I use two call activities in bpmn process file. I put a script task right before end event (Terminate) of parent process. The follwing is the content of script task.
System.out.println("kcontext dispose session"); kcontext.getKieRuntime().dispose();
However, I got the error
Caused by: java.lang.IllegalStateException: Illegal method call. This session was previously disposed.
Why session is already disposed? The error log is attached.
error log.txt.zip 6.0 KB
whenever you use runtime manager you should use disposeRuntimeEngine on manager which will dispose the ksession internally. Alternatively you can get runtime manager within active JTA transaction the runtime engine will be disposed automatically at transaction completion.