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 Details

  • Constructor Details

  • Method Details

    • service

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

      public void initializeWorkflow(FormEntry entry) throws Exception
      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 entry
      types - 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 entry
      excludedTypes - 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 entry
      actionTypeFilter - The filter to apply on the action type or null to retrieve all actions
      Returns:
      The list of accepted available actions