Lesson 3: Adding order-processing logic

In this lesson, you add order-processing logic that calls the discount service that you created in lesson 1 of this tutorial.

The business process waits for the discount data to come back via a correlated response. Upon receiving the discount data, the order processing completes.

  1. In the WorkSpace Innovator, expand MySybStore_Tutorials/Services/BP and double-click MyHandleOrdersBP.svc_bpmn to open the file in the Business Process Service Editor.

  2. In the Business Process Service Editor, select the Business Process tab.

  3. Arrange the Properties and Variables panes so you can work with them more easily. Right-click in the Business Process Service Editor canvas and select Show Properties Panel, then right-click again and select Show Variables Panel to move the panels into outside views.

    NoteYou can also move the views to other locations in the WorkSpace main window for ease of use.

  4. Click anywhere on the editor canvas to have the Properties Panel display Properties, click New beneath the Correlation Sets pane, then click Create below the Variables table.

  5. Enter corr_customerid in the variable Name column.

  6. Select the processRequest activity in the editor canvas, expand the Properties pane (not the Properties Panel), and select the Correlations tab.

  7. Click New below the Correlation Sets pane. By default, the correlation set you just created (CorrelationSet1) displays.

  8. Expand the Business Process Variables view of the Variables Panel and drag and drop customerid to the Variable Reference column in the Properties pane.

  9. Click Initiate Correlation Set on the far right of the Variables table. You may have to maximize the WorkSpace window to see this option.

  10. Right-click in the editor canvas and select Show Tool Palette. In the following order, drag and drop these objects to the editor canvas.

    (Tool Palette category | [Logic|Activity|Exception])

    1. Logic | And Split

    2. Activities | Assign

    3. Logic | Join

    4. Exception Processing | Terminate

      The editor canvas should look like this:

  11. In the Service Explorer, expand Public/MyDiscountSOAP/MyCalculateDiscountBP and drag receiveCustomerData to the editor canvas and drop it between the Assign and Join objects.

  12. On the editor canvas, horizontally line up the And Split, Assign, receiveCustomerData, Join, and Terminate objects after the processRequest object.

  13. Join the following business logic activities. Rearrange the objects on the canvas as necessary to achieve a look similar to the graphic that follows.

    1. Click the right arrow of processRequest, drag to and click the left arrow of And Split.

    2. Click the right arrow of And Split, drag to and click the left arrow of Assign.

    3. Click the right arrow of Assign, drag to and click the left arrow of receiveCustomerData.

    4. Click the right arrow of receiveCustomerData, drag to and click the left arrow of Join.

    5. Click the right arrow of Join, drag to and click the left arrow of Terminate.

  14. In the editor canvas, select the Assign object and expand the Properties Panel

  15. In the Properties Panel, click New (below the Assign Overview table) twice to create two additional assignments.

  16. In the Variables Panel, and expand Interface Variables/MyHandleOrdersBP/MyHandleOrdersBP/process in the tree view.

  17. Drag and drop the customerid, item, and qty parameters to the Source column of the three new assignments.

  18. In the Variables Panel expand Invoked Services Variables/MyDiscountSOAP/MyCalculateDiscountBP/receiveCustomerData/message/receiveCustomerData/sequence in the tree view.

  19. Drag and drop the customerid, item, and qty to the Target column of the three assignments.

  20. Select File|Save from the WorkSpace main menu. When you select the editor canvas again, the red “X” that was on the Assign icon disappears because you have specified the Assign’s target and source.

  21. In the Business Process Service Editor, select the Service Interface tab, right-click in the Interface:MyHandleOrdersBP box in the diagram, and select Add Operation from the context menu.

  22. Select the new operation, expand the Properties Panel, and enter getDiscount in the Name field.

  23. Expand the Operation Parameters pane in the editor and select the new getDiscount operation in the diagram.

  24. Click Add twice to add two parameters to getDiscount operation.

    Parameter 1:

    Parameter 2:

  25. Select the Business Process tab on the editor. It should show the newly added operation getDiscountRequest activity.

  26. Move the getDiscountRequest activity below the And Split activity in the editor canvas. Click the right arrow of And Split and drag to and click the left arrow of getDiscountRequest.

  27. In the editor canvas, select getDiscountRequest, expand the Properties Panel, select the Correlations tab, and click New below the Correlation Sets pane.

  28. Expand the Business Process Variables pane and expand Interface Variables/MyHandleOrdersBP/MyHandleOrdersBP/getDiscount to locate customerid.

  29. Drag and drop customerid to the Variable Reference column in the Variables table on the Correlations tab.

  30. Select File|Save from the WorkSpace main menu bar and leave the service open in the editor.