Я пытаюсь получить переменные во время выполнения рабочего процесса после его завершения.
Создание рабочего процесса в классе WorkflowStart с последующим извлечением значений
ProcessInstance pi = runtimeService.startProcessInstanceByKey("workflowName");
System.out.println("runtimeService.getVariables(getId()) "+runtimeService.getVariables(pi.getId()));
вышеприведенные команды запускают рабочий процесс и выполняют все исполнения. Поэтому, когда я пишу
public class FlowDelegate implements JavaDelegate {
public void execute(DelegateExecution execution) throws Exception {
execution.setVariable("abc123", "123");
System.out.println("Execution variables - "+execution.getVariables());
}
}
вышеуказанная линия печатает
{
abc123 => Value '123' of type 'PrimitiveValueType[string]'
}
Итак, после того, как processInstance выполняет рабочий процесс и пытается получить доступ к переменным, я получаю эту трассировку стека
и выполняет
System.out.println("runtimeService.getVariables(getId()) "+runtimeService.getVariables(pi.getId()));
ENGINE-16004 Exception while closing command context: execution e575eb8b-7b84-11e8-a237-54e1ad4a38ce doesn't exist: execution is null
org.camunda.bpm.engine.exception.NullValueException: execution e575eb8b-7b84-11e8-a237-54e1ad4a38ce doesn't exist: execution is null