- Double click the invoke activity which invokes the sync read adapter.
- Go to adapters tab and click the torch icon.
- Click on Variables and create a new variable.
- Give some name like OutboundheaderVariable, choose message type and click the torch.
- Drill down to fileAadapterOutboundHeader.wsdl > Message Types and select OutboundHeader_msg. Click Ok till you are back in the diagram.
- Place an assign activity above this invoke and copy the file name to the OutboundHeaderVariable > fileName variable.
Saturday, August 15, 2009
Dynamically passing the file name to read adapter
Using BPEL Variables in Transformations
Thursday, July 16, 2009
Converting Synchrous BPEL process to Asynchronous BPEL process
Whenever we create new bpel process three files are created by default viz.
- [processName].bpel
- [processName].wsdl
- bpel.xml
But the difference between the Synchronous and Asynchronous process remains in the .bpel and .wsdl files only.
For explaining how to convert the synchronous process to asynchronous one I have created a BPEL process SynchBP. I’ll be converting SynchBP which is a Synchronous BPEL process to an asynchronous one. As earlier said the difference is only in .bpel and .wsdl file so we'll concentrate only on these two files.
For ease of understanding I have used colours in the text so as to highlight what to change and what to add.
So, first start with SynchBP.bpel file.
There are three places where we have to make changes viz. partnerlink, receive, and reply element.
Partnerlink:
This is how the partnerlink element is of a SynchBP:
<partnerLink name="client" partnerLinkType="client:SynchBP" myRole="SynchBPProvider"/>
Add another attribute partnerRole="SynchBPRequester" to this element. The partnerlink will look like this:
<partnerLink name="client" partnerLinkType="client:SynchBP" myRole="SynchBPProvider" partnerRole="SynchBPRequester"/>
Receive Element:
Below is the receive element of SynchBP
Change the value of attribute operation from process to initiate. The partnerlink will look like this:
Reply element:
Below is the reply element of SynchBP
<reply name="replyOutput" partnerLink="client" portType="client:SynchBP" operation="process" variable="outputVariable"/>
Do the following changes to make it for asynchronous process:
- Change the element name from reply to invoke.
- Change the name attribute value from replyOutput to callbackClient.
- Change the value of attribute portType from client:SynchBP to client:SynchBPCallback (or simply [processName]Callback ).
- Change operation=”process” to operation=”onResult”.
- Change the name of last attribute i.e. variable to inputvariable.
<invoke name="callbackClient" partnerLink="client" portType="client:SynchBPCallback" operation="onResult" inputVariable="outputVariable"/>
Here we are done with SynchBP.bpel, now we need to edit SynchBP.wsdl.
There are very few changes to be made in the .wsdl file.
The elements that need to be changed are portType and partnerLinkType.
portType:
This is how a portType is defined in a synchronous process:
Create another portType element with name SynchronousProcessCallback and operation as onResult. Now delete the output element from both portTypes and in the SynchronousProcessCallback portType, change the attribute value from client:SynchBPRequestMessage to client:SynchBPResponseMessage. (Help: Copy & paste the already defined portType and do as below)
This is how partnerlink information is provided in a wsdl of a synchronous process:
Inside partnerLinkType create one more role element and give it a name as SynchronousProcessRequester. Now inside the role element for portType element change the value of name attribute to client:SynchronousProcessCallback.
Here we are done with .wsdl file and the SynchBP process is now an asynchronous BPEL Process.
Wednesday, July 8, 2009
Asynchronous vs. Synchronous BPEL process
- Client invokes SynchronousBPELProcess.
- SynchronousBPELProcess gets instantiated and starts its operations while Client waits for the response from the SynchronousBPELProcess.
- SynchronousBPELProcess completes its operations and sends a response back to Client.
- Client continues and completes its processing.
- Client invokes AsynchronousBPELProcess.
- AsynchronousBPELProcess gets instantiated and starts its operations while Client also continues to perform its operations.
- AsynchronousBPELProcess completes its operations and callback the Client with the response message.