Interface TaskComponent

  • All Known Subinterfaces:
    WorkflowEngine
    All Known Implementing Classes:
    ActivitiWorkflowEngine

    public interface TaskComponent
    SPI to be implemented by a BPM Engine that provides Task management.
    Author:
    davidc
    • Method Summary

      All Methods Instance Methods Abstract Methods Deprecated Methods 
      Modifier and Type Method Description
      long countTasks​(WorkflowTaskQuery query)
      Count the number of active tasks that match the given query.
      WorkflowTask endTask​(java.lang.String taskId, java.lang.String transitionId)
      End the Task (i.e.
      java.util.List<WorkflowTask> getAssignedTasks​(java.lang.String authority, WorkflowTaskState state, boolean lazyInitialization)
      Gets all tasks assigned to the specified authority
      java.util.List<WorkflowTask> getPooledTasks​(java.util.List<java.lang.String> authorities, boolean lazyInitialization)
      Gets the pooled tasks available to the specified authority
      WorkflowTask getStartTask​(java.lang.String workflowInstanceId)
      Gets all active timers for the specified workflow
      java.util.List<WorkflowTask> getStartTasks​(java.util.List<java.lang.String> workflowInstanceIds, boolean sameSession)
      Gets all start tasks for the specified workflow
      WorkflowTask getTaskById​(java.lang.String taskId)
      Gets a Task by unique Id
      java.util.List<WorkflowTask> queryTasks​(WorkflowTaskQuery query)
      Deprecated.
      Use overloaded method with the sameSession parameter (this method defaults the parameter to false).
      java.util.List<WorkflowTask> queryTasks​(WorkflowTaskQuery query, boolean sameSession)
      Query for tasks Hint: use WorkflowTaskQuery setLimit() method to limit the number of processed items if you don't really need to go through all of them
      WorkflowTask startTask​(java.lang.String taskId)
      Start the specified Task Note: this is an optional task operation.
      WorkflowTask suspendTask​(java.lang.String taskId)
      Suspend the specified Task
      WorkflowTask updateTask​(java.lang.String taskId, java.util.Map<org.alfresco.service.namespace.QName,​java.io.Serializable> properties, java.util.Map<org.alfresco.service.namespace.QName,​java.util.List<org.alfresco.service.cmr.repository.NodeRef>> add, java.util.Map<org.alfresco.service.namespace.QName,​java.util.List<org.alfresco.service.cmr.repository.NodeRef>> remove)
      Update the Properties and Associations of a Task
    • Method Detail

      • getTaskById

        WorkflowTask getTaskById​(java.lang.String taskId)
        Gets a Task by unique Id
        Parameters:
        taskId - the task id
        Returns:
        the task
      • getAssignedTasks

        java.util.List<WorkflowTask> getAssignedTasks​(java.lang.String authority,
                                                      WorkflowTaskState state,
                                                      boolean lazyInitialization)
        Gets all tasks assigned to the specified authority
        Parameters:
        authority - the authority
        state - filter by specified workflow task state
        lazyInitialization - hint in order to return partially-initialized entities
        Returns:
        the list of assigned tasks
      • getPooledTasks

        java.util.List<WorkflowTask> getPooledTasks​(java.util.List<java.lang.String> authorities,
                                                    boolean lazyInitialization)
        Gets the pooled tasks available to the specified authority
        Parameters:
        authorities - the list of authorities
        lazyInitialization - hint in order to return partially-initialized entities
        Returns:
        the list of pooled tasks
      • queryTasks

        java.util.List<WorkflowTask> queryTasks​(WorkflowTaskQuery query)
        Deprecated.
        Use overloaded method with the sameSession parameter (this method defaults the parameter to false).
      • queryTasks

        java.util.List<WorkflowTask> queryTasks​(WorkflowTaskQuery query,
                                                boolean sameSession)
        Query for tasks Hint: use WorkflowTaskQuery setLimit() method to limit the number of processed items if you don't really need to go through all of them
        Parameters:
        query - the filter by which tasks are queried
        sameSession - indicates that the returned WorkflowTask elements will be used in the same session. If true, the returned List will be a lazy loaded list providing greater performance.
        Returns:
        the list of tasks matching the specified query
      • countTasks

        long countTasks​(WorkflowTaskQuery query)
        Count the number of active tasks that match the given query.
        Parameters:
        query - the filter by which tasks are queried
        Returns:
        number of matching tasks.
      • updateTask

        WorkflowTask updateTask​(java.lang.String taskId,
                                java.util.Map<org.alfresco.service.namespace.QName,​java.io.Serializable> properties,
                                java.util.Map<org.alfresco.service.namespace.QName,​java.util.List<org.alfresco.service.cmr.repository.NodeRef>> add,
                                java.util.Map<org.alfresco.service.namespace.QName,​java.util.List<org.alfresco.service.cmr.repository.NodeRef>> remove)
        Update the Properties and Associations of a Task
        Parameters:
        taskId - the task id to update
        properties - the map of properties to set on the task (or null, if none to set)
        add - the map of items to associate with the task (or null, if none to add)
        remove - the map of items to dis-associate with the task (or null, if none to remove)
        Returns:
        the update task
      • startTask

        WorkflowTask startTask​(java.lang.String taskId)
        Start the specified Task Note: this is an optional task operation. It may be used to track when work started on a task as well as resume a suspended task.
        Parameters:
        taskId - the task to start
        Returns:
        the updated task
      • suspendTask

        WorkflowTask suspendTask​(java.lang.String taskId)
        Suspend the specified Task
        Parameters:
        taskId - String
        Returns:
        the update task
      • endTask

        WorkflowTask endTask​(java.lang.String taskId,
                             java.lang.String transitionId)
        End the Task (i.e. complete the task)
        Parameters:
        taskId - the task id to end
        transitionId - the task transition id to take on completion (or null, for the default transition)
        Returns:
        the updated task
      • getStartTask

        WorkflowTask getStartTask​(java.lang.String workflowInstanceId)
        Gets all active timers for the specified workflow
        Returns:
        the list of active timers
      • getStartTasks

        java.util.List<WorkflowTask> getStartTasks​(java.util.List<java.lang.String> workflowInstanceIds,
                                                   boolean sameSession)
        Gets all start tasks for the specified workflow
        Returns:
        the list of start tasks