...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
<Action Name="StartSimulatorAction" Documentation="Start the simulator"> <Workflow Limit="1" Live="1" Timeout="-1"> <Task name="Main"> <StartOsWindows>StartProcess.exe cmd.exe "/K c:\Users\Dev\Documents\atomiton\bitbucket\tqlsimulator\build\install\TQLSimulator\bin\TQLSimulator.bat local -runAsFleetEventsGen eventOptions=10"</StartOsWindows> <StartOsUnix>bash config/startupscript.sh</StartOsUnix> <StartOsMac>[:CmdOsUnix:]</StartOsMac> <StopOsWindows>TaskKill.exe /PID [%:Output.ActionArgument.currentSimulatorState/Known/text():%]</StopOsWindows> <StopOsUnix>kill [%:Output.ActionArgument.currentSimulatorState/Known/text():%]</StopOsUnix> <StopOsMac>[:CmdOsUnix:]</StopOsMac> <Event name="Argument" as="ActionArgument"/> <Invoke name="InvokeScript" waitFor="ActionArgument" skip-if="[%:Output.ActionArgument.currentSimulatorState/starts-with(Value, 'off'):%]" execute="[:Start[:OsTag:]:]"> </Invoke> <Output name="ActionResult"> <Value> <currentSimulatorState> [%:Invoke/InvokeScript/Message/Value/text():%] </currentSimulatorState> </Value> </Output> </Task> </Workflow> </Action> |
Action Association
An Action must be associated or attached to a Model Attribute. This association varies depending on where an Action is defined. Please refer to <subscribe> and <sequence> for their respective action associations.
In case of ThingFacet or AppFacet, an Action is associated with an attribute of ThingFacet or AppFacet using "KnonwBy" Modifier as below.
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
<Double Name="RotateValue" KnownBy="RotateCameraAction"/> |
Action Trigger
Triggering an Action:
- Starting of an Action is asynchronous and triggered by external / internal event (change of state of a device).
...