unable to start a process with async workItemHandler
ivanice Nov 20, 2014 5:37 PMHi to all,
like the title i have a process with two custom Service task ( the same task ).
I have implemented the async task like the example in the userguide of jbpm but the process finished before perfoming all tasks.
This is the log error:
INFO: HHH000232: Schema update complete
SLF4J: Failed to load class "org.slf4j.impl.StaticMDCBinder".
SLF4J: Defaulting to no-operation MDCAdapter implementation.
SLF4J: See http://www.slf4j.org/codes.html#no_static_mdc_binder for further details.
Saluti a tutti
nov 20, 2014 11:26:24 PM org.hibernate.ejb.AbstractEntityManagerImpl joinTransaction
WARN: HHH000326: Cannot join transaction: do not override hibernate.transaction.factory_class
Exception in thread "Thread-4" javax.persistence.TransactionRequiredException: No active JTA transaction on joinTransaction call
at org.hibernate.ejb.AbstractEntityManagerImpl.joinTransaction(AbstractEntityManagerImpl.java:1233)
at org.hibernate.ejb.AbstractEntityManagerImpl.joinTransaction(AbstractEntityManagerImpl.java:1183)
at org.drools.persistence.jpa.AbstractPersistenceContextManager.getCommandScopedEntityManager(AbstractPersistenceContextManager.java:110)
at org.drools.persistence.jpa.JpaPersistenceContextManager.getCommandScopedPersistenceContext(JpaPersistenceContextManager.java:65)
at org.drools.persistence.jpa.processinstance.JPAWorkItemManager.completeWorkItem(JPAWorkItemManager.java:110)
at com.sample.Smile$1.run(Smile.java:31)
at java.lang.Thread.run(Thread.java:745)
the code of workitem is:
package com.sample;
import org.kie.api.runtime.process.WorkItem;
import org.kie.api.runtime.process.WorkItemHandler;
import org.kie.api.runtime.process.WorkItemManager;
public class Smile implements WorkItemHandler{
public void abortWorkItem(WorkItem workItem, WorkItemManager manager) {
manager.abortWorkItem(workItem.getId());
}
public void executeWorkItem(WorkItem workItem, WorkItemManager manager) {
final Object p= workItem.getParameter("param1");
final long myId=workItem.getId();
final WorkItemManager man=manager;
new Thread(new Runnable() {
public void run() {
System.out.println(p);
man.completeWorkItem(myId, null);
}
}).start();
}
}
Please somebody can help me???