Sunday, 16 February 2014

Passing Parameters to Taskflow

Hi friends today i am going to post about the passing parameters to Task flow. I have seen most of the developers facing problem in passing parameter to TF.
I have created Business components on Employees table. I have added where clause to the query as shown below and bind variable.

Create custom method in class which is used to filter the employees based on DepartmentId

Now create one BoundedTF (employeeTF) and add the custom method (default activity) and view activity to show the list of employees as table.

Go to overview tab --> parameters --> set the parameter as shown below

Now go to adfc-config.xml file and drag and drop view activity and employeeTF.
Double click on view activity and generate the main.jspx page and drag & drop InputText and button as shown below to pass department ID.

Select the EmployeesTF go to property inspector and pass the value to DeptID #{pageFlowScope.deptID}

Now create bindings for input text and action listener method for button of main.jspx page and set the class to backingBeanScope. Use the below code to set the value in pageFlowScope.

    public void executeDeparment(ActionEvent actionEvent) {
        // Add event code here...
        AdfFacesContext.getCurrentInstance().getPageFlowScope().put("deptID", deptid.getValue().toString());

Now run the page

Thanks :) Happy Learning