Package org.flowable.engine.impl
Class RepositoryServiceImpl
java.lang.Object
org.flowable.common.engine.impl.service.CommonServiceImpl<C>
org.flowable.common.engine.impl.service.CommonEngineServiceImpl<ProcessEngineConfigurationImpl>
org.flowable.engine.impl.RepositoryServiceImpl
- All Implemented Interfaces:
RepositoryService
public class RepositoryServiceImpl
extends CommonEngineServiceImpl<ProcessEngineConfigurationImpl>
implements RepositoryService
- Author:
- Tom Baeyens, Falko Menge, Joram Barrez
-
Field Summary
Fields inherited from class org.flowable.common.engine.impl.service.CommonEngineServiceImpl
commandExecutorFields inherited from class org.flowable.common.engine.impl.service.CommonServiceImpl
configuration -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactivateProcessDefinitionById(String processDefinitionId) Activates the process definition with the given id.voidactivateProcessDefinitionById(String processDefinitionId, boolean activateProcessInstances, Date activationDate) Activates the process definition with the given id.voidactivateProcessDefinitionByKey(String processDefinitionKey) Activates the process definition with the given key (=id in the bpmn20.xml file).voidactivateProcessDefinitionByKey(String processDefinitionKey, boolean activateProcessInstances, Date activationDate) Activates the process definition with the given key (=id in the bpmn20.xml file).voidactivateProcessDefinitionByKey(String processDefinitionKey, boolean activateProcessInstances, Date activationDate, String tenantId) Similar toRepositoryService.activateProcessDefinitionByKey(String, boolean, Date), but only applicable for the given tenant identifier.voidactivateProcessDefinitionByKey(String processDefinitionKey, String tenantId) Similar toRepositoryService.activateProcessDefinitionByKey(String), but only applicable for the given tenant identifier.voidaddCandidateStarterGroup(String processDefinitionId, String groupId) Authorizes a candidate group for a process definition.voidaddCandidateStarterUser(String processDefinitionId, String userId) Authorizes a candidate user for a process definition.voidaddModelEditorSource(String modelId, byte[] bytes) Saves the model editor source for a modelvoidaddModelEditorSourceExtra(String modelId, byte[] bytes) Saves the model editor source extra for a modelvoidchangeDeploymentParentDeploymentId(String deploymentId, String newParentDeploymentId) Changes the parent deployment id of a deployment.voidchangeDeploymentTenantId(String deploymentId, String newTenantId) EXPERIMENTAL FEATURE! Changes the tenant identifier of a deployment to match the given tenant identifier.voidchangeDeploymentTenantId(String deploymentId, String newTenantId, DeploymentMergeStrategy deploymentMergeStrategy) EXPERIMENTAL FEATURE! See more usage informationRepositoryService.changeDeploymentTenantId(String, String)voidchangeDeploymentTenantId(String deploymentId, String newTenantId, MergeMode mergeMode) EXPERIMENTAL FEATURE! See more usage informationRepositoryService.changeDeploymentTenantId(String, String)Starts creating a new deploymentQuery deployment.Query models.Returns a newNativeQueryfor deployment.Returns a newNativeQueryfor process definitions.Returns a newNativeQueryfor process definitions.Query process definitions.voiddeleteCandidateStarterGroup(String processDefinitionId, String groupId) Removes the authorization of a candidate group for a process definition.voiddeleteCandidateStarterUser(String processDefinitionId, String userId) Removes the authorization of a candidate user for a process definition.voiddeleteDeployment(String deploymentId) Deletes the given deployment.voiddeleteDeployment(String deploymentId, boolean cascade) Deletes the given deployment and cascade deletion to process instances, history process instances and jobs.voiddeleteDeploymentCascade(String deploymentId) voiddeleteModel(String modelId) deploy(DeploymentBuilderImpl deploymentBuilder) getAppResourceModel(String deploymentId) Returns the app model object (.app file) for a deployment.getAppResourceObject(String deploymentId) Returns the app resource object (.app file) for a deployment.getBpmnModel(String processDefinitionId) Returns theBpmnModelcorresponding with the process definition with the provided process definition id.getDecisionsForProcessDefinition(String processDefinitionId) Retrieves theDmnDecisions associated with the given process definition.getDeployedProcessDefinition(String processDefinitionId) getDeploymentResourceNames(String deploymentId) Retrieves a list of deployment resources for the given deployment, ordered alphabetically.getFormDefinitionsForProcessDefinition(String processDefinitionId) Retrieves theFormDefinitions associated with the given process definition.getIdentityLinksForProcessDefinition(String processDefinitionId) Retrieves theIdentityLinks associated with the given process definition.Returns theModelbyte[]getModelEditorSource(String modelId) Returns the model editor source as a byte arraybyte[]getModelEditorSourceExtra(String modelId) Returns the model editor source extra as a byte arraygetProcessDefinition(String processDefinitionId) Returns theProcessDefinitionincluding all BPMN information like additional Properties (e.g.getProcessDiagram(String processDefinitionId) Gives access to a deployed process diagram, e.g., a PNG image, through a stream of bytes.getProcessDiagramLayout(String processDefinitionId) Provides positions and dimensions of elements in a process diagram as provided byRepositoryService.getProcessDiagram(String).getProcessModel(String processDefinitionId) Gives access to a deployed process model, e.g., a BPMN 2.0 XML file, through a stream of bytes.getResourceAsStream(String deploymentId, String resourceName) Gives access to a deployment resource through a stream of bytes.isFlowable5ProcessDefinition(String processDefinitionId) Checks if the process definition should be executed by the V5 engine.booleanisProcessDefinitionSuspended(String processDefinitionId) Checks if the process definition is suspended.newModel()Creates a new model.voidSaves the model.voidsetDeploymentCategory(String deploymentId, String category) Sets the category of the deployment.voidsetDeploymentKey(String deploymentId, String key) Sets the key of the deployment.voidsetProcessDefinitionCategory(String processDefinitionId, String category) Sets the category of the process definition.voidsuspendProcessDefinitionById(String processDefinitionId) Suspends the process definition with the given id.voidsuspendProcessDefinitionById(String processDefinitionId, boolean suspendProcessInstances, Date suspensionDate) Suspends the process definition with the given id.voidsuspendProcessDefinitionByKey(String processDefinitionKey) Suspends the all process definitions with the given key (= id in the bpmn20.xml file).voidsuspendProcessDefinitionByKey(String processDefinitionKey, boolean suspendProcessInstances, Date suspensionDate) Suspends the all process definitions with the given key (= id in the bpmn20.xml file).voidsuspendProcessDefinitionByKey(String processDefinitionKey, boolean suspendProcessInstances, Date suspensionDate, String tenantId) Similar toRepositoryService.suspendProcessDefinitionByKey(String, boolean, Date), but only applicable for the given tenant identifier.voidsuspendProcessDefinitionByKey(String processDefinitionKey, String tenantId) Similar toRepositoryService.suspendProcessDefinitionByKey(String), but only applicable for the given tenant identifier.validateProcess(BpmnModel bpmnModel) Validates the given process definition against the rules for executing a process definition on the process engine.Methods inherited from class org.flowable.common.engine.impl.service.CommonEngineServiceImpl
getCommandExecutor, setCommandExecutorMethods inherited from class org.flowable.common.engine.impl.service.CommonServiceImpl
getConfiguration
-
Constructor Details
-
RepositoryServiceImpl
public RepositoryServiceImpl()
-
-
Method Details
-
createDeployment
Description copied from interface:RepositoryServiceStarts creating a new deployment- Specified by:
createDeploymentin interfaceRepositoryService
-
deploy
-
deleteDeployment
Description copied from interface:RepositoryServiceDeletes the given deployment.- Specified by:
deleteDeploymentin interfaceRepositoryService- Parameters:
deploymentId- id of the deployment, cannot be null.
-
deleteDeploymentCascade
-
deleteDeployment
Description copied from interface:RepositoryServiceDeletes the given deployment and cascade deletion to process instances, history process instances and jobs.- Specified by:
deleteDeploymentin interfaceRepositoryService- Parameters:
deploymentId- id of the deployment, cannot be null.
-
setDeploymentCategory
Description copied from interface:RepositoryServiceSets the category of the deployment. Deployments can be queried by category: seeDeploymentQuery.deploymentCategory(String).- Specified by:
setDeploymentCategoryin interfaceRepositoryService
-
setDeploymentKey
Description copied from interface:RepositoryServiceSets the key of the deployment. Deployments can be queried by key: seeDeploymentQuery.deploymentKey(String).- Specified by:
setDeploymentKeyin interfaceRepositoryService
-
changeDeploymentParentDeploymentId
Description copied from interface:RepositoryServiceChanges the parent deployment id of a deployment. This is used to move deployments to a different app deployment parent.- Specified by:
changeDeploymentParentDeploymentIdin interfaceRepositoryService- Parameters:
deploymentId- The id of the deployment of which the parent deployment identifier will be changed.newParentDeploymentId- The new parent deployment identifier.
-
createProcessDefinitionQuery
Description copied from interface:RepositoryServiceQuery process definitions.- Specified by:
createProcessDefinitionQueryin interfaceRepositoryService
-
createNativeProcessDefinitionQuery
Description copied from interface:RepositoryServiceReturns a newNativeQueryfor process definitions.- Specified by:
createNativeProcessDefinitionQueryin interfaceRepositoryService
-
getDeploymentResourceNames
Description copied from interface:RepositoryServiceRetrieves a list of deployment resources for the given deployment, ordered alphabetically.- Specified by:
getDeploymentResourceNamesin interfaceRepositoryService- Parameters:
deploymentId- id of the deployment, cannot be null.
-
getResourceAsStream
Description copied from interface:RepositoryServiceGives access to a deployment resource through a stream of bytes.- Specified by:
getResourceAsStreamin interfaceRepositoryService- Parameters:
deploymentId- id of the deployment, cannot be null.resourceName- name of the resource, cannot be null.
-
changeDeploymentTenantId
Description copied from interface:RepositoryServiceEXPERIMENTAL 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:
changeDeploymentTenantIdin interfaceRepositoryService- Parameters:
deploymentId- The id of the deployment of which the tenant identifier will be changed.newTenantId- The new tenant identifier.
-
changeDeploymentTenantId
Description copied from interface:RepositoryServiceEXPERIMENTAL FEATURE! See more usage informationRepositoryService.changeDeploymentTenantId(String, String)- Specified by:
changeDeploymentTenantIdin interfaceRepositoryService- Parameters:
deploymentId- The id of the deployment of which the tenant identifier will be changed.newTenantId- The new tenant identifier.mergeMode- Mode which is used to merge the deployment into the new tenant, in case the second tenant already has the same deployment key
-
changeDeploymentTenantId
public void changeDeploymentTenantId(String deploymentId, String newTenantId, DeploymentMergeStrategy deploymentMergeStrategy) Description copied from interface:RepositoryServiceEXPERIMENTAL FEATURE! See more usage informationRepositoryService.changeDeploymentTenantId(String, String)- Specified by:
changeDeploymentTenantIdin interfaceRepositoryService- Parameters:
deploymentId- The id of the deployment of which the tenant identifier will be changed.newTenantId- The new tenant identifier.deploymentMergeStrategy- Strategy to be used to merge the deployment into the new tenant, in case the second tenant already has this deployment key
-
createDeploymentQuery
Description copied from interface:RepositoryServiceQuery deployment.- Specified by:
createDeploymentQueryin interfaceRepositoryService
-
createNativeDeploymentQuery
Description copied from interface:RepositoryServiceReturns a newNativeQueryfor deployment.- Specified by:
createNativeDeploymentQueryin interfaceRepositoryService
-
getProcessDefinition
Description copied from interface:RepositoryServiceReturns theProcessDefinitionincluding all BPMN information like additional Properties (e.g. documentation).- Specified by:
getProcessDefinitionin interfaceRepositoryService
-
isFlowable5ProcessDefinition
Description copied from interface:RepositoryServiceChecks if the process definition should be executed by the V5 engine.- Specified by:
isFlowable5ProcessDefinitionin interfaceRepositoryService
-
getBpmnModel
Description copied from interface:RepositoryServiceReturns theBpmnModelcorresponding with the process definition with the provided process definition id. TheBpmnModelis a pojo versions of the BPMN 2.0 xml and can be used to introspect the process definition using regular Java.- Specified by:
getBpmnModelin interfaceRepositoryService
-
getDeployedProcessDefinition
-
isProcessDefinitionSuspended
Description copied from interface:RepositoryServiceChecks if the process definition is suspended.- Specified by:
isProcessDefinitionSuspendedin interfaceRepositoryService
-
suspendProcessDefinitionById
Description copied from interface:RepositoryServiceSuspends 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:
suspendProcessDefinitionByIdin interfaceRepositoryService
-
suspendProcessDefinitionById
public void suspendProcessDefinitionById(String processDefinitionId, boolean suspendProcessInstances, Date suspensionDate) Description copied from interface:RepositoryServiceSuspends 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:
suspendProcessDefinitionByIdin interfaceRepositoryServicesuspendProcessInstances- 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
Description copied from interface:RepositoryServiceSuspends 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:
suspendProcessDefinitionByKeyin interfaceRepositoryService
-
suspendProcessDefinitionByKey
public void suspendProcessDefinitionByKey(String processDefinitionKey, boolean suspendProcessInstances, Date suspensionDate) Description copied from interface:RepositoryServiceSuspends 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:
suspendProcessDefinitionByKeyin interfaceRepositoryServicesuspendProcessInstances- 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
Description copied from interface:RepositoryServiceSimilar toRepositoryService.suspendProcessDefinitionByKey(String), but only applicable for the given tenant identifier.- Specified by:
suspendProcessDefinitionByKeyin interfaceRepositoryService
-
suspendProcessDefinitionByKey
public void suspendProcessDefinitionByKey(String processDefinitionKey, boolean suspendProcessInstances, Date suspensionDate, String tenantId) Description copied from interface:RepositoryServiceSimilar toRepositoryService.suspendProcessDefinitionByKey(String, boolean, Date), but only applicable for the given tenant identifier.- Specified by:
suspendProcessDefinitionByKeyin interfaceRepositoryService
-
activateProcessDefinitionById
Description copied from interface:RepositoryServiceActivates the process definition with the given id.- Specified by:
activateProcessDefinitionByIdin interfaceRepositoryService
-
activateProcessDefinitionById
public void activateProcessDefinitionById(String processDefinitionId, boolean activateProcessInstances, Date activationDate) Description copied from interface:RepositoryServiceActivates the process definition with the given id.- Specified by:
activateProcessDefinitionByIdin interfaceRepositoryServiceactivationDate- 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
Description copied from interface:RepositoryServiceActivates the process definition with the given key (=id in the bpmn20.xml file).- Specified by:
activateProcessDefinitionByKeyin interfaceRepositoryService
-
activateProcessDefinitionByKey
public void activateProcessDefinitionByKey(String processDefinitionKey, boolean activateProcessInstances, Date activationDate) Description copied from interface:RepositoryServiceActivates the process definition with the given key (=id in the bpmn20.xml file).- Specified by:
activateProcessDefinitionByKeyin interfaceRepositoryServiceactivationDate- 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
Description copied from interface:RepositoryServiceSimilar toRepositoryService.activateProcessDefinitionByKey(String), but only applicable for the given tenant identifier.- Specified by:
activateProcessDefinitionByKeyin interfaceRepositoryService
-
activateProcessDefinitionByKey
public void activateProcessDefinitionByKey(String processDefinitionKey, boolean activateProcessInstances, Date activationDate, String tenantId) Description copied from interface:RepositoryServiceSimilar toRepositoryService.activateProcessDefinitionByKey(String, boolean, Date), but only applicable for the given tenant identifier.- Specified by:
activateProcessDefinitionByKeyin interfaceRepositoryService
-
setProcessDefinitionCategory
Description copied from interface:RepositoryServiceSets the category of the process definition. Process definitions can be queried by category: seeProcessDefinitionQuery.processDefinitionCategory(String).- Specified by:
setProcessDefinitionCategoryin interfaceRepositoryService
-
getProcessModel
Description copied from interface:RepositoryServiceGives access to a deployed process model, e.g., a BPMN 2.0 XML file, through a stream of bytes.- Specified by:
getProcessModelin interfaceRepositoryService- Parameters:
processDefinitionId- id of aProcessDefinition, cannot be null.
-
getProcessDiagram
Description copied from interface:RepositoryServiceGives access to a deployed process diagram, e.g., a PNG image, through a stream of bytes.- Specified by:
getProcessDiagramin interfaceRepositoryService- Parameters:
processDefinitionId- id of aProcessDefinition, cannot be null.- Returns:
- null when the diagram resource name of a
ProcessDefinitionis null.
-
getProcessDiagramLayout
Description copied from interface:RepositoryServiceProvides positions and dimensions of elements in a process diagram as provided byRepositoryService.getProcessDiagram(String). This method requires a process model and a diagram image to be deployed.- Specified by:
getProcessDiagramLayoutin interfaceRepositoryService- Parameters:
processDefinitionId- id of aProcessDefinition, cannot be null.- Returns:
- DiagramLayout instance containing diagram info, null when the input stream of a process diagram is null.
-
getAppResourceObject
Description copied from interface:RepositoryServiceReturns the app resource object (.app file) for a deployment.- Specified by:
getAppResourceObjectin interfaceRepositoryService
-
getAppResourceModel
Description copied from interface:RepositoryServiceReturns the app model object (.app file) for a deployment.- Specified by:
getAppResourceModelin interfaceRepositoryService
-
newModel
Description copied from interface:RepositoryServiceCreates a new model. The model is transient and must be saved usingRepositoryService.saveModel(Model).- Specified by:
newModelin interfaceRepositoryService
-
saveModel
Description copied from interface:RepositoryServiceSaves the model. If the model already existed, the model is updated otherwise a new model is created.- Specified by:
saveModelin interfaceRepositoryService- Parameters:
model- model to save, cannot be null.
-
deleteModel
- Specified by:
deleteModelin interfaceRepositoryService- Parameters:
modelId- id of model to delete, cannot be null. When an id is passed for a non-existent model, this operation is ignored.
-
addModelEditorSource
Description copied from interface:RepositoryServiceSaves the model editor source for a model- Specified by:
addModelEditorSourcein interfaceRepositoryService- Parameters:
modelId- id of model to delete, cannot be null. When an id is passed for a non-existent model, this operation is ignored.
-
addModelEditorSourceExtra
Description copied from interface:RepositoryServiceSaves the model editor source extra for a model- Specified by:
addModelEditorSourceExtrain interfaceRepositoryService- Parameters:
modelId- id of model to delete, cannot be null. When an id is passed for an unexisting model, this operation is ignored.
-
createModelQuery
Description copied from interface:RepositoryServiceQuery models.- Specified by:
createModelQueryin interfaceRepositoryService
-
createNativeModelQuery
Description copied from interface:RepositoryServiceReturns a newNativeQueryfor process definitions.- Specified by:
createNativeModelQueryin interfaceRepositoryService
-
getModel
Description copied from interface:RepositoryServiceReturns theModel- Specified by:
getModelin interfaceRepositoryService- Parameters:
modelId- id of model
-
getModelEditorSource
Description copied from interface:RepositoryServiceReturns the model editor source as a byte array- Specified by:
getModelEditorSourcein interfaceRepositoryService- Parameters:
modelId- id of model
-
getModelEditorSourceExtra
Description copied from interface:RepositoryServiceReturns the model editor source extra as a byte array- Specified by:
getModelEditorSourceExtrain interfaceRepositoryService- Parameters:
modelId- id of model
-
addCandidateStarterUser
Description copied from interface:RepositoryServiceAuthorizes a candidate user for a process definition.- Specified by:
addCandidateStarterUserin interfaceRepositoryService- Parameters:
processDefinitionId- id of the process definition, cannot be null.userId- id of the user involve, cannot be null.
-
addCandidateStarterGroup
Description copied from interface:RepositoryServiceAuthorizes a candidate group for a process definition.- Specified by:
addCandidateStarterGroupin interfaceRepositoryService- Parameters:
processDefinitionId- id of the process definition, cannot be null.groupId- id of the group involve, cannot be null.
-
deleteCandidateStarterGroup
Description copied from interface:RepositoryServiceRemoves the authorization of a candidate group for a process definition.- Specified by:
deleteCandidateStarterGroupin interfaceRepositoryService- Parameters:
processDefinitionId- id of the process definition, cannot be null.groupId- id of the group involve, cannot be null.
-
deleteCandidateStarterUser
Description copied from interface:RepositoryServiceRemoves the authorization of a candidate user for a process definition.- Specified by:
deleteCandidateStarterUserin interfaceRepositoryService- Parameters:
processDefinitionId- id of the process definition, cannot be null.userId- id of the user involve, cannot be null.
-
getIdentityLinksForProcessDefinition
Description copied from interface:RepositoryServiceRetrieves theIdentityLinks associated with the given process definition. Such anIdentityLinkinforms how a certain identity (eg. group or user) is authorized for a certain process definition- Specified by:
getIdentityLinksForProcessDefinitionin interfaceRepositoryService
-
validateProcess
Description copied from interface:RepositoryServiceValidates the given process definition against the rules for executing a process definition on the process engine. To create such aBpmnModelfrom 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:
validateProcessin interfaceRepositoryService
-
getDecisionsForProcessDefinition
Description copied from interface:RepositoryServiceRetrieves theDmnDecisions associated with the given process definition.- Specified by:
getDecisionsForProcessDefinitionin interfaceRepositoryService- Parameters:
processDefinitionId- id of the process definition, cannot be null.
-
getFormDefinitionsForProcessDefinition
Description copied from interface:RepositoryServiceRetrieves theFormDefinitions associated with the given process definition.- Specified by:
getFormDefinitionsForProcessDefinitionin interfaceRepositoryService- Parameters:
processDefinitionId- id of the process definition, cannot be null.
-