Using jBPM 5.4, Hibernate 4, JPA2 I have a rule in which I want to create an object and then start a process with a facthandle to this object as one of the variables. (FYI, I'm passing the facthandle because I want the process to retract the object I created before it ends.
The issue is that right after my rule fires (right after the output, "started process: 123" - see below) I get the following error:
java.lang.IllegalArgumentException: IOException while storing process instance 123: org.drools.common.NamedEntryPoint
If I insert null or a string instead of the fact handle, everything works fine.
MY GOAL: I am inserting objects into working memory and based upon the object, if a related process already exists, I will send a signal to it, if a related process does not already exist I want to create/start one. I use a "MarkerBean" to determine whether or not a related process already exists. When a process ends, it needs to remove the related MarkerBean.
The following rule is giving me the exception. Here, an object (MyEventBean) has been inserted and I am looking to see if there is a corresponding MarkerBean. Then, I create the process and new markerbean if necessary:
$meb: MyEventBean(style matches ".*western.*")
not ($mb : MarkerBean(title matches $meb.getTitle()))
// first get the fact handle and pass it to the process
MarkerBean $mb = new MarkerBean();
Object factHandle = kcontext.getKnowledgeRuntime().insert($mb);
System.out.println("got object:"+factHandle.getClass().getName()); <=== prints org.drools.common.DefaultFactHandle
java.util.Map<String,Object> variables = new java.util.HashMap<String,Object>();
WorkflowProcessInstance pi = (WorkflowProcessInstance)kcontext.getKnowledgeRuntime().createProcessInstance("test.SimpleProcess", variables);
//store the new processinstance in the new MarkerBean (so I can later signal it)
System.out.println("started process "+pi.getId());
For grins I added DefaultFactHandle ( to my persistence.xml, didn't help. As I mentioned, if I add a plain string rather than the factHandle, everything works.
Does anyone see anything here that could be causing a problem?
I created a simple process: start->timer->end and a little java app to run it. I have one process variable that is of type org.drools.runtime.rule.Facthandle.
In my little test java app, I can start the process, but just like in my rule, if I insert an object and pass its facthandle I get the same exception as above.
Further, I added a processEventListener and the afterProcessStarted, and afterVariableChanged methods are reached before the exception is thrown (I assume the timer causes a safe point and thus there is an attempt to persist the process?) Thanks again for any thoughts.