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
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidacquireExclusiveLock(CommandContext commandContext) protected voidaddResources(List<ResourceEntity> resources, DeploymentBuilderImpl deploymentBuilder) protected voidcheckCreateAndReadDeployments(CommandContext commandContext, Set<String> deploymentIds) protected voidcheckDuplicateResourceName(List<ResourceEntity> resources) protected voidcreateUserOperationLog(DeploymentBuilderImpl deploymentBuilder, Deployment deployment, CommandContext commandContext) protected voiddeploy(CommandContext commandContext, DeploymentEntity deployment) protected DeploymentWithDefinitionsdoExecute(CommandContext commandContext) protected voidensureDeploymentsWithIdsExists(Set<String> expected, List<DeploymentEntity> actual) protected voidensureResourcesWithIdsExist(String deploymentId, Set<String> expectedIds, List<ResourceEntity> actual) protected voidensureResourcesWithKeysExist(String deploymentId, Set<String> expectedKeys, Map<String, ResourceEntity> actual, String valueProperty) protected voidensureResourcesWithNamesExist(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 DeploymentEntityprotected booleanisBpmnResource(Resource resourceEntity) protected booleanisCmmnResource(Resource resourceEntity) booleanWhen CockroachDB is used, this command may be retried multiple times until it is successful, or the retries are exhausted.parseProcessDefinitionKeys(Collection<Resource> resources) protected ProcessApplicationRegistrationregisterProcessApplication(CommandContext commandContext, DeploymentEntity deploymentToRegister, CandidateDeployment candidateDeployment, Collection ignoredResources) protected voidregisterWithJobExecutor(CommandContext commandContext, Deployment deployment) protected Map<String,ResourceEntity> resolveResourcesToDeploy(CommandContext commandContext, DeploymentEntity candidateDeployment) protected voidscheduleProcessDefinitionActivation(CommandContext commandContext, DeploymentWithDefinitions deployment) protected voidsetDeploymentName(String deploymentId, DeploymentBuilderImpl deploymentBuilder, CommandContext commandContext)
-
Field Details
-
deploymentBuilder
-
deploymentHandler
-
-
Constructor Details
-
DeployCmd
-
-
Method Details
-
execute
- Specified by:
executein 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:
isRetryablein interfaceCommand<DeploymentWithDefinitions>- Returns:
- true if the
CrdbTransactionRetryInterceptorcan make a transparent retry of this command upon failure with aCrdbTransactionRetryException(only used when running on CockroachDB).
-