protected int getNumberOfActiveChildExecutionsForProcessInstance(ExecutionEntityManager executionEntityManager, String processInstanceId) { Collection<ExecutionEntity> executions = executionEntityManager.findChildExecutionsByProcessInstanceId(processInstanceId); int activeExecutions = 0; for (ExecutionEntity execution : executions) { if (execution.isActive() && !processInstanceId.equals(execution.getId())) { activeExecutions++; } } return activeExecutions; }
Collection<ExecutionEntity> allExecutions = executionEntityManager.findChildExecutionsByProcessInstanceId(execution.getProcessInstanceId()); Iterator<ExecutionEntity> executionIterator = allExecutions.iterator(); boolean oneExecutionCanReachGateway = false;
public Void execute(CommandContext commandContext) { // check that the new process definition is just another version of the same // process definition that the process instance is using ExecutionEntityManager executionManager = commandContext.getExecutionEntityManager(); ExecutionEntity processInstance = executionManager.findById(processInstanceId); if (processInstance == null) { throw new ActivitiObjectNotFoundException("No process instance found for id = '" + processInstanceId + "'.", ProcessInstance.class); } else if (!processInstance.isProcessInstanceType()) { throw new ActivitiIllegalArgumentException("A process instance id is required, but the provided id " + "'" + processInstanceId + "' " + "points to a child execution of process instance " + "'" + processInstance.getProcessInstanceId() + "'. " + "Please invoke the " + getClass().getSimpleName() + " with a root execution id."); } DeploymentManager deploymentCache = commandContext.getProcessEngineConfiguration().getDeploymentManager(); ProcessDefinition currentProcessDefinition = deploymentCache.findDeployedProcessDefinitionById(processInstance.getProcessDefinitionId()); ProcessDefinition newProcessDefinition = deploymentCache .findDeployedProcessDefinitionByKeyAndVersionAndTenantId(currentProcessDefinition.getKey(), processDefinitionVersion, currentProcessDefinition.getTenantId()); validateAndSwitchVersionOfExecution(commandContext, processInstance, newProcessDefinition); // switch the historic process instance to the new process definition version commandContext.getHistoryManager().recordProcessDefinitionChange(processInstanceId, newProcessDefinition.getId()); // switch all sub-executions of the process instance to the new process definition version Collection<ExecutionEntity> childExecutions = executionManager.findChildExecutionsByProcessInstanceId(processInstanceId); for (ExecutionEntity executionEntity : childExecutions) { validateAndSwitchVersionOfExecution(commandContext, executionEntity, newProcessDefinition); } return null; }
List<ExecutionEntity> processInstanceExecutions = executionEntityManager.findChildExecutionsByProcessInstanceId(execution.getProcessInstanceId()); for (ExecutionEntity childExecution : processInstanceExecutions) { if (childExecution.getCurrentFlowElement() != null
Collection<ExecutionEntity> childExecutions = commandContext.getExecutionEntityManager().findChildExecutionsByProcessInstanceId(processInstanceId); for (ExecutionEntity childExecution : childExecutions) { if (!childExecution.getId().equals(processInstanceId)) {
protected int getNumberOfActiveChildExecutionsForProcessInstance(ExecutionEntityManager executionEntityManager, String processInstanceId) { Collection<ExecutionEntity> executions = executionEntityManager.findChildExecutionsByProcessInstanceId(processInstanceId); int activeExecutions = 0; for (ExecutionEntity execution : executions) { if (execution.isActive() && !processInstanceId.equals(execution.getId())) { activeExecutions++; } } return activeExecutions; }
Collection<ExecutionEntity> allExecutions = executionEntityManager.findChildExecutionsByProcessInstanceId(execution.getProcessInstanceId()); Iterator<ExecutionEntity> executionIterator = allExecutions.iterator(); boolean oneExecutionCanReachGateway = false;
public Void execute(CommandContext commandContext) { // check that the new process definition is just another version of the same // process definition that the process instance is using ExecutionEntityManager executionManager = commandContext.getExecutionEntityManager(); ExecutionEntity processInstance = executionManager.findById(processInstanceId); if (processInstance == null) { throw new ActivitiObjectNotFoundException("No process instance found for id = '" + processInstanceId + "'.", ProcessInstance.class); } else if (!processInstance.isProcessInstanceType()) { throw new ActivitiIllegalArgumentException("A process instance id is required, but the provided id " + "'" + processInstanceId + "' " + "points to a child execution of process instance " + "'" + processInstance.getProcessInstanceId() + "'. " + "Please invoke the " + getClass().getSimpleName() + " with a root execution id."); } DeploymentManager deploymentCache = commandContext.getProcessEngineConfiguration().getDeploymentManager(); ProcessDefinition currentProcessDefinition = deploymentCache.findDeployedProcessDefinitionById(processInstance.getProcessDefinitionId()); ProcessDefinition newProcessDefinition = deploymentCache .findDeployedProcessDefinitionByKeyAndVersionAndTenantId(currentProcessDefinition.getKey(), processDefinitionVersion, currentProcessDefinition.getTenantId()); validateAndSwitchVersionOfExecution(commandContext, processInstance, newProcessDefinition); // switch the historic process instance to the new process definition version commandContext.getHistoryManager().recordProcessDefinitionChange(processInstanceId, newProcessDefinition.getId()); // switch all sub-executions of the process instance to the new process definition version Collection<ExecutionEntity> childExecutions = executionManager.findChildExecutionsByProcessInstanceId(processInstanceId); for (ExecutionEntity executionEntity : childExecutions) { validateAndSwitchVersionOfExecution(commandContext, executionEntity, newProcessDefinition); } return null; }
.findChildExecutionsByProcessInstanceId(processInstanceId); for (ExecutionEntity executionEntity : childExecutions) { validateAndSwitchVersionOfExecution(commandContext, executionEntity, newProcessDefinition);
List<ExecutionEntity> childExecutions = commandContext.getExecutionEntityManager().findChildExecutionsByProcessInstanceId(executionId); for (ExecutionEntity childExecution : childExecutions) { if (!childExecution.getId().equals(executionId)) {
List<ExecutionEntity> processInstanceExecutions = executionEntityManager.findChildExecutionsByProcessInstanceId(execution.getProcessInstanceId()); for (ExecutionEntity childExecution : processInstanceExecutions) { if (childExecution.getCurrentFlowElement() != null
List<ExecutionEntity> childExecutions = commandContext.getExecutionEntityManager().findChildExecutionsByProcessInstanceId(executionId); for (ExecutionEntity childExecution : childExecutions) { if (!childExecution.getId().equals(executionId)) {
Collection<ExecutionEntity> childExecutions = commandContext.getExecutionEntityManager().findChildExecutionsByProcessInstanceId(processInstanceId); for (ExecutionEntity childExecution : childExecutions) { if (!childExecution.getId().equals(processInstanceId)) {