The Assign activity is a light-weight mapping tool. Like a map, the properties for Assign require that you specify a source and target. Using Assign, you can:
Set variable values.
Add and remove subtrees from complex variables using Graft and Prune.
Retrieve system variables.
Perform multiple operations on contexts within a single Assign.
Arrange the order of execution of assignment operations defined within a single Assign activity.
Assign provides two types of data modification:
Value based
Change to the data is value-based when a specific value is set in the target document. A value can be a literal, context variable, environment variable, or process id.
Structure based
Change to the data is structure-based when an XPath notation is used to pass a group of values to the target document.
To create an Assign:
In your business process, select the Business Process tab.
Click on the Business Process canvas to activate the Tool Palette.
If the Tool Palette does not appear in the perspective or on the Fast View shortcut bar, open the Tool Palette.
Select the Activities tool palette and drag and drop the Assign activity onto the canvas.
Either expand Properties in the Business Process Logic Page or open the Properties Panel view.
To change the assign type, from the Assign Overview tab, in the Type column, click in the cell of the Assign that you want to change, then click the arrow that appears to open the Type drop-down list.
If you are using a complex parameter, you must change the type from Assign to Graft.
Select one of the following:
Assign Functions
Function | Description |
---|---|
Assign | Use the Assign function to map data. If the source and target are leaf element nodes, the Assign type is based on the value of the single element specified as the target. If source and target are operation parameters, the Assign type action is actually a graft-like deep copy that transfers all child elements, with their data values, from the target structure to the source structure. Use this function when parameters have identical definitions. |
Graft | Use the Graft function to transfer a subset of the source structure to the target structure when the source and target elements have the same namespaces. This action can be used to combine several document instances into a single document instance, aggregating an entire tree of elements. To map individual source elements, see Creating a Transformation Service. |
Graft Children | Use the Graft Children function to transfer a set of children from the source structure to the target structure when the source and target elements have the same namespaces. This action can be used to combine several child document instances into a single child document instance, excluding the source element itself. To map individual child elements, see Creating a Transformation Service. |
Prune | Use the Prune function to delete elements from the target structure, including all the child elements of a specified element. |
Click in the Source column and click
.
The Variable Reference Dialog appears.
As an alternative, you can drag and drop variables from the Variables section to the appropriate fields in Properties.
Select one of the following:
Variable
Click Select. The Variable Selection Dialog appears. Select the variable that you want to use and click OK.
The source in an Assign must be a simple type or an XSD complex or simple type to invoke the Expression editor. A complex parameter cannot be used to create an XPath.
Literal
Type the literal in the text box.
Click OK.
The variable or literal you selected now appears in the Source column.
Click in the Target column and click
.
The Variable Reference Dialog appears.
Select the variable that you want to use and click OK.
Click OK.
Repeat step 6 through step 13 to add multiple types, sources, and targets.
To change the execution order, use the Move Up and Move Down buttons.
Operations are executed in the order specified, from first to last.
If you are creating an Assign for a Database service in a Business Process service, to catch faults, create a Fault Handler.
Using an Assign to Specify an Instance of a Repeating Element
Acting on Repeating Elements in Data
Send your feedback on this help topic to Sybase Tech Pubs: pubs@sybase.com