Class FlowNode
- java.lang.Object
-
- lumis.portal.analytics.automationflow.FlowNode
-
- Direct Known Subclasses:
AbstractJourneyTransitionActionNode
,AddUserAttributeActionNode
,CustomActionActionNode
,RecalculateUserSegmentationsMembershipActionNode
,RemoveUserAttributeActionNode
,RemoveUserFromJourneyActionNode
,SendEmailActionNode
,TrueFalseNode
,WaitActionNode
,WaitForEventActionNode
public abstract class FlowNode extends java.lang.Object
A flow node.- Since:
- 12.0.0
- Version:
- $Revision$ $Date$
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FlowNode.FlowNodeExecutionResult
Flow node execution result.
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
id
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract FlowNode.FlowNodeExecutionResult
execute(FlowContext flowContext)
Executes this node and returns the next node to be executed.protected static MonitorUser
getAndValidateNotAnonymousUser(FlowContext flowContext)
Returns the user from flow context.protected FlowEntry
getFlowEntry()
Returns the flowEntry.java.util.Collection<FlowNode>
getFollowUps()
Returns all possible follow up nodes.protected java.lang.String
getId()
Returns the id.java.lang.String
getName()
Returns the name.protected java.lang.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(java.lang.String message, ILogger logger)
Log invalid node with commons enunciation.protected void
logError(java.lang.String message, ILogger logger, java.lang.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.
-
-
-
Constructor Detail
-
FlowNode
protected FlowNode(java.lang.String id, java.lang.String name)
Creates a new instance with no configuration.- Parameters:
id
- the node identifiername
- the node name- Since:
- 12.1.0
-
FlowNode
public FlowNode(org.json.JSONObject object, FlowEntry flowEntry)
Creates a new instance from the given JSON object. This constructor is the counterpart oftoJSONObject()
method.- Parameters:
object
- the JSON object.flowEntry
- the flow entry this node belongs to.- Since:
- 12.0.0
-
-
Method Detail
-
execute
public abstract FlowNode.FlowNodeExecutionResult execute(FlowContext flowContext) throws PortalException
Executes this node and returns the next node to be executed.- Parameters:
flowContext
- the flow context- Returns:
- the next node to be executed
- Throws:
PortalException
- Since:
- 12.0.0
-
validateStateAndLog
public 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. So, to prevents exception on flow node execution and prevent to save flow when flow node is invalid state, this methods will check if all variables is OK and log otherwise.- Parameters:
checkAllNextNodes
- check all next nodes nodes.- Returns:
- true if all variable state is OK.
- Since:
- 12.0.0
-
toJSONObject
public org.json.JSONObject toJSONObject()
Returns the JSON representation of this node. This method is the counterpart of#FlowNode(JSONObject)
constructor.- Returns:
- the JSON representation of this node.
- Since:
- 12.0.0
-
getName
public java.lang.String getName()
Returns the name.- Returns:
- the name
- Since:
- 12.0.0
-
getId
protected java.lang.String getId()
Returns the id.- Returns:
- the id
- Since:
- 12.0.0
-
getFlowEntry
protected FlowEntry getFlowEntry()
Returns the flowEntry.- Returns:
- the flowEntry
- Since:
- 12.0.0
-
getFollowUps
public java.util.Collection<FlowNode> getFollowUps()
Returns all possible follow up nodes.- Returns:
- all possible follow up nodes.
- Since:
- 12.1.0
-
logError
protected void logError(java.lang.String message, ILogger logger)
Log invalid node with commons enunciation.- Parameters:
message
- the message.logger
- the logger.- Since:
- 12.0.0
-
logError
protected void logError(java.lang.String message, ILogger logger, java.lang.Throwable causeError)
Log invalid node with commons enunciation.- Parameters:
message
- the message.logger
- the logger.causeError
- the cause error.- Since:
- 12.2.0
-
getNodeLogLabel
protected java.lang.String getNodeLogLabel()
Returns the label node to log.- Returns:
- the label node to log.
- Since:
- 12.1.0
-
init
protected void init(FlowEntry flowEntry)
Initializes the flow node with the given flow entry.- Parameters:
flowEntry
- the flow entry.- Since:
- 12.1.0
-
getAndValidateNotAnonymousUser
protected static MonitorUser getAndValidateNotAnonymousUser(FlowContext flowContext) throws DaoException, PortalException
Returns the user from flow context. But if he is anonymous user, throwFlowInterruptedWithErrorException
to stop flow.- Parameters:
flowContext
- the flow context- Returns:
- the user from flow context.
- Throws:
DaoException
PortalException
- Since:
- 12.3.0
-
-