Package org.camunda.bpm.engine.impl.cmd
Class DeployCmd
java.lang.Object
org.camunda.bpm.engine.impl.cmd.DeployCmd
- All Implemented Interfaces:
Serializable
,Command<DeploymentWithDefinitions>
- Author:
- Tom Baeyens, Joram Barrez, Thorben Lindhauer, Daniel Meyer
- See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
acquireExclusiveLock
(CommandContext commandContext) protected void
addResources
(List<ResourceEntity> resources, DeploymentBuilderImpl deploymentBuilder) protected void
checkCreateAndReadDeployments
(CommandContext commandContext, Set<String> deploymentIds) protected void
checkDuplicateResourceName
(List<ResourceEntity> resources) protected void
createUserOperationLog
(DeploymentBuilderImpl deploymentBuilder, Deployment deployment, CommandContext commandContext) protected void
deploy
(CommandContext commandContext, DeploymentEntity deployment) protected DeploymentWithDefinitions
doExecute
(CommandContext commandContext) protected void
ensureDeploymentsWithIdsExists
(Set<String> expected, List<DeploymentEntity> actual) protected void
ensureResourcesWithIdsExist
(String deploymentId, Set<String> expectedIds, List<ResourceEntity> actual) protected void
ensureResourcesWithKeysExist
(String deploymentId, Set<String> expectedKeys, Map<String, ResourceEntity> actual, String valueProperty) protected void
ensureResourcesWithNamesExist
(String deploymentId, Set<String> expectedNames, List<ResourceEntity> actual) execute
(CommandContext commandContext) getAllDeploymentIds
(DeploymentBuilderImpl deploymentBuilder) protected List<? extends ProcessDefinition>
getDeployedProcesses
(CommandContext commandContext, DeploymentWithDefinitions deployment) getMissingElements
(Set<String> expected, Map<String, ?> actual) protected String[]
getProcessDefinitionsFromResources
(CommandContext commandContext, DeploymentEntity deploymentToRegister, Collection ignoredResources) protected List<ResourceEntity>
getResources
(DeploymentBuilderImpl deploymentBuilder, CommandContext commandContext) protected List<ResourceEntity>
getResourcesByDeploymentId
(Set<String> deploymentIds, CommandContext commandContext) protected List<ResourceEntity>
getResourcesById
(Map<String, Set<String>> resourcesById, CommandContext commandContext) protected List<ResourceEntity>
getResourcesByName
(Map<String, Set<String>> resourcesByName, CommandContext commandContext) protected DeploymentEntity
protected boolean
isBpmnResource
(Resource resourceEntity) protected boolean
isCmmnResource
(Resource resourceEntity) boolean
When CockroachDB is used, this command may be retried multiple times until it is successful, or the retries are exhausted.parseProcessDefinitionKeys
(Collection<Resource> resources) protected ProcessApplicationRegistration
registerProcessApplication
(CommandContext commandContext, DeploymentEntity deploymentToRegister, CandidateDeployment candidateDeployment, Collection ignoredResources) protected void
registerWithJobExecutor
(CommandContext commandContext, Deployment deployment) protected Map<String,
ResourceEntity> resolveResourcesToDeploy
(CommandContext commandContext, DeploymentEntity candidateDeployment) protected void
scheduleProcessDefinitionActivation
(CommandContext commandContext, DeploymentWithDefinitions deployment) protected void
setDeploymentName
(String deploymentId, DeploymentBuilderImpl deploymentBuilder, CommandContext commandContext)
-
Field Details
-
deploymentBuilder
-
deploymentHandler
-
-
Constructor Details
-
DeployCmd
-
-
Method Details
-
execute
- Specified by:
execute
in interfaceCommand<DeploymentWithDefinitions>
-
doExecute
-
acquireExclusiveLock
-
resolveResourcesToDeploy
protected Map<String,ResourceEntity> resolveResourcesToDeploy(CommandContext commandContext, DeploymentEntity candidateDeployment) -
deploy
-
scheduleProcessDefinitionActivation
protected void scheduleProcessDefinitionActivation(CommandContext commandContext, DeploymentWithDefinitions deployment) -
registerProcessApplication
protected ProcessApplicationRegistration registerProcessApplication(CommandContext commandContext, DeploymentEntity deploymentToRegister, CandidateDeployment candidateDeployment, Collection ignoredResources) -
registerWithJobExecutor
-
createUserOperationLog
protected void createUserOperationLog(DeploymentBuilderImpl deploymentBuilder, Deployment deployment, CommandContext commandContext) -
initDeployment
-
setDeploymentName
protected void setDeploymentName(String deploymentId, DeploymentBuilderImpl deploymentBuilder, CommandContext commandContext) -
addResources
protected void addResources(List<ResourceEntity> resources, DeploymentBuilderImpl deploymentBuilder) -
getMissingElements
-
getResources
protected List<ResourceEntity> getResources(DeploymentBuilderImpl deploymentBuilder, CommandContext commandContext) -
getResourcesByDeploymentId
protected List<ResourceEntity> getResourcesByDeploymentId(Set<String> deploymentIds, CommandContext commandContext) -
getResourcesById
protected List<ResourceEntity> getResourcesById(Map<String, Set<String>> resourcesById, CommandContext commandContext) -
getResourcesByName
protected List<ResourceEntity> getResourcesByName(Map<String, Set<String>> resourcesByName, CommandContext commandContext) -
getDeployedProcesses
protected List<? extends ProcessDefinition> getDeployedProcesses(CommandContext commandContext, DeploymentWithDefinitions deployment) -
getProcessDefinitionsFromResources
protected String[] getProcessDefinitionsFromResources(CommandContext commandContext, DeploymentEntity deploymentToRegister, Collection ignoredResources) -
parseProcessDefinitionKeys
-
getAllDeploymentIds
-
checkDuplicateResourceName
-
checkCreateAndReadDeployments
protected void checkCreateAndReadDeployments(CommandContext commandContext, Set<String> deploymentIds) -
isBpmnResource
-
isCmmnResource
-
ensureDeploymentsWithIdsExists
-
ensureResourcesWithIdsExist
protected void ensureResourcesWithIdsExist(String deploymentId, Set<String> expectedIds, List<ResourceEntity> actual) -
ensureResourcesWithNamesExist
protected void ensureResourcesWithNamesExist(String deploymentId, Set<String> expectedNames, List<ResourceEntity> actual) -
ensureResourcesWithKeysExist
-
isRetryable
public boolean isRetryable()When CockroachDB is used, this command may be retried multiple times until it is successful, or the retries are exhausted. CockroachDB uses a stricter, SERIALIZABLE transaction isolation which ensures a serialized manner of transaction execution. A concurrent transaction that attempts to modify the same data as another transaction is required to abort, rollback and retry. This also makes our use-case of pessimistic locks redundant since we only use them as synchronization barriers, and not to lock actual data which would protect it from concurrent modifications. The Deploy command only executes internal code, so we are certain that a retry of a failed deployment will not impact user data, and may be performed multiple times.- Specified by:
isRetryable
in interfaceCommand<DeploymentWithDefinitions>
- Returns:
- true if the
CrdbTransactionRetryInterceptor
can make a transparent retry of this command upon failure with aCrdbTransactionRetryException
(only used when running on CockroachDB).
-