public abstract class TrueFalseNode extends FlowNode
FlowNode.FlowNodeExecutionResult
Constructor and Description |
---|
TrueFalseNode(org.json.JSONObject object,
FlowEntry flowEntry)
Creates a new instance from the given JSON object.
|
TrueFalseNode(String id,
String name,
FlowNode trueNode,
FlowNode falseNode)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addFalseNodeToJson(FlowNode falseNode,
org.json.JSONObject nextNodesObj)
Adds the false node to the next nodes JSON object.
|
protected void |
addTrueNodeToJson(FlowNode trueNode,
org.json.JSONObject nextNodesObj)
Adds the true node to the next nodes JSON object.
|
abstract boolean |
evaluate(FlowContext flowContext)
Evaluates the given flow context.
|
FlowNode.FlowNodeExecutionResult |
execute(FlowContext flowContext)
Executes this node and returns the next node to be executed.
|
protected FlowNode |
getFalseNodeFromJson(FlowEntry flowEntry,
org.json.JSONObject nextNodesObj)
Returns the false node from the next nodes JSON object.
|
Collection<FlowNode> |
getFollowUps()
Returns all possible follow up nodes.
|
protected FlowNode |
getTrueNodeFromJson(FlowEntry flowEntry,
org.json.JSONObject nextNodesObj)
Returns the true node from the next nodes JSON object.
|
org.json.JSONObject |
toJSONObject()
Returns the JSON representation of this node.
|
boolean |
validateStateAndLog(boolean checkAllNextNodes)
To permit edition when JSON flow is saved incorrectly in data base, the flow node constructor by JSON parameter need allows to load flow node variables
without exception when something already is wrong.
|
getAndValidateNotAnonymousUser, getFlowEntry, getId, getName, getNodeLogLabel, init, logError, logError
public TrueFalseNode(String id, String name, FlowNode trueNode, FlowNode falseNode)
id
- the node identifiername
- the node nametrueNode
- the node to be executed if the condition is evaluated to true
.falseNode
- the node to be executed if the condition is evaluated to false
.public TrueFalseNode(org.json.JSONObject object, FlowEntry flowEntry)
object
- the JSON object.flowEntry
- the flow entry this node belongs to.public boolean validateStateAndLog(boolean checkAllNextNodes)
FlowNode
validateStateAndLog
in class FlowNode
checkAllNextNodes
- check all next nodes nodes.public org.json.JSONObject toJSONObject()
FlowNode
#FlowNode(JSONObject)
constructor.toJSONObject
in class FlowNode
protected FlowNode getTrueNodeFromJson(FlowEntry flowEntry, org.json.JSONObject nextNodesObj)
flowEntry
- the flow entrynextNodesObj
- the next objects JSON objectprotected FlowNode getFalseNodeFromJson(FlowEntry flowEntry, org.json.JSONObject nextNodesObj)
flowEntry
- the flow entrynextNodesObj
- the next objects JSON objectprotected void addTrueNodeToJson(FlowNode trueNode, org.json.JSONObject nextNodesObj)
trueNode
- the true node.nextNodesObj
- the next nodes object.protected void addFalseNodeToJson(FlowNode falseNode, org.json.JSONObject nextNodesObj)
falseNode
- the false node.nextNodesObj
- the next nodes object.public FlowNode.FlowNodeExecutionResult execute(FlowContext flowContext) throws PortalException
FlowNode
execute
in class FlowNode
flowContext
- the flow contextPortalException
public abstract boolean evaluate(FlowContext flowContext) throws PortalException
true
if the context matches the condition or false
otherwise.flowContext
- the contexttrue
if the context matches the condition or false
otherwise.PortalException
public Collection<FlowNode> getFollowUps()
FlowNode
getFollowUps
in class FlowNode
LumisXP 12.5.0.200928 - Copyright © 2006–2020 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.