Interface WorkflowService

    • Method Detail

      • getWorkflowsForTemplateAndUser

        java.util.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

        java.util.List<WorkflowModel> getAllAdhocWorkflows​(java.util.EnumSet<WorkflowStatus> workflowsStatuses,
                                                           java.util.Date adhocDateFrom,
                                                           java.util.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

        java.util.List<WorkflowModel> getAllWorkflows​(java.util.EnumSet<WorkflowStatus> workflowsStatuses,
                                                      java.util.Date dateFrom,
                                                      java.util.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​(java.lang.String workflowName,
                                     WorkflowTemplateModel template,
                                     java.util.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​(java.lang.String workflowName,
                                          java.util.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

        java.util.Date getStartTime​(WorkflowModel workflow)
        Gets start time from a workflow
        Parameters:
        workflow -
        Returns:
        start date of workflow