Package org.ametys.plugins.forms.helper
Class FormWorkflowHelper
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.forms.helper.FormWorkflowHelper
- All Implemented Interfaces:
LogEnabled,Component,Serviceable
Helper for manipulating workflows for
Form-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected WorkflowHelperThe workflow helper componentprotected WorkflowProviderThe workflow providerstatic final StringThe edit action typestatic final StringThe edit by submitter action typestatic final StringAvalon Role -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected List<com.opensymphony.workflow.loader.ActionDescriptor> getAvailableActions(FormEntry entry, Predicate<String> actionTypeFilter) Get the wanted available actions for the given form entryList<com.opensymphony.workflow.loader.ActionDescriptor> getAvailableActionsExcludingTypes(FormEntry entry, List<String> excludedTypes) Get the non excluded available actions for the given form entryList<com.opensymphony.workflow.loader.ActionDescriptor> getAvailableActionsRestrictedToTypes(FormEntry entry, List<String> types) Get the available actions for the given form entry and wanted action typesvoidinitializeWorkflow(FormEntry entry) Initialize workflow for form entryvoidservice(ServiceManager serviceManager) Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
ROLE
Avalon Role -
EDIT_ACTION
The edit action type- See Also:
-
EDIT_BY_SUBMITTER_ACTION
The edit by submitter action type- See Also:
-
_workflowProvider
The workflow provider -
_workflowHelper
The workflow helper component
-
-
Constructor Details
-
FormWorkflowHelper
public FormWorkflowHelper()
-
-
Method Details
-
service
- Specified by:
servicein interfaceServiceable- Throws:
ServiceException
-
initializeWorkflow
Initialize workflow for form entry- Parameters:
entry- the form entry- Throws:
Exception- if an error occurred
-
getAvailableActionsRestrictedToTypes
public List<com.opensymphony.workflow.loader.ActionDescriptor> getAvailableActionsRestrictedToTypes(FormEntry entry, List<String> types) Get the available actions for the given form entry and wanted action types- Parameters:
entry- The form entrytypes- The action types to include. If empty, all available actions are returned. Otherwise, only actions with the specified types are returned.- Returns:
- The list of wanted available actions
-
getAvailableActionsExcludingTypes
public List<com.opensymphony.workflow.loader.ActionDescriptor> getAvailableActionsExcludingTypes(FormEntry entry, List<String> excludedTypes) Get the non excluded available actions for the given form entry- Parameters:
entry- The form entryexcludedTypes- The action types to exclude. If empty, all available actions are returned. Otherwise, only actions whose type is not listed are returned.- Returns:
- The list of available actions except the excluded ones
-
getAvailableActions
protected List<com.opensymphony.workflow.loader.ActionDescriptor> getAvailableActions(FormEntry entry, Predicate<String> actionTypeFilter) Get the wanted available actions for the given form entry- Parameters:
entry- The form entryactionTypeFilter- The filter to apply on the action type or null to retrieve all actions- Returns:
- The list of accepted available actions
-