protected void ensureExecutionInitialized() { if (execution == null && executionId != null) { execution = Context .getCommandContext() .getExecutionManager() .findExecutionById(executionId); } }
@Override public ExecutionEntity getExecution() { if ( (execution==null) && (executionId!=null) ) { this.execution = Context .getCommandContext() .getExecutionManager() .findExecutionById(executionId); } return execution; }
protected void ensureSuperExecutionInstanceInitialized() { if (superExecution == null && superExecutionId != null) { superExecution = Context .getCommandContext() .getExecutionManager() .findExecutionById(superExecutionId); } }
public ExecutionEntity getExecution() { if(execution == null && executionId != null) { execution = Context.getCommandContext() .getExecutionManager() .findExecutionById(executionId); } return execution; }
@Override public ExecutionEntity getExecution() { if ( (execution==null) && (executionId!=null) ) { this.execution = Context .getCommandContext() .getExecutionManager() .findExecutionById(executionId); } return execution; }
protected void ensureExecutionInitialized() { if (execution == null && executionId != null) { execution = Context .getCommandContext() .getExecutionManager() .findExecutionById(executionId); } }
protected void ensureExecutionInitialized() { if (execution == null) { execution = Context.getCommandContext().getExecutionManager().findExecutionById(executionId); EnsureUtil.ensureNotNull( "Cannot find execution with id " + executionId + " for external task " + id, "execution", execution); } }
protected void initialize() { ExecutionEntity processInstance = commandContext.getExecutionManager().findExecutionById(processInstanceId); this.processDefinition = processInstance.getProcessDefinition(); List<ExecutionEntity> executions = fetchExecutionsForProcessInstance(processInstance); executions.add(processInstance); List<ExecutionEntity> leaves = findLeaves(executions); assignExecutionsToActivities(leaves); }
protected void ensureProcessInstanceInitialized() { if ((processInstance == null) && (processInstanceId != null)) { if (isExecutionTreePrefetchEnabled()) { ensureExecutionTreeInitialized(); } else { processInstance = Context.getCommandContext().getExecutionManager().findExecutionById(processInstanceId); } } }
protected List<ExecutionEntity> loadFromDb(final String processInstanceId, final CommandContext commandContext) { List<ExecutionEntity> executions = commandContext.getExecutionManager().findExecutionsByProcessInstanceId(processInstanceId); ExecutionEntity processInstance = commandContext.getExecutionManager().findExecutionById(processInstanceId); // initialize parent/child sets if (processInstance != null) { processInstance.restoreProcessInstance(executions, null, null, null, null, null, null); } return executions; }
protected ExecutionEntity getEntity() { ensureNotNull("executionId", entityId); ExecutionEntity execution = commandContext .getExecutionManager() .findExecutionById(entityId); ensureNotNull("execution " + entityId + " doesn't exist", "execution", execution); checkSetExecutionVariables(execution); return execution; }
protected void ensureParentInitialized() { if (parent == null && parentId != null) { if (isExecutionTreePrefetchEnabled()) { ensureExecutionTreeInitialized(); } else { parent = Context.getCommandContext().getExecutionManager().findExecutionById(parentId); } } }
protected ExecutionEntity getEntity() { ensureNotNull("executionId", entityId); ExecutionEntity execution = commandContext .getExecutionManager() .findExecutionById(entityId); ensureNotNull("execution " + entityId + " doesn't exist", "execution", execution); checkSetExecutionVariables(execution); return execution; }
protected List<ExecutionEntity> loadFromDb(final String processInstanceId, final CommandContext commandContext) { List<ExecutionEntity> executions = commandContext.getExecutionManager().findExecutionsByProcessInstanceId(processInstanceId); ExecutionEntity processInstance = commandContext.getExecutionManager().findExecutionById(processInstanceId); // initialize parent/child sets if (processInstance != null) { processInstance.restoreProcessInstance(executions, null, null, null, null, null, null); } return executions; }
public List<String> execute(CommandContext commandContext) { ensureNotNull("executionId", executionId); // fetch execution ExecutionManager executionManager = commandContext.getExecutionManager(); ExecutionEntity execution = executionManager.findExecutionById(executionId); ensureNotNull("execution " + executionId + " doesn't exist", "execution", execution); checkGetActivityIds(execution, commandContext); // fetch active activities return execution.findActiveActivityIds(); }
public VariableMap execute(CommandContext commandContext) { ensureNotNull("executionId", executionId); ExecutionEntity execution = commandContext .getExecutionManager() .findExecutionById(executionId); ensureNotNull("execution " + executionId + " doesn't exist", "execution", execution); checkGetExecutionVariables(execution, commandContext); VariableMapImpl executionVariables = new VariableMapImpl(); // collect variables from execution execution.collectVariables(executionVariables, variableNames, isLocal, deserializeValues); return executionVariables; }
@Override public void execute(DelegateExecution execution) throws Exception { ExecutionManager executionManager = Context.getCommandContext().getExecutionManager(); ExecutionEntity execution1 = executionManager.findExecutionById(ENTITY_ID1); ExecutionEntity execution2 = executionManager.findExecutionById(ENTITY_ID2); // revert the references execution2.setParent(null); execution1.setParent(execution2); executionThreadControl.sync(); }
public VariableMap execute(CommandContext commandContext) { ensureNotNull("executionId", executionId); ExecutionEntity execution = commandContext .getExecutionManager() .findExecutionById(executionId); ensureNotNull("execution " + executionId + " doesn't exist", "execution", execution); checkGetExecutionVariables(execution, commandContext); VariableMapImpl executionVariables = new VariableMapImpl(); // collect variables from execution execution.collectVariables(executionVariables, variableNames, isLocal, deserializeValues); return executionVariables; }
protected void sendSignalToExecution(CommandContext commandContext, String signalName, String executionId) { ExecutionManager executionManager = commandContext.getExecutionManager(); ExecutionEntity execution = executionManager.findExecutionById(executionId); ensureNotNull("Cannot find execution with id '" + executionId + "'", "execution", execution); EventSubscriptionManager eventSubscriptionManager = commandContext.getEventSubscriptionManager(); List<EventSubscriptionEntity> signalEvents = eventSubscriptionManager.findSignalEventSubscriptionsByNameAndExecution(signalName, executionId); ensureNotEmpty("Execution '" + executionId + "' has not subscribed to a signal event with name '" + signalName + "'.", signalEvents); checkAuthorizationOfCatchSignals(commandContext, signalEvents); notifyExecutions(signalEvents); }
protected void sendSignalToExecution(CommandContext commandContext, String signalName, String executionId) { ExecutionManager executionManager = commandContext.getExecutionManager(); ExecutionEntity execution = executionManager.findExecutionById(executionId); ensureNotNull("Cannot find execution with id '" + executionId + "'", "execution", execution); EventSubscriptionManager eventSubscriptionManager = commandContext.getEventSubscriptionManager(); List<EventSubscriptionEntity> signalEvents = eventSubscriptionManager.findSignalEventSubscriptionsByNameAndExecution(signalName, executionId); ensureNotEmpty("Execution '" + executionId + "' has not subscribed to a signal event with name '" + signalName + "'.", signalEvents); checkAuthorizationOfCatchSignals(commandContext, signalEvents); notifyExecutions(signalEvents); }