| From CallService1
|
JMS Inbound |
Receives messages from 2_CallService1 Route. |
| Get Previous Call Result
|
Data Storage Inbound |
Fetches previous responses from the Data Storage.
Tip If the Data Storage returns a message (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 the route, the Flow property is checked for a decision on the next steps in the message flow.
|
| WithinRetryLimit?
|
Router |
If the current message processing iteration is within the limit, sends the message further down to make a call to web service #2. Otherwise, sends the message to the route 4_MessageCompletion. |
| Get Original Data
|
JMS Inbound |
Retrieves the original individual claim from the Data Storage. |
| Call Service 1
|
REST Client |
Makes an HTTP request to web service #2 represented by the profile's RESTful Web Service. The route Emulation/Service_2 handles this request. When the component gets a response from the route Emulation/Service_2, 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 current retry attempt number in Data Storage. |
| Analyze Response
|
Groovy |
Executes a Groovy script that does the following:
- If the response status code is higher or the same as 500, sets the property "Flow"="retry" which means that the message goes for another processing attempt.
- Sets the "Flow"="done" property 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 defined in the component's Groovy script parameters section. Declaring this parameter allows you to reference the variable ResponseStatus within the Groovy code.
|
| Action
|
Router |
Directs the message to one of the two outputs based on the XEServer property Flow:
- Retry: In this case the route makes two more attempts to get the data from the web service #2. If the attempts fail, the component sends the file Call Response to the route 4_MessageCompletion.
- To Completion: In all other cases.
|
| Delay
|
Delay |
Pauses the message flow for 5 seconds. |
| Retry Service 2
|
JMS Outbound |
Sends the message for one more processing attempt (JMS queue "Service2") on this route. |
| To Completion
|
JMS Outbound |
Sends the message that is marked as complete to the route 4_MessageCompletion. |