Locked History Actions

Action

Action

Action elements perform various actions in the state model such as sending output, receiving input, or changing to another state in the state model. Actions are child elements of State.

<Action name="SendData" type="output">
  <DataModel ref="MyDataModel" />

  <!-- Optional data element -->
  <Data name="load defaults" fileName="template.bin" />
</Action>

Attributes:

  • name -- Name of the action [optional]

  • type -- Action type [required]

  • when -- Only preform action if expression provided is true.

  • onComplete -- Expression to run on completion of action

  • onStart -- Expression to run on start of action

  • method -- Method to call [required, type=call]

  • property -- Property to get or set [required, type=setprop, getprop]

  • setXpath -- XPath for value to set [required, type=slurp]

  • value -- Value [type=slurp]

  • valueXpath -- XPath for value [type=slurp]

  • ref -- Reference of state to change to [type=changeState]

Valid Child-Elements:

Action Types

start (implicit)

Start up the publisher, this is an implicit action and is not normally needed.

<Action type="start" />

stop (implicit)

Stop the publisher, this is an implicit action and is not normally needed.

<Action type="stop" />

open/connect (implicit)

Open and connect are aliases for each other and perform the same action. Typically this action is implicit, for files the file must be opened or created, for sockets a connection is made. Only when special control is required does one need to use this action.

<Action type="open" />

<Action type="connect" />

close (implicit)

Close is also implicit and is not normally required unless specific control is wanted.

<Action type="close" />

accept

Accept an incoming connection. Not all publishers support this action type. This action will typically block until the incoming connection available.

<Action type="accept" />

input

Receive or read input from the publisher. Requires a data model be specified to hold the incoming data.

<Action type="input">
   <DataModel ref="InputModel" />
</Action>

output

Send or write output via publisher. Requires a data model and an optional data set.

<Action type="output">
   <DataModel ref="SomeDataModel" />
</Action>

<Action type="output">
   <DataModel ref="SomeDataModel" />
   <Data name="somesampledata" fileName="sample.bin" />
</Action>

call

Call a method with optional parameters. Not supported by all publishers.

<Action type="call" method="openUrl">
  <Param name="p1" type="in">
     <DataModel ref="Param1DataModel" />
  </Param>
  <Param name="p2" type="in">
     <DataModel ref="Param2DataModel" />
     <Data name="p2data">
        <Field name="value" value="http://foo.com" />
     </Data>
  </Param>
</Action>

setprop

Set a property.

<Action type="setprop" property="Name">
   <DataModel ref="NameModel"/>
</Action>

getprop

Get a property.

<Action type="setprop" property="Name">
   <DataModel ref="NameModel"/>
</Action>

slurp

Slurp allows moving data between two data models. Typically these data models are assigned to different Actions in a StateModel. A standard use case is during a protocol sequence you are given a sequence id, or a challenge id you must send back to the server. You can use slurp to move that data to be sent back.

<DataModel name="ReceiveChallenge">
  <String name="Challenge" />
</DataModel>
<DataModel name="SendChallenge">
  <String name="Challenge" />
</DataModel>

<!-- Other stuff -->

<State>
  <Action name="ReceiveChallenge" type="input">
    <DataModel ref="ReceiveChallenge"/>
  </Action>

  <Action type="slurp" valueXpath="//ReceiveChallenge//Challenge" setXpath="//SendChallenge//Challenge" />
  
  <Action name="SendChallenge" type="output">
    <DataModel ref="SendChallenge"/>
  </Action>
</State>

changeState

Change to a different state.