Hi,
This is Tiah. Recently I started learning ADF Task flows and using them dynamically inside regions. When I came across a requirement to pass different sets of parameters to different task flows that gets instantiated within a region, I found no concrete example. So sort of tried the information given in Fusion Guide and able to work with passing different sets of parameters to different task flows.
This is a simple example where I have two task flows first and second. First task flow has one parameter "Param1" and the Second task flow has two parameters "Param1" & "Param2". I used the bean to create the param maps when I am switching the task flows.
The code is given below... I will soon upload my sample example
I will be enhancing it with return params as well soon.
Hope it will be useful,
Thanks,
Tiah
(*) Code in my managed bean as follows:
package tiah.test;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.el.ELContext;
import javax.el.ExpressionFactory;
import javax.el.ValueExpression;
import javax.faces.application.Application;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import oracle.adf.controller.TaskFlowId;
import oracle.adf.view.rich.component.rich.RichPopup;
import oracle.adf.view.rich.component.rich.data.RichTree;
import oracle.adf.view.rich.component.rich.fragment.RichRegion;
import oracle.adf.view.rich.event.RegionNavigationEvent;
import oracle.adf.view.rich.render.ClientEvent;
import org.apache.myfaces.trinidad.render.ExtendedRenderKitService;
import org.apache.myfaces.trinidad.util.Service;
public class DynRegionBean {
private String emptyTaskFlowId = "";
private String firstTaskFlowId =
"/WEB-INF/flows/first-task-flow.xml#first-task-flow";
private String secondTaskFlowId =
"/WEB-INF/flows/second-task-flow.xml#second-task-flow";
private String taskFlowId = "";
Map paramMap;
public DynRegionBean() {
taskFlowId = emptyTaskFlowId;
}
public String getDynamicTaskFlowId() {
if (taskFlowId != null)
return taskFlowId;
else
return getEmptyTaskFlowId();
}
public void setDynamicTaskFlowId(String newTaskFlowId) {
taskFlowId = newTaskFlowId;
}
public String getEmptyTaskFlowId() {
return emptyTaskFlowId;
}
public void setFirstTaskFlowId(String firstTaskFlowId) {
this.firstTaskFlowId = firstTaskFlowId;
}
public String getFirstTaskFlowId() {
paramMap = new HashMap();
paramMap.put("Param1", "Parameter 1");
return firstTaskFlowId;
}
public void setSecondTaskFlowId(String secondTaskFlowId) {
this.secondTaskFlowId = secondTaskFlowId;
}
public String getSecondTaskFlowId() {
paramMap = new HashMap();
paramMap.put("Param1", "Parameter 1");
paramMap.put("Param2", "Parameter 2");
return secondTaskFlowId;
}
public void setParamMap(Map paramMap) {
this.paramMap = paramMap;
}
public Map getParamMap() {
return paramMap;
}
}
Friday, March 19, 2010
Subscribe to:
Comments (Atom)