In this article, I will explain on how to handle exceptions in TibcoBW. In previous article, we developed TibcoBW process to invoke booking service based of service type in the request. This process isn't having any exception handling mechanism.
Let run the process and place a invalid booking request and as parsexml isn't able to parse the file exception occurred.
In the main process, bring in another WriteToLog and map exception details using custom exception schema
Run and test the process, exceptions details are captured using the custom exception schema.
Let run the process and place a invalid booking request and as parsexml isn't able to parse the file exception occurred.
Here, we will enhance the process to handle run-time exceptions using catch activity and then customize exception using custom exception schema. Lets bring in catch activity and configure enable Catch All exception. In case, if we want to catch specific exception choose the exception available from the dropdown. This allows multiple catch activities in single BW process.
Bring in WriteToLog activity and connect the catch to log and then to end activity as shown below, mapping from catch to log activity is shown below.
Re-run the process with invalid xml request and as you see, exception is caught and handled gracefully.
In case, of service is down, the same catch block handles the failure, the failures bubbles up to the parent process.
Now, lets develop a custom exception schema as shown below.
In the end activity of child process, configure the error schema to custom developed schema as shown below.
Bring in a catch and generate error activities; configure generate error activity with the custom schema and map the exception details to custom schema as shown.In the main process, bring in another WriteToLog and map exception details using custom exception schema
Run and test the process, exceptions details are captured using the custom exception schema.
The video demonstration is available on the Youtube, here is the embedded video.
No comments:
Post a Comment
Note: only a member of this blog may post a comment.