BPEL Process with multiple Operations / Pick Activity / BPEL Process in Top-down approach

Topics covered:

1. Developing a BPEL process which can expose multiple operations to its clients or handle multiple messages request from clients

2. Developing the BPEL process in Top – Down approach

3. Having a pick activity as the first activity in BPEL process

4. Developing a BPEL process Based on WSDL

5. Developing XSD and WSDL

Sample Description:

    Implementing the Calculator service which exposes 4 operations( addition, subtraction, multiplication, division) which takes 2 parameters as input and returns value. Use BPEL to implement the Calculator service and expose it as service so that client can any operations of his choice

Sample implementation

1. Create a SOA Project with empty composite



Click Finish.

2. Creating XSD

  1. Right click the PickProject –> New –> In “New Gallery” window select “All Technologies” Tab –> In “General” Section select XML –> Select “XML Schema” –> click OK

  2. Specify the File name, directory and target namespace –> click OK

  3. Create the elements as below

    <?xml version=”1.0″ encoding=”utf-8″ ?>

    <xsd:schema xmlns:xsd=”http://www.w3.org/2001/XMLSchema&#8221;

    xmlns=”http://www.manohar.org&#8221;

    targetNamespace=”http://www.manohar.org&#8221;

    elementFormDefault=”qualified”>

    <xsd:element name=”calculatorInput”>

    <xsd:complexType>

    <xsd:sequence>

    <xsd:element name=”inputParam1″ type=”xsd:int”/>

    <xsd:element name=”inputParam2″ type=”xsd:int”/>

    </xsd:sequence>

    </xsd:complexType>

    </xsd:element>

    <xsd:element name=”calculatorOutput”>

    <xsd:complexType>

    <xsd:sequence>

    <xsd:element name=”output” type=”xsd:int”/>

    </xsd:sequence>

    </xsd:complexType>

    </xsd:element>

    </xsd:schema>

    3. Develop a WSDL with 4 operations (addition, subtraction, multiplication, division)

  4. Right click PickProject –> New –> All Technologies –> Web services –> WSDL Document –> OK



  5. Specify WSDL name, Directory and Target Namespace

    Click OK



  6. Create a Messages by clicking “+” in message section

    Enter the Message Name –> Click OK


  7. Create a part element inside the “addInputMsg”.

    – Simple way of doing this by dragging and dropping the “CalculatorInput” element from Calculator.xsd on the “addInputMsg”.

    – To do this keep “Calculator.xsd” and “Calculator.wsdl” in 2 different window side-by-side as below

    Know drag and drop the “CalculatorInput” element from XSD on to “addInputMsg” of the wsdl

  8. Create one more message element for addition response by clicking “+” symbol

    create the part by right clicking on “addOutputMsg” element.


    Specify the Part Name and Reference Value

  9. Repeat Step “e” for creating the other message required for remaining operations


  10. Create a “PortTypes” by clicking “+” in PortTypes section


    create the operation as below


  11. specify the required details as shown below



  12. Similarly create other operations(Subtraction, Multiplication, division)
  13. At the end, wsdl file should look the as below


    3. Create a BPEL Process based on WSDL



    Click OK

    1. By default when the process is created it will create the Receive, Reply activity based on the operation type in wsdl
    2. Delete the default activities created as part of the process like receive, reply
    3. Drag and drop the pick activity on to the Calculator process

      Double click the pick activity and Specify the name and Select “Create Instance” checkbox


    4. Double click the OnMessage –> Select Partner Link, Operation, variable to hold the data.

      Click OK

    5. Drag and drop the Reply activity on to the OnMessage. Know connect the reply activity with the Partner link.
    6. Drag and drop the assign activity before the reply activity to assign the result value to the reply output variable.
    7. Add 3 more OnMessage activities as part of the Pick activity
    8. Repeat steps d, e, f for other OnMessage activities with other operations
    9. Finally your BPEL process should look like below


    10. Testing

      Login to the “EM” –> select the project –> click Test

11 responses

  1. JP >> Jayaprakash Vattikundala | Reply

    Thanks for posting the good and valuable articles, please share ur email or test mail @ chiranjeevijp@yahoo.co.in

  2. Can I use multiple parts in the message declaration?

    1. Hi,

      Yes you can have parts in the message declaration only in the case of RPC style communication.

      1. jyotirmaya sahoo

        Thanks for the response. But I am unaware of the RPC style. Can you please throw some light on this.
        Presently I am working on Oracle SOA-10g. I have built a BPEL process sing pick activity so that it can work for multiple operations. But the input assign component is parsing only the element values of the top part of the message defined in the WSDL. For the second or other parts it is parsing NULL value.
        Can you please suggest some steps?

  3. Hi Manohar,

    It’s nice post.
    Could you please tell me how to use onalarm and wait activities for the above project..?

    Thanks,
    Mithun

  4. Very good post.
    I have one small testcase, which I am unable to solve, could you plese help,
    My scenario is,

    Project0- Parent Async Process
    Project1- Child Async Process
    Project3- Sync BPEL process.

    Flow : Project0 Project1–>Project3
    UseCase: polling a queue for a specific message using correlation id in Mid of BPEL process (Project1) and reply the output to another async process(Project0)
    Project0 is the parent BPEL process which will call Project1 for the output.

    Project1 will call Project3 and then will check if any message is available in the JMS queue with the( correlation id = Project 1 Conversation id). and will pick that specific message from that queue and send that output to Project0.

    Here we have created one JCA adapter with the JMS queue name and calling that using “Pick” activity.

    In the pick activity we are setting the properties := jcs.jms.Correlationid = conversationidVar.

    So that pick activity can get the message which has the correlationId = Project 1 Conversation id.

    Is that the right approach, I can see that all messages are getting vanished from that queue, but still the activity is in pending state.

    Any idea wuld be really appriciated.

  5. krishna chaithanya | Reply

    very good post i want to known pick activity i am fallowing step by step (but Know drag and drop the “CalculatorInput” element from XSD on to “addInputMsg” of the wsdl)i cant able to understand please say me and my mail id:krishnachaithanya689@gmail.com give me answer to me i am waiting for your response…….

  6. I am new to bpel i can not understand where the arithmetic operations are actually performed in this bpel flow. Can you please explain ?

  7. Nice Post 🙂
    Few screenshot is not clear, can you please send me related post blogs to my mail id.

Leave a comment