You can include subflows in your message flows in exactly the same
way as you include built-in nodes.
You
can also connect them to other nodes in the same way. Because you can define
a subflow once, and use it in more than one message flow (and even in more
than one message flow project), a subflow can provide benefits:
- Reuse and reduced development time.
- A consistent way of achieving a particular function, and increased maintainability
of your message flows (consider a subflow as analogous to a programming macro,
or to inline code that is written once but used in many places).
- Flexibility. If you promote some or all of the properties of the nodes
in the subflow, you can tailor a subflow to a specific context (for example,
by updating the output queue information).
However, you must remember that a subflow is not a single node, and
its inclusion increases the number of nodes in the message flow, which might
affect its performance.
Consider these examples of subflow use:
- You can define a subflow that provides a common destination
for messages that result in an error within the message flow.