Global Exception Handler for ADF Task Flow Method Calls

Sharing is Caring

Exception Handler is the central point for handling unexpected Exceptions that are thrown during the Faces lifecycle.
ADF Task Flow provides this facility, using this you can handle all exception that raised in TaskFlow methods.
here i am using ADF bounded TaskFlow with page fragments(.jsff) .
Developers must use this facility to avoid unexpected exception inside task flows.

This is the very simple approach, you have to do nothing more but create a method in Task Flow and mark it as Exception Handler and write your code inside this method, that you want to show when an exception is caught in TaskFlow.

To do this I have implemented this scenario-

    • Create a method that throws an Exception and add this method to task flow and on page call this method on button click


public void exception() {
throw new JboException(“Failded to load”);
Control Flow Case in Bounded taskFlow
  • When we click on the button that calls exception() method, JboException is raised inside TaskFlow and look like this- Your page crashed
    • Now create a method that will behave as exception handler  and add it to TaskFlow and mark as Exception Handler (Symbol in Jdev toolbar for marking)


public void exceptioHandeler() {
System.out.println(“Inside Handeler”);
FacesMessage message = new FacesMessage(“This is custom Message for Jbo Exception-Exception Handeler”);
FacesContext fc = FacesContext.getCurrentInstance();
fc.addMessage(null, message);



Drop a method as Exception Handler in Bounded Taskflow
    • Use this sign to mark the method as Exception Handler in Bounded Task Flow

There is a red icon to mark method as exception handler
  • Now Run your page and click on the button that calls exception() method, your page never crash, as there is a handler
Customised Message appears in case of any exception in taskflow

Find Sample application Download Sample ADF Application

Related Posts

0 thoughts on “Global Exception Handler for ADF Task Flow Method Calls”

Leave a Reply

Your email address will not be published. Required fields are marked *