BPEL structured activities: Pick

Using BPEL Pick activity, you can specify which process would be executed according to the received event. Event could be a message event or an alarm event. For each event, we can specify a set of activities to be performed.

Objective: creating a BPEL process to run either operation sayHello or sayGoodbye according to a received message.
Tools: Eclipse 3.6, BPEL Designer 0.5.0 Plugin, Tomcat 7.0.53, ODE 1.3.5

BPEL's Pick activity

  1. Create a new BPEL project named “BPEL_Pick” by selecting File→New→Others→BPEL 2.0→BPEL Project. Select Next. Type the project name as BPEL_Pick and select the Target Runtime as Apache ODE 1.x Runtime. Click Finish.
  2. Create a new BPEL process file named PickSample by right clicking on the BPEL_Pick/bpelContent folder, select New→Others→BPEL 2.0→New BPEL Process File. Click Next. Fill in BPEL Process Name the string PickSample, and in the Namespace the string http://pick.bpel.tps. click Next.
  3. Select the Template as Synchronous BPEL Process and modify the Service Address as http://localhost:8080/ode/processes/PickSample (suppose that your Tomcat environment is running on port 8080). Click Finish.


  4. Open the PickSampleArtifacts.wsdl file in your project. Right click on the PickSamplePort. Select show properties and make sure that the Address is http://localhost:8080/ode/processes/PickSample. Right click on the PickSample Port Type. Select Add Operation.
  5. Rename the new operation as sayGoodbye . Rename the existing operation from process to sayHello.


  6. Open the Outline→Bindings→PickSampleBinding. In the Properties view. Click Generate Binding Content... Keep default declaration, select Overwrite existing binding Information. Finish.


  7. Open the PickSample.pbel file to design the process. Click and drag the Pick activity from the Palette to the process before the receiveInput activity.
  8. In the Details tab of the Pick activity, select the option Create a new Process instance if one does not already exist.
  9. Remove the receiveInput activity and move the replyOutput activity to the OnMessage event, inside the Pick. Click and drag an Assign activity to the process, before the replyOutput. A Sequence is automatically created.


  10. Click on the OnMessage activity. In the Details tab, select the operation sayHello.


  11. Right click on the Pick activity. Select Add OnMessage. In the Details tab, select the operation sayGoodbye. Add an Assign activity and a Reply activity to the sayGoodbye branch.


  12. Click on the Reply activity of the sayGoodbye branch, in the Details tab, assign the PickSample→sayGoodbye→sayGoodbyeResponse→parameters→out to the clientResponse variable.


  13. The same way with the replyOutput activity, assign PickSample→sayHello→PickSampleResponseMessage→payload→result to the output variable.
  14. Click on the Assign activity, select Details→New. Assign the expression concat(“Hello ”,$input.payload/tns:input) to the output→payload→result variable. A pop-up dialog appears asking you about the variable initiation. Select Yes.


  15. The same way, at the Assign1 activity, assign the expression concat(“Goodbye ”,$clientRequest.parameters/tns:in) to the clientResponse→parameters→out variable.
  16. It's now finish the design part. Verify that there is no error in the dessign. We move to the service declaration and registration.
  17. Right click on the BPEL_Pick/bpelContent folder, select New→Others→BPEL 2.0→Apache ODE Deployment Descriptor. Click Next. Verify the BPEL Project name as /BPEL_Pick/bpelContent. Click Finish.
  18. Open the deploy.xml file. And select the Associated port with the Partner Link client is PickSamplePort.
  19. Save file and open the Server view, right click on the Ode v1.x Server at localhost, select Add and Remove Projects. Select the BPEL_Pick in the Available projects box and click Add. Then, click Finish.
  20. Start the ODE server and use the Eclipse's Web Services Explorer to test our application. You will see two operations sayHello and sayGoodbye that you can select to use. Depending on the operation you select, BPEL will execute the respective process.


  21. Done.

Exercices

  1. Create a simple BPEL process to execute one of the operations add(+) and subtract(-) two integers using Pick activity.
teaching_assistant/bpel/bpel_structured_activities_-_pick.txt · Last modified: 2014/04/14 09:00 by IT Courses (NNC)
Back to top
CC Attribution-Share Alike 4.0 International
chimeric.de = chi`s home Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0