Monday, May 23, 2016

#506 SOA 12.2.2.1. --> JSON processing in BPEL

An excellent feature...

Here is a simple example in which I process a customer.

I start by creating a REST interface -

































































Now I create the BPEL process, based on this -























Edit the process -


















Let's look at the process variables -









Now, if I want to address these within the process, I need to do so as -
process.inputVar.parameterName

e.g. process.inputVar.custName.

I can leverage the above in a simple assign as follows -

Note: I do not see any input structure in the ASSIGN activity.











So I need to add a suffix to outputVar.








Edit the above assignment - adding an attribute to the outputVar.




















I deploy and test -















Now I add a JavaScript activity to the BPEL process -







































Here I am referring to a new process variable v_response.
I need to define this.
























Now let's use v_response to set the output.








Re-deploy and Re-test -














What if this BPEL process needs to call another process, for example, to validate the
customer?









Validate Customer is a simple process -










So how do I pass the JSON input to this process?












Again, edit the ASSIGN -











Simple stuff!


No comments: