Class WorkflowStepDAO

java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.workflow.dao.WorkflowStepDAO
All Implemented Interfaces:
LogEnabled, Component, Serviceable

public class WorkflowStepDAO extends AbstractLogEnabled implements Component, Serviceable
DAO for workflow steps
  • Field Details

  • Constructor Details

  • Method Details

    • service

      public void service(ServiceManager smanager) throws ServiceException
      Specified by:
      service in interface Serviceable
      Throws:
      ServiceException
    • getStepNodes

      public Map<String,Object> getStepNodes(String currentNode, String workflowName)
      Get the workflow editor tree's nodes
      Parameters:
      currentNode - id of the current node
      workflowName - unique name of current workflow
      Returns:
      a map of the current node's children
    • _action2JSON

      protected Map<String,Object> _action2JSON(String stepId, com.opensymphony.workflow.loader.ActionDescriptor action, com.opensymphony.workflow.loader.WorkflowDescriptor workflowDescriptor)
      Get the action infos for tree panel node
      Parameters:
      stepId - id of current step
      action - currently processed action
      workflowDescriptor - current workflow
      Returns:
      map of the action infos
    • _getActionFinalSteps

      protected Set<org.ametys.plugins.workflow.dao.WorkflowStepDAO.StepWithIcon> _getActionFinalSteps(com.opensymphony.workflow.loader.ActionDescriptor action, com.opensymphony.workflow.loader.WorkflowDescriptor workflowDescriptor)
      Get the conditional and unconditional results of current action
      Parameters:
      action - the current action
      workflowDescriptor - the current workflow
      Returns:
      a list of the final steps as (stepId, stepLabel, StepIconPath)
    • getOutgoingSteps

      public Set<com.opensymphony.workflow.loader.StepDescriptor> getOutgoingSteps(com.opensymphony.workflow.loader.ActionDescriptor action, com.opensymphony.workflow.loader.WorkflowDescriptor workflowDescriptor)
      Get possible outgoing steps for action
      Parameters:
      action - the current action
      workflowDescriptor - the current workflow
      Returns:
      a set of the outgoing steps
    • getIncomingSteps

      public Set<com.opensymphony.workflow.loader.StepDescriptor> getIncomingSteps(int actionId, com.opensymphony.workflow.loader.WorkflowDescriptor workflowDescriptor)
      Get possible incoming steps for action
      Parameters:
      actionId - the current action's id
      workflowDescriptor - the current workflow
      Returns:
      a set of the action's incoming steps
    • getFinalSteps

      public Map<String,Object> getFinalSteps(String currentNode, String workflowName, String actionId)
      Get current action's final steps and associated conditions
      Parameters:
      currentNode - id of current node
      workflowName - unique name of current workflow
      actionId - id of current action
      Returns:
      a map of current node's children
    • _step2JSON

      protected Map<String,Object> _step2JSON(com.opensymphony.workflow.loader.WorkflowDescriptor workflowDescriptor, int stepId, boolean hasChildren)
      Get step infos
      Parameters:
      workflowDescriptor - current workflow
      stepId - id of current step
      hasChildren - true if step has actions
      Returns:
      a map of the step infos
    • getStepLabel

      public String getStepLabel(com.opensymphony.workflow.loader.WorkflowDescriptor workflowDescriptor, int stepId)
      Get the translated step label
      Parameters:
      workflowDescriptor - current workflow
      stepId - id of current step
      Returns:
      the step label as string
    • getStepIconPath

      public String getStepIconPath(com.opensymphony.workflow.loader.WorkflowDescriptor workflowDescriptor, int stepId)
      Get the step's icon path
      Parameters:
      workflowDescriptor - current worklfow
      stepId - id of current step
      Returns:
      the icon path
    • getStepIconPathAsBase64

      public String getStepIconPathAsBase64(com.opensymphony.workflow.loader.WorkflowDescriptor workflowDescriptor, int stepId)
      Get the step's icon path as base 64 for svg links
      Parameters:
      workflowDescriptor - current worklfow
      stepId - id of current step
      Returns:
      the icon path as base 64
    • getActionLabel

      public String getActionLabel(com.opensymphony.workflow.loader.ActionDescriptor action)
      Get the translated action label
      Parameters:
      action - current action
      Returns:
      the action label
    • getActionIconPath

      public String getActionIconPath(com.opensymphony.workflow.loader.ActionDescriptor action)
      Get the action's icon path
      Parameters:
      action - current action
      Returns:
      the icon's path
    • getActionIconPathAsBase64

      public String getActionIconPathAsBase64(com.opensymphony.workflow.loader.ActionDescriptor action)
      Get the action's icon path as base 64 for svg's links
      Parameters:
      action - current action
      Returns:
      the icon's path as base 64