Handling general exceptions using task flow templates
One of the great benefits of having a task flow template is to handle general and unhandled exceptions. This can be implemented once you are inside the task flow template, and it'll be included inside any concrete task flow that extends the task flow template.
In this recipe, we will extend the hr-crud-flow
task flow to handle a runtime exception that will be thrown by a new button which will be added inside the viewAllEmployees.jsff
page fragment. This exception will be handled by an exception handler class, which we will create in this recipe. You can continue from the last recipe, or you can grab this project's recipe by cloning the HandlingExceptionsUsingTFTemplates
application from the Git repository.
How to do it…
To know how to handle unhandled exceptions with task flow templates, perform the following steps.
First, we will add a step inside the task flow template to throw the exception by performing the following steps:
Open the hr...