public long executeCount(CommandContext commandContext, Map<String, Object> parameterMap) { return commandContext .getExecutionManager() // can use execution count, since the result type doesn't matter .findExecutionCountByNativeQuery(parameterMap); }
public List<Execution> executeList(CommandContext commandContext, Map<String, Object> parameterMap, int firstResult, int maxResults) { return commandContext .getExecutionManager() .findExecutionsByNativeQuery(parameterMap, firstResult, maxResults); }
public List<Execution> executeList(CommandContext commandContext, Map<String, Object> parameterMap, int firstResult, int maxResults) { return commandContext .getExecutionManager() .findExecutionsByNativeQuery(parameterMap, firstResult, maxResults); }
public List<ProcessInstance> executeList(CommandContext commandContext, Map<String, Object> parameterMap, int firstResult, int maxResults) { return commandContext .getExecutionManager() .findProcessInstanceByNativeQuery(parameterMap, firstResult, maxResults); }
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 void ensureSubProcessInstanceInitialized() { if (subProcessInstance == null) { subProcessInstance = Context .getCommandContext() .getExecutionManager() .findSubProcessInstanceBySuperCaseExecutionId(id); } }
protected void ensureSubProcessInstanceInitialized() { if (shouldQueryForSubprocessInstance && subProcessInstance == null) { subProcessInstance = Context.getCommandContext().getExecutionManager().findSubProcessInstanceBySuperExecutionId(id); } }
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 @SuppressWarnings("unchecked") public List<Execution> executeList(CommandContext commandContext, Page page) { checkQueryOk(); ensureVariablesInitialized(); return (List) commandContext .getExecutionManager() .findExecutionsByQueryCriteria(this, page); }
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); } }
public List<String> executeIdsList(CommandContext commandContext) { checkQueryOk(); ensureVariablesInitialized(); return commandContext .getExecutionManager() .findProcessInstancesIdsByQueryCriteria(this); }
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 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; }
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(); }