Try OpenEdge Now
skip to main content
BP Server Developer's Guide
Messaging workstep : Messaging example
 

Messaging example

Figure 35 shows how messaging works between multiple applications.
Figure 35. Messaging example
In the above figure, the application on the left hand side is ‘ProductManager’ and the application on the right hand side is ‘ProductApproval’. The publisher workstep—SendProductForApproval—in the ‘ProductManager’ application publishes a message with the following content:
<NewProduct>
    <ProductID>123</ProductId>
    <ProductName>Laptop</ProductName>
    <ProductQty>100</ProductQty>
    <ProductPrice>50000.00</ProductPrice>
    <ProductDescription>Laptop description here</ProductDescription>
</NewProduct>
This message also carries the "ApproverName" as the header property. When such a message is published, a new process instance of the second application ‘ProductApproval’ is created, and all data from this message is passed on to dataslots of the new process instance. The Header Property ‘ApproverName’ is also copied to a dataslot of the new process instance.
In the publisher workstep of second application, following message is sent:
<ProductApproval>
    <ID>123</ID>
    <Status>true</Status>
    <Comments>Approval comments here</Comments>
</ProductApproval>
When such a message is published, it is correlated to the appropriate process instance of the first application ‘ProductManager’ based on ‘ID’. In this way, the requesting user comes to know about approver’s decision.