Class RepositoryServiceImpl

    • Constructor Detail

      • RepositoryServiceImpl

        public RepositoryServiceImpl()
    • Method Detail

      • deleteDeployment

        public void deleteDeployment​(java.lang.String deploymentId)
        Description copied from interface: RepositoryService
        Deletes the given deployment.
        Specified by:
        deleteDeployment in interface RepositoryService
        Parameters:
        deploymentId - id of the deployment, cannot be null.
      • deleteDeploymentCascade

        public void deleteDeploymentCascade​(java.lang.String deploymentId)
      • deleteDeployment

        public void deleteDeployment​(java.lang.String deploymentId,
                                     boolean cascade)
        Description copied from interface: RepositoryService
        Deletes the given deployment and cascade deletion to process instances, history process instances and jobs.
        Specified by:
        deleteDeployment in interface RepositoryService
        Parameters:
        deploymentId - id of the deployment, cannot be null.
      • getDeploymentResourceNames

        public java.util.List<java.lang.String> getDeploymentResourceNames​(java.lang.String deploymentId)
        Description copied from interface: RepositoryService
        Retrieves a list of deployment resources for the given deployment, ordered alphabetically.
        Specified by:
        getDeploymentResourceNames in interface RepositoryService
        Parameters:
        deploymentId - id of the deployment, cannot be null.
      • getResourceAsStream

        public java.io.InputStream getResourceAsStream​(java.lang.String deploymentId,
                                                       java.lang.String resourceName)
        Description copied from interface: RepositoryService
        Gives access to a deployment resource through a stream of bytes.
        Specified by:
        getResourceAsStream in interface RepositoryService
        Parameters:
        deploymentId - id of the deployment, cannot be null.
        resourceName - name of the resource, cannot be null.
      • changeDeploymentTenantId

        public void changeDeploymentTenantId​(java.lang.String deploymentId,
                                             java.lang.String newTenantId)
        Description copied from interface: RepositoryService
        EXPERIMENTAL FEATURE! Changes the tenant identifier of a deployment to match the given tenant identifier. This change will cascade to any related entity: - process definitions related to the deployment - process instances related to those process definitions - executions related to those process instances - tasks related to those process instances - jobs related to the process definitions and process instances This method can be used in the case that there was no tenant identifier set on the deployment or those entities before. This method can be used to remove a tenant identifier from the deployment and related entities (simply pass null). Important: no optimistic locking will be done while executing the tenant identifier change! This is an experimental feature, mainly because it WILL NOT work properly in a clustered environment without special care: suppose some process instance is in flight. The process definition is in the process definition cache. When a task or job is created when continuing the process instance, the process definition cache will be consulted to get the process definition and from it the tenant identifier. Since it's cached, it will not be the new tenant identifier. This method does clear the cache for this engineinstance , but it will not be cleared on other nodes in a cluster (unless using a shared process definition cache).
        Specified by:
        changeDeploymentTenantId in interface RepositoryService
        Parameters:
        deploymentId - The id of the deployment of which the tenant identifier will be changed.
        newTenantId - The new tenant identifier.
      • getBpmnModel

        public org.activiti.bpmn.model.BpmnModel getBpmnModel​(java.lang.String processDefinitionId)
        Description copied from interface: RepositoryService
        Returns the BpmnModel corresponding with the process definition with the provided process definition id. The BpmnModel is a pojo versions of the BPMN 2.0 xml and can be used to introspect the process definition using regular Java.
        Specified by:
        getBpmnModel in interface RepositoryService
      • getDeployedProcessDefinition

        public ProcessDefinition getDeployedProcessDefinition​(java.lang.String processDefinitionId)
      • suspendProcessDefinitionById

        public void suspendProcessDefinitionById​(java.lang.String processDefinitionId)
        Description copied from interface: RepositoryService
        Suspends the process definition with the given id. If a process definition is in state suspended, it will not be possible to start new process instances based on the process definition. Note: all the process instances of the process definition will still be active (ie. not suspended)!
        Specified by:
        suspendProcessDefinitionById in interface RepositoryService
      • suspendProcessDefinitionById

        public void suspendProcessDefinitionById​(java.lang.String processDefinitionId,
                                                 boolean suspendProcessInstances,
                                                 java.util.Date suspensionDate)
        Description copied from interface: RepositoryService
        Suspends the process definition with the given id. If a process definition is in state suspended, it will not be possible to start new process instances based on the process definition.
        Specified by:
        suspendProcessDefinitionById in interface RepositoryService
        suspendProcessInstances - If true, all the process instances of the provided process definition will be suspended too.
        suspensionDate - The date on which the process definition will be suspended. If null, the process definition is suspended immediately. Note: The job executor needs to be active to use this!
      • suspendProcessDefinitionByKey

        public void suspendProcessDefinitionByKey​(java.lang.String processDefinitionKey)
        Description copied from interface: RepositoryService
        Suspends the all process definitions with the given key (= id in the bpmn20.xml file). If a process definition is in state suspended, it will not be possible to start new process instances based on the process definition. Note: all the process instances of the process definition will still be active (ie. not suspended)!
        Specified by:
        suspendProcessDefinitionByKey in interface RepositoryService
      • suspendProcessDefinitionByKey

        public void suspendProcessDefinitionByKey​(java.lang.String processDefinitionKey,
                                                  boolean suspendProcessInstances,
                                                  java.util.Date suspensionDate)
        Description copied from interface: RepositoryService
        Suspends the all process definitions with the given key (= id in the bpmn20.xml file). If a process definition is in state suspended, it will not be possible to start new process instances based on the process definition.
        Specified by:
        suspendProcessDefinitionByKey in interface RepositoryService
        suspendProcessInstances - If true, all the process instances of the provided process definition will be suspended too.
        suspensionDate - The date on which the process definition will be suspended. If null, the process definition is suspended immediately. Note: The job executor needs to be active to use this!
      • activateProcessDefinitionById

        public void activateProcessDefinitionById​(java.lang.String processDefinitionId,
                                                  boolean activateProcessInstances,
                                                  java.util.Date activationDate)
        Description copied from interface: RepositoryService
        Activates the process definition with the given id.
        Specified by:
        activateProcessDefinitionById in interface RepositoryService
        activationDate - The date on which the process definition will be activated. If null, the process definition is activated immediately. Note: The job executor needs to be active to use this!
      • activateProcessDefinitionByKey

        public void activateProcessDefinitionByKey​(java.lang.String processDefinitionKey)
        Description copied from interface: RepositoryService
        Activates the process definition with the given key (=id in the bpmn20.xml file).
        Specified by:
        activateProcessDefinitionByKey in interface RepositoryService
      • activateProcessDefinitionByKey

        public void activateProcessDefinitionByKey​(java.lang.String processDefinitionKey,
                                                   boolean activateProcessInstances,
                                                   java.util.Date activationDate)
        Description copied from interface: RepositoryService
        Activates the process definition with the given key (=id in the bpmn20.xml file).
        Specified by:
        activateProcessDefinitionByKey in interface RepositoryService
        activationDate - The date on which the process definition will be activated. If null, the process definition is activated immediately. Note: The job executor needs to be active to use this!
      • getProcessModel

        public java.io.InputStream getProcessModel​(java.lang.String processDefinitionId)
        Description copied from interface: RepositoryService
        Gives access to a deployed process model, e.g., a BPMN 2.0 XML file, through a stream of bytes.
        Specified by:
        getProcessModel in interface RepositoryService
        Parameters:
        processDefinitionId - id of a ProcessDefinition, cannot be null.
      • saveModel

        public void saveModel​(Model model)
        Description copied from interface: RepositoryService
        Saves the model. If the model already existed, the model is updated otherwise a new model is created.
        Specified by:
        saveModel in interface RepositoryService
        Parameters:
        model - model to save, cannot be null.
      • deleteModel

        public void deleteModel​(java.lang.String modelId)
        Specified by:
        deleteModel in interface RepositoryService
        Parameters:
        modelId - id of model to delete, cannot be null. When an id is passed for an unexisting model, this operation is ignored.
      • addModelEditorSource

        public void addModelEditorSource​(java.lang.String modelId,
                                         byte[] bytes)
        Description copied from interface: RepositoryService
        Saves the model editor source for a model
        Specified by:
        addModelEditorSource in interface RepositoryService
        Parameters:
        modelId - id of model to delete, cannot be null. When an id is passed for an unexisting model, this operation is ignored.
      • addModelEditorSourceExtra

        public void addModelEditorSourceExtra​(java.lang.String modelId,
                                              byte[] bytes)
        Description copied from interface: RepositoryService
        Saves the model editor source extra for a model
        Specified by:
        addModelEditorSourceExtra in interface RepositoryService
        Parameters:
        modelId - id of model to delete, cannot be null. When an id is passed for an unexisting model, this operation is ignored.
      • getModelEditorSource

        public byte[] getModelEditorSource​(java.lang.String modelId)
        Description copied from interface: RepositoryService
        Returns the model editor source as a byte array
        Specified by:
        getModelEditorSource in interface RepositoryService
        Parameters:
        modelId - id of model
      • getModelEditorSourceExtra

        public byte[] getModelEditorSourceExtra​(java.lang.String modelId)
        Description copied from interface: RepositoryService
        Returns the model editor source extra as a byte array
        Specified by:
        getModelEditorSourceExtra in interface RepositoryService
        Parameters:
        modelId - id of model
      • addCandidateStarterUser

        public void addCandidateStarterUser​(java.lang.String processDefinitionId,
                                            java.lang.String userId)
        Description copied from interface: RepositoryService
        Authorizes a candidate user for a process definition.
        Specified by:
        addCandidateStarterUser in interface RepositoryService
        Parameters:
        processDefinitionId - id of the process definition, cannot be null.
        userId - id of the user involve, cannot be null.
      • addCandidateStarterGroup

        public void addCandidateStarterGroup​(java.lang.String processDefinitionId,
                                             java.lang.String groupId)
        Description copied from interface: RepositoryService
        Authorizes a candidate group for a process definition.
        Specified by:
        addCandidateStarterGroup in interface RepositoryService
        Parameters:
        processDefinitionId - id of the process definition, cannot be null.
        groupId - id of the group involve, cannot be null.
      • deleteCandidateStarterGroup

        public void deleteCandidateStarterGroup​(java.lang.String processDefinitionId,
                                                java.lang.String groupId)
        Description copied from interface: RepositoryService
        Removes the authorization of a candidate group for a process definition.
        Specified by:
        deleteCandidateStarterGroup in interface RepositoryService
        Parameters:
        processDefinitionId - id of the process definition, cannot be null.
        groupId - id of the group involve, cannot be null.
      • deleteCandidateStarterUser

        public void deleteCandidateStarterUser​(java.lang.String processDefinitionId,
                                               java.lang.String userId)
        Description copied from interface: RepositoryService
        Removes the authorization of a candidate user for a process definition.
        Specified by:
        deleteCandidateStarterUser in interface RepositoryService
        Parameters:
        processDefinitionId - id of the process definition, cannot be null.
        userId - id of the user involve, cannot be null.
      • validateProcess

        public java.util.List<org.activiti.validation.ValidationError> validateProcess​(org.activiti.bpmn.model.BpmnModel bpmnModel)
        Description copied from interface: RepositoryService
        Validates the given process definition against the rules for executing a process definition on the Activiti engine. To create such a BpmnModel from a String, following code may be used: XMLInputFactory xif = XMLInputFactory.newInstance(); InputStreamReader in = new InputStreamReader(new ByteArrayInputStream(myProcess.getBytes()), "UTF-8"); // Change to other streams for eg from classpath XMLStreamReader xtr = xif.createXMLStreamReader(in); bpmnModel = new BpmnXMLConverter().convertToBpmnModel(xtr);
        Specified by:
        validateProcess in interface RepositoryService