Sie sind auf Seite 1von 15

Exercise 4: Create Orders

In this exercise, the sales and purchase orders are created in parallel. If one fails, both orders are canceled. As an extension of this exercise, the creation of the purchase order part is enhanced by a manual compensation in case the creation of the purchase order fails. The exercise uses application and transport acknowledgments of send messages. Moreover, send contexts are used for routing purposes. 1. Collapse the Create Materials block and add a CreateSalesAndPurchaseOrdersBlock block.

2. Insert a fork step createparallel with two necessary branches:

3. Create the correlation CorrOrder:

4. Create a send step SendPO. Enter PurchaseOrder for the Send Context property. This is important because the routing depends on this send context.

5. In the process container, create a container element po_resp.

6. Insert a receive step ReceivePO:

7. Create a container element status_po (type xsd:string):

8. Insert a container operation getPOstatus:

9. Insert a send step SendSO into the other branch:

10. Create a container element so_resp:

11. Insert a receive step ReceiveSO:

12. Create a container element status_so (type xsd:string):

13. Create a container operation getSOStatus:

14. Create a block AutomaticCompensation:

15. In this block, insert a switch CancelOrders:

16. Insert a send step Cancel_PO into branch1. Enter CancelPO for the Send Context property.

17. Insert a send step Cancel_SO into branch1. Enter CancelSO as the send context:

18. Insert a control step AlertCancelOrders, which raises an alert:

19. Insert a control step OrdersCanceled, which cancels the process:

20. Save, check and activate your process

21. Test your process: If you use a customer name containing a Y, the response message correlated to the CreatePurchaseOrderMessage from Airline_Group_2 indicates that an error occurred (this is not an application error in XI):

The same is true for the SalesOrder if you use a customer name containing a Z:

Check if your process works. If you use customer names without Y and Z, your Workflow log should look as follows:

If you use customer names with Y and/or Z, your Workflow log should look as follows:

Check the alert inbox:

22. Check the graphical Workflow log:

23. Check the transport and application acknowledgments in transaction SXMB_MONI:

Extension
1. Add a switch step check after the container operation getPOstatus:

2. Insert a block ManualCompensation into branch1 and define the exception TimeOut:

3. Add a deadline branch to this block:

4. Add a control step NoInteraction to this deadline branch, which triggers the TimeOut exception:

5. Add an exception branch to this block, which handles the TimeOut exception:

6. In the Manual Compensation branch, insert a control step POErrorControl, which triggers an alert with the alert message PurchaseOrder could not be created, Run Report SPAREPARTS_MANUALCOMPENSATION in client 813 within the next 60 seconds to compensate manually.

7. Insert a receive step ReceivePOAgain after the last control step:

8. Insert a container operation setPOStatus:

9. Save, check and activate your process.

10. Test the manual compensation step:

a. Log on to client 813 and prepare to run the SPAREPARTS_MANUALCOMPENSATION report. b. Run your process with a customer containing a Y. c. In the graphical Workflow log, check that the process reaches the ReceivePOAgain step. d. Run the SPAREPARTS_MANUALCOMPENSATION report in client 813. e. Check that the orders are not cancelled due to the manual compensation (run the report, which sends a message to the ReceivePOAgain step).

Process waiting for manual compensation

Process manually compensated

Process without manual compensation

Das könnte Ihnen auch gefallen