Showing posts with label Router Activity. Show all posts
Showing posts with label Router Activity. Show all posts

Monday, August 26, 2013

ADF Task Flow Router Activities

Router activity is used to route the activities based on run-time evaluation of EL.Create a bounded task flow as below

Router activity has 
  • Default outcome 
  • Can define cases at any point of development/design 


router_view1.jspx
<?xml version='1.0' encoding='UTF-8'?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1" xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
  <af:panelGroupLayout id="pgl1">
    <af:outputText value="Router view1" id="ot1"/>
    <af:button text="button 1" id="b1" action="toRouter"/>
  </af:panelGroupLayout>

</jsp:root>

Create a managed bean in the pageFlowScope 

package test.view;


public class RouterTest {
 
    public boolean router=false;
    public RouterTest() {
        super();
    }
   
    public void setRouter(boolean router) {
        this.router = router;
    }

    public boolean isRouter() {
        return router;
    }

 
}

The source code changes in bounded task flow xml for router activity
<router id="router1">
      <case id="__6">
        <expression>#{pageFlowScope.Router.router}</expression>
        <outcome>routeView2</outcome>
      </case>
      <default-outcome>routView3</default-outcome>
    </router>