Class WorkflowServiceImpl

  • All Implemented Interfaces:
    WorkflowService

    public class WorkflowServiceImpl
    extends java.lang.Object
    implements WorkflowService
    Default Alfresco Workflow Service whose implementation is backed by registered BPM Engine plug-in components.
    Author:
    davidc
    • Constructor Detail

      • WorkflowServiceImpl

        public WorkflowServiceImpl()
    • Method Detail

      • setTransactionService

        public void setTransactionService​(TransactionService transactionService)
        Parameters:
        transactionService - service that tells if the server is read-only or not
      • setAuthorityService

        public void setAuthorityService​(AuthorityService authorityService)
        Sets the Authority Service
        Parameters:
        authorityService - AuthorityService
      • setBPMEngineRegistry

        public void setBPMEngineRegistry​(BPMEngineRegistry registry)
        Sets the BPM Engine Registry
        Parameters:
        registry - bpm engine registry
      • setWorkflowAdminService

        public void setWorkflowAdminService​(WorkflowAdminService workflowAdminService)
        Parameters:
        workflowAdminService - the workflowAdminService to set
      • setWorkflowPackageComponent

        public void setWorkflowPackageComponent​(WorkflowPackageComponent workflowPackageComponent)
        Sets the Workflow Package Component
        Parameters:
        workflowPackageComponent - workflow package component
      • setNodeService

        public void setNodeService​(org.alfresco.service.cmr.repository.NodeService nodeService)
        Sets the Node Service
        Parameters:
        nodeService - NodeService
      • setContentService

        public void setContentService​(ContentService contentService)
        Sets the Content Service
        Parameters:
        contentService - ContentService
      • setDictionaryService

        public void setDictionaryService​(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)
        Set the dictionary service
        Parameters:
        dictionaryService - DictionaryService
      • setProtectedNodeService

        public void setProtectedNodeService​(org.alfresco.service.cmr.repository.NodeService protectedNodeService)
        Set the node service which applies permissions
        Parameters:
        protectedNodeService - NodeService
      • setWorkflowNotification

        public void setWorkflowNotification​(WorkflowNotificationUtils service)
        Set the workflow notification utils
        Parameters:
        service - workflow notification utils
      • setMaxAuthoritiesForPooledTasks

        public void setMaxAuthoritiesForPooledTasks​(int maxAuthoritiesForPooledTasks)
        Sets the maximum number of groups to check for pooled tasks. For performance reasons, this is limited to 100 by default.
        Parameters:
        maxAuthoritiesForPooledTasks - the limit to set. If this is less than or equal to zero then there is no limit.
      • setMaxPooledTasks

        public void setMaxPooledTasks​(int maxPooledTasks)
        Sets the maximum number of pooled tasks to return in a query. It may be necessary to limit this depending on UI limitations.
        Parameters:
        maxPooledTasks - the limit to set. If this is less than or equal to zero then there is no limit.
      • deployDefinition

        public WorkflowDeployment deployDefinition​(java.lang.String engineId,
                                                   java.io.InputStream workflowDefinition,
                                                   java.lang.String mimetype)
        Description copied from interface: WorkflowService
        Deploy a Workflow Definition to the Alfresco Repository
        Specified by:
        deployDefinition in interface WorkflowService
        Parameters:
        engineId - the bpm engine id
        workflowDefinition - the workflow definition
        mimetype - the mimetype of the workflow definition
        Returns:
        workflow deployment descriptor
      • deployDefinition

        public WorkflowDeployment deployDefinition​(java.lang.String engineId,
                                                   java.io.InputStream workflowDefinition,
                                                   java.lang.String mimetype,
                                                   java.lang.String name)
        Description copied from interface: WorkflowService
        Deploy a Workflow Definition to the Alfresco Repository
        Specified by:
        deployDefinition in interface WorkflowService
        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
      • isDefinitionDeployed

        public boolean isDefinitionDeployed​(org.alfresco.service.cmr.repository.NodeRef workflowDefinition)
        Description copied from interface: WorkflowService
        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.
        Specified by:
        isDefinitionDeployed in interface WorkflowService
        Parameters:
        workflowDefinition - the content object containing the definition
        Returns:
        true => already deployed
      • isDefinitionDeployed

        public boolean isDefinitionDeployed​(java.lang.String engineId,
                                            java.io.InputStream workflowDefinition,
                                            java.lang.String mimetype)
        Description copied from interface: WorkflowService
        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.
        Specified by:
        isDefinitionDeployed in interface WorkflowService
        Parameters:
        engineId - the bpm engine id
        workflowDefinition - the definition to check
        mimetype - the mimetype of the definition
        Returns:
        true => already deployed
      • deployDefinition

        public WorkflowDeployment deployDefinition​(org.alfresco.service.cmr.repository.NodeRef definitionContent)
        Description copied from interface: WorkflowService
        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.
        Specified by:
        deployDefinition in interface WorkflowService
        Parameters:
        definitionContent - the content object containing the definition
        Returns:
        workflow deployment descriptor
      • undeployDefinition

        public void undeployDefinition​(java.lang.String workflowDefinitionId)
        Description copied from interface: WorkflowService
        Undeploy an exisiting Workflow Definition TODO: Determine behaviour when "in-flight" workflow instances exist
        Specified by:
        undeployDefinition in interface WorkflowService
        Parameters:
        workflowDefinitionId - the id of the definition to undeploy
      • getDefinitionById

        public WorkflowDefinition getDefinitionById​(java.lang.String workflowDefinitionId)
        Description copied from interface: WorkflowService
        Gets a Workflow Definition by unique Id
        Specified by:
        getDefinitionById in interface WorkflowService
        Parameters:
        workflowDefinitionId - the workflow definition id
        Returns:
        the deployed workflow definition (or null if not found)
      • getDefinitionByName

        public WorkflowDefinition getDefinitionByName​(java.lang.String workflowName)
        Description copied from interface: WorkflowService
        Gets the latest Workflow Definition by unique name
        Specified by:
        getDefinitionByName in interface WorkflowService
        Parameters:
        workflowName - workflow name e.g. activiti$activitiReview
        Returns:
        the deployed workflow definition (or null if not found)
      • getAllDefinitionsByName

        public java.util.List<WorkflowDefinition> getAllDefinitionsByName​(java.lang.String workflowName)
        Description copied from interface: WorkflowService
        Gets all (including previous) Workflow Definitions for the given unique name
        Specified by:
        getAllDefinitionsByName in interface WorkflowService
        Parameters:
        workflowName - workflow name e.g. activiti$activitiReview
        Returns:
        the deployed workflow definition (or null if not found)
      • getDefinitionImage

        public byte[] getDefinitionImage​(java.lang.String workflowDefinitionId)
        Description copied from interface: WorkflowService
        Gets a graphical view of the Workflow Definition
        Specified by:
        getDefinitionImage in interface WorkflowService
        Parameters:
        workflowDefinitionId - the workflow definition id
        Returns:
        image view of the workflow definition
      • getTaskDefinitions

        public java.util.List<WorkflowTaskDefinition> getTaskDefinitions​(java.lang.String workflowDefinitionId)
        Description copied from interface: WorkflowService
        Gets the Task Definitions for the given Workflow Definition
        Specified by:
        getTaskDefinitions in interface WorkflowService
        Parameters:
        workflowDefinitionId - the workflow definition id
        Returns:
        the deployed task definitions (or null if not found)
      • startWorkflow

        public WorkflowPath startWorkflow​(java.lang.String workflowDefinitionId,
                                          java.util.Map<org.alfresco.service.namespace.QName,​java.io.Serializable> parameters)
        Description copied from interface: WorkflowService
        Start a Workflow Instance
        Specified by:
        startWorkflow in interface WorkflowService
        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

        public WorkflowPath startWorkflowFromTemplate​(org.alfresco.service.cmr.repository.NodeRef templateDefinition)
        Description copied from interface: WorkflowService
        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.
        Specified by:
        startWorkflowFromTemplate in interface WorkflowService
        Parameters:
        templateDefinition - the node representing the Start Task properties
        Returns:
        the initial workflow path
      • getActiveWorkflows

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

        public java.util.List<WorkflowInstance> getCompletedWorkflows​(java.lang.String workflowDefinitionId)
        Gets all completed workflow instances of the specified Workflow Definition
        Specified by:
        getCompletedWorkflows in interface WorkflowService
        Parameters:
        workflowDefinitionId - the workflow definition id
        Returns:
        the list of "in-flight" workflow instances
      • getWorkflows

        public java.util.List<WorkflowInstance> getWorkflows​(java.lang.String workflowDefinitionId)
        Gets all workflow instances (both active and completed) of the specified Workflow Definition
        Specified by:
        getWorkflows in interface WorkflowService
        Parameters:
        workflowDefinitionId - the workflow definition id
        Returns:
        the list of "in-flight" workflow instances
      • getWorkflows

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

        public long countWorkflows​(WorkflowInstanceQuery workflowInstanceQuery)
        Description copied from interface: WorkflowService
        Get count of workflow instances
        Specified by:
        countWorkflows in interface WorkflowService
        Parameters:
        workflowInstanceQuery - WorkflowInstanceQuery
        Returns:
        count of workflow instances
      • countTasks

        public long countTasks​(WorkflowTaskQuery workflowTaskQuery)
        Description copied from interface: WorkflowService
        Get the number of tasks matching the given query
        Specified by:
        countTasks in interface WorkflowService
        Parameters:
        workflowTaskQuery - the filter by which tasks are queried
        Returns:
        count of matching tasks
      • getWorkflows

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

        public WorkflowInstance getWorkflowById​(java.lang.String workflowId)
        Gets a specific workflow instances
        Specified by:
        getWorkflowById in interface WorkflowService
        Parameters:
        workflowId - the id of the workflow to retrieve
        Returns:
        the workflow instance (or null if not found)
      • getWorkflowPaths

        public java.util.List<WorkflowPath> getWorkflowPaths​(java.lang.String workflowId)
        Description copied from interface: WorkflowService
        Gets all Paths for the specified Workflow instance. NOTE: It only returns information for an active Workflow instance.
        Specified by:
        getWorkflowPaths in interface WorkflowService
        Parameters:
        workflowId - workflow instance id
        Returns:
        the list of workflow paths
      • getPathProperties

        public java.util.Map<org.alfresco.service.namespace.QName,​java.io.Serializable> getPathProperties​(java.lang.String pathId)
        Description copied from interface: WorkflowService
        Gets the properties associated with the specified path (and parent paths)
        Specified by:
        getPathProperties in interface WorkflowService
        Parameters:
        pathId - workflow path id
        Returns:
        map of path properties
      • cancelWorkflow

        public WorkflowInstance cancelWorkflow​(java.lang.String workflowId)
        Description copied from interface: WorkflowService
        Cancel an "in-flight" Workflow instance
        Specified by:
        cancelWorkflow in interface WorkflowService
        Parameters:
        workflowId - the workflow instance to cancel
        Returns:
        an updated representation of the workflow instance
      • cancelWorkflows

        public java.util.List<WorkflowInstance> cancelWorkflows​(java.util.List<java.lang.String> workflowIds)
        Description copied from interface: WorkflowService
        Cancel a batch of "in-flight" Workflow instances
        Specified by:
        cancelWorkflows in interface WorkflowService
        Parameters:
        workflowIds - List of the workflow instances to cancel
        Returns:
        List of updated representations of the workflow instances
      • setMultiTenantWorkflowDeploymentEnabled

        public void setMultiTenantWorkflowDeploymentEnabled​(boolean deployWorkflowsInTenant)
      • isMultiTenantWorkflowDeploymentEnabled

        public boolean isMultiTenantWorkflowDeploymentEnabled()
        Specified by:
        isMultiTenantWorkflowDeploymentEnabled in interface WorkflowService
        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.
      • deleteWorkflow

        public WorkflowInstance deleteWorkflow​(java.lang.String workflowId)
        Description copied from interface: WorkflowService
        Delete a Workflow instance. NOTE: This will force a delete, meaning that the workflow instance may not go through all the appropriate cancel events.
        Specified by:
        deleteWorkflow in interface WorkflowService
        Parameters:
        workflowId - the workflow instance to cancel
        Returns:
        an updated representation of the workflow instance
      • signal

        public WorkflowPath signal​(java.lang.String pathId,
                                   java.lang.String transition)
        Description copied from interface: WorkflowService
        Signal the transition from one Workflow Node to another
        Specified by:
        signal in interface WorkflowService
        Parameters:
        pathId - the workflow path to signal on
        transition - the transition id to follow (or null, for the default transition)
        Returns:
        the updated workflow path
      • fireEvent

        public WorkflowPath fireEvent​(java.lang.String pathId,
                                      java.lang.String event)
        Description copied from interface: WorkflowService
        Fire custom event against specified path
        Specified by:
        fireEvent in interface WorkflowService
        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
      • getTimers

        public java.util.List<WorkflowTimer> getTimers​(java.lang.String workflowId)
        Description copied from interface: WorkflowService
        Gets all active timers for the specified workflow
        Specified by:
        getTimers in interface WorkflowService
        Returns:
        the list of active timers
      • getTasksForWorkflowPath

        public java.util.List<WorkflowTask> getTasksForWorkflowPath​(java.lang.String pathId)
        Description copied from interface: WorkflowService
        Gets all Tasks associated with the specified path
        Specified by:
        getTasksForWorkflowPath in interface WorkflowService
        Parameters:
        pathId - the path id
        Returns:
        the list of associated tasks
      • getStartTask

        public WorkflowTask getStartTask​(java.lang.String workflowInstanceId)
        Gets the start task instance for the given workflow instance.
        Specified by:
        getStartTask in interface WorkflowService
        Parameters:
        workflowInstanceId - String
        Returns:
        WorkflowTask
      • getStartTasks

        public java.util.List<WorkflowTask> getStartTasks​(java.util.List<java.lang.String> workflowInstanceIds,
                                                          boolean sameSession)
        Description copied from interface: WorkflowService
        Gets the start task instances for the given workflow instances.
        Specified by:
        getStartTasks in interface WorkflowService
        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

        public boolean hasWorkflowImage​(java.lang.String workflowInstanceId)
        Description copied from interface: WorkflowService
        Determines if a graphical view of the workflow instance exists
        Specified by:
        hasWorkflowImage in interface WorkflowService
        Parameters:
        workflowInstanceId - the workflow instance id
        Returns:
        true if there is a workflow instance diagram available
      • getWorkflowImage

        public java.io.InputStream getWorkflowImage​(java.lang.String workflowInstanceId)
        Description copied from interface: WorkflowService
        Gets a graphical view of the workflow instance
        Specified by:
        getWorkflowImage in interface WorkflowService
        Parameters:
        workflowInstanceId - the workflow instance id
        Returns:
        image view of the workflow instance as an InputStream or null if a diagram is not available
      • getAssignedTasks

        public java.util.List<WorkflowTask> getAssignedTasks​(java.lang.String authority,
                                                             WorkflowTaskState state)
        Description copied from interface: WorkflowService
        Gets all tasks assigned to the specified authority
        Specified by:
        getAssignedTasks in interface WorkflowService
        Parameters:
        authority - the authority
        state - filter by specified workflow task state
        Returns:
        the list of assigned tasks
      • getAssignedTasks

        public java.util.List<WorkflowTask> getAssignedTasks​(java.lang.String authority,
                                                             WorkflowTaskState state,
                                                             boolean lazyInitialization)
        Description copied from interface: WorkflowService
        Gets all tasks assigned to the specified authority
        Specified by:
        getAssignedTasks in interface WorkflowService
        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 WorkflowService.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
      • getPooledTasks

        public java.util.List<WorkflowTask> getPooledTasks​(java.lang.String authority)
        Description copied from interface: WorkflowService
        Gets the pooled tasks available to the specified authority
        Specified by:
        getPooledTasks in interface WorkflowService
        Parameters:
        authority - the authority
        Returns:
        the list of pooled tasks
      • getPooledTasks

        public java.util.List<WorkflowTask> getPooledTasks​(java.lang.String authority,
                                                           boolean lazyinitialization)
        Description copied from interface: WorkflowService
        Gets the pooled tasks available to the specified authority
        Specified by:
        getPooledTasks in interface WorkflowService
        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 WorkflowService.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

        public java.util.List<WorkflowTask> queryTasks​(WorkflowTaskQuery query,
                                                       boolean sameSession)
        Description copied from interface: WorkflowService
        Query for tasks
        Specified by:
        queryTasks in interface WorkflowService
        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
      • updateTask

        public 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)
        Description copied from interface: WorkflowService
        Update the Properties and Associations of a Task
        Specified by:
        updateTask in interface WorkflowService
        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

        public WorkflowTask endTask​(java.lang.String taskId,
                                    java.lang.String transition)
        Description copied from interface: WorkflowService
        End the Task (i.e. complete the task)
        Specified by:
        endTask in interface WorkflowService
        Parameters:
        taskId - the task id to end
        transition - the task transition id to take on completion (or null, for the default transition)
        Returns:
        the updated task
      • isTaskEditable

        public boolean isTaskEditable​(WorkflowTask task,
                                      java.lang.String username)
        Description copied from interface: WorkflowService
        Determines if the given user can edit the given task
        Specified by:
        isTaskEditable in interface WorkflowService
        Parameters:
        task - The task to check
        username - The user to check
        Returns:
        true if the user can edit the task
      • isTaskEditable

        public boolean isTaskEditable​(WorkflowTask task,
                                      java.lang.String username,
                                      boolean refreshTask)
        Description copied from interface: WorkflowService
        Determines if the given user can edit the given task
        Specified by:
        isTaskEditable in interface WorkflowService
        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
      • isTaskReassignable

        public boolean isTaskReassignable​(WorkflowTask task,
                                          java.lang.String username)
        Description copied from interface: WorkflowService
        Determines if the given user can reassign the given task
        Specified by:
        isTaskReassignable in interface WorkflowService
        Parameters:
        task - The task to check
        username - The user to check
        Returns:
        true if the user can reassign the task
      • isTaskReassignable

        public boolean isTaskReassignable​(WorkflowTask task,
                                          java.lang.String username,
                                          boolean refreshTask)
        Description copied from interface: WorkflowService
        Determines if the given user can reassign the given task
        Specified by:
        isTaskReassignable in interface WorkflowService
        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
      • isTaskClaimable

        public boolean isTaskClaimable​(WorkflowTask task,
                                       java.lang.String username)
        Description copied from interface: WorkflowService
        Determines if the given user can claim the given task
        Specified by:
        isTaskClaimable in interface WorkflowService
        Parameters:
        task - The task to check
        username - The user to check
        Returns:
        true if the user can claim the task
      • isTaskClaimable

        public boolean isTaskClaimable​(WorkflowTask task,
                                       java.lang.String username,
                                       boolean refreshTask)
        Description copied from interface: WorkflowService
        Determines if the given user can claim the given task
        Specified by:
        isTaskClaimable in interface WorkflowService
        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
      • isTaskReleasable

        public boolean isTaskReleasable​(WorkflowTask task,
                                        java.lang.String username)
        Description copied from interface: WorkflowService
        Determines if the given user can release the given task
        Specified by:
        isTaskReleasable in interface WorkflowService
        Parameters:
        task - The task to check
        username - The user to check
        Returns:
        true if the user can release the task
      • isTaskReleasable

        public boolean isTaskReleasable​(WorkflowTask task,
                                        java.lang.String username,
                                        boolean refreshTask)
        Description copied from interface: WorkflowService
        Determines if the given user can release the given task
        Specified by:
        isTaskReleasable in interface WorkflowService
        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
      • getTaskById

        public WorkflowTask getTaskById​(java.lang.String taskId)
        Description copied from interface: WorkflowService
        Gets a Task by unique Id
        Specified by:
        getTaskById in interface WorkflowService
        Parameters:
        taskId - the task id
        Returns:
        the task (or null, if not found)
      • createPackage

        public org.alfresco.service.cmr.repository.NodeRef createPackage​(org.alfresco.service.cmr.repository.NodeRef container)
        Description copied from interface: WorkflowService
        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.
        Specified by:
        createPackage in interface WorkflowService
        Parameters:
        container - (optional) a pre-created container (e.g. folder, versioned folder or layered folder)
        Returns:
        the workflow package
      • getWorkflowsForContent

        public java.util.List<WorkflowInstance> getWorkflowsForContent​(org.alfresco.service.cmr.repository.NodeRef packageItem,
                                                                       boolean active)
        Description copied from interface: WorkflowService
        Gets the Workflows that act upon the specified Repository content.
        Specified by:
        getWorkflowsForContent in interface WorkflowService
        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

        public java.util.List<org.alfresco.service.cmr.repository.NodeRef> getPackageContents​(java.lang.String taskId)
        Description copied from interface: WorkflowService
        Get a list of node refs to all the package contents for the given task id.
        Specified by:
        getPackageContents in interface WorkflowService
        Parameters:
        taskId - - the task id
        Returns:
        - A list of NodeRefs
      • getPackageContents

        public java.util.List<org.alfresco.service.cmr.repository.NodeRef> getPackageContents​(org.alfresco.service.cmr.repository.NodeRef packageRef)
        Description copied from interface: WorkflowService
        Get a list of node refs to all the package contents.
        Specified by:
        getPackageContents in interface WorkflowService
        Parameters:
        packageRef - the nodeRef to the package
        Returns:
        A list of nodeRefs the package is referring to