Class BaseFlowNode

java.lang.Object
com.codingapi.flow.node.BaseFlowNode
All Implemented Interfaces:
IMapConvertor, IFlowNode
Direct Known Subclasses:
BaseAuditNode, ConditionBranchNode, DelayNode, EndNode, InclusiveBranchNode, ParallelBranchNode, RouterNode, StartNode, SubProcessNode, TriggerNode

public abstract class BaseFlowNode extends Object implements IFlowNode
  • Field Details

    • id

      protected String id
      节点id
    • name

      protected String name
      节点名称
    • order

      protected int order
      条件顺序,越小则优先级越高
    • actions

      protected List<IFlowAction> actions
      节点操作
    • strategies

      protected List<INodeStrategy> strategies
      节点策略
  • Constructor Details

  • Method Details

    • setStrategies

      public void setStrategies(List<INodeStrategy> strategies)
      节点策略
      Parameters:
      strategies - 节点策略
    • setActions

      public void setActions(List<IFlowAction> actions)
    • toMap

      public Map<String,Object> toMap()
      Specified by:
      toMap in interface IMapConvertor
    • fromMap

      public static <T extends BaseFlowNode> T fromMap(Map<String,Object> map, Class<T> clazz)
    • verifyNode

      public void verifyNode(FormMeta form)
      Description copied from interface: IFlowNode
      节点验证 用于流程配置完成以后的验证时触发
      Specified by:
      verifyNode in interface IFlowNode
    • isWaitRecordMargeParallelNode

      public boolean isWaitRecordMargeParallelNode(FlowSession session)
      是否等待并行节点的汇聚
    • handle

      public boolean handle(FlowSession session)
      Description copied from interface: IFlowNode
      是否执行节点 当前流程节点执行完成以后,触发下一环节时执行的函数,当返回true时则将继续执行后续节点的handle流程,当返回false时则不继续执行后续流程,将执行当前节点的创建流程记录函数 IFlowNode.generateCurrentRecords(FlowSession)
      Specified by:
      handle in interface IFlowNode
      Parameters:
      session - 会话
      Returns:
      true: 继续执行下一个节点
    • verifySession

      public void verifySession(FlowSession session)
      Description copied from interface: IFlowNode
      节点验证会话 流程执行continueTrigger之前需要先对判断请求会话的参数是否满足节点参数要求
      Specified by:
      verifySession in interface IFlowNode
    • isDone

      public boolean isDone(FlowSession session)
      Description copied from interface: IFlowNode
      节点是否完成
      Specified by:
      isDone in interface IFlowNode
      Parameters:
      session - 会话
      Returns:
      true: 节点完成
    • fillNewRecord

      public void fillNewRecord(FlowSession session, FlowRecord flowRecord)
      Description copied from interface: IFlowNode
      填充流程记录,在保存流程记录时将会触发当前节点的填充流程记录函数。由于不同节点存储的流程数据会存在差异。
      Specified by:
      fillNewRecord in interface IFlowNode
      Parameters:
      session - 会话
      flowRecord - 流程记录
    • filterBranches

      public List<IFlowNode> filterBranches(List<IFlowNode> nodeList, FlowSession flowSession)
      Description copied from interface: IFlowNode
      过滤条件分支
      Specified by:
      filterBranches in interface IFlowNode
      Parameters:
      nodeList - 当前节点下的所有条件
      flowSession - 当前会话
      Returns:
      匹配的节点
    • generateCurrentRecords

      public List<FlowRecord> generateCurrentRecords(FlowSession session)
      Description copied from interface: IFlowNode
      构建当前节点下的流程记录,不需要创建记录的返回 空集合
      Specified by:
      generateCurrentRecords in interface IFlowNode
      Parameters:
      session - 会话
      Returns:
      流程记录
    • actionManager

      public ActionManager actionManager()
      Description copied from interface: IFlowNode
      获取节点操作对象管理器
      Specified by:
      actionManager in interface IFlowNode
      Returns:
      节点操作对象管理器
    • strategyManager

      public NodeStrategyManager strategyManager()
      Description copied from interface: IFlowNode
      获取节点策略管理器
      Specified by:
      strategyManager in interface IFlowNode
      Returns:
      节点策略管理器
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object