Class DeploymentBuilderImpl
- java.lang.Object
-
- org.camunda.bpm.engine.impl.repository.DeploymentBuilderImpl
-
- All Implemented Interfaces:
java.io.Serializable,DeploymentBuilder
- Direct Known Subclasses:
ProcessApplicationDeploymentBuilderImpl
public class DeploymentBuilderImpl extends java.lang.Object implements DeploymentBuilder, java.io.Serializable
- Author:
- Tom Baeyens, Joram Barrez
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected booleandeployChangedOnlyprotected DeploymentEntitydeploymentprotected java.util.Map<java.lang.String,java.util.Set<java.lang.String>>deploymentResourcesByIdprotected java.util.Map<java.lang.String,java.util.Set<java.lang.String>>deploymentResourcesByNameprotected java.util.Set<java.lang.String>deploymentsprotected booleanisDuplicateFilterEnabledprotected java.lang.StringnameFromDeploymentprotected java.util.DateprocessDefinitionsActivationDateprotected RepositoryServiceImplrepositoryService
-
Constructor Summary
Constructors Constructor Description DeploymentBuilderImpl(RepositoryServiceImpl repositoryService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DeploymentBuilderactivateProcessDefinitionsOn(java.util.Date date)Sets the date on which the process definitions contained in this deployment will be activated.protected DeploymentBuilderaddBytes(java.lang.String resourceName, byte[] bytes)DeploymentBuilderaddClasspathResource(java.lang.String resource)DeploymentBuilderaddDeploymentResourceById(java.lang.String deploymentId, java.lang.String resourceId)A given resource specified by id and deployment id will be added to the new deployment to re-deploy the given resource.DeploymentBuilderaddDeploymentResourceByName(java.lang.String deploymentId, java.lang.String resourceName)A given resource specified by name and deployment id will be added to the new deployment to re-deploy the given resource.DeploymentBuilderaddDeploymentResources(java.lang.String deploymentId)All existing resources contained by the given deployment will be added to the new deployment to re-deploy them.DeploymentBuilderaddDeploymentResourcesById(java.lang.String deploymentId, java.util.List<java.lang.String> resourceIds)All given resources specified by id and deployment id will be added to the new deployment to re-deploy the given resource.DeploymentBuilderaddDeploymentResourcesByName(java.lang.String deploymentId, java.util.List<java.lang.String> resourceNames)All given resources specified by name and deployment id will be added to the new deployment to re-deploy the given resource.DeploymentBuilderaddInputStream(java.lang.String resourceName, java.io.InputStream inputStream)DeploymentBuilderaddModelInstance(java.lang.String resourceName, BpmnModelInstance modelInstance)Adds a BPMN model to the deployment.DeploymentBuilderaddModelInstance(java.lang.String resourceName, CmmnModelInstance modelInstance)Adds a CMMN model to the deployment.DeploymentBuilderaddModelInstance(java.lang.String resourceName, DmnModelInstance modelInstance)Adds a DMN model to the deployment.DeploymentBuilderaddString(java.lang.String resourceName, java.lang.String text)DeploymentBuilderaddZipInputStream(java.util.zip.ZipInputStream zipInputStream)Deploymentdeploy()Deploys all provided sources to the process engine and returns the created deployment.DeploymentWithDefinitionsdeployWithResult()Deploys all provided sources to the process engine and returns the created deployment with the deployed definitions.DeploymentBuilderenableDuplicateFiltering()If set, this deployment will be compared to any previous deployment.DeploymentBuilderenableDuplicateFiltering(boolean deployChangedOnly)Check the resources for duplicates in the set of previous deployments with same deployment source.DeploymentEntitygetDeployment()java.util.Map<java.lang.String,java.util.Set<java.lang.String>>getDeploymentResourcesById()java.util.Map<java.lang.String,java.util.Set<java.lang.String>>getDeploymentResourcesByName()java.util.Set<java.lang.String>getDeployments()java.lang.StringgetNameFromDeployment()java.util.DategetProcessDefinitionsActivationDate()java.util.Collection<java.lang.String>getResourceNames()booleanisDeployChangedOnly()booleanisDuplicateFilterEnabled()DeploymentBuildername(java.lang.String name)Gives the deployment the given name.DeploymentBuildernameFromDeployment(java.lang.String deploymentId)Sets the deployment id to retrieve the deployment name from it.DeploymentBuildersource(java.lang.String source)Sets the source of a deployment.DeploymentBuildertenantId(java.lang.String tenantId)Sets the tenant id of a deployment.
-
-
-
Field Detail
-
repositoryService
protected transient RepositoryServiceImpl repositoryService
-
deployment
protected DeploymentEntity deployment
-
isDuplicateFilterEnabled
protected boolean isDuplicateFilterEnabled
-
deployChangedOnly
protected boolean deployChangedOnly
-
processDefinitionsActivationDate
protected java.util.Date processDefinitionsActivationDate
-
nameFromDeployment
protected java.lang.String nameFromDeployment
-
deployments
protected java.util.Set<java.lang.String> deployments
-
deploymentResourcesById
protected java.util.Map<java.lang.String,java.util.Set<java.lang.String>> deploymentResourcesById
-
deploymentResourcesByName
protected java.util.Map<java.lang.String,java.util.Set<java.lang.String>> deploymentResourcesByName
-
-
Constructor Detail
-
DeploymentBuilderImpl
public DeploymentBuilderImpl(RepositoryServiceImpl repositoryService)
-
-
Method Detail
-
addInputStream
public DeploymentBuilder addInputStream(java.lang.String resourceName, java.io.InputStream inputStream)
- Specified by:
addInputStreamin interfaceDeploymentBuilder
-
addClasspathResource
public DeploymentBuilder addClasspathResource(java.lang.String resource)
- Specified by:
addClasspathResourcein interfaceDeploymentBuilder
-
addString
public DeploymentBuilder addString(java.lang.String resourceName, java.lang.String text)
- Specified by:
addStringin interfaceDeploymentBuilder
-
addModelInstance
public DeploymentBuilder addModelInstance(java.lang.String resourceName, CmmnModelInstance modelInstance)
Description copied from interface:DeploymentBuilderAdds a CMMN model to the deployment.- Specified by:
addModelInstancein interfaceDeploymentBuilder- Parameters:
resourceName- resource name. See suffix requirements for resource names: {@see DeploymentBuilder}.modelInstance- model instance- Returns:
-
addModelInstance
public DeploymentBuilder addModelInstance(java.lang.String resourceName, BpmnModelInstance modelInstance)
Description copied from interface:DeploymentBuilderAdds a BPMN model to the deployment.- Specified by:
addModelInstancein interfaceDeploymentBuilder- Parameters:
resourceName- resource name. See suffix requirements for resource names: {@see DeploymentBuilder}.modelInstance- model instance- Returns:
-
addModelInstance
public DeploymentBuilder addModelInstance(java.lang.String resourceName, DmnModelInstance modelInstance)
Description copied from interface:DeploymentBuilderAdds a DMN model to the deployment.- Specified by:
addModelInstancein interfaceDeploymentBuilder- Parameters:
resourceName- resource name. See suffix requirements for resource names: {@see DeploymentBuilder}.modelInstance- model instance- Returns:
-
addBytes
protected DeploymentBuilder addBytes(java.lang.String resourceName, byte[] bytes)
-
addZipInputStream
public DeploymentBuilder addZipInputStream(java.util.zip.ZipInputStream zipInputStream)
- Specified by:
addZipInputStreamin interfaceDeploymentBuilder
-
addDeploymentResources
public DeploymentBuilder addDeploymentResources(java.lang.String deploymentId)
Description copied from interface:DeploymentBuilderAll existing resources contained by the given deployment will be added to the new deployment to re-deploy them.- Specified by:
addDeploymentResourcesin interfaceDeploymentBuilder
-
addDeploymentResourceById
public DeploymentBuilder addDeploymentResourceById(java.lang.String deploymentId, java.lang.String resourceId)
Description copied from interface:DeploymentBuilderA given resource specified by id and deployment id will be added to the new deployment to re-deploy the given resource.- Specified by:
addDeploymentResourceByIdin interfaceDeploymentBuilder
-
addDeploymentResourcesById
public DeploymentBuilder addDeploymentResourcesById(java.lang.String deploymentId, java.util.List<java.lang.String> resourceIds)
Description copied from interface:DeploymentBuilderAll given resources specified by id and deployment id will be added to the new deployment to re-deploy the given resource.- Specified by:
addDeploymentResourcesByIdin interfaceDeploymentBuilder
-
addDeploymentResourceByName
public DeploymentBuilder addDeploymentResourceByName(java.lang.String deploymentId, java.lang.String resourceName)
Description copied from interface:DeploymentBuilderA given resource specified by name and deployment id will be added to the new deployment to re-deploy the given resource.- Specified by:
addDeploymentResourceByNamein interfaceDeploymentBuilder
-
addDeploymentResourcesByName
public DeploymentBuilder addDeploymentResourcesByName(java.lang.String deploymentId, java.util.List<java.lang.String> resourceNames)
Description copied from interface:DeploymentBuilderAll given resources specified by name and deployment id will be added to the new deployment to re-deploy the given resource.- Specified by:
addDeploymentResourcesByNamein interfaceDeploymentBuilder
-
name
public DeploymentBuilder name(java.lang.String name)
Description copied from interface:DeploymentBuilderGives the deployment the given name.- Specified by:
namein interfaceDeploymentBuilder
-
nameFromDeployment
public DeploymentBuilder nameFromDeployment(java.lang.String deploymentId)
Description copied from interface:DeploymentBuilderSets the deployment id to retrieve the deployment name from it.- Specified by:
nameFromDeploymentin interfaceDeploymentBuilder
-
enableDuplicateFiltering
public DeploymentBuilder enableDuplicateFiltering()
Description copied from interface:DeploymentBuilderIf set, this deployment will be compared to any previous deployment. This means that every (non-generated) resource will be compared with the provided resources of this deployment. If any resource of this deployment is different to the existing resources, all resources are re-deployed.
Deprecated: use
DeploymentBuilder.enableDuplicateFiltering(boolean)- Specified by:
enableDuplicateFilteringin interfaceDeploymentBuilder
-
enableDuplicateFiltering
public DeploymentBuilder enableDuplicateFiltering(boolean deployChangedOnly)
Description copied from interface:DeploymentBuilderCheck the resources for duplicates in the set of previous deployments with same deployment source. If no resources have changed in this deployment, its contained resources are not deployed at all. For further configuration, use the parameterdeployChangedOnly.- Specified by:
enableDuplicateFilteringin interfaceDeploymentBuilder- Parameters:
deployChangedOnly- determines whether only those resources should be deployed that have changed from the previous versions of the deployment. If false, all of the resources are re-deployed if any resource differs.
-
activateProcessDefinitionsOn
public DeploymentBuilder activateProcessDefinitionsOn(java.util.Date date)
Description copied from interface:DeploymentBuilderSets the date on which the process definitions contained in this deployment will be activated. This means that all process definitions will be deployed as usual, but they will be suspended from the start until the given activation date.- Specified by:
activateProcessDefinitionsOnin interfaceDeploymentBuilder
-
source
public DeploymentBuilder source(java.lang.String source)
Description copied from interface:DeploymentBuilderSets the source of a deployment.
Furthermore if duplicate check of deployment resources is enabled (by calling
DeploymentBuilder.enableDuplicateFiltering(boolean)) then only previous deployments with the same given source are considered to perform the duplicate check.- Specified by:
sourcein interfaceDeploymentBuilder
-
tenantId
public DeploymentBuilder tenantId(java.lang.String tenantId)
Description copied from interface:DeploymentBuilderSets the tenant id of a deployment.- Specified by:
tenantIdin interfaceDeploymentBuilder
-
deploy
public Deployment deploy()
Description copied from interface:DeploymentBuilderDeploys all provided sources to the process engine and returns the created deployment.
The returned
Deploymentinstance has no information about the definitions, which are deployed with that deployment. To access this information you can use theDeploymentBuilder.deployWithResult()method. This method will return an instance ofDeploymentWithDefinitions, which contains the information about the successful deployed definitions.- Specified by:
deployin interfaceDeploymentBuilder- Returns:
- the created deployment
-
deployWithResult
public DeploymentWithDefinitions deployWithResult()
Description copied from interface:DeploymentBuilderDeploys all provided sources to the process engine and returns the created deployment with the deployed definitions.- Specified by:
deployWithResultin interfaceDeploymentBuilder- Returns:
- the created deployment, contains the deployed definitions
-
getResourceNames
public java.util.Collection<java.lang.String> getResourceNames()
- Specified by:
getResourceNamesin interfaceDeploymentBuilder- Returns:
- the names of the resources which were added to this builder.
-
getDeployment
public DeploymentEntity getDeployment()
-
isDuplicateFilterEnabled
public boolean isDuplicateFilterEnabled()
-
isDeployChangedOnly
public boolean isDeployChangedOnly()
-
getProcessDefinitionsActivationDate
public java.util.Date getProcessDefinitionsActivationDate()
-
getNameFromDeployment
public java.lang.String getNameFromDeployment()
-
getDeployments
public java.util.Set<java.lang.String> getDeployments()
-
getDeploymentResourcesById
public java.util.Map<java.lang.String,java.util.Set<java.lang.String>> getDeploymentResourcesById()
-
getDeploymentResourcesByName
public java.util.Map<java.lang.String,java.util.Set<java.lang.String>> getDeploymentResourcesByName()
-
-