@Override public void setProcessInstance(PvmExecutionImpl processInstance) { this.processInstance = (ExecutionEntity) processInstance; if (processInstance != null) { this.processInstanceId = this.processInstance.getId(); } }
protected ExecutionEntity intersect(Set<ExecutionEntity> executions, String[] executionIds) { Set<String> executionIdSet = new HashSet<String>(); for (String executionId : executionIds) { executionIdSet.add(executionId); } for (ExecutionEntity execution : executions) { if (executionIdSet.contains(execution.getId())) { return execution; } } throw new ProcessEngineException("Could not determine execution"); }
public void submit(MigratingEventScopeInstance compensationInstance) { ExecutionEntity scopeExecution = compensationInstance.resolveRepresentativeExecution(); if (scopeExecution != null) { compensationInstances.put(scopeExecution.getId(), compensationInstance); } }
protected ExecutionEntity intersect(Set<ExecutionEntity> executions, String[] executionIds) { Set<String> executionIdSet = new HashSet<String>(); for (String executionId : executionIds) { executionIdSet.add(executionId); } for (ExecutionEntity execution : executions) { if (executionIdSet.contains(execution.getId())) { return execution; } } throw new ProcessEngineException("Could not determine execution"); }
public MigratingInstanceParseContext( MigratingInstanceParser parser, MigrationPlan migrationPlan, ExecutionEntity processInstance, ProcessDefinitionEntity targetProcessDefinition) { this.parser = parser; this.sourceProcessDefinition = processInstance.getProcessDefinition(); this.targetProcessDefinition = targetProcessDefinition; this.migratingProcessInstance = new MigratingProcessInstance(processInstance.getId(), sourceProcessDefinition, targetProcessDefinition); this.mapping = new ActivityExecutionTreeMapping(Context.getCommandContext(), processInstance.getId()); this.instructionsBySourceScope = organizeInstructionsBySourceScope(migrationPlan); }
public MigratingInstanceParseContext( MigratingInstanceParser parser, MigrationPlan migrationPlan, ExecutionEntity processInstance, ProcessDefinitionEntity targetProcessDefinition) { this.parser = parser; this.sourceProcessDefinition = processInstance.getProcessDefinition(); this.targetProcessDefinition = targetProcessDefinition; this.migratingProcessInstance = new MigratingProcessInstance(processInstance.getId(), sourceProcessDefinition, targetProcessDefinition); this.mapping = new ActivityExecutionTreeMapping(Context.getCommandContext(), processInstance.getId()); this.instructionsBySourceScope = organizeInstructionsBySourceScope(migrationPlan); }
public ProcessEngineException processDefinitionOfInstanceDoesNotMatchMigrationPlan(ExecutionEntity processInstance, String processDefinitionId) { return new ProcessEngineException(exceptionMessage( "002", "Process instance '{}' cannot be migrated. Its process definition '{}' does not match the source process definition of the migration plan '{}'", processInstance.getId(), processInstance.getProcessDefinitionId(), processDefinitionId )); }
public ProcessEngineException processDefinitionOfInstanceDoesNotMatchModification(ExecutionEntity processInstance, String processDefinitionId) { return new ProcessEngineException(exceptionMessage( "037", "Process instance '{}' cannot be modified. Its process definition '{}' does not match given process definition '{}'", processInstance.getId(), processInstance.getProcessDefinitionId(), processDefinitionId )); }
public ProcessEngineException processDefinitionOfInstanceDoesNotMatchModification(ExecutionEntity processInstance, String processDefinitionId) { return new ProcessEngineException(exceptionMessage( "037", "Process instance '{}' cannot be modified. Its process definition '{}' does not match given process definition '{}'", processInstance.getId(), processInstance.getProcessDefinitionId(), processDefinitionId )); }
protected void logVariableOperation(AbstractVariableScope scope) { ExecutionEntity execution = (ExecutionEntity) scope; commandContext.getOperationLogManager().logVariableOperation(getLogEntryOperation(), execution.getId(), null, PropertyChange.EMPTY_CHANGE); }
protected void moveExternalTasksTo(ExecutionEntity other) { for (ExternalTaskEntity externalTask : getExternalTasksInternal()) { externalTask.setExecutionId(other.getId()); externalTask.setExecution(other); other.addExternalTask(externalTask); } getExternalTasksInternal().clear(); }
public void checkDeleteProcessInstance(ExecutionEntity execution) { if (execution != null && !getTenantManager().isAuthenticatedTenant(execution.getTenantId())) { throw LOG.exceptionCommandWithUnauthorizedTenant("delete the process instance '"+ execution.getId() + "'"); } }
public void checkDeleteProcessInstance(ExecutionEntity execution) { if (execution != null && !getTenantManager().isAuthenticatedTenant(execution.getTenantId())) { throw LOG.exceptionCommandWithUnauthorizedTenant("delete the process instance '"+ execution.getId() + "'"); } }
@Override public void checkUpdateProcessInstance(ExecutionEntity execution) { if (execution != null && !getTenantManager().isAuthenticatedTenant(execution.getTenantId())) { throw LOG.exceptionCommandWithUnauthorizedTenant("update the process instance '"+ execution.getId() + "'"); } }
@Override public void checkUpdateProcessInstance(ExecutionEntity execution) { if (execution != null && !getTenantManager().isAuthenticatedTenant(execution.getTenantId())) { throw LOG.exceptionCommandWithUnauthorizedTenant("update the process instance '"+ execution.getId() + "'"); } }
@Override public void checkReadProcessInstance(ExecutionEntity execution) { if (execution != null && !getTenantManager().isAuthenticatedTenant(execution.getTenantId())) { throw LOG.exceptionCommandWithUnauthorizedTenant("read the process instance '"+ execution.getId() + "'"); } }
public void cancelTimers(ExecutionEntity execution) { List<TimerEntity> timers = Context .getCommandContext() .getJobManager() .findTimersByExecutionId(execution.getId()); for (TimerEntity timer: timers) { timer.delete(); } }
protected void triggerExecution(CommandContext commandContext, CorrelationHandlerResult correlationResult) { String executionId = correlationResult.getExecutionEntity().getId(); MessageEventReceivedCmd command = new MessageEventReceivedCmd(messageName, executionId, builder.getPayloadProcessInstanceVariables(), builder.getPayloadProcessInstanceVariablesLocal(), builder.isExclusiveCorrelation()); command.execute(commandContext); }
public Void execute(CommandContext commandContext) { IncidentContext incidentContext = new IncidentContext(); incidentContext.setExecutionId(execution.getId()); IncidentEntity.createAndInsertIncident("foo", incidentContext, null); return null; } });
protected void setReferenceToProcessInstance(HistoricDecisionInstanceEntity event, ExecutionEntity execution) { event.setProcessDefinitionKey(getProcessDefinitionKey(execution)); event.setProcessDefinitionId(execution.getProcessDefinitionId()); event.setRootProcessInstanceId(execution.getRootProcessInstanceId()); event.setProcessInstanceId(execution.getProcessInstanceId()); event.setExecutionId(execution.getId()); event.setActivityId(execution.getActivityId()); event.setActivityInstanceId(execution.getActivityInstanceId()); }