Monday, August 12, 2013

ADF Task flow sample and introduction


  • Task flow supports modular approaches in ADF applications 
  • Task Flows are re-usable 
  • There are two type of taskflows bounded and unbounded 
  • Unbounded task flows will have multiple entry points 
  • Bounded task flows 
    • Single entry point multiple exists 
    • Reusable,supports parameters , transaction management ,support re-entry 
    • Render in an ADF region 
    • More than one bounded task flows in a single source file is possible but not recommended 
  • Typical application will have a bounded task flow and multiple unbounded task flows 
  • adfc-config.xml is an unbounded task flow created by default when we create a Fusion web application 
Right click on UI view controller project > From the New gallery select the ADF Task flows option 


Creating a bounded task flow 
Drag and drop view activities 

Create and unbounded task flow by unchecking the "Create as Bounded Task Flow " option
Create a home.jspx file and drag and drop the bounded task flow to it . It will shows the error icon for bounded task flow as below
Remove the unbounded task flow from the editor .Create a btfcall.jspx page and drag and drop the bounded task flow as a region to it .

Drag and drop the btfcall.jspx to the unbounded task flow 

home.jspx 
<?xml version='1.0' encoding='UTF-8'?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1" xmlns:f="http://java.sun.com/jsf/core"
          xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    <jsp:directive.page contentType="text/html;charset=UTF-8"/>
    <f:view>
        <af:document title="home.jspx" id="d1">
            <af:form id="f1">
                <af:panelGroupLayout id="pgl1">
                    <af:outputText value="Home" id="ot1"/>
                </af:panelGroupLayout>
                <af:button text="Call Bounded Tf jspx" id="b1" action="tobtf"/>
            </af:form>
        </af:document>
    </f:view>
</jsp:root>

view1.jsff :
<?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="view1" id="ot1"/>
  </af:panelGroupLayout>
  <af:button text="To View 2" id="b1" action="flow12"/>
</jsp:root>

Run the unbounded task flow by right clicking .

Click on the button 


Click on button 
Unbounded TaskFlow
adfc-config.xml is the unbounded task flow created by default
Unbounded tasks flow has bookmarkable view activities
Unbounded taskflow wotnt be called by another taskflow
Unbounded task flow provide multiple point of entry to the application

Bounded Taskflow
Bounded TaskFlow has a single entry point to the application
Bounded taskflow accept input parameters
Bounded taskflow can have return values
Bounded taskflow has its on memory scope called page flow scope
Bounded taskflow can have exception handling activity
Bounded taskflow has well defined boundary
Bounded taskflow are addressable
Re-usability is a major advantage of using bounded taskflow
Shared datacontrol between bounded taskflow is possible
Bounded taskflow provide transaction management
Re-entry option is availabe to enable or disable
On demand loading of metadata
Security can be provided for bounded taskflow through ADF security framework

1 comment: