Skip to content


The Assign activity can copy data from one variable to another, copy fixed values into variables, or copy the results of an XPath expression into a variable.

You can use XPath expressions to select specific parts of variables or compute values.

The Assign activity can contain one or more copy rules. The Assign is a parent for copy activities that contain ‘from’ and ‘to’ sub-elements.

To add an Assign activity to the process

  1. From the palette, drag an Assign activity to the BPEL Editor.

  2. In the Properties view, click cross to open the Create Copy Rule dialog box.

    Copy rules are made up of two parts: a ‘From’ and a ‘To’. The Assign activity copies a value from the source to the destination using the Copy element.

  3. From the From section drop down list, select the type of variable you want to use.

    Type of variable Function
    Variable Selecting “Variable” in the To or From side of the copy rule dialog box, specifies that you want to either copy to or copy from the variable. You can copy or assign the entire contents of the variable or just a portion of it.
    Expression An XPath expression selects specific pieces of data or computes new values. See Using XPath for more information.
    Fixed value This is a constant that conforms to an XML schema definition. A literal value is used as the source value to assign to a destination. For example, assigning "5" to an integer or "Bob" to a string.
  4. In the To section, select a type from the drop down list. The To complex XML type must be compatible with the From XML type. This means that complex XML types must be similarily defined in the schema.

    As you make your selections, the copy rule displays at the bottom of the Copy Rule dialog box.

  5. Click OK.

The completed copy rule is listed in the Copy Rules section of the Details tab in the Properties view. You can add multiple Copy operations to an Assign and they will be executed in the order they are listed here. You can re-order the list using the UP arrow in the right-hand toolbar.

More information