Pick activity is similar to receive activity. Pick activity will be triggered when a partner link invokes it. This can contain more than one OnMessage and OnAlarm activities.
Here we will create XSD and WSDL manually from jDeveloper 12C. Then those will be used in creating calculator service with pick activity (OnMessage).
- Create a SOA application with SOA project and select Empty Composite.
- Create a XSD. Right click on project -> New -> From Gallery -> General -> XML -> XML Schema
- Click on OK button. Enter xsd file name and let the target namespace be default.
- Now enter the xml code in the source tab. Click here for the sample xsd file. XSD will be like this.
- Create WSDL using this schema. From Gallery -> Business Tier -> Web Services -> WSDL Document
- WSDL creation window will open. Enter WSDL name and select directory. Here we will create message and port type manually.
- Click on OK button
- Click on green plus sign in Message tab. Enter message name addInputMsg. Now add part in the input message. To do this keep XSD and WSDL window side by side and drag and drop the calculatorInput element in the input message.
- Create output message
- Right click on output message and select Insert Inside Message -> part
- Enter part name and select reference value
- Two messages will look like below screenshot
- Create six more messages for calculator service. Check below screenshot
- Second element will be port type in ort type in WSDL. Click on green plus sign in port types tab and enter port type name
- Click on OK button and create operation under port type. Right click on port type -> Insert Inside portType -> operation
- Enter operation name and operation type will be Request Response. Select input and output message. You can add fault also according to your requirement.
- Addition operation will look like below screenshot under port type
- Create another three operations (subtraction, multiplication, division)
- Create a BPEL process in this project. Right click on project -> New -> From Gallery -> SOA Tier -> Service Components ->A� BPEL Process
- Here template type will be Base on a WSDL. Browse the newly created WSDL and select calculatorPortType.
- Click on OK button. Delete receiveInput, replyOutput activities and drag and drop Pick activity in place of receive activity
- Edit the pick activity. Double click on pick icon A�and change the default name. Select Create Instance checkbox also.
- Double click OnMessage icon and editor of OnMessage operation will open. Select BPEL process partner link and select addition operation. Create a variable for OnMessage operation.
- Drag and drop a Reply activity under OnMessage.
- Double click on reply activity to open the editor window. Enter reply activity name and port type & operation will be selected automatically. Create a variable for reply activity.
- Add an Assign activity before reply activity, under OnMessage scope
- Map the reply variable with the OnMessage variable through an expression
- OnMessage will be like this
- Add three more OnMessage operation for subtraction, multiplication and division like addition
- Save the application and deploy it in weblogic server. Test this application in EM console. Enter two input numbers and select operation of your choice. Here I am selecting addition operation
- Click on Test Web Service and check the flow instance in Launch Flow Trace
Test this application with other operations also.