| From Intake
|
JMS Inbound |
Receives individual claims from 1 Intake Route. |
| Get Previous Call Result
|
Data Storage Inbound |
Fetches previous responses from the Data Storage.
Tip If the Data Storage returns a response (which means that there was an attempt to process this message before), then the component sends out 2 messages (the one retrieved from the Data Storage and the original) further down the route. If the route processes the message for the first time, the component sends out only one original message. A Groovy script checks this condition later to determine the processing flow.
|
| Aggregation
|
Aggregation |
Aggregates the message fetched from the Data Storage (if any) and the original message into a multimessage exchange. |
| Analyze Previous Attempts
|
Groovy |
Executes a Groovy script which detects the current message processing iteration. The script sets the XEServer property Flow to one of the following values:
- Flow = proceed: If the route processes the message for the first time.
- Flow = too_many_attempts: If the route processes the message three or more times.
- Flow = retry: If the route processes the message fewer than three or more times.
Later on, in the route, the WithinRetryLimit component checks the Flow property for a decision on the next steps in the message flow.
|
| WithinRetryLimit?
|
Router |
Checks the XEServer property Flow and sends the message to make a call to web service #1 if the property value is proceed or retry. Otherwise, sends the message to 4_MessageCompletion Route. |
| Get Original Data
|
JMS Inbound |
Retrieves the original data (individual claim) from the Data Storage. |
| Call Service 1
|
REST Client |
Makes an HTTP request to the web service #1 represented by the profile's RESTful Web Service and the Groovy component. This request is handled by the Emulation/Service_1 Route. When the component gets a response from the Emulation/Service_1 Route the component sets the response status code as an XEServer property. |
| Save Call Response
|
Data Storage Outbound |
Stores the response in the Data Storage. |
| Save Error and Attempt number
|
Data Storage Outbound |
If an error occurs, stores the message and the retry attempt number in Data Storage. |
| Analyze Response
|
Groovy |
Executes a Groovy script that does the following:
- If the status code of the response is higher or the same as 500, sets the property "Flow"="retry" which means that the message goes for another request attempt.
- If the Emulation/Service_1 Route returns the control string NEXT, sets the property "Flow"="next" which means that the message goes to the next web service (Service_2 Route).
- Sets "Flow"="done" in all other cases which means that the message processing is complete and the message goes to 4_MessageCompletion Route.
Tip Note the ResponseStatus parameter in the Groovy script parameters section. Declaring this parameter allows you to reference the ResponseStatus variable within the Groovy code.
|
| Action
|
Router |
Directs the message to one of the three outputs based on the XEServer property Flow:
- retry: If the REST Client response status code is 5xx, the route makes two more attempts to get the data from web service #1 (Service_1 Route). If the attempts fail, the component sends the response file to the route 4_MessageCompletion bypassing the route 3_Call Service2.
- service2: If the response message is NEXT, the message goes to service #2 (3_Call Service2 Route).
- completion: If the response message is DONE, the message processing is considered complete. In this case, the individual claim does not go to web service #2 (3_Call Service2 Route).
|
| Delay
|
Delay |
Makes a 5-second pause between retry attempts. |
| Retry Service 1
|
JMS Outbound |
Sends the message for one more processing attempt (JMS queue "Service1") on this route. |
| To Service 2
|
JMS Outbound |
Sends the message to be processed by web service #2 (Emulation/Service_2 Route). |
| To Completion
|
JMS Outbound |
Sends the message that is marked as complete to 4_MessageCompletion Route. |