Jump to: navigation, search

Subroutine Block

Use the Subroutine block to create reusable sub-modules (sub-workflows). You can invoke external SCXML documents or use a sub-workflow created using Composer.  The input and output parameters names will be automatically picked from the sub-workflow created by Composer. Composer supports passing variables between a workflow and sub-workflow.

Also see Using Composer Shared Subroutines.

Important
Starting with Composer 8.1.3 versions, the callflow diagram Subdialog block and the workflow diagram Subroutine block use absolute paths with the Project name to refer to the location of the selected resource in the Workspace, e.g., workspace:///WFM/Workflows/subroutine.workflow. Renaming or copying Projects requires a manual update to change the Project name in the Subroutine and Subdialog blocks.

Creating a Subroutine Using A Sub-Workflow

  1. Create the main workflow diagram file using New > Other > Composer > Workflow diagram > Main Workflow.
  2. After designing the main workflow diagram, create the sub-workflow diagram using New > Other > Composer > Workflow diagram > Sub-Workflow.
  3. In the Entry Block of the sub-workflow diagram, enter the parameters, which will be passed as input from the main to the sub-workflow diagram.  
Subroutine1.gif
  1. Design the sub-workflow diagram.
  2. In the Exit block of the sub-workflow diagram, select the variables, which will be returned back to the called main diagram.
Subroutine2.gif
  1. In the main diagram, use the Subroutine Block to call the newly created sub-workflow and the input and output parameters. For input/output synchronization, use the Uri property of the Subroutine block to select the sub-workflow diagram.
Subroutine3.gif

Now the Parameters property can be used for the Parameter Synchronization. The main diagram implicitly parses the sub-workflow parameters and lists them in the Parameter settings dialog as shown below.

Subroutine4.gif
  1. Define the value for the input type variables and collect the returning output type variables in a variable.

The Subroutine block has the following properties:

Name Property

Find this property's details under Common Properties.

Block Notes Property

Find this property's details under Common Properties.

Exceptions Property

Find this property's details under Common Properties.

Uri Property

The Uri property specifies the destination (URL or Composer Project) depending on the value of the Type property. To set a URL destination for the Uri property (Type property is set to URL):

  1. Select the Uri row in the block's property table.
  2. In the Value field, type a valid URL. Variables should not be selected as all subroutines are fetched by Orchestration Server before it starts executing the application at which time variables do not exist.

To set a Project destination for the Uri property (Type property is set to ProjectFile):

  1. Click the Uri row in the block's property table.
  2. Click the OpenDialogBoxButton.gif button to open the Uri dialog box.
  3. Select a workflow in the list.
  4. Click OK to close the dialog box.

Type Property

The Type property sets the type of the invoked subroutine. There are two options:

  • URL--The invoked sub-workflow can be found at the location specified in the Uri property.
  • ProjectFile--The invoked sub-workflow is another workflow in the Project.

To select a value for the Type property:

  1. Select the Type row in the block's property table.
  2. In the Value field, select URL or ProjectFile from the drop-down list.

Condition Property

Find this property's details under Common Properties.

Logging Details Property

Find this property's details under Common Properties.

Log Level Property

Find this property's details under Common Properties.

Enable Status Property

Find this property's details under Common Properties.

Parameters Property

Use the Parameters property to specify parameters to pass to the invoked sub-workflow. To specify parameters: The URI field must contain a value.

  1. Click the Parameters row under Value.
  2. Click the OpenDialogBoxButton.gif button to open the Subroutine Input Output Parameters dialog box.
  3. Click the Add button to enter parameter details.
  4. In the Parameter field, accept the default name or change it.
  5. From the Type drop-down list, select input, output, or inout:
    input Input parameters are variables submitted to the sub-workflow.
    output Output parameters are variables that the sub-workflow returns and will be reassigned back to the current workflow.
    input/output Inout parameters are parameters that act as both input and output.
  6. In the Expression drop-down list, select from among the variables shown, type your own expression, or click the OpenDialogBoxButton.gif button to use Expression Builder.
  7. In the Description field, type a description for this parameter.
  8. Click Add again to enter another parameter, or click OK to finish.

ORS Extensions Property

Starting with 8.1.4, Composer blocks used to build routing applications (with the exception of the Disconnect and EndParallel blocks) add a new ORS Extensions property.

Feedback

Comment on this article:

blog comments powered by Disqus
This page was last modified on 29 August 2017, at 00:59.