A basic user-defined pattern is a copy of an existing message
flow, but by extending a user-defined pattern you can allow the pattern
user to customize the pattern.
Procedure
You can extend a user-defined pattern in the following
ways:
Create documentation for the pattern. Creating
documentation provides guidance to your pattern users. To update the
pattern documentation, see Creating documentation for a pattern.
Define the target properties. A user-defined
pattern can change the value of user-defined properties, promoted
node properties, and node properties in a message flow. A property
that is changed by a pattern is called a target property. Pattern
users create a pattern instance by configuring pattern parameters.
The values of the pattern parameters that are configured by a pattern
user can be used to configure the target properties in the pattern
instance. To define target properties, see Defining the target properties.
Define the user interface. You can customize
how the pattern parameters are displayed to pattern users by defining
the user interface. For example, you can rename or group pattern parameters,
and you can define default values for pattern parameters. To define
the user interface, see Defining the user interface, Adding and editing parameter groups, and Enabling parameter groups.
Configure the categories in the Patterns Explorer view. When a pattern user imports a user-defined pattern, it is shown
in the Patterns Explorer view. You can select which category the user-defined
pattern is assigned to in the Patterns Explorer view and create new
categories. To configure the categories, see Creating and configuring categories.
Change pattern parameter IDs. Pattern parameter
IDs are used to refer to pattern parameters in XPath, Java™, and PHP code. You can write the code to
modify pattern parameters or pattern instances. Default parameter
IDs are assigned, but you can change them to custom IDs. To change
parameter IDs, see Changing pattern parameter IDs.
Control the creation of projects in the pattern. You can use XPath expressions to control whether a project in
a user-defined pattern is created based on the values of pattern parameters.
To set up project creation expressions and then test the expressions,
see Creating a project used in a user-defined pattern and Testing a project creation expression.
Transform the pattern parameters. You can calculate
values for pattern parameters from other pattern parameters by using
XPath expressions. To set up transformations for pattern parameters
and then test the transformations, see Transforming pattern parameters and Testing a transformation expression.
Enable or disable the pattern parameters. You
can use XPath expressions to control whether a pattern parameter can
be modified by a pattern user based on the values of other pattern
parameters. To set up enabling expressions for pattern parameters
and then test the expressions, see Enabling pattern parameters and Testing an enabling expression.
Use enumerated values for the pattern parameters. You
can set up enumerated types for pattern parameters so that pattern
users have a predefined list of values for the pattern parameters.
If a target property has a list of possible values, the pattern authoring
tool generates an enumerated type for that target property. You can
modify the enumerated type that is automatically created. To use enumerated
types see Using enumerated values for pattern parameters and Creating enumerated types for pattern parameters.
Use tables for the pattern parameters. You
can set up table types for pattern parameters by defining the columns
for the table. Pattern users can then enter one or more rows of data
in the table in your user-defined pattern. To use table types see Using tables for pattern parameters and Adding pattern parameter table types.
Use user-defined editors for the pattern parameters. You can create user-defined editors for pattern parameters in
your user-defined patterns. Pattern users use these editors when they
enter values for pattern parameters in an instance of your user-defined
pattern. To use user-defined editors, see Using user-defined editors for pattern parameters.
Modify pattern instances by using Java or PHP. You can write code
in Java or PHP that modifies
pattern instances when a pattern user generates an instance of a user-defined
pattern. For example, you can write code to modify the structure of
a message flow based on the values of pattern parameters. To use Java or PHP in user-defined patterns,
see Modifying pattern instances by using Java or PHP.
What to do next
After extending your user-defined pattern, you must build
the pattern plug-in, see Building pattern plug-ins.