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

Auto-create Target Path for Copy To Example

Auto-create Target Path for Copy To Example

The following example shows the effect of enabling and disabling the Auto Create Target Path for Copy/To option.
For details on WS-BPEL 2.0 processes, see Using the Process Developer Create XPath Extension.
For a description of this BPEL4WS 1.1 preference, see Simulation Preferences.
Code sample
:
<assign> <copy> <from part="OrderInfo" query="/ns1:OrderInfo /ns1:OrderHeader/ns1:BillToInfo/ns1:Addr1" variable="var1"/> <to part="OrderInfo" query="/ns1:OrderInfo /ns1:OrderHeader/ns1:BillToInfo/ns1:Addr1" variable="var2"/> </copy> </assign>
In the code sample, the Assign From/To query is for an optional element, as shown in the schema snippet below.
Schema Snippet for Var1 and Var2:
<xs:complexType name="AddressInfoType"> <xs:sequence> <xs:element ref="ord:Name"/>
<xs:element ref="ord:Addr1" minOccurs="0"/>
<xs:element ref="ord:Addr2"/> <xs:element ref="ord:City"/> <xs:element ref="ord:St"/> <xs:element ref="ord:Zip"/> <xs:element ref="ord:Cntry"/> </xs:sequence> </xs:complexType> <xs:element name="BillToInfo" type="ord:AddressInfoType"/>
Var1 Sample Data
Var2 Initialization
<ns1:OrderInfo xmlns:ns1="http:// temp.com"> <ns1:OrderHeader> <ns1:OrdId>78</ns1:OrdId> <ns1:BillToInfo> <ns1:Name>Name1</ns1:Name>
<ns1:Addr1>Apt 12
</ns1:Addr1>
<ns1:Addr2>1 Main St </ns1:Addr2> <ns1:City>Albany</ns1:City> <ns1:St>NY</ns1:St> <ns1:Zip>12012</ns1:Zip> <ns1:Cntry>USA</ns1:Cntry> </ns1:BillToInfo> ...
<ns1:OrderInfo xmlns:ns1="http:/ /temp.com"> <ns1:OrderHeader> <ns1:OrdId/> <ns1:BillToInfo> <ns1:Name/>
(Addr1 is missing)
<ns1:Addr2/> <ns1:City/> <ns1:St/> <ns1:Zip/> <ns1:Cntry/> </ns1:BillToInfo> ...
With Auto Create Target Path for Copy/To disabled, the simulation ends in a fault because
Var1
contains the query selection node, but it cannot be assigned to the
Var2
query selection node because the location path is missing.
With Auto Create Target Path for Copy/To enabled, the process terminates normally because the location path for
Addr1
is built, and the value is added to
Addr1
during the assignment.

0 COMMENTS

We’d like to hear from you!