Table of Contents

Search

  1. Preface
  2. Part 1: Using Process Developer
  3. Part 2: Creating and Modifying Processes
  4. Part 3: Functions, Events, Errors, and Correlation
  5. Part 4: Testing and Deployment
  6. Part 5: Process Central and Process Server (On-Premises)

Process Developer

Process Developer

Assign

Assign

Select a FROM Type and then complete the Copy operation by making other appropriate selections. Add, edit, copy, delete, and reorganize Copy operations and scripts for the selected Assign activity.
BPMN Implementation: Script task, None/Start/End throw event
The assign activity updates the content of variables. It updates variables in several ways:
  • Copies data from one variable to another for a
    Copy
    operation
  • Executes a script with a
    Script
    operation without the need for specifying a copy from/to definition
  • Constructs new data using XPath (or other language) expressions and functions
  • Constructs new data using WS-BPEL and other extension functions
You can also use assign to copy endpoint references to and from partner links for dynamic selection of service partners.
If desired, you can validate the value of variables against their XML or WSDL definitions.
Tip:
You can take a shortcut to creating an assign by creating data assignments within a receive, invoke, reply, and people activity. For details, see Output Variable.
Required Properties
Optional Properties
Copy
optional attributes:
Keep Source Element Name. See Validating Variables
Ignore Missing From Data. See Copy Operation with Ignore Missing From Data Attribute.
 
 
Suppress Join Failure. See Process Properties
 
 
 
 
 
Validate. See Validating Variables
 
Extension Attributes and Extension Elements. See Declaring Extension Elements and Attributes.Elements and Attributes.
To add an assign activity to the process:
  1. From the
    Task
    palette, drag a script task to the Process Editor canvas.
    You can add a background color to the script task.
  2. Double-click the assign to open the Operations dialog.
    Alternately, in the Properties view, click in the Value field of the Copy Operations and select the
    Dialog (...) Button
    .
  3. Select
    New Copy
    or
    New Script
    .
  4. For a New Script, the Script Builder opens where you can create an expression to execute. The script operation avoids the need for defining a from/to specification that a copy operation uses.
  5. For a New Copy, in the From section, select a
    Type
    .
    From Type
    Description
    Upon Selection of this Type...
    Expression
    An XPath (or other language) expression to perform computations on variables and properties. Must return a string, number or Boolean.
    You can create the expression with an Expression Builder. For more information, see Using the Expression Builder
    Literal
    A constant that conforms to an XML schema definition. The type can be indicated inline using
    xsi:type
    Do one of the following:
    Type in literal value (for example, 100)
    Select the Literal Contents
    Dialog (...) Button
    to open a larger editing area
    Generate literal contents for a complex variable, described in Using the XML Data Wizard and Copy Operation Literal Contents Examples.
    Assign a dynamic endpoint reference. See Copy Operation Dynamic Endpoint Reference Example.
    Opaque
    Name representing private application data. Use this option only for an abstract process. For more information, see Creating an Executable vs. an Abstract Process.
    No other choices are allowed
    Partner
    This selection generates a list of partner links and roles
    Select a partner link and role defining an endpoint reference
    Variable
    A WSDL message variable and optional part name
    A WSDL message property
    XML schema simple type or element
    Select a variable name, and optionally, a part name and query. For more information, see Using the Query Builder. Queries are allowed only in executable processes.
    Variable Property
    A WSDL message property
    Select a variable name and property
  6. In the To section, select a Type. The To type must be compatible with the From type, as shown.
    This From type
    Must match this To type
    Message-type variable
    Message-type variable with matching type
    XML schema type variable
    A variable containing a schema type
    XML element type variable
    A variable containing the same element
    Literal
    Must have a matching XML schema type
    Expression
    Expression or Variable
    Partnerlink
    partner role
  7. If desired, enable the
    Keep Source Element Name
    check box, applicable only for element-based variables. The source element name is used as the name of the resulting destination element. See Element to Element Copy Operation with Keep Source Element Name Attribute.
  8. If desired, enable the Ignore Missing From Datacheck box to avoid a selection failure if the source variable is missing optional data. See Copy Operation with Ignore Missing From Data Attribute.
  9. Click
    OK
    . You can add multiple operations to an Assign. They are executed in the order shown in the
    Operations
    dialog and also in the Outline view.
  10. If desired, in the Properties view, set the Validate property to yes to validate all variables used in the assign's Copy operations.
For a shortcut to creating new assigns or adding Copy operations to an existing assign, you can use drag-and-drop features in the Process Variables view. For more information, see Using Variables in a Copy Operation.
Copy Operation XML Syntax
<assign validate="yes|no"? standard-attributes> standard-elements (<copy keepSrcElementName="yes|no"? ignoreMissingFromData="yes|no"?> from-spec (see below) to-spec (see below) </copy> | <extensionAssignOperation> ...assign-element-of-other-namespace... </extensionAssignOperation>) + </assign>
From-Spec XML Syntax
The From element can be in one of these forms:
<from variable="BPELVariableName" part="NCName"? <query queryLanguage="anyURI"?>? queryContent </query> /from> <from partnerLink="NCName" endpointReference="myRole|partnerRole"/> <from variable="BPELVariableName" property="QName"/> <from expressionLanguage="anyURI"?>expression</from> <from><literal>literal value</literal></from>
In an abstract process, you can also use:
<from opaque="yes">
Opaque data is private application data that you do not want to expose to your business partners. It is effectively an abstract process placeholder for some real data that you intend to use in an executable process.
To-Spec XML Syntax
The To element can be in one of these forms:
<to variable="BPELVariableName" part="NCName"? <query queryLanguage="anyURI"?>? queryContent </query> /to> <to partnerLink="NCName"/> <to variable="BPELVariableName" property="QName"/> <to expressionLanguage="anyURI"?>expression</to>
Examples
:
Example 1
<assign> <copy> <from>'yes'</from> <to part="accept" variable="approval"/> </copy> </assign> <assign> <copy> <from>$po.lineItem[@prodCode=$myProd]/amt * $exchangeRate </from> <to>$convertedPO.lineItem[@prodCode=$myProd]/amt</to> </copy> </assign>
Example 2: XML for a Script Operation
<bpel:assign> <bpel:extensionAssignOperation> <bpel:documentation>new script operation </bpel:documentation> <ext3:script>abx:createAttachment('request', 'text/plain', abx:base64Encode("Test attachment") )</ext3:script> </bpel:extensionAssignOperation> </bpel:assign>
See also:

0 COMMENTS

We’d like to hear from you!