Using a subflow as a user-defined node
You can develop a user-defined node that packages a subflow
from scratch, in the same way that you can create any other user-defined
node that has its implementation based on Java™, or base it on an existing subflow.
The project that contains user-defined nodes can be exported as
a plug-in that is installed in the development environment of the
user. The nodes that are packaged in the plug-in are displayed in
the palette in the Message Flow editor, and can
be used in a message flow in the same way as a built-in node.
Packaging a subflow as a user-defined node provides all the benefits
of a subflow, such as reusability and maintainability, as well as
the following benefits:
- The user-defined node can be distributed to other developers as
a plug-in.
- The user-defined node hides the implementation details of the
subflow from developers who reuse the subflow.
- The user-defined node prevents developers who reuse the subflow
from modifying it.
- The subflow is displayed in the palette in the Message Flow editor.
Limitations
- You cannot use user-defined nodes that are created from
subflows in subflows that are defined in .subflow files.
- Message flows that contain user-defined nodes that are
created from subflows must be included in BAR files as compiled message flow
(.cmf) files. For more information, see Adding resources to a BAR file.
- All the flow resources (Maps, ESQL, XSL, or other external resources),
except Java code and message
sets, that are referenced in the subflow, must be located in the user-defined
node project.
- A user-defined node can reference another user-defined node in
the same or different user-defined node project, but it must not reference
anything from a regular integration project.
- The user-defined node project can have references to other projects,
such as message set and Java projects.
- If the user-defined node references a message set, you must deploy
the message set to the runtime separately. You can copy the message
set to your workspace and deploy it through the BAR file.
- A subflow implementation of a user-defined node can contain other
subflows, but all the subflows must be contained in the user-defined
node project.
- Promoted properties from the nodes within the subflow are supported.
Configurable promoted properties from nodes in the subflow are displayed
as configurable node properties in the BAR editor.
- User-defined properties (UDP) on the subflow are supported. If
you create multiple instances of user-defined nodes in your flow,
each type of user-defined property that you define must have the same
value in each instance.
- You can use the same subflow more than once to construct a flow
of your own.
- You can use node types that have named correlators to create a
user-defined node; for example:
- Asynchronous request and response nodes
- Route and Label nodes
- Aggregation nodes
- TimeoutControl and TimeoutNotification nodes
These paired nodes use a unique ID string to match the pair of
nodes. Therefore, you must not use more than one instance of this
type of user-defined node in a flow, an integration server, or an
integration node because the correlation ID will no longer be unique.
- Resources in the plug-in space are visible to all projects in
the workspace. Keep user-defined nodes and their associated flows,
maps, ESQL, and other similar resources, in appropriately named broker
schemas. Do not put such resources in a default schema, or schemas
with special names, for example, mqsi.