Using an Asynchronous Event Handler to Implement a Simple Mortgage Workflow
Mortgage application consumer and provider processes interact with each other through the message correlation mechanism. The event handler invocation allows for asynchronous event processing and executes the logic parallel to the main business logic of the process.
Procedure
Result
12:19:45.639 [bwThread:In-Memory STWorkProcessor-2] INFO c.t.b.p.g.L.t.b.s.c.e.A.LogSubmitMortgage - ### Received SubmitMortgageApp()
12:19:45.670 [bwThread:In-Memory STWorkProcessor-4] INFO c.t.b.p.g.L.t.b.s.c.e.A.Log - Cancel Application F54734546
12:19:45.685 [bwThread:In-Memory STWorkProcessor-4] INFO c.t.b.p.g.L.t.b.s.c.e.A.Log - Cancel Application F54734546
12:19:45.685 [bwThread:In-Memory STWorkProcessor-4] INFO c.t.b.p.g.L.t.b.s.c.e.A.Log - Cancel Application F54734546
12:19:45.701 [bwThread:In-Memory STWorkProcessor-8] INFO c.t.b.p.g.L.t.b.s.c.e.A.Log - ### Done, get Mortgage Rate: 9.1
Understanding the Configuration
- MortgageAppProvider: This is a Mortgage service with three operations, the SubmitMortgageApp, SubmitFinDoc and the CancelMortgageApp operations defined in the event handler container. Both the CancelMortgageApp and SubmitFinDoc operations have a correlation key obtained from the response to the operation SubmitMortgageApp.
- MortgageAppConsumer: The consumer invokes the
CancelMortgageApp operation before the operation
SubmitFinDoc: This way, the service calls
CancelMortgageApp after receiving the correlation message key,
mortgageAppID: The
CancelMortgageApp activity has the input properties configured as shown in the following image: