Search in sources :

Example 1 with ProcessApplicationDeploymentBuilderImpl

use of org.camunda.bpm.engine.impl.repository.ProcessApplicationDeploymentBuilderImpl in project camunda-bpm-platform by camunda.

the class DeployCmd method registerProcessApplication.

protected ProcessApplicationRegistration registerProcessApplication(CommandContext commandContext, DeploymentEntity deployment, Set<String> processKeysToRegisterFor) {
    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()) {
        if (ResumePreviousBy.RESUME_BY_PROCESS_DEFINITION_KEY.equals(appDeploymentBuilder.getResumePreviousVersionsBy())) {
            deploymentsToRegister.addAll(resumePreviousByProcessDefinitionKey(commandContext, deployment, processKeysToRegisterFor));
        } else if (ResumePreviousBy.RESUME_BY_DEPLOYMENT_NAME.equals(appDeploymentBuilder.getResumePreviousVersionsBy())) {
            deploymentsToRegister.addAll(resumePreviousByDeploymentName(commandContext, deployment));
        }
    }
    // register process application for deployments
    return new RegisterProcessApplicationCmd(deploymentsToRegister, appReference).execute(commandContext);
}
Also used : ProcessApplicationReference(org.camunda.bpm.application.ProcessApplicationReference) ProcessApplicationDeploymentBuilderImpl(org.camunda.bpm.engine.impl.repository.ProcessApplicationDeploymentBuilderImpl) HashSet(java.util.HashSet)

Aggregations

HashSet (java.util.HashSet)1 ProcessApplicationReference (org.camunda.bpm.application.ProcessApplicationReference)1 ProcessApplicationDeploymentBuilderImpl (org.camunda.bpm.engine.impl.repository.ProcessApplicationDeploymentBuilderImpl)1