Class FlowNode

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.lang.String id  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected FlowNode​(java.lang.String id, java.lang.String name)
      Creates a new instance with no configuration.
        FlowNode​(org.json.JSONObject object, FlowEntry flowEntry)
      Creates a new instance from the given JSON object.
    • 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • id

        protected final java.lang.String id
    • Constructor Detail

      • FlowNode

        protected FlowNode​(java.lang.String id,
                           java.lang.String name)
        Creates a new instance with no configuration.
        Parameters:
        id - the node identifier
        name - 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 of toJSONObject() method.
        Parameters:
        object - the JSON object.
        flowEntry - the flow entry this node belongs to.
        Since:
        12.0.0
    • Method Detail

      • 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