Source:
public void deploy(DeploymentEntity deployment, Map<String, Object> deploymentSettings) { log.debug("Processing deployment {}", deployment.getName()); ParsedDeployment parsedDeployment = parsedDeploymentBuilderFactory .getBuilderForDeploymentAndSettings(deployment, deploymentSettings) .build(); bpmnDeploymentHelper.verifyProcessDefinitionsDoNotShareKeys(parsedDeployment.getAllProcessDefinitions()); bpmnDeploymentHelper.copyDeploymentValuesToProcessDefinitions( parsedDeployment.getDeployment(), parsedDeployment.getAllProcessDefinitions()); bpmnDeploymentHelper.setResourceNamesOnProcessDefinitions(parsedDeployment); createAndPersistNewDiagramsIfNeeded(parsedDeployment); setProcessDefinitionDiagramNames(parsedDeployment); if (deployment.isNew()) { Map<ProcessDefinitionEntity, ProcessDefinitionEntity> mapOfNewProcessDefinitionToPreviousVersion = getPreviousVersionsOfProcessDefinitions(parsedDeployment); setProcessDefinitionVersionsAndIds(parsedDeployment, mapOfNewProcessDefinitionToPreviousVersion); persistProcessDefinitionsAndAuthorizations(parsedDeployment); updateTimersAndEvents(parsedDeployment, mapOfNewProcessDefinitionToPreviousVersion); dispatchProcessDefinitionEntityInitializedEvent(parsedDeployment); } else { makeProcessDefinitionsConsistentWithPersistedVersions(parsedDeployment); } cachingAndArtifactsManager.updateCachingAndArtifacts(parsedDeployment); for (ProcessDefinitionEntity processDefinition : parsedDeployment.getAllProcessDefinitions()) { BpmnModel bpmnModel = parsedDeployment.getBpmnModelForProcessDefinition(processDefinition); createLocalizationValues(processDefinition.getId(), bpmnModel.getProcessById(processDefinition.getKey())); } }

Target:
public void deploy(DeploymentEntity deployment, Map<String, Object> deploymentSettings) { log.debug("Processing deployment {}", deployment.getName()); ParsedDeployment parsedDeployment = parsedDeploymentBuilderFactory .getBuilderForDeploymentAndSettings(deployment, deploymentSettings) .build(); bpmnDeploymentHelper.verifyProcessDefinitionsDoNotShareKeys(parsedDeployment.getAllProcessDefinitions()); bpmnDeploymentHelper.copyDeploymentValuesToProcessDefinitions( parsedDeployment.getDeployment(), parsedDeployment.getAllProcessDefinitions()); bpmnDeploymentHelper.setResourceNamesOnProcessDefinitions(parsedDeployment); setProcessDefinitionDiagramNames(parsedDeployment); if (deployment.isNew()) { Map<ProcessDefinitionEntity, ProcessDefinitionEntity> mapOfNewProcessDefinitionToPreviousVersion = getPreviousVersionsOfProcessDefinitions(parsedDeployment); setProcessDefinitionVersionsAndIds(parsedDeployment, mapOfNewProcessDefinitionToPreviousVersion); persistProcessDefinitionsAndAuthorizations(parsedDeployment); updateTimersAndEvents(parsedDeployment, mapOfNewProcessDefinitionToPreviousVersion); dispatchProcessDefinitionEntityInitializedEvent(parsedDeployment); } else { makeProcessDefinitionsConsistentWithPersistedVersions(parsedDeployment); } cachingAndArtifactsManager.updateCachingAndArtifacts(parsedDeployment); for (ProcessDefinitionEntity processDefinition : parsedDeployment.getAllProcessDefinitions()) { BpmnModel bpmnModel = parsedDeployment.getBpmnModelForProcessDefinition(processDefinition); createLocalizationValues(processDefinition.getId(), bpmnModel.getProcessById(processDefinition.getKey())); } }