Package org.ametys.plugins.workflow.dao
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 Summary
Modifier and TypeFieldDescriptionprotected WorflowRightHelper
The workflow right helperprotected WorkflowSessionHelper
The workflow session helperprotected WorkflowStepDAO
The workflow step DAOprotected WorkflowTransitionDAO
The workflow transition DAOstatic final String
The component role -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddConditionalResult
(String workflowName, Integer stepId, Integer actionId, Integer resultId) Add a conditional result to actiondeleteConditionalResult
(String workflowName, Integer stepId, Integer actionId, Integer resultId) Delete a conditional result from actioneditConditionalResult
(String workflowName, Integer stepId, Integer actionId, Integer resultOldId, Integer resultNewId) Edit a conditional resultprotected 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 treegetConditionalResultsToJson
(String workflowName, Integer actionId, Integer currentStepId) Get a list of the action's conditional results in a json formatint
getIndexOfStepResult
(List<com.opensymphony.workflow.loader.ConditionalResultDescriptor> conditionalResults, Integer stepResultId) Get the index of selected step result in the list of conditional resultsString[]
Get the path to the current nodeList<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 operatorvoid
service
(ServiceManager manager) Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
ROLE
The component role -
_workflowSessionHelper
The workflow session helper -
_workflowRightHelper
The workflow right helper -
_workflowStepDAO
The workflow step DAO -
_workflowTransitionDAO
The workflow transition DAO
-
-
Constructor Details
-
WorkflowResultDAO
public WorkflowResultDAO()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- 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 nameactionId
- the current actioncurrentStepId
- 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 workflowstepId
- id of the parent step of the selected actionactionId
- id of selected actionresultId
- 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 workflowstepId
- id of the parent step of the selected actionactionId
- id of selected actionresultOldId
- former id of selected resultresultNewId
- 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 workflowstepId
- id of the parent step of the selected actionactionId
- id of selected actionresultId
- 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 treeaction
- the selected actionconditionalResults
- the action's conditional results- Returns:
- a list of conditions, can be empty
-
getPath
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 resultsstepId
- 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 resultsstepResultId
- id of the result to find- Returns:
- the step result's index
-