public void execute(DelegateExecution execution) throws Exception { assertCanAccessServices(execution.getProcessEngineServices()); } }
public void execute(DelegateExecution execution) throws Exception { assertCanStartProcessInstance(execution.getProcessEngineServices()); } }
public void notify(DelegateExecution execution) throws Exception { assertCanStartProcessInstance(execution.getProcessEngineServices()); } }
public void execute(DelegateExecution execution) throws Exception { assertCanPerformQuery(execution.getProcessEngineServices()); } }
public void notify(DelegateExecution execution) throws Exception { assertCanAccessServices(execution.getProcessEngineServices()); } }
public void notify(DelegateExecution execution) throws Exception { assertCanPerformQuery(execution.getProcessEngineServices()); } }
public void executeCommand(DelegateExecution execution) { executeCommand(execution.getProcessEngineServices()); }
@Override public void execute(DelegateExecution execution) throws Exception { RuntimeService runtimeService = execution.getProcessEngineServices().getRuntimeService(); runtimeService.correlateMessage(MESSAGE); } }
@Override public void execute(DelegateExecution execution) throws Exception { DecisionService decisionService = execution.getProcessEngineServices().getDecisionService(); evaluateDecision(decisionService, execution); }
@Override public void execute(DelegateExecution execution) throws Exception { RuntimeService runtimeService = execution.getProcessEngineServices().getRuntimeService(); runtimeService.correlateMessage(MESSAGE); } }
@Override public void doAssert(DelegateExecution execution) { IdentityService identityService = execution.getProcessEngineServices().getIdentityService(); Authentication currentAuthentication = identityService.getCurrentAuthentication(); assertThat(currentAuthentication, is(nullValue())); } };
public void execute(DelegateExecution execution) throws Exception { activityInstance = execution.getProcessEngineServices() .getRuntimeService() .getActivityInstance(execution.getProcessInstanceId()); }
@Override public void execute(DelegateExecution execution) throws Exception { ProcessEngineServices processEngineServices = execution.getProcessEngineServices(); RuntimeService runtimeService = processEngineServices.getRuntimeService(); runtimeService.getActivityInstance(execution.getProcessInstanceId()); }
public void execute(DelegateExecution execution) throws Exception { ProcessEngineServices services = execution.getProcessEngineServices(); RuntimeService runtimeService = services.getRuntimeService(); runtimeService.setVariable(execution.getId(), "serviceTaskCalled", true); }
@Override public void doAssert(DelegateExecution execution) { IdentityService identityService = execution.getProcessEngineServices().getIdentityService(); Authentication currentAuthentication = identityService.getCurrentAuthentication(); assertThat(currentAuthentication, is(notNullValue())); assertThat(currentAuthentication.getTenantIds(), hasItem(expectedTenantId)); } };
public void execute(DelegateExecution execution) throws Exception { HistoryService historyService = execution.getProcessEngineServices().getHistoryService(); HistoricVariableInstance variableInstance = historyService .createHistoricVariableInstanceQuery() .variableName("listVar") .singleResult(); List<String> list = (List<String>) variableInstance.getValue(); // implicit update of the list, should not trigger an update // of the value since we deal with historic variables list.add(NEW_ELEMENT); }
@Override public void execute(DelegateExecution execution) throws Exception { RuntimeService runtimeService = execution.getProcessEngineServices().getRuntimeService(); TaskService taskService = execution.getProcessEngineServices().getTaskService(); String instanceToDelete = (String) execution.getVariable("instanceToComplete"); Task taskToTrigger = taskService.createTaskQuery().processInstanceId(instanceToDelete).singleResult(); taskService.complete(taskToTrigger.getId()); ActivityInstance activityInstance = runtimeService.getActivityInstance(instanceToDelete); execution.setVariable("activityInstanceNull", activityInstance == null); }
@Override public void execute(DelegateExecution execution) throws Exception { Task task = execution.getProcessEngineServices().getTaskService().createTaskQuery().taskName(TASK_WITH_CONDITION).singleResult(); ((TaskEntity) task).getExecution().setVariableLocal(VARIABLE_NAME, 1); execution.setVariableLocal(VARIABLE_NAME+1, 1); } }
public void execute(DelegateExecution execution) throws Exception { RuntimeService runtimeService = execution.getProcessEngineServices().getRuntimeService(); ObjectValue jsonSerializeable = Variables .objectValue(createJsonSerializable()) .serializationDataFormat(SerializationDataFormats.JSON) .create(); // this should be executed in the context of the current process application runtimeService.setVariable(execution.getProcessInstanceId(), VARIABLE_NAME, jsonSerializeable); }
public void execute(DelegateExecution execution) throws Exception { RepositoryService repoService = execution.getProcessEngineServices().getRepositoryService(); ProcessDefinition targetDefinition = repoService.createProcessDefinitionQuery().latestVersion().singleResult(); SetProcessDefinitionVersionCmd migrationCommand = new SetProcessDefinitionVersionCmd(execution.getProcessInstanceId(), targetDefinition.getVersion()); Context.getProcessEngineConfiguration().getCommandExecutorTxRequired().execute(migrationCommand); }