|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface FlowBuilder
Builder interface used to build a flow definition. The process of building a flow consists of the following steps:
init(String, AttributeMap)
.
buildVariables()
to create any variables of the flow and add them to the flow definition.
buildInputMapper()
to create and set the input mapper for the flow.
buildStartActions()
to create and add any start actions to the flow.
buildInlineFlows()
to create any inline flows encapsulated by the flow and add them to the flow
definition.
buildStates()
to create the states of the flow and add them to the flow definition.
buildGlobalTransitions()
to create the any transitions shared by all states of the flow and add
them to the flow definition.
buildEndActions()
to create and add any end actions to the flow.
buildOutputMapper()
to create and set the output mapper for the flow.
buildExceptionHandlers()
to create the exception handlers of the flow and add them to the flow
definition.
getFlow()
to return the fully-built Flow
definition.
dispose()
.
Implementations should encapsulate flow construction logic, either for a specific kind of flow, for example, an
OrderFlowBuilder
built in Java code, or a generic flow builder strategy, like the
XmlFlowBuilder
, for building flows from an XML-definition.
Flow builders are used by the FlowAssembler
, which acts as an
assembler (director). Flow Builders may be reused, however, exercise caution when doing this as these objects are not
thread safe. Also, for each use be sure to call init, followed by the build* methods, getFlow, and dispose completely
in that order.
This is an example of the classic GoF builder pattern.
Flow
,
FlowAssembler
,
AbstractFlowBuilder
,
XmlFlowBuilder
Method Summary | |
---|---|
void |
buildEndActions()
Builds any end actions to execute when the flow ends. |
void |
buildExceptionHandlers()
Creates and adds all exception handlers to the flow built by this builder. |
void |
buildGlobalTransitions()
Builds any transitions shared by all states of the flow. |
void |
buildInlineFlows()
Builds any "in-line" flows encapsulated by the flow. |
void |
buildInputMapper()
Builds the input mapper responsible for mapping flow input on start. |
void |
buildOutputMapper()
Builds the output mapper responsible for mapping flow output on end. |
void |
buildStartActions()
Builds any start actions to execute when the flow starts. |
void |
buildStates()
Builds the states of the flow. |
void |
buildVariables()
Builds any variables initialized by the flow when it starts. |
void |
dispose()
Shutdown the builder, releasing any resources it holds. |
Flow |
getFlow()
Get the fully constructed and configured Flow object - called by the builder's assembler (director) after assembly. |
void |
init(java.lang.String flowId,
AttributeMap attributes)
Initialize this builder. |
Method Detail |
---|
void init(java.lang.String flowId, AttributeMap attributes) throws FlowBuilderException
flowId
- the identifier to assign to the flowattributes
- custom attributes to assign to the flow
FlowBuilderException
- an exception occured building the flowvoid buildVariables() throws FlowBuilderException
FlowBuilderException
- an exception occured building the flowvoid buildInputMapper() throws FlowBuilderException
FlowBuilderException
- an exception occured building the flowvoid buildStartActions() throws FlowBuilderException
FlowBuilderException
- an exception occured building the flowvoid buildInlineFlows() throws FlowBuilderException
FlowBuilderException
- an exception occured building the flowvoid buildStates() throws FlowBuilderException
FlowBuilderException
- an exception occured building the flowvoid buildGlobalTransitions() throws FlowBuilderException
FlowBuilderException
- an exception occured building the flowvoid buildEndActions() throws FlowBuilderException
FlowBuilderException
- an exception occured building the flowvoid buildOutputMapper() throws FlowBuilderException
FlowBuilderException
- an exception occured building the flowvoid buildExceptionHandlers() throws FlowBuilderException
FlowBuilderException
- an exception occured building this flowFlow getFlow()
void dispose()
init(String, AttributeMap)
method.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |