Skip to main content

Automation

An automation runs an action (an automation target) when something happens to an item, for example emailing a curve when it is updated. You create automations in ODSL with an AutomationBuilder: give it the item, choose one of the automation templates the item offers (the listAutomations special function lists them), set the template's properties and build it. See Automations.

Construction​

FunctionDescription
AutomationBuilder(service, source)Creates a new OpenDataDSL automation using a builder
AutomationBuilder(service, source, key)Creates a new OpenDataDSL automation using a builder

Builder methods​

NameDescriptionReturn Type
withAutomationTemplate(template)Select the template to use for this automationAutomationBuilder
set(name, value)Set a property on the automationAutomationBuilder
build()Build the automation you have configured with this builderAutomation

Properties​

NameDescriptionType
conditionsThe conditions for when this automation will fireList
enabledSet to false to disable this automationBoolean
iconThe icon (bootstrap icons) to be shown next the automation in the GUI - usually the same as the target iconString
nameThe READONLY name of this automation, this is generated using the template and propertiesString
ownerThe READONLY owner of this automation, used for setting security policies on the automationString
propertiesThe properties to send to the targetObject
targetThe automation target idString
templateThe text template used to create this automationString

Example​

builder = AutomationBuilder("object", "private", "NGE.GAS.TTF")
// template is the text of one of the automations this item offers,
// as listed by the listAutomations special function
builder.withAutomationTemplate(template)
builder.set("to", "market-data@northgate-energy.com")
automation = builder.build()
save ${automation:automation}

Automation targets​

An automation target is the action an automation runs. You can create your own with AutomationTarget().

Properties​

NameDescriptionType
actionsThe actions this target can work with, leave empty for allList
allowPropertyChangeTrue if we allow the user to specify a check for a property changing to either a specific value or anythingBoolean
allowTransformationTrue if we allow the user to specify a transformer to transform the data to be submittedBoolean
codeThe code id of the automation targetString
descriptionThe long description of the automation targetString
iconThe code for the icon (bootstrap icons) to be shown next the automation target name in the GUIString
inputsThe input configuration informationObject
nameThe name of the automation targetString
propertiesThe properties array to send to the targetObject
publisherThe publisher of the automation targetString
scriptThe script name that performs the actionString
servicesThe services this target can work with, leave empty for allList
tagsA list of tags used to categorise this automation targetList
templateThe text used to collect information from the user and the data to collectString

Further Reading​