Thursday, August 29, 2013

ADF Dynamic Task Flow reference

We can define task flow reference dynamically using a EL expression . Create a bounded task flow as below
Code for dynamic_called_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="Dynamic called view1" id="ot1"/>
  </af:panelGroupLayout>
</jsp:root>

Create a calling task flow 

Note the properties for the task flow activity.Here task flow reference is Dynamic and reference is getting from EL expression.Below is the code for the managed bean in pageFlowScope used for dynamic task flow reference.
package test.view;


public class TestDynamicCall {
    private String tFUrl = "";

    public void setTFUrl(String tFUrl) {
        this.tFUrl = tFUrl;
    }

    public String getTFUrl() {

        System.out.println("Inside getTFUrl..");
        if (true)
            return "/WEB-INF/dynamic_calledTF.xml";
        else
            return "/WEB-INF/dynamic_calledTF1.xml";


    }

    public TestDynamicCall() {
        super();
    }
}

Drag and drop the calling task flow to a jspx file as a region.Clicking on the button the flow will  dynamically moved to the called TF.

No comments:

Post a Comment