Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 71 Next »

 Expand to see legends and methodology

Unable to render {include} The included page could not be found.

Go to page

Workflow

<Workflow  Limit="1" Live="1" Timeout="-1">...</Workflow>

<Workflow  Limit="5" Live="2" Timeout="PT3M">...</Workflow>

 


Referenced by:


Overall workflow structure definition

  • Limit: Maximum number of workflow instances existing at any given time.
  • Live: Maximum number of workflow instances running at the same time.
  • Timeout: Period of time after which a workflow instance is considered dead. Both XSD time period format and plain number of milliseconds allowed.

 

WfTask

<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>

 


Referenced by:


Task of workflow

  • While: Logical expression for repeatable tasks (only true/false is currently supported).

WfResult

Example

<ThingFacet name="FooFacet">

  <String name="fooAttr" KnownBy="fooAc" />

  <Action name="fooAc">

    <Workflow Limit="1" Live="1">

      <Task name="Main">

        <Event name="Argument" as="ActionArgument" />

        <Invoke name="fooInvoke" waitFor="Argument">

          <FacetScript>

            <Log Message="Action called...[:Event.Argument:]"/>

            <foo fooName="bar"/>

            <CreateSubscription SubscriberId="fooTopic" Topic="TQL.Create.CIM.FooDomain.FooModel2.*">

              <ActionBody>

                <SetContextData key="guard" value="" />

                <Log message="IN SUBSCRIBER [:[:$ContextData.guard:]$Request.Message.Value:]" />

              </ActionBody>

            </CreateSubscription>

            <SubmitWf>

              <Wf live="1" limit="1" Timeout="PT5S">

                <Namespace Name="WorkflowNs">

                  <Result name="ResponseCompleted" value="Response.$Completed" />

                  <Task Name="Event" while="true">

                    <Output Name="Msg" />

                  </Task>

                  <Task name="Response">

                    <Input Name="Msg" Value="Event.Msg" />

                    <Invoke name="Respond" fid="FooEcho">

                      <FacetScript>

                        <DoResponse target="FooEcho">

                          <Process>

                            <Message type="json">

                              <Value>

                                <Include>Input.Msg</Include>

                              </Value>

                            </Message>

                          </Process>

                        </DoResponse>

                      </FacetScript>

                    </Invoke>

                    <Log message="exiting workflow" />

                  </Task>

                </Namespace>

              </Wf>

            </SubmitWf>

          </FacetScript>

        </Invoke>

        <Output name="ActionResult">

          <Value>

            <fileName>[%:Event.Argument.foo.Value:%]</fileName>

          </Value>

        </Output>

      </Task>

    </Workflow>

  </Action>

</ThingFacet>


Referenced by:

WfReturn

Example

<Workflow name="ExecuteRemoteQuery">

  <Return name="PostDataOutput" value="postTQLQuery.TQLResponse"/>

  <Task name="postTQLQuery">

    <Invoke name="postTQL" post="[:$Macro.Argument.RemoteTQLEndPoint:]" AutoCloseTimeout="PT15S">

      <Message type="xml">

        <Value>[:$Macro.Argument.QueryString:]</Value>

      </Message>

    </Invoke>

    <Output name="TQLResponse">

      <Value>[:Invoke.postTQL:]</Value>

    </Output>

  </Task>

</Workflow>


Referenced by:

WfInput

Example

<Workflow>
  <Namespace name="WdlTest">
    <Task name="Input" while="true">
      <Output name="Command"/>
    </Task>
    <Task name="WdlTestTask">
      <Input name="Command" value="Input.Command"/>
      <Variable name="MyVar" type="int" value="3"/>
      <Invoke name="JexlTest">
        <JexlScript>

               var file = sffInvoke.getName()+".Variable.xml";
               var vars = sff:loadTxt(file);
               if(vars != null)
                      Variable = vars;
                      sffLog.info("JexlTest: MyVar="+Variable.MyVar);
                      var i = Variable.MyVar;
                      while((i = i - 1) ge 0)
                                 sffLog.info("JexlTest: "+i);
                      var sin1 = math:sin(PI / 2);
                      Variable.MyVar = Variable.MyVar + 1;
                      Variable.MyVar1 = Variable.MyVar;
                      Variable.add("MyVar1", Variable.MyVar + 1);
                      sff:saveTxt(file, Variable);
                      return Input.Command.toString().concat(Variable.MyVar.toString()).concat("5:").concat(sin1.toString());

        </JexlScript>
      </Invoke>
      <Output name="Result" value="[%:Invoke.JexlTest:%]"/>
    </Task>
    <Task name="Response">
      <Input name="Command" value="Input.Command"/>
      <Input name="Result" value="WdlTestTask.Result"/>
      <Invoke name="Respond" fid="wdl">
        <FacetScript>
          <DoResponse target="wdl:*">
            <Process>
              <Message type="json"xmlns="http://test">
                <Value>
                  <command>[%:Input.Command:%]</command>
                  <result>[%:Input.Result:%]</result>
                </Value>
              </Message>
            </Process>
          </DoResponse>
        </FacetScript>
      </Invoke>
    </Task>
  </Namespace>
</Workflow>


Referenced by: WfTask

WfOutput

Example

<Task name="Event" while="true">

         <Output name="RFID" skip-if="$NotOnSchedule([30..59/30sec])"/>

</Task>


Referenced by: WfTask


Output of workflow

  • SkipIf: Value guard. A logical expression to accept or reject the value.

LogInvoke

Example

<Task name="Trigger">

  <!--Input name="Start" value="Event.RFID"/-->

  <Log level="info" name="Wait1" WaitFor="(Event1 or Event2) and (Event3 or Event4)" message="Trigger1 ([:WaitFor:])"/>

  <Log level="info" name="Wait2" WaitFor="Event1 and Event3" message="Trigger2 ([:WaitFor:])"/>

  <Log level="info" name="Wait3" WaitFor="Event2 and Event4" message="Trigger3 ([:WaitFor:])"/>

  <Log level="info" name="Wait4" WaitFor="(Event1 or Event2) and (Event3 or Event4)" message="Trigger4 ([:WaitFor:])"/>

  <Output name="Event1"/>

  <Output name="Event2"/>

  <Output name="Event3"/>

  <Output name="Event4"/>

</Task>


Referenced by:

InvokeGroup

Example

 <Invoke name="InvokeSerialRead" waitFor="Argument" get="perif://">...</Invoke>

 


Referenced by:


Workflow invokes with the Invoke tab name:

  • Name: Optional invoke name.
  • ExecuteInvoke - Command line invoke.

CommonInvokeArguments
Example

<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>

 

Referenced by:

Common invoke arguments

  • WaitFor: A logical expression of possibly multiple outputs/events.
  • Unless: Delay termination output/event. Usually used with timeout/delay.
  • SkipIf: A logical expression to skip the invoke execution.
  • OnlyIf: A logical expression to execute invoke conditionally.
  • DelayUntil: Absolute invoke execution time.
  • DelayBefore: Invoke execution delay interval (delay before invoke starts executing).
  • Delay: Synonym for DelayBefore.
  • Timeout: Invoke type dependent hint. Different invoke types may interpret it differently.
  • DelayAfterInvoke result delay interval (delay after invoke has completed).

ScriptInvoke

Example

<Task name="WdlTestTask">
  <Input name="Command" value="Input.Command"/>
  <Variable name="MyVar" type="int" value="3"/>
  <Invoke name="JexlTest">
    <JexlScript>

          var file = sffInvoke.getName()+".Variable.xml";
          var vars = sff:loadTxt(file);
                if(vars != null)
                        Variable = vars;
                sffLog.info("JexlTest: MyVar="+Variable.MyVar);
                var i = Variable.MyVar;
                while((i = i - 1) ge 0)
                      sffLog.info("JexlTest: "+i);
                var sin1 = math:sin(PI / 2);
                Variable.MyVar = Variable.MyVar + 1;
                Variable.MyVar1 = Variable.MyVar;
                Variable.add("MyVar1", Variable.MyVar + 1);
                sff:saveTxt(file, Variable);
                return Input.Command.toString().concat(Variable.MyVar.toString()).concat("5:").concat(sin1.toString());

      </JexlScript>
  </Invoke>
  <Output name="Result" value="[%:Invoke.JexlTest:%]"/>
</Task>


Referenced by: InvokeGroup

ExecuteInvoke

Example

 


Referenced by:


ExecuteInvoke - command line invoke

  • Execute: Command line to execute.
  • StdIn: Optional content of stdin stream.

HTTP Communications

Example

 


Referenced by:


HTTP Communications

  • HTTP GET - HttpGetInvokeArguments.
  • HTTP PUT - HttpPutInvokeArguments.
  • HTTP POST - HttpPostInvoke Arguments.
  • HTTP DELETE - HttpDeleteInvokeArguments.
  • get: http request URL for the method.
  • put: http request URL for the method.
  • post: http request URL for the method.
  • delete: http request URL for the method.

Serial Communications

Example

 


Referenced by:


Serial Communications

  • get: device path regular expression (e.g. COM[3-9] or /dev/tty\\.usbserial.*).
  • put: device path regular expression (e.g. COM[3-9] or /dev/tty\\.usbserial.*).
  • post: device path regular expression (e.g. COM[3-9] or /dev/tty\\.usbserial.*).

CommonRxTxInvokeArguments

Example

 


Referenced by:


CommonRxTxInvokeArguments

  • MaxWait: Maximum message wait time in seconds.
  • OpenTimeout: Open timeout in msec.
  • ReadTimeout: Non-communication timeout in seconds.
  • WriteTimeout: Non-communication timeout in seconds.
  • RepeatDelay: Duplicate message delay in seconds.
  • OmitEmpty: Omit empty messages.
  • Encoding: Apply encoding/decoding to both the input and output. Only supported value is 'URL'.
  • DecodeOut: Apply decoding to the output message. Only supported value is 'URL'.
  • EncodeIn: Apply encoding to the input message. Only supported value is 'URL'.
  • Trim: Trim whitespace.
  • FlowControl: Possible values: in:rts/cts, out:rts/cts, in:xon/xoff, out:xon/xoff.
  • BaudRate: Interface baud rate.
  • DataBits: Possible values: 5,6,7,8.
  • StopBits: Possible values: 1,2,1.5.
  • Parity: Possible values: none,odd,even,mark,space.

Phidget Communications

Example

 


Referenced by:

CommonPhidInvokeArguments

Perif Communications

Example

 


Referenced by:

CommonPerifInvokeArguments

USBCam Communications

Example

 


Referenced by:

CommonUcamInvokeArguments

SMTP Communications

Example

 


Referenced by:

CommonSMTPInvokeArguments

 

 

  • No labels