A subroutine is a workflow that you can call from multiple orchestration
workflows. Subroutines can contain any orchestration elements, such as the
Calculate step, and are useful when your orchestrations contain common actions.
Once you have created a subroutine, you can use it by dragging it from the
Step Palette into an orchestration workflow.
You can define inputs for a subroutine workflow, similar to defining
Working Data, and you can define outputs for a subroutine in the
Data Mapping tab of the
Like Web services, you can then map these inputs within the calling
orchestration to the appropriate source elements. You can use outputs in
mapping and expressions of other steps.
Note the following points about subroutines:
- Subroutines can be used in both asynchronous and synchronous
- You can define as many subroutines as you want and nest them as
- A subroutine cannot call itself either directly or indirectly via
This simple example demonstrates how to create a subroutine that
appends the text "-subroutine" to a field.
- Create an application process app and add a new text field called
- In the application workflow, create a quick transition called
Test Subroutine that starts and ends at the
- Add an action to the
Test Subroutine transition that does the
- Calls a new synchronous orchestration before the transition
Text1 as a field that is used and returned
by the event
- In app explorer, right-click
Orchestration Workflows and select
Add New Subroutine.
- Change the default name to
- From the
Step Palette, drag a
Calculate step to the subroutine.
- Select the subroutine workflow. For the data mapping inputs, add
- Select the
End step. For the data mapping outputs, add
step, and create a new assignment
with the following values:
- Select the orchestration you created in step 2.
- Drag the new subroutine step
AppendTextSubroutine to the orchestration.
Select the subroutine step and map the
InText1 input to the following source:
- Select the
End step and map the
Text1 output to the following source:
- Save and deploy the process app.
To test in
SBM Work Center,
submit a new item and then click the
Test Subroutine button. The
Text1 field should display the following:
Copyright © 2007–2019 Micro Focus or one of its affiliates. All rights reserved.