Juan Gago [
https://community.jboss.org/people/juan.gago] created the discussion
"Re: Problem in JPAWorkItemManager when completing a task"
To view the discussion, visit:
https://community.jboss.org/message/646027#646027
--------------------------------------------------------------
Thanks for the response
I am using JPAKnowledgeService, initialized from Spring application context configuration
file:
<jbpm:kbase id="kbase">
<jbpm:resources>
<jbpm:resource type="BPMN2"
source="classpath:workflows/Test.bpmn" />
</jbpm:resources>
</jbpm:kbase>
<jbpm:ksession id="ksession" type="stateful"
kbase="kbase">
<jbpm:configuration>
<jbpm:jpa-persistence>
<jbpm:entity-manager-factory
ref="entityManagerFactory"/>
<jbpm:transaction-manager
ref="transactionManager"/>
</jbpm:jpa-persistence>
</jbpm:configuration>
</jbpm:ksession>
CommandBasedWSHumanTaskHandler is configured to execute connect method at application
startup.
And for completing a task the code just execute the task client method:
BlockingTaskOperationResponseHandler completeResponseHandler = new
BlockingTaskOperationResponseHandler();
getTaskClient().complete(taskId, userId, null, completeResponseHandler);
completeResponseHandler.waitTillDone(getClientMaxWaitTime());
The session is loaded, because I previously can create process instances, and the task
client can change task status to Completed.
Should I do something more? What listener must I declare?
The CommandBasedWSHumanTaskHandler.connect works fine, but when TaskCompletedHandler
executes the PersistenceContext stored in the session environment has a reference to a
closed EntityManager.
--------------------------------------------------------------
Reply to this message by going to Community
[
https://community.jboss.org/message/646027#646027]
Start a new discussion in jBPM at Community
[
https://community.jboss.org/choose-container!input.jspa?contentType=1&...]