Package org.ametys.plugins.workflow.dao
Class WorkflowStepDAO
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.workflow.dao.WorkflowStepDAO
- All Implemented Interfaces:
LogEnabled
,Component
,Serviceable
DAO for workflow steps
-
Field Summary
Modifier and TypeFieldDescriptionprotected static final String
Default path for svg action iconsprotected static final String
Default path for svg step iconsprotected I18nUtils
I18n Utilsprotected WorkflowConditionDAO
The workflow condition DAOprotected WorkflowHelper
The workflow helperstatic final I18nizableText
The default label for actionsstatic final I18nizableText
The default label for stepsstatic final String
Id for initial stepstatic final String
The component's role -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription_action2JSON
(String stepId, com.opensymphony.workflow.loader.ActionDescriptor action, com.opensymphony.workflow.loader.WorkflowDescriptor workflowDescriptor) Get the action infos for tree panel nodeprotected 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_step2JSON
(com.opensymphony.workflow.loader.WorkflowDescriptor workflowDescriptor, int stepId, boolean hasChildren) Get step infosgetActionIconPath
(com.opensymphony.workflow.loader.ActionDescriptor action) Get the action's icon pathgetActionIconPathAsBase64
(com.opensymphony.workflow.loader.ActionDescriptor action) Get the action's icon path as base 64 for svg's linksgetActionLabel
(com.opensymphony.workflow.loader.ActionDescriptor action) Get the translated action labelgetFinalSteps
(String currentNode, String workflowName, String actionId) Get current action's final steps and associated conditionsSet<com.opensymphony.workflow.loader.StepDescriptor>
getIncomingSteps
(int actionId, com.opensymphony.workflow.loader.WorkflowDescriptor workflowDescriptor) Get possible incoming steps for actionSet<com.opensymphony.workflow.loader.StepDescriptor>
getOutgoingSteps
(com.opensymphony.workflow.loader.ActionDescriptor action, com.opensymphony.workflow.loader.WorkflowDescriptor workflowDescriptor) Get possible outgoing steps for actiongetStepIconPath
(com.opensymphony.workflow.loader.WorkflowDescriptor workflowDescriptor, int stepId) Get the step's icon pathgetStepIconPathAsBase64
(com.opensymphony.workflow.loader.WorkflowDescriptor workflowDescriptor, int stepId) Get the step's icon path as base 64 for svg linksgetStepLabel
(com.opensymphony.workflow.loader.WorkflowDescriptor workflowDescriptor, int stepId) Get the translated step labelgetStepNodes
(String currentNode, String workflowName) Get the workflow editor tree's nodesvoid
service
(ServiceManager smanager) Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
ROLE
The component's role -
INITIAL_STEP_ID
Id for initial step- See Also:
-
DEFAULT_STEP_NAME
The default label for steps -
DEFAULT_ACTION_NAME
The default label for actions -
__DEFAULT_SVG_STEP_ICON_PATH
Default path for svg step icons- See Also:
-
__DEFAULT_SVG_ACTION_ICON_PATH
Default path for svg action icons- See Also:
-
_workflowHelper
The workflow helper -
_workflowConditionDAO
The workflow condition DAO -
_i18nUtils
I18n Utils
-
-
Constructor Details
-
WorkflowStepDAO
public WorkflowStepDAO()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
getStepNodes
Get the workflow editor tree's nodes- Parameters:
currentNode
- id of the current nodeworkflowName
- 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 stepaction
- currently processed actionworkflowDescriptor
- 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 actionworkflowDescriptor
- 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 actionworkflowDescriptor
- 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 idworkflowDescriptor
- the current workflow- Returns:
- a set of the action's incoming steps
-
getFinalSteps
Get current action's final steps and associated conditions- Parameters:
currentNode
- id of current nodeworkflowName
- unique name of current workflowactionId
- 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 workflowstepId
- id of current stephasChildren
- 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 workflowstepId
- 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 worklfowstepId
- 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 worklfowstepId
- id of current step- Returns:
- the icon path as base 64
-
getActionLabel
Get the translated action label- Parameters:
action
- current action- Returns:
- the action label
-
getActionIconPath
Get the action's icon path- Parameters:
action
- current action- Returns:
- the icon's path
-
getActionIconPathAsBase64
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
-