Lesson 1: Creating a business service to send a correlation request

  1. Select Window|Open Perspective|Other, select Service Development, and click OK

  2. Select File|New|Service from the WorkSpace main menu bar.

  3. When the Create a service wizard opens, select Business Process Service and click Next.

  4. Select the MySybStore_Tutorials/Services/BP as the parent folder, enter MyCalculateDiscountBP as the name of the service, and click Finish.

  5. When the new service opens in the Business Process Service Editor, select the Service Interface tab.

  6. Expand the Properties pane, select the operation1 box in the Service Interface diagram, and change the operation Name to receiveCustomerData.

  7. Open the Operation Parameters pane, reselect the receiveCustomerData operation in the diagram if necessary, and click Add three times in the Operation Parameters pane to add three parameters with these values:

    Parameter 1:

    Parameter 2:

    Parameter 3:

    NoteTo change parameter name and type, use the Properties pane.

  8. Select the Business Process tab.

  9. Add some logic to calculate the discount. Right-click in the editor canvas and select Show Tool Palette from the context menu.

    NoteIf the Tool Palette disappears, click the Tool Palette icon in the Fast View to redisplay it.

  10. Select the Logic category and drag and drop the Single-rule logic onto the canvas.

  11. Select the Single-rule object in the diagram and expand the Business Process Variables pane in the editor. Expand the Interface Variables folder, then expand the tree view below that until you see the qty parameter.

  12. With the Single-rule object selected in the diagram, expand the Properties pane and drag the qty variable to the Expression editor in the Properties pane and drop it on the Select Variable icon.

  13. Click in the Expression editor, reselect or reopen the Tool Palette, select the Boolean Functions category, and drag and drop the is greater than item on top of the is equal to item in the Expression editor to replace it.

    NoteTo redisplay the Tool Palette from the Fast View, right-click the Tool Palette title tab and select Fast View. You can also right-click the Tool Palette title tab, select Detached and move the Tool Palette view anywhere on your screen.

  14. Click in the Expression editor, reselect or reopen the Tool Palette, select the Generic Variable and Constants category, and drag and drop the integer constant item on top of the string constant item in the Expression editor to replace it.

  15. Select the integer constant item in the Expression editor, and in the Properties for the Operation section to the right of the Expression editor, enter 10 in the Logical Name field and select Bind Source to Logical Name. The Source Text field now displays “10.”

    The completed single-rule expression should look like this:

  16. In the Business Process Diagram canvas, click the right arrow of receiveCustomerDataRequest and drag and click on the left arrow of Single-rule to connect the logic.

  17. Close the Properties pane, then select File|Save on the WorkSpace main menu bar.

  18. On the Business Process Diagram canvas, reopen the Tool Palette, select the Activities category, then drag and drop two Assign activities to the MyCalculateDiscountBP service.

  19. Connect the two Assign activities to the Single-Rule activity. Rearrange the objects on the canvas as necessary to achieve the look shown in the following graphic.

  20. Expand the Business Process Variables pane (below the canvas), right-click the Local Variables folder and select New Variable from the context menu.

  21. In the Business Process Variables pane, right-click the Local Variables folder and select New Variable from the context menu.

  22. Expand the Local Variables folder, right-click the new local variable, and select Edit Variable from the context menu.

  23. When the Properties section opens, change the Name to discount and verify that the Datatype is Simple Type Integer.

  24. Select File|Save from the WorkSpace main menu bar.

  25. Make the new discount variable the target for each Assign activity:

    1. On the Business Process Diagram canvas, select the top Assign object, expand the Properties pane, then expand the Business Process Variables pane.

    2. Drag Local Variables/discount from the Business Process Variables pane and drop it in the Target column of the top Assign.

    3. Select the bottom Assign object on the canvas, and drag Local Variablesdiscount from the Business Process Variables pane and drop it in the Target column of the bottom Assign

  26. Give the top Assign activity discount a literal value of 10.

    1. Select the top Assign on the canvas and in the Properties pane, click the ellipsis button in the Source column.

    2. When the Variable Reference Dialog window opens, select the Literal option, enter 10, and click OK.

  27. Set the bottom Assign activity discount variable a literal value of 0 (zero).

    1. Select the bottom Assign on the canvas and in the Properties pane, click the ellipsis button in the Source column.

    2. When the Variable Reference Dialog window opens, select the Literal option, enter 0 (zero), and click OK.

  28. Select File|Save from the WorkSpace main menu bar, then select File|Close to close the editor.

  29. In the WorkSpace Navigator, create the MyCalculateDiscountBP package profile and package, then deploy the service.

    NoteUnwired Orchestrator must be running and there must be a connection established from MyServiceContainer in WorkSpace. See “Starting and connecting to the Unwired Orchestrator server” for instructions.

    1. Expand MySybStore_Tutorials/Services/BP, right-click MyCalculateDiscountBP.svc_bpmn and select Create Sybase Services Package Profile from the context menu. Select File|Close to close the package profile in the editor.

    2. Right-click MyCalculateDiscountBP.svcpkgdef and select Build Package from the context menu. When a message displays stating that the package was built successfully, click OK.

    3. Right-click MyCalculateDiscountBP.svcpkgdef and select Deploy Package from the context menu. When the Select Target Server window opens, select MyServiceContainer and click OK. If a message asks if the current package file can be overwritten, click Yes.

    4. When the Deployment Status window states that deployment to MyServiceContainer was successful, click OK.

    The Console view shows the progress of each activity. Click the “X” on the Console title tab to close that window.

    NoteSee the WorkSpace online help topic WorkSpace Development|Service Development|Packages for more information about building and deploying service packages.

  30. In the Enterprise Explorer, expand Service Containers/MyServiceContainer/Packages/MyCalculateDiscountBP/Services and locate MyCalculateDiscountBP.

  31. Right-click MyCalculateDiscountBP and select Save WSDL from the context menu.

  32. When the Save WSDL Wizard dialog box opens, select MySybStore_Tutorials/Services/BP in the tree view, confirm the File Name is MyCalculateDiscountBP, and click Finish.

  33. In the WorkSpace Navigator, expand MySybStore_Tutorials/Services/BP right-click MyCalculateDiscount.wsdl, and select Create SOAP Service from the context menu.

  34. When the New Service Wizard opens, select MySybStore_Tutorials/Services/BP as the parent folder, enter MyDiscountSOAP for the File Name of the service, and click Next.

  35. In the Service Summary window, click Next.

  36. In the Service Endpoint Creation window, select the option Yes, Create An Endpoint Now, and click Next.

  37. In the Endpoint Name window, accept the default Name endpoint and click Next.

  38. In the Connection Properties window, click Finish.

  39. The SOAP service is created and opens in the SOAP Service Editor. Select File|Close. You do not need to save the service because you have not made any changes to it.