Return to the MyCalculateDiscountBP service to finish its implementation and send the correlated response to MyHandleOrdersBP.
Open the Service Development perspective.
In the WorkSpace Navigator, expand MySybStore_Tutorials/Services/BP and double-click MyCalculateDiscountBP.svc_bpmn to open it in the Business Process Service Editor.
Right-click in the editor and select Show Tool Palette from the context menu.
In the Tool Palette, drag and drop these activities to the editor canvas:
(Tool Palette category | [Logic|Activities])
Logic | Join to the right of the two Assigns
Activities | Delay to the right of the new Join
Activities | Assign to the right of the Delay activity
In the Service Explorer, expand Public/MyProcessOrderSOAP/MyHandleOrdersBP, and drag and drop the getDiscount operation on to the editor canvas to the right of the Assign on the far right of the canvas.
Connect the activities on the editor canvas, rearranging the objects as necessary.
Click the right arrow of the top Assign and drag to and click the left arrow of Join.
Click the right arrow of the bottom Assign and drag to and click the left arrow of Join.
Click the right arrow of Join and drag to and click the left arrow of Delay.
Click the right arrow of Delay and drag to and click the left arrow of the last Assign.
Click the right arrow of the last Assign and drag to and click the left arrow of getDiscount.
Select Delay in the
editor canvas and expand the Properties pane.
Set the Timer Type to Relative,
and set the Timer Details to Literal and 1
Second.
Select the Assign activity on the far right of the editor canvas, expand the Properties pane, and click New to add one more assignment row. There are now two Assigns in the Assign Overview table.
Expand the Business Process Variables pane, and specify each assignment’s Source and Target value in the Property pane as follows:
Drag customerid from Interface Variables/MyCalculateDiscountBP/MyCalculateDiscountBP/receiveCustomerData to the Source column of the first assignment in the Assign Overview table.
Drag customerid from Invoked Services Variables/MyProcessOrderSOAP/MyHandleOrdersBP/getDiscount/message/getDiscount/sequence to the Target column of the first assignment.
In the Business Process Variables pane, expand the Local Variables folder and drag discount to the Source column of the second assignment in the Assign Overview table.
Drag discount from Invoked Services Variables/MyProcessOrderSOAP/MyHandleOrdersBP/getDiscount/message/getDiscount/sequence to the Target column of the second assignment.
Select File|Save from the WorkSpace main menu bar.
To resynchronize the package because you added a new SOAP service operation to the business process, right-click MyCalculateDiscountBP.svc_bpmn again and select Create Sybase Services Package Profile from the context menu. Answer yes when you are asked if you want to overwrite the existing file.
Right-click MyCalculateDiscountBP.svcpkgdef, and select Build Package from the context menu. When you are prompted to overwrite an existing file, click Yes to All. When a message states that the package was built successfully, click OK.
To deploy the business process, right-click MyCalculateDiscountBP.svcpkgdef, and select Deploy Package.
When the Select Target Server dialog box opens, select MyServiceContainer and click OK. When you are prompted to overwrite an existing file, click Yes to All. If a message warns you about existing packages of the same name already existing, click OK.
When you see a message stating that the package was successfully deployed, click OK.
Close the Console window and select File|Close from the WorkSpace main menu to close any editor windows.
Upon successful execution, MyHandleOrdersBP logs a message in Jaguar.log that prints the customer ID and the discount given to that customer (10 or 0, depending on the value you enter for input quantity.
Executing the business process results in a call made to the receiveCustomerData operation of the MyDiscountSOAP service, which in turn calls the getDiscount operation on the waiting MyProcessOrdersSOAP service (MyHandleOrdersBP). The call to getDiscount is correlated, based on the value of customer ID, then sent to the waiting service instance.
Congratulations! You have completed the Process Orchestration tutorials.