}
}
protected ProcessApplicationRegistration registerProcessApplication(CommandContext commandContext, DeploymentEntity deployment,
Set<String> additionalProcessKeysToRegisterFor) {
ProcessApplicationDeploymentBuilderImpl appDeploymentBuilder = (ProcessApplicationDeploymentBuilderImpl) deploymentBuilder;
final ProcessApplicationReference appReference = appDeploymentBuilder.getProcessApplicationReference();
// build set of deployment ids this process app should be registered for:
Set<String> deploymentsToRegister = new HashSet<String>(Collections.singleton(deployment.getId()));
if (appDeploymentBuilder.isResumePreviousVersions()) {
Set<String> processDefinitionKeys = new HashSet<String>();
List<ProcessDefinitionEntity> deployedProcesses = getDeployedProcesses(deployment);
for (ProcessDefinitionEntity deployedProcess : deployedProcesses) {
if (deployedProcess.getVersion() > 1) {