Java Reference
In-Depth Information
/**
*
* @author Juneau
*/
@Named("exampleFlow2")
@FlowDefinition
public class ExampleFlow {
private static final long serialVersionUID = -7623501087369765218L;
public Flow defineFlow(FacesContext context, FlowBuilder builder){
String flowId = "example2";
builder.id("",flowId);
builder.viewNode(flowId, "/" + flowId + ".xhtml").markAsStartNode();
builder.returnNode("returnFromFlow").fromOutcome("#{flowBean.returnValue}");
return builder.getFlow();
}
}
Table 2-3 specifies the different methods that are available via the FlowBuilder.
Table 2-3. FlowBuilder Methods
Method
Description
finalizer(MethodExpression)
Specifies the finalizer method for the flow
finalizer(String)
flowCallNode(String string)
Specifies a call node for the flow
getFlow()
Retrieves an instance of the flow
id(String, String)
Specifies the flow identifier
inboundParameter(String, ValueExpression)
Specifies an inbound parameter for the flow
inboundParameter(String, String)
initializer(MethodExpression)
Specifies the initializer method for the flow
initializer(String)
methodCallNode(String)
Specifies a method call node
returnNode(String)
Specifies the name of the exiting node
switchNode(String)
Specifies the name of a switch node
viewNode(String, String)
Specifies a view node
Either technique, XML or Java, works in the same manner. However, it is a good idea to specify the flow
configuration within XML if you plan to change the way that the flow is configured, because using the Java API will
mandate a recompile.
 
 
Search WWH ::




Custom Search