Skip to main content

Curve Build Targets

The curve build targets build a Smart or Event Curve when the data it depends on is updated.

IdNameTemplateServicesActions
odsl.curveBuild a Smart Curvebuild Smart Curve [curve]dataupdate
odsl.ecurveBuild an Event Curvebuild Event Curve [curve]event, dataupdate

Neither target supports @transformer or property-change filtering. The event service is mapped to data, so conditions on event lists use the data service. The icons are graph-up text-success for Smart Curves and graph-up-arrow text-primary for Event Curves.

Inputs​

InputDescription
curveThe id of the Curve to build

Created for you by the platform​

You don't normally create these automations yourself. When you save a Smart Curve or an Event Curve, the platform creates its build automations, and when you delete it the platform removes them.

You can list them with ODSL:

find ${automation} where target = "odsl.curve"
find ${automation} where target = "odsl.ecurve"

What an Event Curve build automation looks like​

Event lists are data items, so an Event Curve build automation has a condition on the event list with the data service and the update action. The condition also has did set to the id of the Event Curve, so the platform knows which item the automation belongs to. For an Event Curve MY_OBJECT:CURVE built from the event list MY_OBJECT:TRADES, the automation looks like this:

{
"target": "odsl.ecurve",
"template": "When 'MY_OBJECT:TRADES' is updated, build Event Curve [curve]",
"icon": "graph-up-arrow text-primary",
"enabled": true,
"conditions": [
{
"source": "private",
"service": "data",
"id": "MY_OBJECT:TRADES",
"action": "update",
"did": "MY_OBJECT:CURVE"
}
],
"properties": {
"curve": "MY_OBJECT:CURVE"
}
}

Reacting to a build​

A built curve is saved like any other data, so you can create your own automations on it with the data service and the update action. Use the id of the built Curve, not the id of its inputs. For example, to email the team each time the Event Curve is rebuilt:

a = AutomationBuilder("data", "private", "MY_OBJECT:CURVE").build()

c = SimpleObject()
c.source = "private"
c.service = "data"
c.id = "MY_OBJECT:CURVE"
c.action = "update"
conds = []
conds.add(c)
a.conditions = conds

a.target = "odsl.email"
a.template = "When 'MY_OBJECT:CURVE' is updated, send an email to [to] with subject [subject]"
a.icon = "envelope-at text-outlook"
a.properties.to = "trading@mycompany.com"
a.properties.subject = "MY_OBJECT:CURVE has been rebuilt"
a.properties.attachment = false
a.enabled = true
save ${automation:a}