assign has been edited by Maciej Szefler (Apr 23, 2007). Content:Name<assign> — update the values of variables with new data Synopsis<assign validate="yes|no"? standard-attributes> standard-elements ( <copy keepSrcElementName="yes|no"? ignoreMissingFromData="yes|no"?> from-spec to-spec </copy> | <extensionAssignOperation> assign-element-of-other-namespace </extensionAssignOperation> )+ </assign>
From/To-Spec VariantsThe <assign> activity copies a type-compatible value from the source ("from-spec") to the destination ("to-spec"), using the <copy> element. The from-spec must be one of the following variants: <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> <from/> <!-- DO NOT USE --> <from variable="BPELVariableName" extension="QName" /> <!-- non-standard extension -->
The to-spec must be one of the following variants: <to variable="BPELVariableName" part="NCName"?> <query queryLanguage="anyURI"?>? queryContent </query> </to> <to partnerLink="NCName" />
<to variable="BPELVariableName" property="QName" />
<to expressionLanguage="anyURI"?>_expression_</to> <to/> <!-- DO NOT USE --> <to variable="BPELVariableName" extension="QName" /> <!-- ODE SPECIFIC -->
A to-spec must return an lvalue. If a to-spec does not return an lvalue then a bpel:selectionFailure
Assignment is an atomic operation; that is, either all {{<copy>}}s succeed, or no changes are made.
Variable VariantSelects value stored in a BPEL variable. <to|from variable="BPELVariableName" part="NCName"?> <query queryLanguage="anyURI"?>? queryContent </query> </to|from>
PartnerLink VariantAllows manipulation of the endpoint references associated with partnerLinks. <from partnerLink="NCName" endpointReference="myRole|partnerRole" />
<to partnerLink="NCName" />
For from-specs, the role attribute must be specified, while for the to-spec, the assignment is only possible to the partnerRole, hence there is no need to specify the role. Therefore, the to-spec can only refer to a <partnerLink> of which the declaration specifies the partnerRole attribute. The type of the value referenced by partnerLink-style from/to-specs is always a <sref:service-ref> element. An attempt during process execution to read a partner link before its partnerRole EPR is initialized results in the bpel:uninitializedPartnerRole standard fault. Partner roles of partner links are read when they are referenced in an <invoke> or the <from> part of a <copy> in an <assign> activity. Property VariantAllows data manipulation using properties <to|from variable="BPELVariableName" property="QName" />
_expression_ VariantIn the _expression_ Variant, an _expression_ language (typically XPath), is used to calculate a value. <to|from expressionLanguage="anyURI"?>_expression_</from>
The computed value of the _expression_ must be one of the following:
Literal VariantThe Literal Variant allows a literal value to be given as the rvalue. <from><literal>literal value</literal></from>
The type of the literal value may be optionally indicated inline with the value by using XML Schema's instance type mechanism (xsi:type). The literal content must be either a single element or text. An empty <literal/> element is equivalent to an empty text node. Empty VariantThe empty variant exist for extensibility purposes; it is not supported by ODE. <from|to/>
Variable Extension Variant (non-standard extension)The variable extension variants are non-standard extensions implemented by ODE to allow manipulation of protocol-specific properties from within a BPEL process. <from variable="BPELVariableName" extension="QName" />
The variable referenced by this variant must be message-typed. The following extensions are supported:
Faults
ExamplesThe following assigns a childless element bar in namespace http://example.com <assign> <copy> <from> <literal xmlns:foo="http://example.com"> <foo:bar /> </literal> </from> <to variable="myFooBarElemVar" /> </copy> </assign> The following assigns the string "FooBar" to a string-typed variable myStringVar: <assign> <copy> <from> <literal> <![CDATA[FooBar]]> </literal> </from> <to variable="myStringVar" /> </copy> </assign> The following assigns the string "" (i.e. the empty string) to a string-typed variable myStringVar: <copy> <from> <literal /> </from> <to variable="myStringVar" /> </copy> </assign> The following illustrates copying one variable (c1) to another (c2) as well as copying a variable part (address part of variable c1) to a variable of compatible element type (c3): <assign> |
Unsubscribe or edit your notifications preferences