You can define any of the normalized message properties using the Source view. You can only access path or query parameters from the Source view.
Open the BPEL process you want to edit in the BPEL Designer.
In the BPEL Designer toolbar, click Source.
The BPEL source code for the process is now visible.
Declare the sxnmp namespace near the beginning of the process element; for example:
xmlns:sxnmp="http://www.sun.com/wsbpel/2.0/process/executable/SUNExtension/NMProperty"
Access the property using the property names listed and described in Normalized Message Properties for REST.
For path and query parameters, separate normalized message properties are created for each. For example,
<assign name="AssignActivity"> <copy> <from variable="GetCustomerNameIn" sxnmp:nmProperty="org.glassfish.openesb.rest.path-params.custName"/> <to>$CustomerQuery_OperationIn.part/ns0:param1</to> </copy> </assign> |
There are two methods to use normalized message properties to encode information as query parameters in an outbound REST call. Both methods are illustrated below in examples that show how to define query parameters for a simple address.
The following example illustrates defining all the parts and assigning their values as a single string.
<copy> <from>'{"street":"800 Royal Oaks Blvd.", "city":"Monrovia", "state":"CA", "zip":"91016"}'</from> <to variable="YahoomapIn" sxnmp:nmProperty="org.glassfish.openesb.rest.params"/> </copy> |
The following example illustrates defining each part as a query parameter and assigning the values individually.
<copy> <from>'800 Royal Oaks Blvd.'</from> <to variable="YahoomapIn" sxnmp:nmProperty="org.glassfish.openesb.rest.params.street"/> </copy> <copy> <from>'Monrovia'</from> <to variable="YahoomapIn" sxnmp:nmProperty="org.glassfish.openesb.rest.params.city"/> </copy> <copy> <from>'CA'</from> <to variable="YahoomapIn" sxnmp:nmProperty="org.glassfish.openesb.rest.params.state"/> </copy> <copy> <from>'91016'</from> <to variable="YahoomapIn" sxnmp:nmProperty="org.glassfish.openesb.rest.params.zip"/> </copy> |