Recipe schema guidelines
Recipes support deployment to structured targets, ListView and NetLogic objects,
and customizable schemas with metadata for improved traceability.
Deployment and structure
- You can set a specific target where to deploy the recipe. The structure of the target must be the same as the structure saved in the recipe schema.
- You can use the legacy recipe schema and the new recipe schema in the same project but it may require manual adjustments.
Usage and parameters
- You can use recipes with a ListView or by using NetLogic.
- A recipe parameter is an Item or DataItem selected in the RecipeSchema editor. The recipe parameters represented in a ListView are always presented as read-only.
Recipe schema management
- You can create, edit, and store recipe schemas with unlimited parameters and metadata.
- You can define and store custom metadata, such as author or creation date or an associated image, which enhances traceability and contextual understanding of recipes.
Performance and transaction management
The recipes introduce an elevated number of insert/update/delete operations for
certain tasks. This may increase the time needed to complete operations, especially
for remote databases and high latency. To prevent data loss, minimal transaction
management is supported. Transaction management is not customizable.
IMPORTANT:
To prevent data loss when working with
DataLogger and EventLogger, it is highly recommended not to use the same
database that is used for recipes.
Query to
EmbeddedDatabase
example: SELECT R.*, M.*
FROM Recipes AS R LEFT JOIN "RecipeMetadata_RecipeSchema1" AS M ON R.Id =
M.RecipeId WHERE R.RecipeSchemaName = 'RecipeSchema1' ORDER BY
R.Name
SQL query examples
Use the following SQL queries to manage recipes and their metadata at runtime:
List of recipes
SELECT * FROM Recipes WHERE RecipeSchemaName = 'DemoRecipeSchema' ORDER BY Name
List of recipes and their metadata
SELECT R.*, M.* FROM Recipes AS R LEFT JOIN RecipeMetadata_DemoRecipeSchema AS M ON R.Id = M.RecipeId WHERE R.RecipeSchemaName = 'DemoRecipeSchema' ORDER BY R.Name
Items from the edit model of a specific recipe
SELECT * FROM EditModel WHERE RecipeName = {#name:sql_literal} AND RecipeVersion = {#version:sql_literal} ORDER BY DisplayName SELECT * FROM EditModel WHERE RecipeName = {#name:sql_literal} AND RecipeVersion = {#version:sql_literal} AND TypeDisplayName = {#type_name:sql_literal} ORDER BY DisplayName
EditModel store table
The EditModel store table contains the following structure
ItemId | ItemRelativeBrowsePath | TypeId | DisplayName | TypeDisplayName | DataItems |
|---|---|---|---|---|---|
Motor1_id | ["Machine", "Motors", "Motor1"] | MotorType_id | Motor1 | Motor | data_items_array |
Motor2_id | ["Machine", "Motors", "Motor2"] | MotorType_id | Motor2 | Motor | data_items_array |
Tank1_id | ["Machine", "Tanks", "Tank1"] | TankType_id | Tank1 | Tank | data_items_array |
DataItems is an array of JSON objects:
[ { "RelativeBrowsePath": ["TargetSpeed"], "ElementAccess": null, "Value": 1500.0, "DataTypeId": "Float", "ActualDataTypeID": "Float" }, { "RelativeBrowsePath": ["TorqueLimit"], "ElementAccess": null, "Value": 15.5, "DataTypeId": "Float", "ActualDataTypeID": "Float" } ]
Provide Feedback