Class WorkflowResultDAO

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

DAO for workflow results
  • Field Details

  • Constructor Details

  • Method Details

    • service

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

      public Map<String,Object> getConditionalResultsToJson(String workflowName, Integer actionId, Integer currentStepId)
      Get a list of the action's conditional results in a json format
      Parameters:
      workflowName - the current workflow's unique name
      actionId - the current action
      currentStepId - in edition mode, id of the selected final step
      Returns:
      a list of available conditional results for this action
    • addConditionalResult

      public Map<String,Object> addConditionalResult(String workflowName, Integer stepId, Integer actionId, Integer resultId)
      Add a conditional result to action
      Parameters:
      workflowName - unique name of current workflow
      stepId - id of the parent step of the selected action
      actionId - id of selected action
      resultId - id of step to add as conditional result
      Returns:
      map of result's infos
    • editConditionalResult

      public Map<String,Object> editConditionalResult(String workflowName, Integer stepId, Integer actionId, Integer resultOldId, Integer resultNewId)
      Edit a conditional result
      Parameters:
      workflowName - unique name of current workflow
      stepId - id of the parent step of the selected action
      actionId - id of selected action
      resultOldId - former id of selected result
      resultNewId - new id for selected result
      Returns:
      map of result's infos
    • deleteConditionalResult

      public Map<String,Object> deleteConditionalResult(String workflowName, Integer stepId, Integer actionId, Integer resultId)
      Delete a conditional result from action
      Parameters:
      workflowName - unique name of current workflow
      stepId - id of the parent step of the selected action
      actionId - id of selected action
      resultId - id of the result to delete
      Returns:
      map of result's infos
    • getChildrenResultConditions

      protected List<com.opensymphony.workflow.loader.AbstractDescriptor> getChildrenResultConditions(String currentNode, com.opensymphony.workflow.loader.ActionDescriptor action, List<com.opensymphony.workflow.loader.ConditionalResultDescriptor> conditionalResults)
      Get children conditions of current node in result tree
      Parameters:
      currentNode - id of current node in tree
      action - the selected action
      conditionalResults - the action's conditional results
      Returns:
      a list of conditions, can be empty
    • getPath

      public String[] getPath(String currentNodeId)
      Get the path to the current node
      Parameters:
      currentNodeId - id of the current node, is like 'step1-(and|or)0-condition4'
      Returns:
      an array of the path (step1, and0, condition4)
    • getRootResultConditions

      public List<com.opensymphony.workflow.loader.ConditionsDescriptor> getRootResultConditions(List<com.opensymphony.workflow.loader.ConditionalResultDescriptor> conditionalResults, int stepId)
      Get the root ConditionsDescriptor having current step as result this is the conditions descriptor that decide whether children conditions are linked by an AND or an OR operator
      Parameters:
      conditionalResults - list of current action's conditional results
      stepId - id of current targeted step
      Returns:
      a list of the root ConditionsDescriptor if exist
    • getIndexOfStepResult

      public int getIndexOfStepResult(List<com.opensymphony.workflow.loader.ConditionalResultDescriptor> conditionalResults, Integer stepResultId)
      Get the index of selected step result in the list of conditional results
      Parameters:
      conditionalResults - a list of conditional results
      stepResultId - id of the result to find
      Returns:
      the step result's index