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.

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

Create the main workflow diagram file using New > Other > Composer > Workflow diagram > Main Workflow.

After designing the main workflow diagram, create the sub-workflow diagram using New > Other > Composer > Workflow diagram > Sub-Workflow.

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.

Design the sub-workflow diagram.

In the Exit block of the sub-workflow diagram, select the variables, which will be returned back to the called main diagram.

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.

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.

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

Block Notes Property

Exceptions Property

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

Select the Uri row in the block's property table.

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

Click the Uri row in the block's property table.

Click the button to open the Uri dialog box.

Select a workflow in the list.

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:

Select the Type row in the block's property table.

In the Value field, select URL or ProjectFile from the drop-down list.