Creating a Product Template
Overview
You can save service capabilities of a product as a product template. When creating a product, you can select and inherit the service capabilities of the product template to quickly create the product.
Creating a Product Template
- Log in to the ROMA Connect console. On the Instances page, click View Console next to a specific instance.
- In the navigation pane on the left, choose LINK > Product Management. On the page displayed, click Create Product Template in the upper right corner.
- In the Create Product Template dialog box, set product template parameters and click OK.
Table 1 Parameters for creating a product template Parameter
Description
Name
Enter a product template name. It is recommended that you enter a name based on naming rules to facilitate search.
NOTE:The name of each product template created in instances under the same tenant is unique.
Description
Enter the descriptive information of the product template.
Status
Specify whether to enable the product template (enabled by default). When disabled, the product template cannot add services and cannot be selected during product creation.
Adding a Thing Model Service to a Product Template
- Log in to the ROMA Connect console, choose LINK > Product Management, and click the Product Templates tab.
- Click the product template name to go to the product template details page.
- Add a thing model service to a product template.
- On the Thing Model tab page, click Create.
- In the Create Thing Model Service dialog box, set thing model service parameters and click OK.
Table 2 Parameters for creating a thing model service Parameter
Description
Name
Enter a thing model service name. It is recommended that you enter a name based on naming rules to facilitate search.
Status
This parameter specifies whether to enable the thing model service. The thing model service is enabled by default.
Description
Enter a brief description of the thing model service.
- Add attributes for the thing model service.
- On the Thing Model tab page, select the thing model service for which you want to add attributes.
- On the Attributes tab page on the right, click Create.
- In the Create Attribute dialog box, set attribute parameters and click OK.
Table 3 Parameters for creating an attribute Parameter
Description
Attribute Name
Enter an attribute name. It is recommended that you enter a name based on naming rules to facilitate search.
Data Type
Select the data type of the attribute.
- Int: integer. If you select Int, you also need to specify Min. Value, Max. Value, and Unit.
- Number: number. If you select Number, you also need to specify Min. Value, Max. Value, and Unit.
- String: a character string. If you select String, you also need to specify the maximum data length and enumerated values.
- Bool: Boolean. If you select Bool, you also need to specify 0 and 1.
- DateTime: date. If you select DateTime, you also need to specify the maximum data length.
- JsonObject: JSON object. If you select JsonObject, you also need to specify the maximum data length.
- Array: array.
The following uses the Int type as an example:
For example, when defining the temperature attribute for thermometers, set Type to Int, Min. Value to 0, Max. Value to 100, Step to 2, and Unit to °C. This indicates that the device reports the temperature value (for example, 0°C, 2°C, 4°C, 6°C and 8°C) each time the temperature changes by two degrees.
Mandatory
This parameter specifies whether a device must report this attribute. This parameter is enabled by default.
Description
Enter a description of the attribute.
- Add commands for the thing model service.
- On the Thing Model tab page, select the thing model service for which you want to add commands.
- On the Commands tab page, click Create.
- In the Create Command dialog box, set command parameters and click OK.
Table 4 Parameters for creating a command Parameter
Description
Command Name
Enter a command name. It is recommended that you enter a name based on naming rules to facilitate search.
Description
Enter a brief description of the command.
- Locate the created command in the command list and click next to the command name to expand the command field list.
Click Delivery Command Fields or Response Command Fields on the right to view the delivery command fields and response command fields of the command.
- Click Create Field.
- In the Create Field dialog box, set command field parameters and click OK.
Table 5 Parameters for creating a command field Parameter
Description
Field Name
Enter a field name. It is recommended that you enter a name based on naming rules to facilitate search.
Data Type
Select the data type of the command field.
- Int: integer. If you select Int, you also need to specify Min. Value, Max. Value, and Unit.
- Number: number. If you select Number, you also need to specify Min. Value, Max. Value, and Unit.
- String: a character string. If you select String, you also need to specify the maximum data length and enumerated values.
- Bool: Boolean. If you select Bool, you also need to specify 0 and 1.
- DateTime: date. If you select DateTime, you also need to specify the maximum data length.
- JsonObject: JSON object. If you select JsonObject, you also need to specify the maximum data length.
- Array: array.
Mandatory
This parameter specifies whether the field must be carried in the delivery command. By default, the field must be carried.
Description
Enter the descriptive information of the command field.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot