Writing Copy Rules

The Assign activity assigns values to variables. Each assignment is called a copy rule. Copy rules are added to the Assign to specify which data will be copied into which variable. A variable can be assigned with a value from another variable, with a literal value, or with an XPath expression.

To add a copy rule

  1. Select the Assign activity from the BPEL Editor.

  2. In the Properties view, click the Add Copy Rule icon from the toolbar. copy rule icon
    The Copy Rule dialog box displays, and you can now build the copy rules you need to perform simple data manipulation and transformation.

    You can create multiple copy rules from the Copy Rule dialog box, using the available toolbar. The asterisk denotes a copy rule that has been modified.

  3. Select either Variable, Fixed Value, or `Expression from the From drop down list, depending on what type of value you are assigning.

    In the Copy Rule Editor (available when you select Expression in the drop down list) you can cycle through the variables, XPath functions, and XPath operations available to you, by pressing Ctl+Space. Type the dollar sign ($) in the editor to display a list of variables.

    Each copy rule for an Assign activity has a From part, which specifies the source data, and a To part, which specifies a variable or element part as the destination for the data.

  4. Complete the To section of the Copy Rule form to specify a variable or element part in the reply message.

Optional attributes

See section 8.4.2. Replacement Logic of Copy Operations in the BPEL specification for more detailed information on optional attributes.

copy rule attributes


The Ignore Missing Source Data attribute specifies whether missing From-side data is ignored

Keep Source Element Name replaces the element at the destination with a copy of the entire element at the source, including children and attribute properties. This attribute supports XSD substitution groups and choice.

Related Topics
Bullet Initializing Variables
Bullet Using XPath
Bullet Assign Activity
Bullet Creating XPath Expressions