public abstract class FlowNode extends Object
Modifier and Type | Class and Description |
---|---|
static class |
FlowNode.FlowNodeExecutionResult
Flow node execution result.
|
Modifier | Constructor and Description |
---|---|
|
FlowNode(org.json.JSONObject object,
FlowEntry flowEntry)
Creates a new instance from the given JSON object.
|
protected |
FlowNode(String id,
String name)
Creates a new instance with no configuration.
|
Modifier and Type | Method and Description |
---|---|
abstract FlowNode.FlowNodeExecutionResult |
execute(FlowContext flowContext)
Executes this node and returns the next node to be executed.
|
protected MonitorUser |
getAndValidateNotAnonymousUser(FlowContext flowContext)
Returns the user from flow context.
|
protected FlowEntry |
getFlowEntry()
Returns the flowEntry.
|
Collection<FlowNode> |
getFollowUps()
Returns all possible follow up nodes.
|
protected String |
getId()
Returns the id.
|
String |
getName()
Returns the name.
|
protected String |
getNodeLogLabel()
Returns the label node to log.
|
protected void |
init(FlowEntry flowEntry)
Initializes the flow node with the given flow entry.
|
protected void |
logError(String message,
ILogger logger)
Log invalid node with commons enunciation.
|
protected void |
logError(String message,
ILogger logger,
Throwable causeError)
Log invalid node with commons enunciation.
|
org.json.JSONObject |
toJSONObject()
Returns the JSON representation of this node.
|
abstract 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.
|
protected final String id
protected FlowNode(String id, String name)
id
- the node identifiername
- the node namepublic FlowNode(org.json.JSONObject object, FlowEntry flowEntry)
toJSONObject()
method.object
- the JSON object.flowEntry
- the flow entry this node belongs to.public abstract FlowNode.FlowNodeExecutionResult execute(FlowContext flowContext) throws PortalException
flowContext
- the flow contextPortalException
public abstract boolean validateStateAndLog(boolean checkAllNextNodes)
checkAllNextNodes
- check all next nodes nodes.public org.json.JSONObject toJSONObject()
#FlowNode(JSONObject)
constructor.public String getName()
protected String getId()
protected FlowEntry getFlowEntry()
public Collection<FlowNode> getFollowUps()
protected void logError(String message, ILogger logger)
message
- the message.logger
- the logger.protected void logError(String message, ILogger logger, Throwable causeError)
message
- the message.logger
- the logger.causeError
- the cause error.protected String getNodeLogLabel()
protected void init(FlowEntry flowEntry)
flowEntry
- the flow entry.protected MonitorUser getAndValidateNotAnonymousUser(FlowContext flowContext) throws DaoException, PortalException
FlowInterruptedWithErrorException
to stop flow.flowContext
- the flow contextDaoException
PortalException
LumisXP 12.3.0.200408 - Copyright © 2006–2020 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.