Class DeploymentBuilderImpl
- java.lang.Object
-
- org.camunda.bpm.engine.impl.repository.DeploymentBuilderImpl
-
- All Implemented Interfaces:
Serializable
,DeploymentBuilder
- Direct Known Subclasses:
ProcessApplicationDeploymentBuilderImpl
public class DeploymentBuilderImpl extends Object implements DeploymentBuilder, Serializable
- Author:
- Tom Baeyens, Joram Barrez
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
deployChangedOnly
protected DeploymentEntity
deployment
protected Map<String,Set<String>>
deploymentResourcesById
protected Map<String,Set<String>>
deploymentResourcesByName
protected Set<String>
deployments
protected boolean
isDuplicateFilterEnabled
protected String
nameFromDeployment
protected Date
processDefinitionsActivationDate
protected RepositoryServiceImpl
repositoryService
-
Constructor Summary
Constructors Constructor Description DeploymentBuilderImpl(RepositoryServiceImpl repositoryService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DeploymentBuilder
activateProcessDefinitionsOn(Date date)
Sets the date on which the process definitions contained in this deployment will be activated.protected DeploymentBuilder
addBytes(String resourceName, byte[] bytes)
DeploymentBuilder
addClasspathResource(String resource)
DeploymentBuilder
addDeploymentResourceById(String deploymentId, String resourceId)
A given resource specified by id and deployment id will be added to the new deployment to re-deploy the given resource.DeploymentBuilder
addDeploymentResourceByName(String deploymentId, String resourceName)
A given resource specified by name and deployment id will be added to the new deployment to re-deploy the given resource.DeploymentBuilder
addDeploymentResources(String deploymentId)
All existing resources contained by the given deployment will be added to the new deployment to re-deploy them.DeploymentBuilder
addDeploymentResourcesById(String deploymentId, List<String> resourceIds)
All given resources specified by id and deployment id will be added to the new deployment to re-deploy the given resource.DeploymentBuilder
addDeploymentResourcesByName(String deploymentId, List<String> resourceNames)
All given resources specified by name and deployment id will be added to the new deployment to re-deploy the given resource.DeploymentBuilder
addInputStream(String resourceName, InputStream inputStream)
DeploymentBuilder
addModelInstance(String resourceName, BpmnModelInstance modelInstance)
Adds a BPMN model to the deployment.DeploymentBuilder
addModelInstance(String resourceName, CmmnModelInstance modelInstance)
Adds a CMMN model to the deployment.DeploymentBuilder
addModelInstance(String resourceName, DmnModelInstance modelInstance)
Adds a DMN model to the deployment.DeploymentBuilder
addString(String resourceName, String text)
DeploymentBuilder
addZipInputStream(ZipInputStream zipInputStream)
Deployment
deploy()
Deploys all provided sources to the process engine and returns the created deployment.DeploymentWithDefinitions
deployWithResult()
Deploys all provided sources to the process engine and returns the created deployment with the deployed definitions.DeploymentBuilder
enableDuplicateFiltering()
If set, this deployment will be compared to any previous deployment.DeploymentBuilder
enableDuplicateFiltering(boolean deployChangedOnly)
Check the resources for duplicates in the set of previous deployments with same deployment source.DeploymentEntity
getDeployment()
Map<String,Set<String>>
getDeploymentResourcesById()
Map<String,Set<String>>
getDeploymentResourcesByName()
Set<String>
getDeployments()
String
getNameFromDeployment()
Date
getProcessDefinitionsActivationDate()
Collection<String>
getResourceNames()
boolean
isDeployChangedOnly()
boolean
isDuplicateFilterEnabled()
DeploymentBuilder
name(String name)
Gives the deployment the given name.DeploymentBuilder
nameFromDeployment(String deploymentId)
Sets the deployment id to retrieve the deployment name from it.DeploymentBuilder
source(String source)
Sets the source of a deployment.DeploymentBuilder
tenantId(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 Date processDefinitionsActivationDate
-
nameFromDeployment
protected String nameFromDeployment
-
-
Constructor Detail
-
DeploymentBuilderImpl
public DeploymentBuilderImpl(RepositoryServiceImpl repositoryService)
-
-
Method Detail
-
addInputStream
public DeploymentBuilder addInputStream(String resourceName, InputStream inputStream)
- Specified by:
addInputStream
in interfaceDeploymentBuilder
-
addClasspathResource
public DeploymentBuilder addClasspathResource(String resource)
- Specified by:
addClasspathResource
in interfaceDeploymentBuilder
-
addString
public DeploymentBuilder addString(String resourceName, String text)
- Specified by:
addString
in interfaceDeploymentBuilder
-
addModelInstance
public DeploymentBuilder addModelInstance(String resourceName, CmmnModelInstance modelInstance)
Description copied from interface:DeploymentBuilder
Adds a CMMN model to the deployment.- Specified by:
addModelInstance
in interfaceDeploymentBuilder
- Parameters:
resourceName
- resource name. See suffix requirements for resource names: {@see DeploymentBuilder}.modelInstance
- model instance- Returns:
-
addModelInstance
public DeploymentBuilder addModelInstance(String resourceName, BpmnModelInstance modelInstance)
Description copied from interface:DeploymentBuilder
Adds a BPMN model to the deployment.- Specified by:
addModelInstance
in interfaceDeploymentBuilder
- Parameters:
resourceName
- resource name. See suffix requirements for resource names: {@see DeploymentBuilder}.modelInstance
- model instance- Returns:
-
addModelInstance
public DeploymentBuilder addModelInstance(String resourceName, DmnModelInstance modelInstance)
Description copied from interface:DeploymentBuilder
Adds a DMN model to the deployment.- Specified by:
addModelInstance
in interfaceDeploymentBuilder
- Parameters:
resourceName
- resource name. See suffix requirements for resource names: {@see DeploymentBuilder}.modelInstance
- model instance- Returns:
-
addBytes
protected DeploymentBuilder addBytes(String resourceName, byte[] bytes)
-
addZipInputStream
public DeploymentBuilder addZipInputStream(ZipInputStream zipInputStream)
- Specified by:
addZipInputStream
in interfaceDeploymentBuilder
-
addDeploymentResources
public DeploymentBuilder addDeploymentResources(String deploymentId)
Description copied from interface:DeploymentBuilder
All existing resources contained by the given deployment will be added to the new deployment to re-deploy them.- Specified by:
addDeploymentResources
in interfaceDeploymentBuilder
-
addDeploymentResourceById
public DeploymentBuilder addDeploymentResourceById(String deploymentId, String resourceId)
Description copied from interface:DeploymentBuilder
A given resource specified by id and deployment id will be added to the new deployment to re-deploy the given resource.- Specified by:
addDeploymentResourceById
in interfaceDeploymentBuilder
-
addDeploymentResourcesById
public DeploymentBuilder addDeploymentResourcesById(String deploymentId, List<String> resourceIds)
Description copied from interface:DeploymentBuilder
All given resources specified by id and deployment id will be added to the new deployment to re-deploy the given resource.- Specified by:
addDeploymentResourcesById
in interfaceDeploymentBuilder
-
addDeploymentResourceByName
public DeploymentBuilder addDeploymentResourceByName(String deploymentId, String resourceName)
Description copied from interface:DeploymentBuilder
A given resource specified by name and deployment id will be added to the new deployment to re-deploy the given resource.- Specified by:
addDeploymentResourceByName
in interfaceDeploymentBuilder
-
addDeploymentResourcesByName
public DeploymentBuilder addDeploymentResourcesByName(String deploymentId, List<String> resourceNames)
Description copied from interface:DeploymentBuilder
All given resources specified by name and deployment id will be added to the new deployment to re-deploy the given resource.- Specified by:
addDeploymentResourcesByName
in interfaceDeploymentBuilder
-
name
public DeploymentBuilder name(String name)
Description copied from interface:DeploymentBuilder
Gives the deployment the given name.- Specified by:
name
in interfaceDeploymentBuilder
-
nameFromDeployment
public DeploymentBuilder nameFromDeployment(String deploymentId)
Description copied from interface:DeploymentBuilder
Sets the deployment id to retrieve the deployment name from it.- Specified by:
nameFromDeployment
in interfaceDeploymentBuilder
-
enableDuplicateFiltering
public DeploymentBuilder enableDuplicateFiltering()
Description copied from interface:DeploymentBuilder
If 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:
enableDuplicateFiltering
in interfaceDeploymentBuilder
-
enableDuplicateFiltering
public DeploymentBuilder enableDuplicateFiltering(boolean deployChangedOnly)
Description copied from interface:DeploymentBuilder
Check 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:
enableDuplicateFiltering
in 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(Date date)
Description copied from interface:DeploymentBuilder
Sets 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:
activateProcessDefinitionsOn
in interfaceDeploymentBuilder
-
source
public DeploymentBuilder source(String source)
Description copied from interface:DeploymentBuilder
Sets 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:
source
in interfaceDeploymentBuilder
-
tenantId
public DeploymentBuilder tenantId(String tenantId)
Description copied from interface:DeploymentBuilder
Sets the tenant id of a deployment.- Specified by:
tenantId
in interfaceDeploymentBuilder
-
deploy
public Deployment deploy()
Description copied from interface:DeploymentBuilder
Deploys all provided sources to the process engine and returns the created deployment.
The returned
Deployment
instance 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:
deploy
in interfaceDeploymentBuilder
- Returns:
- the created deployment
-
deployWithResult
public DeploymentWithDefinitions deployWithResult()
Description copied from interface:DeploymentBuilder
Deploys all provided sources to the process engine and returns the created deployment with the deployed definitions.- Specified by:
deployWithResult
in interfaceDeploymentBuilder
- Returns:
- the created deployment, contains the deployed definitions
-
getResourceNames
public Collection<String> getResourceNames()
- Specified by:
getResourceNames
in 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 Date getProcessDefinitionsActivationDate()
-
getNameFromDeployment
public String getNameFromDeployment()
-
-