Package com.comalatech.workflow
Interface WorkflowParameterManager
public interface WorkflowParameterManager
Manages space and page level workflow parameters.
-
Method Summary
Modifier and TypeMethodDescriptiongetPageWorkflowParameter(com.atlassian.confluence.pages.AbstractPage page, String parameterName) Returns the workflow parameter that is associated with an specific page.getParametersForAnyTransition(com.atlassian.confluence.pages.AbstractPage page, Workflow.State state, boolean isAdmin) Retrieves the required parameters information for all the states that can be reached from the given state using built in transitions.getParametersForTransition(com.atlassian.confluence.pages.AbstractPage page, Workflow.State targetState) Gets the list of the required parameters to transition to the given target stategetSpaceWorkflowParameter(String spaceKey, String parameterName) Returns the workflow parameter of a space that matches the given parameter name.getSpaceWorkflowsParameters(String spaceKey) Returns a list of existing Workflow Parameters in a certain space.booleanisTransitionAllowed(com.atlassian.confluence.pages.AbstractPage page, Workflow.State targetState) Checks in the given page if the transition to the given workflows state is allowed with the current state of the its parameters.voidsetPageWorkflowParameterValue(com.atlassian.confluence.pages.AbstractPage page, WorkflowParameter workflowParameter) Sets a workflow parameter value on a given page.voidsetSpaceWorkflowParameter(String spaceKey, WorkflowParameter workflowParameter) Sets a workflow parameter in the given space.
-
Method Details
-
getSpaceWorkflowsParameters
Returns a list of existing Workflow Parameters in a certain space.- Parameters:
spaceKey- key of the space from which to get the workflow parameters- Returns:
- a list containing all the workflow parameters defined in the given space
-
getSpaceWorkflowParameter
Returns the workflow parameter of a space that matches the given parameter name.- Parameters:
spaceKey- key of the space from which to get the workflow parameterparameterName- name of the workflow parameter- Returns:
- a workflow parameter that matches the given name in the given space
-
setSpaceWorkflowParameter
void setSpaceWorkflowParameter(String spaceKey, WorkflowParameter workflowParameter) throws WorkflowException Sets a workflow parameter in the given space. A workflow parameter with the same name must already exist.- Parameters:
spaceKey- key of the space in which to set the workflow parameterworkflowParameter- workflow parameter to be set in the given space- Throws:
WorkflowException- if the provided parameter“s value does not match the parameter type
-
getPageWorkflowParameter
PageWorkflowParameter getPageWorkflowParameter(com.atlassian.confluence.pages.AbstractPage page, String parameterName) Returns the workflow parameter that is associated with an specific page.- Parameters:
page- page that contains the requested workflow parameterparameterName- name of the workflow parameter- Returns:
- the page workflow parameter of the given page which name matches the given parameter. If the given page has a "single page workflow", it will return null.
-
setPageWorkflowParameterValue
void setPageWorkflowParameterValue(com.atlassian.confluence.pages.AbstractPage page, WorkflowParameter workflowParameter) throws WorkflowException Sets a workflow parameter value on a given page. The page must already have a workflow parameter which name matches the one of the parameter to be set.- Parameters:
page- page where to set the given workflow parameterworkflowParameter- workflow parameter to override the existing one- Throws:
WorkflowException- if the provided parameter“s value does not match the parameter type
-
getParametersForTransition
List<PageWorkflowParameter> getParametersForTransition(com.atlassian.confluence.pages.AbstractPage page, Workflow.State targetState) Gets the list of the required parameters to transition to the given target state- Parameters:
page- context pagetargetState- desired next state- Returns:
- the list of page parameters for the requested transition
- Since:
- 6.2.0
-
isTransitionAllowed
boolean isTransitionAllowed(com.atlassian.confluence.pages.AbstractPage page, Workflow.State targetState) Checks in the given page if the transition to the given workflows state is allowed with the current state of the its parameters.- Parameters:
page- context pagetargetState- desired next state- Returns:
- if the transition is allowed given the state of its parameters
- Since:
- 6.2.0
-
getParametersForAnyTransition
Map<String,List<PageWorkflowParameter>> getParametersForAnyTransition(com.atlassian.confluence.pages.AbstractPage page, Workflow.State state, boolean isAdmin) Retrieves the required parameters information for all the states that can be reached from the given state using built in transitions. (ie, approve/reject/submit)- Parameters:
page- contextual pagestate- set as an origin to identify the transition states and the required parametersisAdmin- admin override enabled- Returns:
- all state names that can be reached from the given state linked to their required parameters
- Since:
- 6.2.0
-