Communication between Task Flows using Task Flow Parameters

In order to create an enterprise application, usually are required many task flows. These task flows will perform different functions, but they may have to communicate each other. To enable this communication, you can use Task Flow Parameters, Contextual Events or Sharing Data Control Instances.

Ps.: Register parameters within the session scope with a task flow and use them in another task flow is not a good practice, do not use!

In this article, I will describe the Task Flow Parameters, creating a navigation between two pages. The first Task Flow will display the list of employees, and the second Task Flow, will display the information of selected employee.

For this, we will need only the JDeveloper 12c ( and the HR schema. Download the sample application:

Create an ADF Fusion Web Application, and call it as TaskFlowParamApp.


Create the Business Components, using the Employees table.


First of all, let’s create the Task Flow that contains the information of selected employee. Select the ViewController project, create an ADF Task Flow and call it as EditEmployeeTaskFlow.
Uncheck the “Create with Page Fragments” option, so the views are created as full pages instead of fragments. This configuration is necessary because the fragments of pages only run when they are inserted into complete pages.


Drag into the EditEmployeeTaskFlow, the Method Call, View and Task Flow Return components, located in the Components panel. Connect them using the Control Flow Case component.
Name the components: Method Call as setEmployeeId, as EditEmployee View, Task Flow Return as TaskFlowReturn, and Control Flow Case as goEditEmployee and goTaskFlowReturn.
The Default Activity is the entry point of the Task Flow, and is signaled by the green circle. In EditEmployeeTaskFlow, the default activity is setEmployeeId. If not, select the setEmployeeId and click the green circle icon.


In the Data Controls panel, navigate to AppModuleDataControl > EmployeesView1 > Operations. Drag the setCurrentRowWithKey opertaion and drop in setEmployeeId component.
In the Edit Action Binding window, configure RowKey parameter with #{pageFlowScope.employeeSelected} value, and click OK. The setCurrentRowWithKey operation takes the input parameter (employee ID), and sets the iterator of EmployeesView1.


Navigate to Overview > Parameters and add the input parameter of Task Flow. The name should be employeeSelected, the class=java.lang.String, the value=#{pageFlowScope.employeeSelected} and required=false.


Double-click the EditEmployee and click OK to create the EditEmployee.jsf page.


To create the form that will display the information of selected employee, navigate to Data Controls panel, expand the AppModuleDataControl, select the EmployeesView1, drag it into the ViewEmployees.jsf page, and select ADF Form option.


Check the Submit option, and click OK to create the form.


In the form, select the Submit button in the Properties panel and change the Text property to Action and Back property to goTaskFlowReturn.
With this configuration, when we click the Back button, the flow goTaskFlowReturn will run, and the TaskFlowReturn component will return the navigation to the Task Flow which started the execution of the EditEmployeeTaskFlow.


Now let’s create a page that contains a list of employees. Navigate to the ViewController project > Web Content > Page Flows and open the adfc-config.xml file. This file is the default Unbounded Task Flow.
The Bounded Task Flow is a specialized form of Task Flow, with only one entry point and zero or more exit points. But the Unbounded Task Flow can have a collection of activities and control flow rules, with multiple entry points and multiple exit points. A typical application is the combination of an Unbounded Bounded and one or more Flows Task.


Drag a View component and the EditEmployeeTaskFlow.xml file inside the adfc-config.xml. Connect them using the Control Flow component.
Rename them: View as ViewEmployees and Control Flow Case as goEditEmployeeTaskFlow.


Double-click the ViewEmployees component and click OK to create the ViewEmployees.jsf page.


To create the list of employees, navigate to Data Controls panel and expand the AppModuleDataControl. Select the EmployeesView1, drag inside the ViewEmployees.jsf page and choose Table/List View > ADF Table.


Check the Single Row and Read-Only Table options, and click OK to create the table.


We will use the Panel Collection component to add many features to table. Navigate to Structure panel, right-click the af:table -t1 node and choose Surround With.


Select the Panel Collection component and click OK.


Add a button to navigate to view that will display the information of selected employee. In the Panel Collection, right-click the toolbar and choose Insert Inside Facet toolbar > Toolbar.


In the Panel Collection, right-click the toolbar and choose Insert Inside Toolbar > Button.


Select the button, and in the Properties panel set the properties: Text to Edit and Action to goEditEmployeeTaskFlow.
Using this configuration, when we click the Edit button, the goEditEmployeeTaskFlow flow will run, initializing the EditEmployeeTaskFlow with the selected employee.


Configure the Edit button to send the ID of employee to EditEmployeeTaskFlow. Right-click the Edit button and select Insert Inside Button > Browse. In the Insert window, choose the Set Action Listener component and click OK.


In the Insert Set Action Listener window, set From as #{bindings.EmployeesView1Iterator.currentRowKeyString} and To as #{pageFlowScope.employeeSelected}, and click OK.


Navigate to ViewController project, right-click the adfc-config.xml file and choose Run.


In the Set Run Configuration window, select the ViewEmployees option and click OK.


The application will run automatically in your web browser.
Select an employee and click the Edit button to go to next page.


The information of selected employee will appear on the form.


Click the Back button to go back to list of employees.