Adding a subflow
In a message flow, you can include an embedded message flow, also known as a subflow. For example, you might define a subflow that provides error handling, and include it in a message flow connected to a failure terminal on a node that can generate an error in some situations.
Before you begin
About this task
- The subflow that you want to embed is defined in the same application, library, or integration project as the message flow.
- The subflow is defined in a different library, and you have specified the dependency of the current application, library, or integration project on that other library.
- You can embed subflows that are defined in .subflow files into subflows that are defined in .subflow files and .msgflow files.
- You can embed subflows that are defined in .msgflow files into subflows that are defined only in .msgflow files.
- A subflow in a shared library can contain another subflow in the same library or in another shared library.
When an application or shared library references other shared libraries, all the subflows for a broker schema must be in a single container. Subflows for a broker schema must not be in both an application (or shared library) and a shared library that is referenced by that application (or shared library). Subflows for a broker schema must not be in two or more shared libraries that are referenced by a single application or shared library. All the subflows in a broker schema must be either in the main application or shared library, or in a single referenced shared library.
To add a subflow to a message flow or subflow, complete the following steps:
- Open the message flow or subflow in which you want to embed the subflow.
To add a subflow, drag the message flow or subflow that you want to add from the Application Development view to the editor.
Alternatively, click, then select the flow that you want to add from the list.
The embedded subflow is shown in the Message Flow editor as a single node with the terminals that represent the Input and Output nodes that you have included in the subflow.
Connect the subflow node to one or more of the nodes in the main message flow or subflow.
For more details, see Connecting message flow nodes.
- To add and connect further subflow nodes, repeat steps 2 and 3.
- To work with the contents of the subflow, double-click
the subflow icon. The subflow opens in the Message Flow editor.
What to do next
You can package subflows that are defined in .msgflow files as user-defined nodes so that you can use them in message flows and subflows; for more information, see Using a subflow as a user-defined node.