Class FlowNode

    • Field Detail

      • id

        protected final String id
    • Constructor Detail

      • FlowNode

        protected FlowNode​(String id,
                           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 String getName()
        Returns the name.
        Returns:
        the name
        Since:
        12.0.0
      • getId

        protected 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 Collection<FlowNode> getFollowUps()
        Returns all possible follow up nodes.
        Returns:
        all possible follow up nodes.
        Since:
        12.1.0
      • logError

        protected void logError​(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​(String message,
                                ILogger logger,
                                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 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