Interface WorkflowService

All Known Subinterfaces:
CMSWorkflowService
All Known Implementing Classes:
BackofficeWorkflowService, DefaultCMSWorkflowService, DefaultWorkflowService

public interface WorkflowService
Service to manipulate workflows.
  • Method Details

    • getWorkflowsForTemplateAndUser

      List<WorkflowModel> getWorkflowsForTemplateAndUser(WorkflowTemplateModel template, UserModel user)
      Returns workflows that was created from given template whom owner is given user .
      Parameters:
      template - to be matched
      user - owner of the workflow
    • getAllAdhocWorkflows

      List<WorkflowModel> getAllAdhocWorkflows(EnumSet<WorkflowStatus> workflowsStatuses, Date adhocDateFrom, Date adhocDateTo)
      Returns addhoc workflows that match statuses and time range. Workflow meets the time range when its ItemModel.getModifiedtime() is between given adhocDateFrom and adhocDateTo.
      Parameters:
      workflowsStatuses - statuses to be match
      adhocDateFrom - time range start
      adhocDateTo - time range end
      Returns:
      adhoc workflows that match critetia
    • getAllWorkflows

      List<WorkflowModel> getAllWorkflows(EnumSet<WorkflowStatus> workflowsStatuses, Date dateFrom, Date dateTo)
      Returns workflows that match statuses and time range. Workflow meets the time range when its ItemModel.getModifiedtime() is between given adhocDateFrom and adhocDateTo.
      Parameters:
      workflowsStatuses - statuses to be match
      dateFrom - time range start
      dateTo - time range end
      Returns:
      workflows that match critetia
    • createWorkflow

      WorkflowModel createWorkflow(WorkflowTemplateModel template, ItemModel attachment, UserModel owner)
      Creates workflow based on a template and adds an attachment to it. It does not save workflow and actions, please do it by yourself.
      Parameters:
      template - from which workflow is being created
      attachment - to be added
      Returns:
      created workflow
    • createWorkflow

      WorkflowModel createWorkflow(String workflowName, WorkflowTemplateModel template, List<ItemModel> itemsToAdd, UserModel owner)
      Creates workflow based on a template and adds an attachment to it. It does not save workflow and actions, please do it by yourself.
      Parameters:
      workflowName - name of a workflow
      template - from which workflow is being created
      itemsToAdd - attachment items to be added
      Returns:
      created workflow
    • createWorkflow

      WorkflowModel createWorkflow(WorkflowTemplateModel template, UserModel owner)
      Creates workflow based on a template. It does not save workflow and actions, please do it by yourself.
      Parameters:
      template - from which workflow is being created
      owner - of the workflow
      Returns:
      created workflow
    • isPlanned

      boolean isPlanned(WorkflowModel workflow)
      Checks if workflow is planned
      Parameters:
      workflow - to check
      Returns:
      true if planned, false otherwise
    • isRunning

      boolean isRunning(WorkflowModel workflow)
      Checks if workflow is running
      Parameters:
      workflow - to check
      Returns:
      true if running, false otherwise
    • isPaused

      boolean isPaused(WorkflowModel workflow)
      Checks if workflow is paused
      Parameters:
      workflow - to check
      Returns:
      true if paused, false otherwise
    • isFinished

      boolean isFinished(WorkflowModel workflow)
      Checks if workflow is finished
      Parameters:
      workflow - to check
      Returns:
      true if planned, false otherwise
    • isCompleted

      boolean isCompleted(WorkflowModel workflow)
      Checks if workflow is completed
      Parameters:
      workflow - to check
      Returns:
      true if completed, false otherwise
    • isTerminated

      boolean isTerminated(WorkflowModel workflow)
      Checks if workflow is terminated
      Parameters:
      workflow - to check
      Returns:
      true if terminated, false otherwise
    • canBeStarted

      boolean canBeStarted(WorkflowModel workflow)
      Checks if workflow can be started
      Parameters:
      workflow - to check
      Returns:
      true if can be started, false otherwise
    • isAdhocWorkflow

      boolean isAdhocWorkflow(WorkflowModel workflow)
      Checks if workflow is adhoc
      Parameters:
      workflow - to check
    • assignUser

      boolean assignUser(PrincipalModel principal, WorkflowModel workflow)
      Assigns principal to workflow. This action does not save workflow, please do it by yourself.
      Parameters:
      principal - to be assigned to workflow
      workflow -
    • unassignUser

      boolean unassignUser(WorkflowModel workflow)
      Unassigns principal from workflow and assign dummy user
      Parameters:
      workflow -
    • createAdhocWorkflow

      WorkflowModel createAdhocWorkflow(String workflowName, List<ItemModel> itemsToAdd, UserModel owner)
      Creates adhoc workflow with a name and adds an attachment to it. This method does not save workflow, do it by yourself.
      Parameters:
      workflowName - name of a workflow
      itemsToAdd - attachment items to be added
      owner - of the workflow
      Returns:
      created workflow
    • getStartTime

      Date getStartTime(WorkflowModel workflow)
      Gets start time from a workflow
      Parameters:
      workflow -
      Returns:
      start date of workflow
    • getWorkflowForCode

      WorkflowModel getWorkflowForCode(String string)
      Returns workflow for a given code
      Throws:
      UnknownIdentifierException - when no workflow found
      AmbiguousIdentifierException - when more than one workflow found
    • getAllWorkflows

      SearchResult<WorkflowModel> getAllWorkflows(EnumSet<WorkflowStatus> workflowsStatuses, Date dateFrom, Date dateTo, int startIndex, int pageSize)
      Pageable version of method getAllWorkflows(EnumSet, Date, Date)
    • getAllAdhocWorkflows

      SearchResult<WorkflowModel> getAllAdhocWorkflows(EnumSet<WorkflowStatus> workflowsStatuses, Date adhocDateFrom, Date adhocDateTo, int startIndex, int pageSize)