Hi ,
I got the solution.
Steps:
1. While restarting application, re-registers listeners to the task client.
2. In my case starting process was like this:
..
ProcessInstance pi = ksession.createProcessInstance("com.sample.bpmn", null);
ksession.startProcessInstance(pi.getId());
for such multiple command execution need to use transaction(see :http://docs.jboss.org/jbpm/v5.2/userguide/ch07.html#d0e2914)
// create the entity manager factory and register it in the environmentEntityManagerFactory emf = Persistence.createEntityManagerFactory( "org.jbpm.persistence.jpa" );Environment env = KnowledgeBaseFactory.newEnvironment();env.set( EnvironmentName.ENTITY_MANAGER_FACTORY, emf );env.set( EnvironmentName.TRANSACTION_MANAGER, TransactionManagerServices.getTransactionManager() );// create a new knowledge session that uses JPA to store the runtime stateStatefulKnowledgeSession ksession = JPAKnowledgeService.newStatefulKnowledgeSession( kbase, null, env );// start the transactionUserTransaction ut = (UserTransaction) new InitialContext().lookup( "java:comp/UserTransaction" );ut.begin();// perform multiple commands inside one transactionksession.insert( new Person( "John Doe" ) );ksession.startProcess( "MyProcess" );// commit the transactionut.commit();
Now problem is solved . for more info see discussion at https://community.jboss.org/thread/195660
Thanks for ur help...
Reply to this message by going to Community
Start a new discussion in jBPM at Community