Thursday, June 23, 2011

How to Change input and output for BPEL process

How to change the input and output of a BPEL process

It’s quit possible that once we have created a BPEL process with some input and output and in future we want to change then for that process. Here is a simple “HelloWorld” BPEL example to demonstrate how we can change the input and output of that BPEL process.

Step 1.) We can use Assign activity "copy operation" to check the structure of input and output of the BPEL process




Now we will change the input and output of this BPEL process to some other XSD. This is the Math.xsd and our task is to use this in our BPEL process for input/output





Step 2.) Go inside composite.xml and remove the wire between client and the BPEL and also remove the webservice binding (left side)



Step 3.) From the component panel drop a web service adapter on the Exposed Services (left side) of the composite.xml and name it as MathWS and click on the icon for generating the WSDL from the Math.xsd schema.





Browse the schema and select the request element from Math.xsd. If we want to give namespace for this WSDL file we can do it on the same screen, this WSDL getting created which will be exposed to outside world. For output variable and fault we can repeat the same steps.

Now we can see that the new web service MathWS is in place



Step 4.) Before joining the wire to BPEL process we need one more thing, go inside the BPEL process and remove the old client which was for HelloWorld,



Delete both the wire for request and reply and then the web service.




Step 5.)
Now go inside the BPEL process and click on the “X” this will open up the Variables screen, double click the variable we want to change, in our case we are changing both input and output,





On the edit variable screen we see three different types,

  • Simple Type, this will give us standard variable type like, String, Integer, long, double etc.
  • Message Type allows us to select variables from partner links (used in the process) or any WSDL file
  • Element Type allows us to select variables from XML schema files (XSD)
We want to get the input and output from the MathWS so we can browse the message type and select the input from the partner link MathWS and repeat the same for output variable also.

Step 6.) Now join the wire between web service and the BPEL process in composite.xml




Inside the BPEL process we will see this Math web service



We can now join the wires for receive and reply




2 comments:

  1. I just used the same method to change the input and output of that BPEL process you have explained above and it worked perfectly well. Thanks for explaining all the steps in such a simple way which are easy to follow and understand.
    sap upgrade automation

    ReplyDelete