- java.lang.Object
-
- javax.faces.flow.builder.FlowBuilder
-
public abstract class FlowBuilder extends Object
A Java language API for building
Flow
s. 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
publicFlow
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
FlowHandler
using theFlowHandler.addFlow(javax.faces.context.FacesContext, javax.faces.flow.Flow)
method.- Since:
- 2.2
-
-
Constructor Summary
Constructors Constructor and Description FlowBuilder()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description abstract FlowBuilder
finalizer(MethodExpression methodExpression)
A MethodExpression that will be invoked when the flow is exited.
abstract FlowBuilder
finalizer(String methodExpression)
A MethodExpression that will be invoked when the flow is exited.
abstract FlowCallBuilder
flowCallNode(String flowCallNodeId)
Define a flow call node.
abstract Flow
getFlow()
Called as the last step in flow definition, this method must perform any implementation specific initialization and return the built
Flow
.abstract FlowBuilder
id(String definingDocumentId, String id)
Set the defining document id and flow id of this flow.
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.
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.
abstract FlowBuilder
initializer(MethodExpression methodExpression)
A MethodExpression that will be invoked when the flow is entered.
abstract FlowBuilder
initializer(String methodExpression)
A MethodExpression that will be invoked when the flow is entered.
abstract MethodCallBuilder
methodCallNode(String methodCallNodeId)
Define a method call node.
abstract NavigationCaseBuilder
navigationCase()
Define a particular combination of conditions that must match for this case to be executed, and the view id of the component tree that should be selected next.
abstract ReturnBuilder
returnNode(String returnNodeId)
Define a return node.
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.
abstract ViewBuilder
viewNode(String viewNodeId, String vdlDocumentId)
Define a view node in a flow graph.
-
-
-
Method Detail
-
id
public abstract FlowBuilder id(String definingDocumentId, String id)
Set the defining document id and flow id of this flow.
- Parameters:
definingDocumentId
- The defining document id of this flow, or the empty string if this flow does not need a defining document id.id
- the id of the flow- Throws:
NullPointerException
- if any of the parameters arenull
- Since:
- 2.2
-
viewNode
public abstract ViewBuilder viewNode(String viewNodeId, String vdlDocumentId)
Define a view node in a flow graph.
- Parameters:
viewNodeId
- Within the flow graph, the id of this view node. Must be unique among all nodes in this flow graph.vdlDocumentId
- The fully qualified path to the view node within this flow.- Throws:
NullPointerException
- if any of the parameters arenull
- Since:
- 2.2
-
navigationCase
public abstract NavigationCaseBuilder navigationCase()
Define a particular combination of conditions that must match for this case to be executed, and the view id of the component tree that should be selected next.
- Since:
- 2.2
-
switchNode
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
- Within the flow graph, the id of this switch node. Must be unique among all nodes in this flow graph.- Throws:
NullPointerException
- if any of the parameters arenull
- Since:
- 2.2
-
returnNode
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
- Within the flow graph, the id of this return node. Must be unique among all nodes in this flow graph.- Throws:
NullPointerException
- if any of the parameters arenull
- Since:
- 2.2
-
methodCallNode
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
- Within the flow graph, the id of this method call node. Must be unique among all nodes in this flow graph.- Throws:
NullPointerException
- if any of the parameters arenull
- Since:
- 2.2
-
flowCallNode
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
- Within the flow graph, the id of this return node. Must be unique among all nodes in this flow graph.- Throws:
NullPointerException
- if any of the parameters arenull
- Since:
- 2.2
-
initializer
public abstract FlowBuilder initializer(MethodExpression methodExpression)
A MethodExpression that will be invoked when the flow is entered.
- Parameters:
methodExpression
- the expression to invoke, must reference a zero-argument method.- Throws:
NullPointerException
- if any of the parameters arenull
- Since:
- 2.2
-
initializer
public abstract FlowBuilder initializer(String methodExpression)
A MethodExpression that will be invoked when the flow is entered.
- Parameters:
methodExpression
- the expression to invoke, must reference a zero-argument method.- Throws:
NullPointerException
- if any of the parameters arenull
- Since:
- 2.2
-
finalizer
public abstract FlowBuilder finalizer(MethodExpression methodExpression)
A MethodExpression that will be invoked when the flow is exited.
- Parameters:
methodExpression
- the expression to invoke, must reference a zero-argument method.- Throws:
NullPointerException
- if any of the parameters arenull
- Since:
- 2.2
-
finalizer
public abstract FlowBuilder finalizer(String methodExpression)
A MethodExpression that will be invoked when the flow is exited.
- Parameters:
methodExpression
- the expression to invoke, must reference a zero-argument method.- Throws:
NullPointerException
- if any of the parameters arenull
- Since:
- 2.2
-
inboundParameter
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
- the parameter nameexpression
- theValueExpression
to populate with the inbound value when the flow is called.- Throws:
NullPointerException
- if any of the parameters arenull
- Since:
- 2.2
-
inboundParameter
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
- the parameter nameexpression
- theValueExpression
String to populate with the inbound value when the flow is called.- Throws:
NullPointerException
- if any of the parameters arenull
- Since:
- 2.2
-
getFlow
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.- Throws:
IllegalStateException
- if theid(java.lang.String, java.lang.String)
method had not been called prior to this method being called.- Since:
- 2.2
-
-
Nederlandse vertaling
U hebt gevraagd om deze site in het Nederlands te bezoeken. Voor nu wordt alleen de interface vertaald, maar nog niet alle inhoud.Als je me wilt helpen met vertalingen, is je bijdrage welkom. Het enige dat u hoeft te doen, is u op de site registreren en mij een bericht sturen waarin u wordt gevraagd om u toe te voegen aan de groep vertalers, zodat u de gewenste pagina's kunt vertalen. Een link onderaan elke vertaalde pagina geeft aan dat u de vertaler bent en heeft een link naar uw profiel.
Bij voorbaat dank.
Document heeft de 11/06/2005 gemaakt, de laatste keer de 18/08/2025 gewijzigd
Bron van het afgedrukte document:https://www.gaudry.be/nl/java-api-javaee-rf-javax/faces/flow/builder/flowbuilder.html
De infobrol is een persoonlijke site waarvan de inhoud uitsluitend mijn verantwoordelijkheid is. De tekst is beschikbaar onder CreativeCommons-licentie (BY-NC-SA). Meer info op de gebruiksvoorwaarden en de auteur.
Referenties
Deze verwijzingen en links verwijzen naar documenten die geraadpleegd zijn tijdens het schrijven van deze pagina, of die aanvullende informatie kunnen geven, maar de auteurs van deze bronnen kunnen niet verantwoordelijk worden gehouden voor de inhoud van deze pagina.
De auteur van deze site is als enige verantwoordelijk voor de manier waarop de verschillende concepten, en de vrijheden die met de referentiewerken worden genomen, hier worden gepresenteerd. Vergeet niet dat u meerdere broninformatie moet doorgeven om het risico op fouten te verkleinen.