Open APIs

 View Only
  • 1.  ProductCharacteristic without Characteristicvalue

    TM Forum Member
    Posted Aug 22, 2024 10:52

    Hi,

    Our Prodspec has 3 productSpecCharacteristic: "serial number", "Low Latency"  and "colour"

    • "serial number" requires a charvaluethat customer must type on their GUI
    • "low Latency" has no value. the is productSpecCharacteristic selected or not
    • "colour" requires a charvaluethat customer must pick (from a list) on their GUI. 

    how do I represent these  productSpecCharacteristicthe TMF620 API payload? The 3rd one is easy.

    Is this correct:
    {
    {
        "@type": "ProductSpecification",
        "name": "xxxx",
        "productSpecCharacteristic": [
            {
                "name": "Serial Number",
                "valueType": "number",
                "configurable": true,
                "maxCardinality": 1,
                "minCardinality": 1
            },
            {
                "name": "Low Latency",
                "valueType": "boolean",
                "configurable": true,
                "maxCardinality": 1,
                "minCardinality": 0
            },
            {
                "name": "Colour",
                "valueType": "string",
                "configurable": true,
                "maxCardinality": 1,
                "minCardinality": 1,
                "characteristicValueSpecification": [
                    {
                        "valueType": "string",
                        "value": "blue"
                    },
                    {
                        "valueType": "string",
                        "value": "white"
                    }
                ]
            }
        ]
    }

    With the above payload, it's not that easy for the product configurator to know what to show to the client UI.

    • if there is an array of characteristicValueSpecification show the list of charvalue. this works fine for the colour
    • if there is no array of characteristicValueSpecification and valueType= "number" or "string", show an empty charvalue. This could work for the Serial Number
    • if there is no array of characteristicValueSpecification and  valueType= "boolean"  don't show charvalue. This could work for the Low Latency

    I got a suggestion to create a dummy characteristicValueSpecification for the serial number:

            {
                "name": "Serial Number",
                "valueType": "number",
                "configurable": true,
                "maxCardinality": 1,
                "minCardinality": 1,
                "characteristicValueSpecification": [
                    {
                        "valueType": "number",
                        "value": ""
                    }
                ]
            }

    Note: I check the TMF620 doc but I think all examples are for the simple case of an enumeration of characteristicValue

    Any API compliant and conformant suggestion?

    Cheers,



    ------------------------------
    Kind regards,

    Matthieu Hattab
    Lyse Platform
    ------------------------------


  • 2.  RE: ProductCharacteristic without Characteristicvalue

    TM Forum Member
    Posted Aug 23, 2024 01:08

    The serial number is ten digits (0-9):

    {
       "name": "Serial Number",
       "valueType": "integer",
       "configurable": true,
       "maxCardinality": 1,
       "minCardinality": 1
       "regex": "^[0-9]{10}$"
    },



    ------------------------------
    Vance Shipley
    SigScale
    ------------------------------



  • 3.  RE: ProductCharacteristic without Characteristicvalue

    TM Forum Member
    Posted Aug 23, 2024 03:44

    Hello Vance,

    Thanks for your reply.
    Unfortunately, the question is not how to validate the length of the serial number. it's about the characteristicValueSpecification



    ------------------------------
    Kind regards,

    Matthieu Hattab
    Lyse Platform
    ------------------------------



  • 4.  RE: ProductCharacteristic without Characteristicvalue

    TM Forum Member
    Posted Aug 23, 2024 05:04
    Edited by Vance Shipley Aug 23, 2024 05:05

    @Matthieu Hattab wrote:
    > With the above payload, it's not that easy for the product configurator to know what to show to the client UI.

    All of the information used to validate the value may be used to prompt the user, it's a data model.

    The regular expression can define precisely what to prompt the user for. In fact, you can use it directly in a pattern attribute of an HTML <input> tag.

    I did make an error though, the valueType should be string if regex is used. 

    For the boolean you could use either checkbox or radio button <input> type.

    For the characteristicValueSpecification enumerations use a radio button <input> type.

    You could also put the description in a tooltip!

    The expressivity and function lines up quite well.



    ------------------------------
    Vance Shipley
    SigScale
    ------------------------------



  • 5.  RE: ProductCharacteristic without Characteristicvalue

    TM Forum Member
    Posted Aug 23, 2024 06:16

    it seems my question was not clear. Sorry for that.

    I don't want TMF620 (or any backend APIs) to have an opinion on how the product characteristics are displayed (html tag, radio button etc). That is not its job.

    The challenge is how TMF620 represents the 3 types of product characteristics in the payload:

    • a char with an enum list of values (that's easy, all examples of char in TMF620 user guide have a predefined list of char values) => example: colour
    • a char without value (no example in TMF620 user guide)  => example: Low Latency
    • a char with a free text field value (no example in TMF620 user guide) => example: Serial Number

    @Bostjan Keber, do you have payload examples from 620 or (maybe 760) with characteristics similar to my low latency and serial number?



    ------------------------------
    Kind regards,

    Matthieu Hattab
    Lyse Platform
    ------------------------------



  • 6.  RE: ProductCharacteristic without Characteristicvalue

    TM Forum Member
    Posted Aug 23, 2024 06:44

    Are you thinking characteristicValueSpecification is a mandatory attribute?



    ------------------------------
    Vance Shipley
    SigScale
    ------------------------------



  • 7.  RE: ProductCharacteristic without Characteristicvalue

    TM Forum Member
    Posted Aug 27, 2024 09:01

    @Vance Shipley

    I couldn't find any attribute called characteristicValueSpecification 
    I think you meant the resource, not the attribute. characteristicValueSpecification (CVS) is not mandatory according to both the API conformance profile and the user guide (where the relationship CVS says "0..*") which means a productSpecCharacteristic doesn't required a CVS.

    In the meantime, Boštjan answered my question! 

    • productSpecCharacteristic : 
      • (Serial Number) with one value that user must provide
      • (Low Latency) without value
      • (Colour) with a predefined list of values that user must choose

    Below is the TMF620 (simplified) json for my 3 characteristic scenarios:

     "@type": "ProductSpecification",
        "name": "xxxx",
        "productSpecCharacteristic": [
            {
                "name": "Serial Number",
                "valueType": "string",
                "configurable": true,
                "maxCardinality": 1,
                "minCardinality": 1,
    "productSpecCharacteristicValue": [],
            },
            {
                "name": "Low Latency",
                "valueType": "boolean",
                "configurable": true,
                "maxCardinality": 1,
                "minCardinality": 0,
    "productSpecCharacteristicValue": [],
            },
            {
                "name": "Colour",
                "valueType": "string",
                "configurable": true,
                "maxCardinality": 1,
                "minCardinality": 1,
                "productSpecCharacteristicValue": [
                    {
                        "value": "blue"
                    },
                    {
                        "value": "white"
                    }
                ]
            }
        ]
    }


    ------------------------------
    Kind regards,

    Matthieu Hattab
    Lyse Platform
    ------------------------------



  • 8.  RE: ProductCharacteristic without Characteristicvalue

    TM Forum Member
    Posted Aug 23, 2024 07:31

    Hi Matthieu,

    please, check your e-mail.

    Bostjan



    ------------------------------
    Bostjan Keber
    Marand, software ltd
    ------------------------------