Now that David has handled the form data, the order data should be sent to the ERP system. You are going to help him to implement this with a service task. A Service Task is executed automatically when the process reaches it and the process continues to the next element when the execution ends. In contrast to a User Task , no manual intervention by a user is required for service tasks.
|
Click on service task () Create order in ERP system . Order creation is done in two steps:
Select service task Create order in ERP system to display the related execution diagram. Open the library ERPOrderInterface in the Libraries folder.
Select operation mapOrderData from library ERPOrderInterface > ERP > ERPOrder . Drag and drop the operation to the action flow in the execution canvas. | |
You can also use the search in the service panel to find the necessary operations, classes etc. and drag them from the hit list to the execution diagram. | |
The operation has been added to the action flow of the execution UML. Operation mapOrderData needs an incoming object and provides an outgoing object. The incoming object must be WebShopOrder . This is the order data coming from the form you have persisted to variable webShopOrder . | |
Click on the icon in the Persisted section and select variable webShopOrder from the list of available persisted variables. | |
Connect the selected variable with pin webShopOrder of operation mapOrderData . | |
Drag and drop class ERPOrder ( ERPOrderInterface > ERP > ERPOrder ) to the Persisted section of the execution canvas. This creates one more persisted variable ( erpOrder : ERPOrder ) to store the mapped order data returned by the mapOrderData operation. | |
Connect the newly created variable erpOrder with the corresponding output pin. |
The mapping of order data is done. Now you can send the order data to the ERP system.
| Select operation createOrder from library ERPOrderInterface > ERP > ERPOrder . Drag and drop the operation to the action flow after mapOrderData . |
Provide erpOrder as input data to createOrder by drawing the object flow as depicted. |