Example for InitiateSubFlow Activity

The subflow call activity contains the following input parameters which are passed to the called workflow. Note that parameters received by the called workflow are controlled by the input parameters defined in the called workflow.

  • eventState—defined as constant.
  • inDocument—passed in as inDoc
  • inStatus—defined as constant

This activity expects the following output parameters:

  • outRecordList1—record List. Value is assigned to local variable workRecordList.
  • statusFlag—boolean. Value is assigned to local variable finalStatusFlagx.
  • status—String. Value is assigned to local variable finalStatusx.
  • statusValue – long which is assigned to local variable statusValuex.
  • Testunknown – String which is assigned to local variable unknownValue.

The following example is a subflow call activity:

<Activity Name="TestSubflow">
  <Start/>
  <Action>InitiateSubFlow</Action>
  <Description>Spawn the subworkflow for generation of DBDump</Description>
  <Execution>SYNCHR</Execution>
  <Parameter direction="in" type="string" eval="constant"   name="eventState">SPAWNWORKFLOW</Parameter>
  <Parameter direction="in" type="string" eval="constant"   name="ProcessID">standard/workflow/wfin26Test1</Parameter>
  <Parameter direction="in" type="document" eval="variable"   name="InDocument">inDoc</Parameter>
  <Parameter direction="in" type="String" eval="constant"   name="InStatus">TestInStatus</Parameter>
  <Parameter direction="out" eval="variable" type="String"   name="status">finalStatusx</Parameter>
  <Parameter direction="out" eval="variable" type="boolean"   name="statusFlag">finalStatusFlagx</Parameter>
  <Parameter direction="out" eval="variable" type="long"   name="statusValue">statusValuex</Parameter>
  <Parameter direction="out" eval="variable" type="recorList"   name="outRecordList1">workRecordList</Parameter>
  <Parameter direction="out" eval="variable" type="string"   name="Testunknown">unknownValue</Parameter>
</Activity>

An example subflow follows. This workflow provides the following input parameters:

  • InDocument—This is always passed implicitly.
  • InStatus—String which is assigned the value passed in by the TestInStatus parameter of the calling workflow.

A predefined variable, isSubFlow, of type boolean is implicitly passed and set as true when this workflow is called as subflow.

This workflow provides the following output parameters:

  • outRecordList1—record List. Value is assigned by local variable workRecordList which is output of ManageRecordCollection.
  • statusFlag—boolean. Value is assigned by local variable finalStatusFlag which is the output of the AddMsgInfoEvent activity.
  • status—String. Value is assigned by local variable finalStatus which is output of the AddMsgInfoEvent activity.
  • statusValue—Long. Assigned a value of 10.
    <Workflow Version="0.1">
      <Owner>TIBCO</Owner>
      <Name>wfin26test1</Name>
      <Description lang="en">Test subflow activity</Description>
      <Parameter direction="in" eval="variable" type="document"   name="inDoc">1</Parameter>
      <Parameter direction="in" type="String" eval="variable"   name="InStatus">TestInStatus</Parameter>
      <Parameter direction="out" eval="variable" type="document"   name="OutDoc">workDoc</Parameter>
      <Parameter direction="out" eval="variable" type="String"   name="status">finalStatus</Parameter>
      <Parameter direction="out" eval="variable" type="boolean"   name="statusFlag">finalStatusFlag</Parameter>
      <Parameter direction="out" eval="constant" type="long"   name="statusValue">10</Parameter>
      <Parameter direction="out" eval="variable" type="recordList"   name="outRecordList1">workRecordList</Parameter>
      <Activity Name="AddMsgInfoToEvent">
        <Start/>
        <Action>UpdateEvent</Action>
        <Start/>
        <Description lang="en">Initialize Event Info</Description>
        <Parameter direction="in" type="string" eval="constant"     name="eventState">START</Parameter>
        <Parameter direction="in" name="eventDescriptor" type="string"     eval="xpath" source="/Message/Body/Document/@subtype">inDoc</Parameter>
        <Parameter direction="in" eval="constant" type="String"     name="finalStatus">finalStatus1</Parameter>
        <Parameter direction="in" eval="constant" type="boolean"     name="finalStatusFlag">true</Parameter>
        <Parameter direction="in" name="deploymentMode" type="string"     eval="xpath" source="/Message/@messageType">inDoc</Parameter>
        <Parameter direction="in" name="dbDirectLoadDump" type="string"     eval="constant">N</Parameter>
        <Parameter direction="in" name="eventType" type="string"     eval="constant">CAT</Parameter>
      </Activity>
      <Activity Name="TestSubflow">
        <Action>NoOperation</Action>
        <Description>Test Subflow</Description>
        <Execution>ASYNCHR</Execution>
        <Parameter direction="in" type="string" eval="constant"     name="eventState">SPAWNWORKFLOW</Parameter>
        <Parameter direction="in" type="document" eval="variable"     name="InDocument">inDoc</Parameter>
      </Activity>
    </Workflow>