Using Assign Element To Copy All of Process Data Into the Message
In addition to the explicit assignments described thus far, you can also use assign elements within a service implicitly—that is, to copy all of process data into the Message To Service (output message) so that a service can access it.
To use this method, code your assign element as follows:
assign from="*" to=".">
This instructs the service that all (*) of the process data document is available for use. You can use this type of assignment separately for both input and output messages. This is a catch-all construct used when a service may need access to all of process data. Recommended practice is to use explicit assignments in the messages. Explicit assigns, in which the process steps act on or pass on only the useful and necessary pieces of information in process data, yield more efficient overall processing that is less likely to negatively affect system performance.
In the following example, which is a fragment of a business process, the GetCustomerData service executes, processes, and produces the same information as in the first example (see Input and Output ExamplesInput and Output Examples). But, because there are no explicit assign elements, all of the data must be in the correct place in process data:
<operation name="GetCustomerData"> <output name="MessageToGet"> <assign from="*" to="."> </output> <input name="MessageFromGet"> <assign from="*" to="."> </input> </operation>
The following is process data:
<ProcessData> <ID>12345</ID> </ProcessData>
As the service runs, it writes data directly to process data. After the service completes, the process data looks like the following:
<ProcessData> <ID>12345</ID> <NAME>Bob Smith</NAME> <EMAIL>email@example.com</EMAIL> <ADDRESS>4600 Lakehurst Court, Dublin, OH, 43016</ADDRESS> <PHONE>614-793-7000</PHONE> </ProcessData>