Saya mencoba mengatur variabel selama eksekusi alur kerja setelah selesai.
Membuat instance alur kerja di kelas WorkflowStart dan kemudian mengambil nilai
ProcessInstance pi = runtimeService.startProcessInstanceByKey("workflowName");
System.out.println("runtimeService.getVariables(getId()) "+runtimeService.getVariables(pi.getId()));
perintah di atas memulai alur kerja, dan melakukan semua eksekusi. Jadi ketika saya menulis
public class FlowDelegate implements JavaDelegate {
public void execute(DelegateExecution execution) throws Exception {
execution.setVariable("abc123", "123");
System.out.println("Execution variables - "+execution.getVariables());
}
}
baris di atas tercetak
{
abc123 => Value '123' of type 'PrimitiveValueType[string]'
}
Jadi setelah processInstance menjalankan alur kerja dan mencoba mengakses variabel saya mendapatkan jejak tumpukan ini
dan mengeksekusi
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