public final class FlowBuilder extends Object
Flow
. After the flow is built, the same FlowBuilder
instance should not be reused to build another flow.
This class does not support multi-threaded access or modification. Usage example:
Flow flow = new FlowBuilder(flowName) .step(new StepBuilder(stepName).batchlet(batchlet1Name) .next(step2Name) .build()) .step(new StepBuilder(step2Name).batchlet(batchlet1Name) .build()) .build())
JobBuilder
,
DecisionBuilder
,
SplitBuilder
,
StepBuilder
Constructor and Description |
---|
FlowBuilder(String id)
|
Modifier and Type | Method and Description |
---|---|
Flow |
build()
Builds the flow.
|
FlowBuilder |
decision(Decision decision)
Adds a decision to the current flow.
|
Transition.End<FlowBuilder> |
endOn(String exitStatusCondition)
Sets
end transition condition for the flow. |
Transition.Fail<FlowBuilder> |
failOn(String exitStatusCondition)
Sets
fail transition condition for the flow. |
FlowBuilder |
flow(Flow flow)
Adds a flow to the flow.
|
FlowBuilder |
next(String next)
Sets the
next attribute value for the flow. |
Transition.Next<FlowBuilder> |
nextOn(String exitStatusCondition)
Sets
next transition condition for the flow. |
FlowBuilder |
split(Split split)
Adds a split to the current flow.
|
FlowBuilder |
step(Step step)
Adds a step to the current flow.
|
Transition.Stop<FlowBuilder> |
stopOn(String exitStatusCondition)
Sets
stop transition condition for the flow. |
public FlowBuilder(String id)
id
- flow idpublic FlowBuilder next(String next)
next
attribute value for the flow.next
- id of the next job element after the flowFlowBuilder
public Transition.End<FlowBuilder> endOn(String exitStatusCondition)
end
transition condition for the flow. This method does NOT return the current FlowBuilder
instance; instead, it returns an instance of Transition.End
, which can be further
operated on. Invoking Transition.Termination.exitStatus(String...)
will end the operation on
Transition.End
and return the current FlowBuilder
. For example,
endOn("END").exitStatus("new status for end").<other FlowBuilder methods>
exitStatusCondition
- exit status condition to trigger "end" action (may contain wildcard ? and *)Transition.End<FlowBuilder>
Transition.End
,
StepBuilder.endOn(java.lang.String)
,
DecisionBuilder.endOn(String)
public Transition.Fail<FlowBuilder> failOn(String exitStatusCondition)
fail
transition condition for the flow. This method does NOT return the current FlowBuilder
instance; instead, it returns an instance of Transition.Fail
, which can be further
operated on. Invoking Transition.Termination.exitStatus(String...)
will end the operation on
Transition.Fail
and return the current FlowBuilder
. For example,
failOn("FAIL").exitStatus("new status for fail").<other FlowBuilder methods>
exitStatusCondition
- exit status condition to trigger "fail" action (may contain wildcard ? and *)Transition.Fail<FlowBuilder>
Transition.Fail
,
StepBuilder.failOn(java.lang.String)
,
DecisionBuilder.failOn(String)
public Transition.Stop<FlowBuilder> stopOn(String exitStatusCondition)
stop
transition condition for the flow. This method does NOT return the current FlowBuilder
instance; instead, it returns an instance of Transition.Stop
, which can be further
operated on. Invoking Transition.Termination.exitStatus(String...)
will end the operation on
Transition.Stop
and return the current FlowBuilder
. For example,
stopOn("STOP").restartFrom("step1").exitStatus().<other FlowBuilder methods>
exitStatusCondition
- exit status condition to trigger "stop" action (may contain wildcard ? and *)Transition.Stop<FlowBuilder>
Transition.Stop
,
StepBuilder.stopOn(java.lang.String)
,
DecisionBuilder.stopOn(String)
public Transition.Next<FlowBuilder> nextOn(String exitStatusCondition)
next
transition condition for the flow. This method does NOT return the current FlowBuilder
instance; instead, it returns an instance of Transition.Next
, which can be further
operated on. Invoking Transition.Next.to(String)
will end the operation on
Transition.Next
and return the current FlowBuilder
. For example,
nextOn("*").to("step2").<other FlowBuilder methods>
exitStatusCondition
- exit status condition to trigger "next" action (may contain wildcard ? and *)Transition.Next<FlowBuilder>
Transition.Next
,
StepBuilder.nextOn(java.lang.String)
,
DecisionBuilder.nextOn(String)
public FlowBuilder decision(Decision decision)
decision
- the decision to be added to the current flowFlowBuilder
public FlowBuilder flow(Flow flow)
flow
- the flow to be added to the current flowFlowBuilder
public FlowBuilder split(Split split)
split
- the split to be added to the current flowFlowBuilder
public FlowBuilder step(Step step)
step
- the step to be added to the current flowFlowBuilder
Copyright © 2016 JBoss by Red Hat. All rights reserved.