ADF Router Activity in Task Flow

You can use the ADF Router activity for conditional execution. The income to the Router activity is any task flow activity; it needs data for processing in the condition statement.The outcome of the Router activity may have one or more conditional statement and one default statement. The default statement executes when all the conditions are failed. The conditions are executed in EL expression.

The following condition returns true if color of the bean property is red.

#{(pageFlowScope.mybean.color eq ‘red)}

The EL expression supports the following conditional expression and is self-explanatory.

< > <= >= lt gt le ge == != eq ne && and || or ? :

In this section, I have explained a router activity with an example. Below is my bounded task flow. The view1 sends a string parameter ‘A’ or ‘B’ to the router1 activity. The router activity evaluated the string parameter, if it is ‘A’ then it sends to Activity A, if it is ‘B’ then it sends to activity ‘B’, if it is any other text then it sends to Default activity. Download the full project from hereApplication2

070416_1736_ADFRouterac1 ADF Router activity in Task Flow

IDE Used:

JDeveloper 12.2.1

ADF router activity example:

1. Create an ADF Fusion web application: Open JDeveloper >> Click File >> New >> Application>> Fusion Web Application >> Click Finish

2. Create a bounded task flow: Expand the View controller >> Right click on the Web-INF>> Task Flow >> Click Ok

3. Open the bounded task flow, Using View, Router and control view activity create a flow like below. Double click on each view activity and create a jsff pages (view1,jsff, A.jsff, B.jsff &Default.jsff)

070416_1736_ADFRouterac2 ADF Router activity in Task Flow

4. Click on the OverView tab in the task flow, Click on the Managed Bean tab and change the scope to Page Flow

070416_1736_ADFRouterac3 ADF Router activity in Task Flow

5. Click on the parameter, create a string type parameter

070416_1736_ADFRouterac4 ADF Router activity in Task Flow

6. Click on the Diagram Tab, Right click on the Router activity and select go to properties and create conditions like below

#{(pageFlowScope.param eq ‘A’)} then go to activity A

#{(pageFlowScope.param eq ‘B’)} then go to activity B

Else Go to Default

070416_1736_ADFRouterac5 ADF Router activity in Task Flow

7. Open the view1.jsff page. Create three buttons and set the parameter to each button like below. The first button has parameter A; the second button has parameter B, and the third button has nothing

 

8. Open the A.jsff page and put the following output text

9. Open the B.jsff and put the following output text

10. Open the Default.jsff and put the following output text

11. Create a jsf file index.jsf under webContent, Drop the bounded task flow into the jsf page as a region activity

12. The final layout is like below

070416_1736_ADFRouterac6 ADF Router activity in Task Flow

Run and Deploy the code

Index.jsf page load on the browser with three buttons, click on the button ‘Go To A

070416_1736_ADFRouterac7 ADF Router activity in Task Flow

It loads A.jsff page

070416_1736_ADFRouterac8 ADF Router activity in Task Flow

Click the button ‘Go To B’

070416_1736_ADFRouterac9 ADF Router activity in Task Flow

It loads the B.jsff page

070416_1736_ADFRouterac10 ADF Router activity in Task Flow

Click on the button ‘Default

070416_1736_ADFRouterac11 ADF Router activity in Task Flow

It loads the Default.jsff page

070416_1736_ADFRouterac12 ADF Router activity in Task Flow

govindan ADF Router activity in Task Flow
Connect me

Govind

Thank you for visiting my personal blog. Myself Govindan, Software Developer by profession since 2006 and hence I started this blog early in 2016 and ever since I've been writing about technologies experienced and learnings of everyday life.

The views expressed on this blog are my personal views and do not necessarily reflect the views of my employer.

Please feeling free to reach me on any comments and feedbacks you have. Would be more than glad to listen and reply šŸ™‚
govindan ADF Router activity in Task Flow
Connect me
Like us on Facebook.
Connect!