}
public Deployment execute(CommandContext commandContext) {
acquireExclusiveLock(commandContext);
DeploymentEntity deployment = initDeployment();
Map<String, ResourceEntity> resourcesToDeploy = resolveResourcesToDeploy(commandContext, deployment);
Map<String, ResourceEntity> resourcesToIgnore = new HashMap<String, ResourceEntity>(deployment.getResources());
resourcesToIgnore.keySet().removeAll(resourcesToDeploy.keySet());
if (!resourcesToDeploy.isEmpty()) {
log.fine("Creating new deployment.");
deployment.setResources(resourcesToDeploy);
deploy(deployment);
} else {
log.fine("Using existing deployment.");
deployment = getExistingDeployment(commandContext, deployment.getName());
}
scheduleProcessDefinitionActivation(commandContext, deployment);
if(deploymentBuilder instanceof ProcessApplicationDeploymentBuilder) {