In Atomic Domain Languages an Action is a named XML Element that describes fundamental unit of executable functionality.
An Action Element can contain following modifiers or attributes:
- Name
- Documentation
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
<Action Name="RotateCameraACRotateCameraAction" Documentation="Simple Action to Rotate ESKYIP-based Camera by x degrees"/> |
An Action Element can contain following modifiers or attributes:
...
...
An Action can be defined in:
- ThingFacet
- AppFacet
- Subscribe
- Sequence
An Action must describe executable code in any Atomic Domain Languages - like Workflow, FacetScript, TQL, Subscribe, Sequence and any of their combinations.
How is Action Triggered:
What Does Action mean in NOTE: In case of ThingFacet and AppFacet
The execution of an action represents some interaction with external system, transformation or processing in the modeled system. An action execution represents the run-time behavior of executing an action within a specific behavior execution. All action executions will be executions of specific kinds of actions as defined by internal workflow . Action is executed, when actionable attribute gets updated (modified by KnownBy in the model) by the app or side effect in the system.or AppFacet an Action must start with a Workflow Language.
In case of ThingFacet an Action represents:
- Device State Change, for example, current reading sent by a Temperature Sensor
- Device Actuation Commands, for example, Changing the State of the device (Camera Rotation, Starting a Servo Motor, Reducing the flow of a Greenhouse Sprayer etc).
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
<Action name="NextRfidAction" documentation="Read next RFID tag">
<Workflow Limit="1" Live="1" Timeout="0">
<Task name="Main" while="true">
<Event name="Argument" as="ActionArgument"/>
<Invoke name="ReadId" waitFor="Argument" get="[%:Event.Argument.URL.Value:%]" StopChar="0x0D" ReadTimeout="-1" WriteTimeout="-1" RepeatDelay="1"/>
<Output name="Result" as="ActionResult">
<Value>
<RFID>[%:[%:@Output:%]Invoke.ReadId.Message.Value:%]</RFID>
</Value>
</Output>
</Task>
</Workflow>
</Action> |
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
<Action name="SyncPresetAction" documentation="Synchronize camera state and preset">
<Workflow Limit="1" Live="1" Timeout="PT20S">
<Task name="Main" while="true">
<Event name="Argument" as="ActionArgument"/>
<Invoke name="SetPreset" waitFor="Argument" skip-if="[%:[:AD:].Preset/no-value(Value):%]" delayAfter="PT5S"
get="[%:[:AA:].URL.Value:%]/cgi-bin/decoder_control.cgi?[:UP:][%:amp:%]command=15[%:amp:%]sit=[%:[:AD:].Preset.Value:%]"/>
<Output name="Result" as="ActionResult">
<Value>
<State> [%:[%:@Output:%]/if([:POK:]) then 'ON' else 'OFF':%]</State>
<Preset>[%:[%:@Output:%]/if([:POK:]) then '[%:[:AD:].Preset.Value:%]' else null():%]</Preset>
</Value>
</Output>
</Task>
</Workflow>
</Action> |
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
<Action name="TakePictureAction" documentation="Synchronize camera state and snapshot image">
<Workflow Limit="1" Live="1" Timeout="PT10S">
<Task name="Main" while="true">
<Event name="Argument" as="ActionArgument"/>
<Invoke name="GetImage" waitFor="Argument" delay="PT1S" get="[%:[:AA:].URL.Value:%]/cgi-bin/video_snapshot.cgi?[:UP:]"/>
<Output name="Result" as="ActionResult">
<Value>
<State>[%:[%:@Output:%]/if([:IOK:]) then 'ON' else 'OFF':%]</State>
<Image>[%:[%:@Output:%]/if([:IOK:]) then Invoke/GetImage/Message/Value/text() else '/img/no-image.jpg':%]</Image>
</Value>
</Output>
</Task>
</Workflow>
</Action> |
In case of AppFacet an Action represents:
- Triggering an external non-thing event like sending an Email, Tweet, triggering a build etc.
- Receiving data from external source like a Database updates .
How is Action Triggered: Starting of an Action is asynchronous and triggered by external / internal event (change of state).
An action is the specification of an executable statement and is the fundamental unit of processing or behavior in an Thing or App Model that represents some transformation in the modeled system, triggered by an external event.
...