Reuse of Exception Handler with Task Flow Template

Tweet about this on TwitterShare on Facebook0Share on LinkedIn2Share on Google+0

Task Flow Template is used to promote reuse. Any Bounded Task Flow based on template can use the activities, control flows and managed beans that the template contains. It is recommended that all Task Flows are based on Task Flow Templates.

In this post we will promote reuse of an Exception Handler. Exception Handler is a Task Flow component used for handling exceptions that are thrown during the ADF Faces lifecycle.

For this example we will use Page Fragments.
Download the sample application: ExceptionHandlerApp.zip.

Create a Task Flow Template, and name it TaskFlowTemplate.

reuse-of-exception-handler-with-task-flow-template1

Drag and drop a Method Call, and change the name to Exception.
Right-click on Exception and select Mark Activity | Exception Handler.

reuse-of-exception-handler-with-task-flow-template2

Double-click on Exception and create the TaskFlowTemplateBean.

reuse-of-exception-handler-with-task-flow-template3

reuse-of-exception-handler-with-task-flow-template4

Double-click on Exception, and implement the method.

reuse-of-exception-handler-with-task-flow-template5

Create a new Task Flow based on template. Name it TaskFlow.

reuse-of-exception-handler-with-task-flow-template6

Drag and drop a View and a Method Call on the diagram.

reuse-of-exception-handler-with-task-flow-template7

Double-click on Page and click on OK.
Drag and drop a button on page and configure it.

reuse-of-exception-handler-with-task-flow-template8

Double-click on CallException and create the TaskFlowBean.

reuse-of-exception-handler-with-task-flow-template9

reuse-of-exception-handler-with-task-flow-template10

Double-click on CallException, and implement the method.

reuse-of-exception-handler-with-task-flow-template11

Create a page and insert the TaskFlow as region.

reuse-of-exception-handler-with-task-flow-template12

Right-click on page and select Run to test your application.

reuse-of-exception-handler-with-task-flow-template13

Tweet about this on TwitterShare on Facebook0Share on LinkedIn2Share on Google+0

Author: Waslley Souza

Consultor Oracle com foco em tecnologias Oracle Fusion Middleware e SOA. Certificado Oracle WebCenter Portal, Oracle ADF e Java.

Leave a Reply

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