protected ExecutionEntity fetchExecutionEntity(CommandContext commandContext, String executionId) { if (executionId == null) { return null; } return commandContext.getExecutionEntityManager().findById(executionId); }
protected void ensureSuperExecutionInitialized() { if (superExecution == null && superExecutionId != null) { superExecution = (ExecutionEntityImpl) Context.getCommandContext().getExecutionEntityManager().findById(superExecutionId); } }
protected void ensureRootProcessInstanceInitialized() { if (rootProcessInstanceId == null) { rootProcessInstance = (ExecutionEntityImpl) Context.getCommandContext().getExecutionEntityManager().findById(rootProcessInstanceId); } }
public ExecutionEntity getExecution() { if ((execution == null) && (executionId != null)) { this.execution = Context.getCommandContext().getExecutionEntityManager().findById(executionId); } return execution; }
public ExecutionEntity getProcessInstance() { if (processInstance == null && processInstanceId != null) { processInstance = Context.getCommandContext().getExecutionEntityManager().findById(processInstanceId); } return processInstance; }
protected void ensureParentInitialized() { if (parent == null && parentId != null) { parent = (ExecutionEntityImpl) Context.getCommandContext().getExecutionEntityManager().findById(parentId); } }
protected void ensureProcessInstanceInitialized() { if ((processInstance == null) && (processInstanceId != null)) { processInstance = (ExecutionEntityImpl) Context.getCommandContext().getExecutionEntityManager().findById(processInstanceId); } }
public ExecutionEntity getProcessInstance() { if ((processInstance == null) && (processInstanceId != null)) { this.processInstance = Context.getCommandContext().getExecutionEntityManager().findById(processInstanceId); } return processInstance; }
public ExecutionEntity getExecution() { if (execution == null && executionId != null) { execution = Context.getCommandContext().getExecutionEntityManager().findById(executionId); } return execution; }
@SuppressWarnings({ "unchecked", "rawtypes" }) public List<IdentityLink> execute(CommandContext commandContext) { ExecutionEntity processInstance = commandContext.getExecutionEntityManager().findById(processInstanceId); if (processInstance == null) { throw new ActivitiObjectNotFoundException("Cannot find process definition with id " + processInstanceId, ExecutionEntity.class); } return (List) processInstance.getIdentityLinks(); }
/** * Removes the job's execution's reference to this job, if the job has an associated execution. * Subclasses may override to provide custom implementations. */ protected void removeExecutionLink(JobEntity jobEntity) { if (jobEntity.getExecutionId() != null) { ExecutionEntity execution = getExecutionEntityManager().findById(jobEntity.getExecutionId()); if (execution != null) { execution.getJobs().remove(jobEntity); } } }
/** * Removes the job's execution's reference to this job, if the job has an associated execution. * Subclasses may override to provide custom implementations. */ protected void removeExecutionLink(TimerJobEntity jobEntity) { if (jobEntity.getExecutionId() != null) { ExecutionEntity execution = getExecutionEntityManager().findById(jobEntity.getExecutionId()); if (execution != null) { execution.getTimerJobs().remove(jobEntity); } } }
public List<String> execute(CommandContext commandContext) { if (executionId == null) { throw new ActivitiIllegalArgumentException("executionId is null"); } ExecutionEntityManager executionEntityManager = commandContext.getExecutionEntityManager(); ExecutionEntity execution = executionEntityManager.findById(executionId); if (execution == null) { throw new ActivitiObjectNotFoundException("execution " + executionId + " doesn't exist", Execution.class); } return findActiveActivityIds(execution); }
protected void executeJobHandler(JobEntity jobEntity) { ExecutionEntity execution = null; if (jobEntity.getExecutionId() != null) { execution = getExecutionEntityManager().findById(jobEntity.getExecutionId()); } Map<String, JobHandler> jobHandlers = processEngineConfiguration.getJobHandlers(); JobHandler jobHandler = jobHandlers.get(jobEntity.getJobHandlerType()); jobHandler.execute(jobEntity, jobEntity.getJobHandlerConfiguration(), execution, getCommandContext()); }
public Void execute(CommandContext commandContext) { if (processInstanceId == null) { throw new ActivitiIllegalArgumentException("processInstanceId is null"); } ExecutionEntity processInstanceEntity = commandContext.getExecutionEntityManager().findById(processInstanceId); if (processInstanceEntity == null) { throw new ActivitiObjectNotFoundException("No process instance found for id '" + processInstanceId + "'", ProcessInstance.class); } commandContext.getExecutionEntityManager().deleteProcessInstance(processInstanceEntity.getProcessInstanceId(), deleteReason, false); return null; }
public Void execute(CommandContext commandContext) { ExecutionEntityManager executionEntityManager = commandContext.getExecutionEntityManager(); ExecutionEntity processInstance = executionEntityManager.findById(processInstanceId); if (processInstance == null) { throw new ActivitiObjectNotFoundException("Cannot find process instance with id " + processInstanceId, ExecutionEntity.class); } IdentityLinkEntityManager identityLinkEntityManager = commandContext.getIdentityLinkEntityManager(); identityLinkEntityManager.addIdentityLink(processInstance, userId, groupId, type); commandContext.getHistoryManager().createProcessInstanceIdentityLinkComment(processInstanceId, userId, groupId, type, true); return null; }
public Void execute(CommandContext commandContext) { ExecutionEntity processInstance = commandContext.getExecutionEntityManager().findById(processInstanceId); if (processInstance == null) { throw new ActivitiObjectNotFoundException("Cannot find process instance with id " + processInstanceId, ExecutionEntity.class); } commandContext.getIdentityLinkEntityManager().deleteIdentityLink(processInstance, userId, groupId, type); commandContext.getHistoryManager().createProcessInstanceIdentityLinkComment(processInstanceId, userId, groupId, type, false); return null; }
@Override public void insert(VariableInstanceEntity entity, boolean fireCreateEvent) { super.insert(entity, fireCreateEvent); if (entity.getExecutionId() != null && isExecutionRelatedEntityCountEnabledGlobally()) { CountingExecutionEntity executionEntity = (CountingExecutionEntity) getExecutionEntityManager().findById(entity.getExecutionId()); if (isExecutionRelatedEntityCountEnabled(executionEntity)) { executionEntity.setVariableCount(executionEntity.getVariableCount() + 1); } } }
@Override public void delete(JobEntity entity, boolean fireDeleteEvent) { if (entity.getExecutionId() != null && isExecutionRelatedEntityCountEnabledGlobally()) { CountingExecutionEntity executionEntity = (CountingExecutionEntity) getExecutionEntityManager().findById(entity.getExecutionId()); if (isExecutionRelatedEntityCountEnabled(executionEntity)) { executionEntity.setJobCount(executionEntity.getJobCount() - 1); } } super.delete(entity, fireDeleteEvent); }
@Override public void insert(IdentityLinkEntity entity, boolean fireCreateEvent) { super.insert(entity, fireCreateEvent); getHistoryManager().recordIdentityLinkCreated(entity); if (entity.getProcessInstanceId() != null && isExecutionRelatedEntityCountEnabledGlobally()) { CountingExecutionEntity executionEntity = (CountingExecutionEntity) getExecutionEntityManager().findById(entity.getProcessInstanceId()); if (isExecutionRelatedEntityCountEnabled(executionEntity)) { executionEntity.setIdentityLinkCount(executionEntity.getIdentityLinkCount() + 1); } } }