...
In such workflows, it is a good practice to have a Timeout modifier on the workflow.
Expand |
---|
|
Info |
---|
| Workflow instances run on top of pipelines, that is, they use pipelines to be instantiate, trigger or communicate. We call the pipeline that instantiate a workflow instance the originating pipeline. Based on the relationship between the workflow and its originating pipeline, workflow can be categorized into non-repeatable workflows and repeatable workflows. In non-repeatable workflow, the originating pipeline waits until the workflow completes. In repeating working, the originating pipeline does not wait. The workflow, after being instantiated, may be triggered by a different pipeline. |
|
Code Block |
---|
language | xml |
---|
title | Example for Internally continued workflows |
---|
|
<ThingFacet Name="PhidgetRFID">
<Sid Name="RFIDId" />
<String Name="ReadTag" Update="auto" KnownBy="PhidgetReadRFIDTagAc" />
<String Name="WriteTag" KnownBy="PhidgetWriteRFIDTagAc" />
<String Name="RFIDURL" Default="phid://" />
<String Name="InterfaceType" />
<String Name="InterfaceIndex" />
<Unique Name="RFIDIndex" Value="InterfaceIndex" />
<DateTime Name="timestamp" Format="$SimpleDateFormat(yyyy-MM-dd'T'HH:mm:ss'Z')" />
<AA>
[:#o#Output.ActionArgument:]
</AA>
<Action Name="PhidgetReadRFIDTagAc" Documentation="Read the Tag Automatically in the vicinity">
<Workflow Limit="1" Live="1" Timeout="-1">
<Task name="Main" while="true">
<Event name="Argument" as="ActionArgument" />
<Invoke name="ReadValue" waitFor="Argument"
get="[%:Event.Argument.RFIDURL.Value:%]" SerialNumber="[%:Event.Argument.InterfaceIndex.Value:%]"
DeviceType="[%:Event.Argument.InterfaceType.Value:%]" />
<Output name="Result" as="ActionResult">
<Value>
<ReadTag>
[%:[%:@Output:%]Invoke.ReadValue.Message.Value:%]
</ReadTag>
</Value>
</Output>
</Task>
</Workflow>
</Action>
<Action Name="PhidgetWriteRFIDTagAc" Documentation="Write the Tag Value to RFID in the vicinity">
<Workflow Limit="1" Live="1" Timeout="-1">
<Task name="Main" while="true">
<Output name="ActionArgument" as="ActionArgument" />
<Invoke name="WriteValue" waitFor="ActionArgument"
skip-if="[%:[:AA:].WriteTag/no-value(Value):%]" post="[%:[:AA:].RFIDURL.Value:%]"
SerialNumber="[%:[:AA:].InterfaceIndex.Value:%]"
SensorType="WriteTag" DeviceType="[%:[:AA:].InterfaceType.Value:%]">
<Message Type="text" Value="[%:[:AA:].WriteTag.Value:%]" />
</Invoke>
<Output name="Result" as="ActionResult">
<Value>
<WriteTag>
[%:[%:@Output:%]Invoke.WriteValue.Message.Value:%]
</WriteTag>
</Value>
</Output>
</Task>
</Workflow>
</Action>
</ThingFacet> |