protected List<? extends ProcessDefinition> getDeployedProcesses(DeploymentEntity deployment) { List<? extends ProcessDefinition> deployedProcessDefinitions = deployment.getDeployedProcessDefinitions(); if (deployedProcessDefinitions == null) { // existing deployment CommandContext commandContext = Context.getCommandContext(); ProcessDefinitionManager manager = commandContext.getProcessDefinitionManager(); deployedProcessDefinitions = manager.findProcessDefinitionsByDeploymentId(deployment.getId()); } return deployedProcessDefinitions; }
protected List<ProcessDefinition> getDeployedProcessDefinitionArtifacts(DeploymentEntity deployment) { CommandContext commandContext = Context.getCommandContext(); // in case deployment was created by this command List<ProcessDefinition> entities = deployment.getDeployedProcessDefinitions(); if (entities == null) { String deploymentId = deployment.getId(); ProcessDefinitionManager manager = commandContext.getProcessDefinitionManager(); return manager.findProcessDefinitionsByDeploymentId(deploymentId); } return entities; }
protected List<? extends ProcessDefinition> getDeployedProcesses(DeploymentEntity deployment) { List<? extends ProcessDefinition> deployedProcessDefinitions = deployment.getDeployedProcessDefinitions(); if (deployedProcessDefinitions == null) { // existing deployment CommandContext commandContext = Context.getCommandContext(); ProcessDefinitionManager manager = commandContext.getProcessDefinitionManager(); deployedProcessDefinitions = manager.findProcessDefinitionsByDeploymentId(deployment.getId()); } return deployedProcessDefinitions; }
protected List<ProcessDefinition> getDeployedProcessDefinitionArtifacts(DeploymentEntity deployment) { CommandContext commandContext = Context.getCommandContext(); // in case deployment was created by this command List<ProcessDefinition> entities = deployment.getDeployedProcessDefinitions(); if (entities == null) { String deploymentId = deployment.getId(); ProcessDefinitionManager manager = commandContext.getProcessDefinitionManager(); return manager.findProcessDefinitionsByDeploymentId(deploymentId); } return entities; }
protected void scheduleProcessDefinitionActivation(CommandContext commandContext, DeploymentEntity deployment) { if (deploymentBuilder.getProcessDefinitionsActivationDate() != null) { RepositoryService repositoryService = commandContext.getProcessEngineConfiguration().getRepositoryService(); for (ProcessDefinition processDefinition: deployment.getDeployedProcessDefinitions()) { // If activation date is set, we first suspend all the process definition repositoryService .updateProcessDefinitionSuspensionState() .byProcessDefinitionId(processDefinition.getId()) .suspend(); // And we schedule an activation at the provided date repositoryService .updateProcessDefinitionSuspensionState() .byProcessDefinitionId(processDefinition.getId()) .executionDate(deploymentBuilder.getProcessDefinitionsActivationDate()) .activate(); } } }
protected void scheduleProcessDefinitionActivation(CommandContext commandContext, DeploymentEntity deployment) { if (deploymentBuilder.getProcessDefinitionsActivationDate() != null) { RepositoryService repositoryService = commandContext.getProcessEngineConfiguration().getRepositoryService(); for (ProcessDefinition processDefinition: deployment.getDeployedProcessDefinitions()) { // If activation date is set, we first suspend all the process definition repositoryService .updateProcessDefinitionSuspensionState() .byProcessDefinitionId(processDefinition.getId()) .suspend(); // And we schedule an activation at the provided date repositoryService .updateProcessDefinitionSuspensionState() .byProcessDefinitionId(processDefinition.getId()) .executionDate(deploymentBuilder.getProcessDefinitionsActivationDate()) .activate(); } } }
protected List<ProcessDefinition> getDeployedProcessDefinitionArtifacts(DeploymentEntity deployment) { CommandContext commandContext = Context.getCommandContext(); // in case deployment was created by this command List<ProcessDefinition> entities = deployment.getDeployedProcessDefinitions(); if (entities == null) { String deploymentId = deployment.getId(); ProcessDefinitionManager manager = commandContext.getProcessDefinitionManager(); return manager.findProcessDefinitionsByDeploymentId(deploymentId); } return entities; }
protected List<? extends ProcessDefinition> getDeployedProcesses(DeploymentEntity deployment) { List<? extends ProcessDefinition> deployedProcessDefinitions = deployment.getDeployedProcessDefinitions(); if (deployedProcessDefinitions == null) { // existing deployment CommandContext commandContext = Context.getCommandContext(); ProcessDefinitionManager manager = commandContext.getProcessDefinitionManager(); deployedProcessDefinitions = manager.findProcessDefinitionsByDeploymentId(deployment.getId()); } return deployedProcessDefinitions; }
protected void scheduleProcessDefinitionActivation(CommandContext commandContext, DeploymentEntity deployment) { if (deploymentBuilder.getProcessDefinitionsActivationDate() != null) { RepositoryService repositoryService = commandContext.getProcessEngineConfiguration().getRepositoryService(); for (ProcessDefinition processDefinition: deployment.getDeployedProcessDefinitions()) { // If activation date is set, we first suspend all the process definition repositoryService .updateProcessDefinitionSuspensionState() .byProcessDefinitionId(processDefinition.getId()) .suspend(); // And we schedule an activation at the provided date repositoryService .updateProcessDefinitionSuspensionState() .byProcessDefinitionId(processDefinition.getId()) .executionDate(deploymentBuilder.getProcessDefinitionsActivationDate()) .activate(); } } }