Interface WorkflowService

  • All Known Implementing Classes:
    WorkflowServiceImpl

    @AlfrescoPublicApi
    public interface WorkflowService
    Workflow Service. Client facing API for interacting with Alfresco Workflows and Tasks.
    Author:
    davidc
    • Method Summary

      All Methods Instance Methods Abstract Methods Deprecated Methods 
      Modifier and Type Method Description
      WorkflowInstance cancelWorkflow​(java.lang.String workflowId)
      Cancel an "in-flight" Workflow instance
      java.util.List<WorkflowInstance> cancelWorkflows​(java.util.List<java.lang.String> workflowIds)
      Cancel a batch of "in-flight" Workflow instances
      long countTasks​(WorkflowTaskQuery workflowTaskQuery)
      Get the number of tasks matching the given query
      long countWorkflows​(WorkflowInstanceQuery workflowInstanceQuery)
      Get count of workflow instances
      org.alfresco.service.cmr.repository.NodeRef createPackage​(org.alfresco.service.cmr.repository.NodeRef container)
      Create a Workflow Package (a container of content to route through the Workflow).
      WorkflowInstance deleteWorkflow​(java.lang.String workflowId)
      Delete a Workflow instance.
      WorkflowDeployment deployDefinition​(java.lang.String engineId, java.io.InputStream workflowDefinition, java.lang.String mimetype)
      Deploy a Workflow Definition to the Alfresco Repository
      WorkflowDeployment deployDefinition​(java.lang.String engineId, java.io.InputStream workflowDefinition, java.lang.String mimetype, java.lang.String name)
      Deploy a Workflow Definition to the Alfresco Repository
      WorkflowDeployment deployDefinition​(org.alfresco.service.cmr.repository.NodeRef workflowDefinition)
      Deploy a Workflow Definition to the Alfresco Repository Note: The specified content object must be of type bpm:workflowdefinition.
      WorkflowTask endTask​(java.lang.String taskId, java.lang.String transitionId)
      End the Task (i.e.
      WorkflowPath fireEvent​(java.lang.String pathId, java.lang.String event)
      Fire custom event against specified path
      java.util.List<WorkflowInstance> getActiveWorkflows()
      Gets all active workflow instances.
      java.util.List<WorkflowInstance> getActiveWorkflows​(java.lang.String workflowDefinitionId)
      Gets all active workflow instances of the specified Workflow Definition
      java.util.List<WorkflowDefinition> getAllDefinitions()
      Gets all deployed Workflow Definitions (with all previous versions)
      java.util.List<WorkflowDefinition> getAllDefinitionsByName​(java.lang.String workflowName)
      Gets all (including previous) Workflow Definitions for the given unique name
      java.util.List<WorkflowTask> getAssignedTasks​(java.lang.String authority, WorkflowTaskState state)
      Gets all tasks assigned to the specified authority
      java.util.List<WorkflowTask> getAssignedTasks​(java.lang.String authority, WorkflowTaskState state, boolean lazyInitialization)
      Gets all tasks assigned to the specified authority
      java.util.List<WorkflowInstance> getCompletedWorkflows()
      Gets all completed workflow instances.
      java.util.List<WorkflowInstance> getCompletedWorkflows​(java.lang.String workflowDefinitionId)
      Gets all completed workflow instances of the specified Workflow Definition
      WorkflowDefinition getDefinitionById​(java.lang.String workflowDefinitionId)
      Gets a Workflow Definition by unique Id
      WorkflowDefinition getDefinitionByName​(java.lang.String workflowName)
      Gets the latest Workflow Definition by unique name
      byte[] getDefinitionImage​(java.lang.String workflowDefinitionId)
      Gets a graphical view of the Workflow Definition
      java.util.List<WorkflowDefinition> getDefinitions()
      Gets latest deployed Workflow Definitions
      java.util.List<org.alfresco.service.cmr.repository.NodeRef> getPackageContents​(java.lang.String taskId)
      Get a list of node refs to all the package contents for the given task id.
      java.util.List<org.alfresco.service.cmr.repository.NodeRef> getPackageContents​(org.alfresco.service.cmr.repository.NodeRef packageRef)
      Get a list of node refs to all the package contents.
      java.util.Map<org.alfresco.service.namespace.QName,​java.io.Serializable> getPathProperties​(java.lang.String pathId)
      Gets the properties associated with the specified path (and parent paths)
      java.util.List<WorkflowTask> getPooledTasks​(java.lang.String authority)
      Gets the pooled tasks available to the specified authority
      java.util.List<WorkflowTask> getPooledTasks​(java.lang.String authority, boolean lazyinitialization)
      Gets the pooled tasks available to the specified authority
      WorkflowTask getStartTask​(java.lang.String workflowInstanceId)
      Gets the start task instance for the given workflow instance.
      java.util.List<WorkflowTask> getStartTasks​(java.util.List<java.lang.String> workflowInstanceIds, boolean sameSession)
      Gets the start task instances for the given workflow instances.
      WorkflowTask getTaskById​(java.lang.String taskId)
      Gets a Task by unique Id
      java.util.List<WorkflowTaskDefinition> getTaskDefinitions​(java.lang.String workflowDefinitionId)
      Gets the Task Definitions for the given Workflow Definition
      java.util.List<WorkflowTask> getTasksForWorkflowPath​(java.lang.String pathId)
      Gets all Tasks associated with the specified path
      java.util.List<WorkflowTimer> getTimers​(java.lang.String workflowId)
      Gets all active timers for the specified workflow
      WorkflowInstance getWorkflowById​(java.lang.String workflowId)
      Gets a specific workflow instances
      java.io.InputStream getWorkflowImage​(java.lang.String workflowInstanceId)
      Gets a graphical view of the workflow instance
      java.util.List<WorkflowPath> getWorkflowPaths​(java.lang.String workflowId)
      Gets all Paths for the specified Workflow instance.
      java.util.List<WorkflowInstance> getWorkflows()
      Gets all workflow instances (both active and completed).
      java.util.List<WorkflowInstance> getWorkflows​(java.lang.String workflowDefinitionId)
      Gets all workflow instances (both active and completed) of the specified Workflow Definition
      java.util.List<WorkflowInstance> getWorkflows​(WorkflowInstanceQuery workflowInstanceQuery)
      Gets all "in-flight" workflow instances according to the specified workflowInstanceQuery parameter
      java.util.List<WorkflowInstance> getWorkflows​(WorkflowInstanceQuery workflowInstanceQuery, int maxItems, int skipCount)
      Gets maxItems "in-flight" workflow instances according to the specified workflowInstanceQuery parameter Get maxItems and skipCount parameters form request
      java.util.List<WorkflowInstance> getWorkflowsForContent​(org.alfresco.service.cmr.repository.NodeRef packageItem, boolean active)
      Gets the Workflows that act upon the specified Repository content.
      boolean hasWorkflowImage​(java.lang.String workflowInstanceId)
      Determines if a graphical view of the workflow instance exists
      boolean isDefinitionDeployed​(java.lang.String engineId, java.io.InputStream workflowDefinition, java.lang.String mimetype)
      Is the specified Workflow Definition already deployed? Note: the notion of "already deployed" may differ between bpm engines.
      boolean isDefinitionDeployed​(org.alfresco.service.cmr.repository.NodeRef workflowDefinition)
      Is the specified Workflow Definition already deployed? Note: the notion of "already deployed" may differ between bpm engines.
      boolean isMultiTenantWorkflowDeploymentEnabled()  
      boolean isTaskClaimable​(WorkflowTask task, java.lang.String username)
      Determines if the given user can claim the given task
      boolean isTaskClaimable​(WorkflowTask task, java.lang.String username, boolean refreshTask)
      Determines if the given user can claim the given task
      boolean isTaskEditable​(WorkflowTask task, java.lang.String username)
      Determines if the given user can edit the given task
      boolean isTaskEditable​(WorkflowTask task, java.lang.String username, boolean refreshTask)
      Determines if the given user can edit the given task
      boolean isTaskReassignable​(WorkflowTask task, java.lang.String username)
      Determines if the given user can reassign the given task
      boolean isTaskReassignable​(WorkflowTask task, java.lang.String username, boolean refreshTask)
      Determines if the given user can reassign the given task
      boolean isTaskReleasable​(WorkflowTask task, java.lang.String username)
      Determines if the given user can release the given task
      boolean isTaskReleasable​(WorkflowTask task, java.lang.String username, boolean refreshTask)
      Determines if the given user can release the given task
      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
      WorkflowPath signal​(java.lang.String pathId, java.lang.String transitionId)
      Signal the transition from one Workflow Node to another
      WorkflowPath startWorkflow​(java.lang.String workflowDefinitionId, java.util.Map<org.alfresco.service.namespace.QName,​java.io.Serializable> parameters)
      Start a Workflow Instance
      WorkflowPath startWorkflowFromTemplate​(org.alfresco.service.cmr.repository.NodeRef templateDefinition)
      Start a Workflow Instance from an existing "Start Task" template node held in the Repository.
      void undeployDefinition​(java.lang.String workflowDefinitionId)
      Undeploy an exisiting Workflow Definition TODO: Determine behaviour when "in-flight" workflow instances exist
      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

      • deployDefinition

        @Auditable(parameters={"engineId","workflowDefinition","mimetype"},
                   recordable={true,false,true})
        WorkflowDeployment deployDefinition​(java.lang.String engineId,
                                            java.io.InputStream workflowDefinition,
                                            java.lang.String mimetype)
        Deploy a Workflow Definition to the Alfresco Repository
        Parameters:
        engineId - the bpm engine id
        workflowDefinition - the workflow definition
        mimetype - the mimetype of the workflow definition
        Returns:
        workflow deployment descriptor
      • deployDefinition

        @Auditable(parameters={"engineId","workflowDefinition","mimetype","name"},
                   recordable={true,false,true,true})
        WorkflowDeployment deployDefinition​(java.lang.String engineId,
                                            java.io.InputStream workflowDefinition,
                                            java.lang.String mimetype,
                                            java.lang.String name)
        Deploy a Workflow Definition to the Alfresco Repository
        Parameters:
        engineId - the bpm engine id
        workflowDefinition - the workflow definition
        mimetype - the mimetype of the workflow definition
        name - a name representing the deployment
        Returns:
        workflow deployment descriptor
        Since:
        4.0
      • deployDefinition

        @Auditable(parameters="workflowDefinition")
        WorkflowDeployment deployDefinition​(org.alfresco.service.cmr.repository.NodeRef workflowDefinition)
        Deploy a Workflow Definition to the Alfresco Repository Note: The specified content object must be of type bpm:workflowdefinition. This type describes for which BPM engine the definition is appropriate.
        Parameters:
        workflowDefinition - the content object containing the definition
        Returns:
        workflow deployment descriptor
      • isDefinitionDeployed

        @Auditable(parameters="definitionContent")
        boolean isDefinitionDeployed​(org.alfresco.service.cmr.repository.NodeRef workflowDefinition)
        Is the specified Workflow Definition already deployed? Note: the notion of "already deployed" may differ between bpm engines. For example, different versions of the same process may be considered equal.
        Parameters:
        workflowDefinition - the content object containing the definition
        Returns:
        true => already deployed
      • isDefinitionDeployed

        @Auditable(parameters={"engineId","workflowDefinition","mimetype"},
                   recordable={true,false,true})
        boolean isDefinitionDeployed​(java.lang.String engineId,
                                     java.io.InputStream workflowDefinition,
                                     java.lang.String mimetype)
        Is the specified Workflow Definition already deployed? Note: the notion of "already deployed" may differ between bpm engines. For example, different versions of the same process may be considered equal.
        Parameters:
        engineId - the bpm engine id
        workflowDefinition - the definition to check
        mimetype - the mimetype of the definition
        Returns:
        true => already deployed
      • undeployDefinition

        @Auditable(parameters="workflowDefinitionId")
        void undeployDefinition​(java.lang.String workflowDefinitionId)
        Undeploy an exisiting Workflow Definition TODO: Determine behaviour when "in-flight" workflow instances exist
        Parameters:
        workflowDefinitionId - the id of the definition to undeploy
      • getDefinitions

        @Auditable
        java.util.List<WorkflowDefinition> getDefinitions()
        Gets latest deployed Workflow Definitions
        Returns:
        the latest deployed workflow definitions
      • getAllDefinitions

        @Auditable
        java.util.List<WorkflowDefinition> getAllDefinitions()
        Gets all deployed Workflow Definitions (with all previous versions)
        Returns:
        the deployed (and previous) workflow definitions
      • getDefinitionById

        @Auditable(parameters="workflowDefinitionId")
        WorkflowDefinition getDefinitionById​(java.lang.String workflowDefinitionId)
        Gets a Workflow Definition by unique Id
        Parameters:
        workflowDefinitionId - the workflow definition id
        Returns:
        the deployed workflow definition (or null if not found)
      • getDefinitionByName

        @Auditable(parameters="workflowName")
        WorkflowDefinition getDefinitionByName​(java.lang.String workflowName)
        Gets the latest Workflow Definition by unique name
        Parameters:
        workflowName - workflow name e.g. activiti$activitiReview
        Returns:
        the deployed workflow definition (or null if not found)
      • getAllDefinitionsByName

        @Auditable(parameters="workflowName")
        java.util.List<WorkflowDefinition> getAllDefinitionsByName​(java.lang.String workflowName)
        Gets all (including previous) Workflow Definitions for the given unique name
        Parameters:
        workflowName - workflow name e.g. activiti$activitiReview
        Returns:
        the deployed workflow definition (or null if not found)
      • getDefinitionImage

        @Auditable(parameters="workflowDefinitionId")
        byte[] getDefinitionImage​(java.lang.String workflowDefinitionId)
        Gets a graphical view of the Workflow Definition
        Parameters:
        workflowDefinitionId - the workflow definition id
        Returns:
        image view of the workflow definition
      • getTaskDefinitions

        @Auditable(parameters="workflowDefinitionId")
        java.util.List<WorkflowTaskDefinition> getTaskDefinitions​(java.lang.String workflowDefinitionId)
        Gets the Task Definitions for the given Workflow Definition
        Parameters:
        workflowDefinitionId - the workflow definition id
        Returns:
        the deployed task definitions (or null if not found)
      • startWorkflow

        @Auditable(parameters={"workflowDefinitionId","parameters"})
        WorkflowPath startWorkflow​(java.lang.String workflowDefinitionId,
                                   java.util.Map<org.alfresco.service.namespace.QName,​java.io.Serializable> parameters)
        Start a Workflow Instance
        Parameters:
        workflowDefinitionId - the workflow definition id
        parameters - the initial set of parameters used to populate the "Start Task" properties
        Returns:
        the initial workflow path
      • startWorkflowFromTemplate

        @Auditable(parameters="templateDefinition")
        WorkflowPath startWorkflowFromTemplate​(org.alfresco.service.cmr.repository.NodeRef templateDefinition)
        Start a Workflow Instance from an existing "Start Task" template node held in the Repository. The node must be of the Type as described in the Workflow Definition.
        Parameters:
        templateDefinition - the node representing the Start Task properties
        Returns:
        the initial workflow path
      • getActiveWorkflows

        @Auditable(parameters="workflowDefinitionId")
        java.util.List<WorkflowInstance> getActiveWorkflows​(java.lang.String workflowDefinitionId)
        Gets all active workflow instances of the specified Workflow Definition
        Parameters:
        workflowDefinitionId - the workflow definition id
        Returns:
        the list of "in-flight" workflow instances
      • getCompletedWorkflows

        @Auditable(parameters="workflowDefinitionId")
        java.util.List<WorkflowInstance> getCompletedWorkflows​(java.lang.String workflowDefinitionId)
        Gets all completed workflow instances of the specified Workflow Definition
        Parameters:
        workflowDefinitionId - the workflow definition id
        Returns:
        the list of "in-flight" workflow instances
        Since:
        3.4
      • getWorkflows

        @Auditable(parameters="workflowDefinitionId")
        java.util.List<WorkflowInstance> getWorkflows​(java.lang.String workflowDefinitionId)
        Gets all workflow instances (both active and completed) of the specified Workflow Definition
        Parameters:
        workflowDefinitionId - the workflow definition id
        Returns:
        the list of "in-flight" workflow instances
        Since:
        3.4
      • getWorkflows

        java.util.List<WorkflowInstance> getWorkflows​(WorkflowInstanceQuery workflowInstanceQuery)
        Gets all "in-flight" workflow instances according to the specified workflowInstanceQuery parameter
        Parameters:
        workflowInstanceQuery - WorkflowInstanceQuery
      • getWorkflows

        java.util.List<WorkflowInstance> getWorkflows​(WorkflowInstanceQuery workflowInstanceQuery,
                                                      int maxItems,
                                                      int skipCount)
        Gets maxItems "in-flight" workflow instances according to the specified workflowInstanceQuery parameter Get maxItems and skipCount parameters form request
        Parameters:
        workflowInstanceQuery - WorkflowInstanceQuery
        maxItems - int
        skipCount - int
        Returns:
        maxItems workflow instances
      • countWorkflows

        long countWorkflows​(WorkflowInstanceQuery workflowInstanceQuery)
        Get count of workflow instances
        Parameters:
        workflowInstanceQuery - WorkflowInstanceQuery
        Returns:
        count of workflow instances
      • getActiveWorkflows

        @Auditable
        java.util.List<WorkflowInstance> getActiveWorkflows()
        Gets all active workflow instances.
        Returns:
        the list of "in-flight" workflow instances
        Since:
        4.0
      • getCompletedWorkflows

        @Auditable
        java.util.List<WorkflowInstance> getCompletedWorkflows()
        Gets all completed workflow instances.
        Returns:
        the list of "in-flight" workflow instances
        Since:
        4.0
      • getWorkflows

        java.util.List<WorkflowInstance> getWorkflows()
        Gets all workflow instances (both active and completed).
        Returns:
        the list of "in-flight" workflow instances
        Since:
        4.0
      • getWorkflowById

        @Auditable(parameters="workflowId")
        WorkflowInstance getWorkflowById​(java.lang.String workflowId)
        Gets a specific workflow instances
        Parameters:
        workflowId - the id of the workflow to retrieve
        Returns:
        the workflow instance (or null if not found)
      • getWorkflowPaths

        @Auditable(parameters="workflowId")
        java.util.List<WorkflowPath> getWorkflowPaths​(java.lang.String workflowId)
        Gets all Paths for the specified Workflow instance. NOTE: It only returns information for an active Workflow instance.
        Parameters:
        workflowId - workflow instance id
        Returns:
        the list of workflow paths
      • getPathProperties

        @Auditable(parameters="pathId")
        java.util.Map<org.alfresco.service.namespace.QName,​java.io.Serializable> getPathProperties​(java.lang.String pathId)
        Gets the properties associated with the specified path (and parent paths)
        Parameters:
        pathId - workflow path id
        Returns:
        map of path properties
      • cancelWorkflow

        @Auditable(parameters="workflowId")
        WorkflowInstance cancelWorkflow​(java.lang.String workflowId)
        Cancel an "in-flight" Workflow instance
        Parameters:
        workflowId - the workflow instance to cancel
        Returns:
        an updated representation of the workflow instance
      • cancelWorkflows

        @Auditable(parameters="workflowIds")
        java.util.List<WorkflowInstance> cancelWorkflows​(java.util.List<java.lang.String> workflowIds)
        Cancel a batch of "in-flight" Workflow instances
        Parameters:
        workflowIds - List of the workflow instances to cancel
        Returns:
        List of updated representations of the workflow instances
      • deleteWorkflow

        @Auditable(parameters="workflowId")
        WorkflowInstance deleteWorkflow​(java.lang.String workflowId)
        Delete a Workflow instance. NOTE: This will force a delete, meaning that the workflow instance may not go through all the appropriate cancel events.
        Parameters:
        workflowId - the workflow instance to cancel
        Returns:
        an updated representation of the workflow instance
      • signal

        @Auditable(parameters={"pathId","transitionId"})
        WorkflowPath signal​(java.lang.String pathId,
                            java.lang.String transitionId)
        Signal the transition from one Workflow Node to another
        Parameters:
        pathId - the workflow path to signal on
        transitionId - the transition id to follow (or null, for the default transition)
        Returns:
        the updated workflow path
      • fireEvent

        @Auditable(parameters={"pathId","event"})
        WorkflowPath fireEvent​(java.lang.String pathId,
                               java.lang.String event)
        Fire custom event against specified path
        Parameters:
        pathId - the workflow path to fire event on
        event - name of event
        Returns:
        workflow path (it may have been updated as a result of firing the event
      • getTasksForWorkflowPath

        @Auditable(parameters="pathId")
        java.util.List<WorkflowTask> getTasksForWorkflowPath​(java.lang.String pathId)
        Gets all Tasks associated with the specified path
        Parameters:
        pathId - the path id
        Returns:
        the list of associated tasks
      • getStartTask

        @Auditable(parameters="pathId")
        WorkflowTask getStartTask​(java.lang.String workflowInstanceId)
        Gets the start task instance for the given workflow instance.
        Parameters:
        workflowInstanceId - String
        Returns:
        WorkflowTask
      • getStartTasks

        @Auditable(parameters="pathIds")
        java.util.List<WorkflowTask> getStartTasks​(java.util.List<java.lang.String> workflowInstanceIds,
                                                   boolean sameSession)
        Gets the start task instances for the given workflow instances.
        Parameters:
        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.
      • hasWorkflowImage

        @Auditable(parameters="workflowInstanceId")
        boolean hasWorkflowImage​(java.lang.String workflowInstanceId)
        Determines if a graphical view of the workflow instance exists
        Parameters:
        workflowInstanceId - the workflow instance id
        Returns:
        true if there is a workflow instance diagram available
        Since:
        4.0
      • getWorkflowImage

        @Auditable(parameters="workflowInstanceId",
                   recordReturnedObject=false)
        java.io.InputStream getWorkflowImage​(java.lang.String workflowInstanceId)
        Gets a graphical view of the workflow instance
        Parameters:
        workflowInstanceId - the workflow instance id
        Returns:
        image view of the workflow instance as an InputStream or null if a diagram is not available
        Since:
        4.0
      • getTimers

        @Auditable(parameters="workflowId")
        java.util.List<WorkflowTimer> getTimers​(java.lang.String workflowId)
        Gets all active timers for the specified workflow
        Returns:
        the list of active timers
      • getTaskById

        @Auditable(parameters="taskId")
        WorkflowTask getTaskById​(java.lang.String taskId)
        Gets a Task by unique Id
        Parameters:
        taskId - the task id
        Returns:
        the task (or null, if not found)
      • getAssignedTasks

        @Auditable(parameters={"authority","state","lazyInitialization"})
        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 to the underlying workflow-engine to allow returning WorkflowTasks which aren't fully initialized but will be when the required values are required. If true, the returned enities should be used inside of the transaction-boundaries of this service-call. If false, fully initialized entities are returned, just as with getAssignedTasks(String, WorkflowTaskState).
        It's a hint to the underlying workflow-engine and may be ignored by the actual implementation.
        Returns:
        the list of assigned tasks
      • getAssignedTasks

        @Auditable(parameters={"authority","state","lazy"})
        java.util.List<WorkflowTask> getAssignedTasks​(java.lang.String authority,
                                                      WorkflowTaskState state)
        Gets all tasks assigned to the specified authority
        Parameters:
        authority - the authority
        state - filter by specified workflow task state
        Returns:
        the list of assigned tasks
      • getPooledTasks

        @Auditable(parameters="authority")
        java.util.List<WorkflowTask> getPooledTasks​(java.lang.String authority)
        Gets the pooled tasks available to the specified authority
        Parameters:
        authority - the authority
        Returns:
        the list of pooled tasks
      • getPooledTasks

        @Auditable(parameters="authority")
        java.util.List<WorkflowTask> getPooledTasks​(java.lang.String authority,
                                                    boolean lazyinitialization)
        Gets the pooled tasks available to the specified authority
        Parameters:
        authority - the authority
        lazyinitialization - hint to the underlying workflow-engine to allow returning WorkflowTasks which aren't fully initialized but will be when the required values are required. If true, the returned enities should be used inside of the transaction-boundaries of this service-call. If false, fully initialized entities are returned, just as with getPooledTasks(String).
        It's a hint to the underlying workflow-engine and may be ignored by the actual implementation.
        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

        @Auditable(parameters="query")
        java.util.List<WorkflowTask> queryTasks​(WorkflowTaskQuery query,
                                                boolean sameSession)
        Query for tasks
        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 workflowTaskQuery)
        Get the number of tasks matching the given query
        Parameters:
        workflowTaskQuery - the filter by which tasks are queried
        Returns:
        count of matching tasks
      • updateTask

        @Auditable(parameters={"taskId","properties","add","remove"})
        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
      • endTask

        @Auditable(parameters={"taskId","transitionId"})
        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
      • isTaskEditable

        @Auditable(parameters={"task","username"})
        boolean isTaskEditable​(WorkflowTask task,
                               java.lang.String username)
        Determines if the given user can edit the given task
        Parameters:
        task - The task to check
        username - The user to check
        Returns:
        true if the user can edit the task
        Since:
        3.4
      • isTaskEditable

        @Auditable(parameters={"task","username","refreshTask"})
        boolean isTaskEditable​(WorkflowTask task,
                               java.lang.String username,
                               boolean refreshTask)
        Determines if the given user can edit the given task
        Parameters:
        task - The task to check
        username - The user to check
        refreshTask - Whether or not to refresh the WorkflowTask before check is perfromed
        Returns:
        true if the user can edit the task
        Since:
        4.1
      • isTaskReassignable

        @Auditable(parameters={"task","username"})
        boolean isTaskReassignable​(WorkflowTask task,
                                   java.lang.String username)
        Determines if the given user can reassign the given task
        Parameters:
        task - The task to check
        username - The user to check
        Returns:
        true if the user can reassign the task
        Since:
        3.4
      • isTaskReassignable

        @Auditable(parameters={"task","username","refreshTask"})
        boolean isTaskReassignable​(WorkflowTask task,
                                   java.lang.String username,
                                   boolean refreshTask)
        Determines if the given user can reassign the given task
        Parameters:
        task - The task to check
        username - The user to check
        refreshTask - Whether or not to refresh the WorkflowTask before check is perfromed
        Returns:
        true if the user can reassign the task
        Since:
        4.1
      • isTaskClaimable

        @Auditable(parameters={"task","username"})
        boolean isTaskClaimable​(WorkflowTask task,
                                java.lang.String username)
        Determines if the given user can claim the given task
        Parameters:
        task - The task to check
        username - The user to check
        Returns:
        true if the user can claim the task
        Since:
        3.4
      • isTaskClaimable

        @Auditable(parameters={"task","username","refreshTask"})
        boolean isTaskClaimable​(WorkflowTask task,
                                java.lang.String username,
                                boolean refreshTask)
        Determines if the given user can claim the given task
        Parameters:
        task - The task to check
        username - The user to check
        refreshTask - Whether or not to refresh the WorkflowTask before check is perfromed
        Returns:
        true if the user can claim the task
        Since:
        4.1
      • isTaskReleasable

        @Auditable(parameters={"task","username"})
        boolean isTaskReleasable​(WorkflowTask task,
                                 java.lang.String username)
        Determines if the given user can release the given task
        Parameters:
        task - The task to check
        username - The user to check
        Returns:
        true if the user can release the task
        Since:
        3.4
      • isTaskReleasable

        @Auditable(parameters={"task","username","refreshTask"})
        boolean isTaskReleasable​(WorkflowTask task,
                                 java.lang.String username,
                                 boolean refreshTask)
        Determines if the given user can release the given task
        Parameters:
        task - The task to check
        username - The user to check
        refreshTask - Whether or not to refresh the WorkflowTask before check is perfromed
        Returns:
        true if the user can release the task
        Since:
        4.1
      • createPackage

        @Auditable(parameters="container")
        org.alfresco.service.cmr.repository.NodeRef createPackage​(org.alfresco.service.cmr.repository.NodeRef container)
        Create a Workflow Package (a container of content to route through the Workflow). If an existing container is supplied, it's supplemented with the workflow package aspect.
        Parameters:
        container - (optional) a pre-created container (e.g. folder, versioned folder or layered folder)
        Returns:
        the workflow package
      • getWorkflowsForContent

        @Auditable(parameters={"packageItem","active"})
        java.util.List<WorkflowInstance> getWorkflowsForContent​(org.alfresco.service.cmr.repository.NodeRef packageItem,
                                                                boolean active)
        Gets the Workflows that act upon the specified Repository content.
        Parameters:
        packageItem - the repository content item to get workflows for
        active - true => active workflows only, false => completed workflows only
        Returns:
        list of workflows which act upon the specified content
      • getPackageContents

        @Auditable(parameters={"packageItem","active"})
        java.util.List<org.alfresco.service.cmr.repository.NodeRef> getPackageContents​(java.lang.String taskId)
        Get a list of node refs to all the package contents for the given task id.
        Parameters:
        taskId - - the task id
        Returns:
        - A list of NodeRefs
      • getPackageContents

        @Auditable(parameters="packageRef")
        java.util.List<org.alfresco.service.cmr.repository.NodeRef> getPackageContents​(org.alfresco.service.cmr.repository.NodeRef packageRef)
        Get a list of node refs to all the package contents.
        Parameters:
        packageRef - the nodeRef to the package
        Returns:
        A list of nodeRefs the package is referring to
      • isMultiTenantWorkflowDeploymentEnabled

        @Auditable
        boolean isMultiTenantWorkflowDeploymentEnabled()
        Returns:
        true, if all workflows (in workflowDeployers) have a copy deployed per tenant and workflows can be deployed in tenant. False when workflows are shared system-wide, regardless of the tenant context.