Top Description Constructors Methods
javax.faces.flow.builder

public abstract Class FlowBuilder

extends Object
Class Inheritance
Known Direct Subclasses
com.sun.faces.flow.builder.FlowBuilderImpl
Imports
javax.el.MethodExpression, .ValueExpression, javax.faces.flow.Flow

A Java language API for building Flows. This API is semantically identical to the <flow-definition> element in the Application Configuration Resources XML Schema Definition.

Usage example:

public class FlowA implements Serializable {

    @Produces FlowDefinition
    public Flow buildMyFlow(@FlowBuilderParameter FlowBuilder flowBuilder) {
        String flowId = "flow-a";
        flowBuilder.id("unique", flowId);
        flowBuilder.returnNode("taskFlowReturn1").
                fromOutcome("#{flow_a_Bean.returnValue}");
        flowBuilder.inboundParameter("param1FromFlowB", "#{flowScope.param1Value}");
        flowBuilder.inboundParameter("param2FromFlowB", "#{flowScope.param2Value}");
        flowBuilder.flowCallNode("callB").flowReference("", "flow-b").
                outboundParameter("param1FromFlowA", "param1Value").
                outboundParameter("param2FromFlowA", "param2Value");

        return flowBuilder.getFlow();
    }
}

The runtime must discover all such methods at startup time and ensure that the returned flows are added to the javax.faces.flow.FlowHandler using the javax.faces.flow.FlowHandler#addFlow(javax.faces.context.FacesContext, javax.faces.flow.Flow) method.

Since
2.2

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public abstract FlowBuilder

Returns:

the builder instance
finalizer
(MethodExpression
the expression to invoke, must reference a zero-argument method.
methodExpression
)

A MethodExpression that will be invoked when the flow is exited.

public abstract FlowBuilder

Returns:

the builder instance
finalizer
(String
the expression to invoke, must reference a zero-argument method.
methodExpression
)

A MethodExpression that will be invoked when the flow is exited.

public abstract FlowCallBuilder

Returns:

the builder instance
flowCallNode
(String
Within the flow graph, the id of this return node. Must be unique among all nodes in this flow graph.
flowCallNodeId
)

Define a flow call node.

public abstract Flow

Returns:

the completely built Flow
getFlow
()

Called as the last step in flow definition, this method must perform any implementation specific initialization and return the built Flow.

public abstract FlowBuilder

Returns:

the builder instance
id
(String
The defining document id of this flow, or the empty string if this flow does not need a defining document id.
definingDocumentId
,
String
the id of the flow
id
)

Set the defining document id and flow id of this flow.

public abstract FlowBuilder

Returns:

the builder instance
inboundParameter
(String
the parameter name
name
,
ValueExpression
the ValueExpression to populate with the inbound value when the flow is called.
expression
)

A parameter that will be populated with the value from a correspondingly named outbound parameter from another flow when this flow is entered from that flow.

public abstract FlowBuilder

Returns:

the builder instance
inboundParameter
(String
the parameter name
name
,
String
the ValueExpression String to populate with the inbound value when the flow is called.
expression
)

A parameter that will be populated with the value from a correspondingly named outbound parameter from another flow when this flow is entered from that flow.

public abstract FlowBuilder

Returns:

the builder instance
initializer
(MethodExpression
the expression to invoke, must reference a zero-argument method.
methodExpression
)

A MethodExpression that will be invoked when the flow is entered.

public abstract FlowBuilder

Returns:

the builder instance
initializer
(String
the expression to invoke, must reference a zero-argument method.
methodExpression
)

A MethodExpression that will be invoked when the flow is entered.

public abstract MethodCallBuilder

Returns:

the builder instance
methodCallNode
(String
Within the flow graph, the id of this method call node. Must be unique among all nodes in this flow graph.
methodCallNodeId
)

Define a method call node.

public abstract ReturnBuilder

Returns:

the builder instance
returnNode
(String
Within the flow graph, the id of this return node. Must be unique among all nodes in this flow graph.
returnNodeId
)

Define a return node.

public abstract SwitchBuilder

Returns:

the builder instance
switchNode
(String
Within the flow graph, the id of this switch node. Must be unique among all nodes in this flow graph.
switchNodeId
)

Define a particular list of cases that will be inspected in the order they are defined to determine where to go next in the flow graph.

public abstract ViewBuilder

Returns:

the builder instance
viewNode
(String
Within the flow graph, the id of this view node. Must be unique among all nodes in this flow graph.
viewNodeId
,
String
The fully qualified path to the view node within this flow.
vdlDocumentId
)

Define a view node in a flow graph.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

FlowBuilderback to summary
public FlowBuilder()

Method Detail

finalizerback to summary
public abstract FlowBuilder finalizer(MethodExpression methodExpression)

A MethodExpression that will be invoked when the flow is exited.

Parameters
methodExpression:MethodExpression

the expression to invoke, must reference a zero-argument method.

Returns:FlowBuilder

the builder instance

Exceptions
NullPointerException:
if any of the parameters are null
Since
2.2
finalizerback to summary
public abstract FlowBuilder finalizer(String methodExpression)

A MethodExpression that will be invoked when the flow is exited.

Parameters
methodExpression:String

the expression to invoke, must reference a zero-argument method.

Returns:FlowBuilder

the builder instance

Exceptions
NullPointerException:
if any of the parameters are null
Since
2.2
flowCallNodeback to summary
public abstract FlowCallBuilder flowCallNode(String flowCallNodeId)

Define a flow call node. This node will cause the specified flow to be called, passing parameters if necessary.

Parameters
flowCallNodeId:String

Within the flow graph, the id of this return node. Must be unique among all nodes in this flow graph.

Returns:FlowCallBuilder

the builder instance

Exceptions
NullPointerException:
if any of the parameters are null
Since
2.2
getFlowback to summary
public abstract Flow getFlow()

Called as the last step in flow definition, this method must perform any implementation specific initialization and return the built Flow. If called more than one time during a given flow building process, the second and subsequent invocations must take no action and return the built flow.

Returns:Flow

the completely built Flow

Exceptions
IllegalStateException:
if the id method had not been called prior to this method being called.
Since
2.2
idback to summary
public abstract FlowBuilder id(String definingDocumentId, String id)

Set the defining document id and flow id of this flow.

Parameters
definingDocumentId:String

The defining document id of this flow, or the empty string if this flow does not need a defining document id.

id:String

the id of the flow

Returns:FlowBuilder

the builder instance

Exceptions
NullPointerException:
if any of the parameters are null
Since
2.2
inboundParameterback to summary
public abstract FlowBuilder inboundParameter(String name, ValueExpression expression)

A parameter that will be populated with the value from a correspondingly named outbound parameter from another flow when this flow is entered from that flow.

Parameters
name:String

the parameter name

expression:ValueExpression

the ValueExpression to populate with the inbound value when the flow is called.

Returns:FlowBuilder

the builder instance

Exceptions
NullPointerException:
if any of the parameters are null
Since
2.2
inboundParameterback to summary
public abstract FlowBuilder inboundParameter(String name, String expression)

A parameter that will be populated with the value from a correspondingly named outbound parameter from another flow when this flow is entered from that flow.

Parameters
name:String

the parameter name

expression:String

the ValueExpression String to populate with the inbound value when the flow is called.

Returns:FlowBuilder

the builder instance

Exceptions
NullPointerException:
if any of the parameters are null
Since
2.2
initializerback to summary
public abstract FlowBuilder initializer(MethodExpression methodExpression)

A MethodExpression that will be invoked when the flow is entered.

Parameters
methodExpression:MethodExpression

the expression to invoke, must reference a zero-argument method.

Returns:FlowBuilder

the builder instance

Exceptions
NullPointerException:
if any of the parameters are null
Since
2.2
initializerback to summary
public abstract FlowBuilder initializer(String methodExpression)

A MethodExpression that will be invoked when the flow is entered.

Parameters
methodExpression:String

the expression to invoke, must reference a zero-argument method.

Returns:FlowBuilder

the builder instance

Exceptions
NullPointerException:
if any of the parameters are null
Since
2.2
methodCallNodeback to summary
public abstract MethodCallBuilder methodCallNode(String methodCallNodeId)

Define a method call node. This node will cause the specified method to be invoked, passing parameters if necessary. The return from the method is used as the outcome for where to go next in the flow. If the method is a void method, the default outcome is used.

Parameters
methodCallNodeId:String

Within the flow graph, the id of this method call node. Must be unique among all nodes in this flow graph.

Returns:MethodCallBuilder

the builder instance

Exceptions
NullPointerException:
if any of the parameters are null
Since
2.2
returnNodeback to summary
public abstract ReturnBuilder returnNode(String returnNodeId)

Define a return node. This node will cause the specified outcome to be returned to the calling flow.

Parameters
returnNodeId:String

Within the flow graph, the id of this return node. Must be unique among all nodes in this flow graph.

Returns:ReturnBuilder

the builder instance

Exceptions
NullPointerException:
if any of the parameters are null
Since
2.2
switchNodeback to summary
public abstract SwitchBuilder switchNode(String switchNodeId)

Define a particular list of cases that will be inspected in the order they are defined to determine where to go next in the flow graph. If none of the cases match, the outcome from the default case is chosen.

Parameters
switchNodeId:String

Within the flow graph, the id of this switch node. Must be unique among all nodes in this flow graph.

Returns:SwitchBuilder

the builder instance

Exceptions
NullPointerException:
if any of the parameters are null
Since
2.2
viewNodeback to summary
public abstract ViewBuilder viewNode(String viewNodeId, String vdlDocumentId)

Define a view node in a flow graph.

Parameters
viewNodeId:String

Within the flow graph, the id of this view node. Must be unique among all nodes in this flow graph.

vdlDocumentId:String

The fully qualified path to the view node within this flow.

Returns:ViewBuilder

the builder instance

Exceptions
NullPointerException:
if any of the parameters are null
Since
2.2