Automation Tasks Library#
Administration.AutomationTasksLibrary
AutomationTasksLibrary.Show
The Workflow designer for Connect IoT and Factory Automation has a set of low code components, tasks and converters, that are rendered in the workflow. These components are able to be defined using the entity Automation Task Library.
An Automation Task Library is an entity that holds a set of metadata that informs the workflow designer on how to render IoT components. It allows for users without knowledge of software development for the GUI, to be able to define their components. This will also allow for multiple versions of tasks and converters to be correctly rendered.
Each Automation Tasks Library will map to the existing packages in the configured repository, which can be one of the options configured under the /Cmf/System/Configuration/ConnectIoT/RepositoryLocation configuration entry. Those packages will contain metadata information that can be used to configure the tasks library and allow it to be loaded in the Critical Manufacturing MES.
Warning
Multiple libraries can be created that use different versions of the same package. However, there can only be one package set as default for each package name loaded in the system.
Experimental Feature
Automation Task Libraries are still experimental. To revert to previously compiled tasks, terminate the Task Library. This can be done through the MES UI:
* Go to the MES Main Menu.
* Select the "Automation" entry.
* On the "Automation" page, select "Automation Task Library."
* For each library listed, open its page and use the "Terminate" operation.
After completing these steps and refreshing the workflow page, the experimental tasks will no longer be displayed, and their equivalent production-ready versions will be visible.
Default Automation Tasks Library#
There can only be one default Automation Tasks Library for each combination of package and its respective version. When you create a new Automation Tasks Library and set it as default, the previously default library will reset the default flag. When an Automation Tasks Library is tagged as default, it will be suggested to you when creating new or updating existing Automation Controllers.
Metadata example#
Below you can see a simple example of the metadata configuration for a task as displayed on the entity page:
{
"converters": [],
"tasks": [
{
"name": "createFile",
"displayName": "Create File",
"iconClass": "icon-filesbased-iot-lg-filewithcontent",
"isProtocol": true,
"isController": false,
"lifecycle": "Experimental",
"lifecycleMessage": "Task was migrated to use a different visual renderer. It is currently in preview mode.",
"dependsOnProtocol": [],
"dependsOnScope": [],
"inputs": {
"activate": {
"type": "Activate",
"displayName": "Activate"
},
"path": {
"type": "Static",
"dataType": "String",
"displayName": "path"
},
"content": {
"type": "Static",
"dataType": "String",
"displayName": "content"
},
"encoding": {
"type": "Static",
"dataType": "String",
"defaultValue": "utf8",
"displayName": "encoding"
},
"mode": {
"type": "Static",
"dataType": "Integer",
"defaultValue": 438,
"displayName": "mode"
},
"flag": {
"type": "Static",
"dataType": "String",
"defaultValue": "w",
"displayName": "flag"
},
"attempts": {
"type": "Static",
"dataType": "Integer",
"defaultValue": 1,
"displayName": "attempts"
},
"sleepBetweenAttempts": {
"type": "Static",
"dataType": "Integer",
"defaultValue": 1000,
"displayName": "sleepBetweenAttempts"
}
},
"outputs": {
"success": {
"type": "Success",
"displayName": "Success"
},
"error": {
"type": "Error",
"displayName": "Error"
}
},
"settings": {
"General": {
"Settings": [
{
"name": "path",
"displayName": "Path",
"settingKey": "path",
"dataType": "string",
"infoMessage": "Full path of the file to create",
"infoMessageBlock": "Available tokens:\n ${path} - Watched path\n ${archive} - Archive path\n ${temp} - Temporary directory of the user\n ${id} - DriverId ('\\' chars replaced with '_')\n\nExamples:\n ${path}\\subdir\\newFile.txt\n ${temp}\\files\\${id}\\Recipe\\File.csv\n c:\\source\\Result\\OK.bin"
},
{
"name": "content",
"displayName": "Content",
"settingKey": "content",
"dataType": "string",
"infoMessage": "Content to write into the file"
},
{
"name": "encoding",
"displayName": "Encoding",
"settingKey": "encoding",
"settings": {
"enumValues": [
"utf8",
"ucs2",
"utf16le",
"latin1",
"binary",
"base64",
"ascii",
"hex"
]
},
"defaultValue": "utf8",
"infoMessage": "Encoding of the file content"
},
{
"name": "mode",
"displayName": "Mode",
"settingKey": "mode",
"dataType": "Integer",
"defaultValue": "438",
"infoMessage": "Defines the permissions of the file. Expecting linux format, in integer (0o666=438, 0o777=511, 0o655=429, etc)"
},
{
"name": "flag",
"displayName": "Flag",
"settingKey": "flag",
"dataType": "string",
"defaultValue": "w",
"infoMessage": "Flag to use when writing to the file. Check https://nodejs.org/api/fs.html#fs_file_system_flags for all options.",
"infoMessageBlock": "Most common options:\n'w' - Open file for writing. The file is created (if it does not exist) or truncated (if it exists).\n'w+' - Open file for reading and writing. The file is created (if it does not exist) or truncated (if it exists).\n'a' - Open file for appending. The file is created if it does not exist.\n'a+' - Open file for reading and appending. The file is created if it does not exist"
},
{
"name": "attempts",
"displayName": "Number of attempts",
"settingKey": "attempts",
"dataType": "Integer",
"defaultValue": "1",
"infoMessage": "Number of attempts to perform the operation before resulting a failure"
},
{
"name": "sleepBetweenAttempts",
"displayName": "Sleep between attempts",
"settingKey": "sleepBetweenAttempts",
"dataType": "Long",
"defaultValue": "1000",
"settings": {
"symbol": "ms"
},
"infoMessage": "Amount of time (milliseconds) between attempts to allow conditions to be more favorable for a success"
}
]
}
}
}
]
}
The Automation Tasks Library page is available in the Administration page group. All task libraries can be used with any of the Automation Controllers and subsequently in Automation Workflows.
Sequence Of Steps#
The necessary steps for correctly configuring and using an Automation Tasks Library are the following:
- Configure the
RepositoryLocationin the Configuration tile of the Administration menu. For more information, see System Configuration Entries. - Create the Automation Tasks Library.
Management Operations#
For information about Automation Task Library management operations, refer to the Operations Page.