[jboss-user] [jBPM] - How to start/spawn 'n' subprocesses for 'n' users using JBPM-4.3.

Felix Jose do-not-reply at jboss.com
Thu Jul 15 08:54:01 EDT 2010


Felix Jose [http://community.jboss.org/people/FelixKJose] replied to the discussion

"How to start/spawn 'n' subprocesses for 'n' users using JBPM-4.3."

To view the discussion, visit: http://community.jboss.org/message/552767#552767

--------------------------------------------------------------
Hi All,

I have write a JBPM main process (Request.jpdl.xml) for starting "n" subprocess depending upon the input(number of users) and is given below











<java class=+"com.felix.poc.TestActivity" method=+"decreaseForkCounter"+  name=+"decreaseForkCounter" var=+"request" g=+"570,94,149,40">  <arg>  <object expr=+"#{request}" />  </arg> 
<transition g=+"-71,-18" name=+"sendToAssist" to=+"sendToAssist" />++++++</java>
<decision g=+"250,208,48,48" name=+"decideForkAgain"> <handler class="com.felix.poc.ForkAgainHandler" /> <transition g="274,113:78,-18" name="FORK_AGAIN" to="decreaseForkCounter" /> <transition g="280,556:172,-23" name="FORK_NOT_AGAIN" to="join1" /> </decision>  <fork g="623,207,80,40" name="sendToAssist"> <transition name="assist" to="assist" g="-16,-16" /> <transition g="-39,-18" name="decideForkAgain" to="decideForkAgain" /> </fork> <sub-process g="753,210,80,40" name="assist" sub-process-key="Assist"> <ransition g="14,16" name="join1" to="join1" /> </sub-process>  <join g="777,529,80,40" name="join1"> <transition g="-31,-18" name="end" to="theEnd" /> </join> I have atttached the same application with this.  But when I am trying to start multiple sub processes I am getting the following exception: Drecreased fork counter to:22796 [main] INFO com.felix.poc.TestActivity - Drecreased fork counter to:12796 [main] INFO org.hibernate.event.def.DefaultDeleteEventListener - handling transient entity in delete processingFork counter is 12827 [main] INFO com.felix.poc.ForkAgainHandler - Fork counter is 1fork again2827 [main] INFO com.felix.poc.ForkAgainHandler - fork againDrecreased fork counter to:12827 [main] INFO com.felix.poc.TestActivity - Drecreased fork counter to:0Fork counter is 02843 [main] INFO com.felix.poc.ForkAgainHandler - Fork counter is 02843 [main] INFO com.felix.poc.ForkAgainHandler - fork finished2874 [main] WARN org.hibernate.util.JDBCExceptionReporter - SQL Error: -104, SQLState: 230002874 [main] ERROR org.hibernate.util.JDBCExceptionReporter - Violation of unique constraint $$: duplicate value(s) for column(s) $$: SYS_CT_50 in statement [update JBPM4_EXECUTION set DBVERSION_=?, ACTIVITYNAME_=?, PROCDEFID_=?, HASVARS_=?, NAME_=?, KEY_=?, ID_=?, STATE_=?, SUSPHISTSTATE_=?, PRIORITY_=?, HISACTINST_=?, PARENT_=?, INSTANCE_=?, SUPEREXEC_=?, SUBPROCINST_=? where DBID_=? and DBVERSION_=?]2874 [main] ERROR org.hibernate.event.def.AbstractFlushingEventListener - Could not synchronize database state with sessionorg.hibernate.exception.ConstraintViolationException  : could not update: [org.jbpm.pvm.internal.model.ExecutionImpl#26]at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:94)at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2453)at org.hibernate.persister.entity.AbstractEntityPersister.updateOrInsert(AbstractEntityPersister.java:2335)at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2635)at org.hibernate.action.EntityUpdateAction.execute(EntityUpdateAction.java:115)at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279)at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:263)at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:168)at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:50)at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1027)at org.jbpm.pvm.internal.tx.HibernateSessionResource.prepare(HibernateSessionResource.java:56)at org.jbpm.pvm.internal.tx.StandardTransaction.commit(StandardTransaction.java:107)at org.jbpm.pvm.internal.tx.StandardTransaction.complete(StandardTransaction.java:64)at org.jbpm.pvm.internal.tx.StandardTransactionInterceptor.execute(StandardTransactionInterceptor.java:61)at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.executeInNewEnvironment(EnvironmentInterceptor.java:53)at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:40)at org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:55)at org.jbpm.pvm.internal.svc.SkipInterceptor.execute(SkipInterceptor.java:43)at org.jbpm.pvm.internal.svc.ExecutionServiceImpl.startProcessInstanceByKey(ExecutionServiceImpl.java:70)at com.felix.poc.Starter.main(Starter.java:31)Caused by:java.sql.SQLException: Violation of unique constraint $$: duplicate value(s) for column(s) $$: SYS_CT_50 in statement [update JBPM4_EXECUTION set DBVERSION_=?, ACTIVITYNAME_=?, PROCDEFID_=?, HASVARS_=?, NAME_=?, KEY_=?, ID_=?, STATE_=?, SUSPHISTSTATE_=?, PRIORITY_=?, HISACTINST_=?, PARENT_=?, INSTANCE_=?, SUPEREXEC_=?, SUBPROCINST_=? where DBID_=? and DBVERSION_=?]at org.hsqldb.jdbc.Util.throwError(Unknown Source)at org.hsqldb.jdbc.jdbcPreparedStatement.executeUpdate(Unknown Source)at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2435)... 19 more  So how can I start the multiple suprocesses? How can I get rid from this exception.I am attching the test application with this. Please help me.  Thank you,With Regards,Felix K Jose  So how can I start the multiple suprocesses? How can I get rid from this exception.I am attching the test application with this. Please help me.  Thank you,With Regards,Felix K Jose                                                                                                                                ++++++++++++++
++

+++

+

+++
+++

++++++++++
+++

+

+++
+++
+++++++++++++
+++

+

+++
+++


+++++++
+

+++
+++
++++++++
+

+++
+++


++++++
+++
+++
+++
++++++
+++




--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/552767#552767]

Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20100715/75155472/attachment-0001.html 


More information about the jboss-user mailing list