Community

jBPM 4.3 starting a sub-process after a state node will fail

created by Tun Mang in jBPM - View the full discussion

Hi :

 

I got a db constrain failure when call executionService.signalExecutionById(executionId) for the "check_id" state node as shown below.

 

================================

<?xml version="1.0" encoding="UTF-8"?>
<process name="SubDocument" xmlns="http://jbpm.org/4.3/jpdl">
  <start g="36,109,48,48">
    <transition to="check_id" >
   <event-listener>
        <field name="msg"><string value="(start) go to state (check_id)."/></field>
      </event-listener>      
    </transition>   
  </start>
  <state name="check_id" g="256,106,88,52" >   
    <transition to="review" g="167,200:7,3">
   <event-listener>
        <field name="msg"><string value="(check_id) go to (sub-process)."/></field>
      </event-listener>         
    </transition>     
  </state>
  <sub-process name="review" sub-process-key="SubProcTasks" g="118,106,99,52">              
    <transition to="ok" g="167,67:6,-19">     
   <event-listener>
        <field name="msg"><string value="(sub-process) go to parent (ok)."/></field>
      </event-listener>      
    </transition>   
  </sub-process>
 
  <state name="ok"     g="255,41,88,52">   
    <transition to="end" g="167,67:6,-19">     
   <event-listener>
        <field name="msg"><string value="(parent-process) go to (end)."/></field>
      </event-listener>
    </transition>           
  </state> 
  <end name="end" g="254,19,88,52" >
    <on event="start">
   <event-listener>
        <field name="msg"><string value="(parent-process) entered (end) node."/></field>
      </event-listener>      
    </on>  
  </end> 
</process>

 

======================

The exception is listed below:

 

16:38:55,249 WRN | [JDBCExceptionReporter] SQL Error: 1452, SQLState: 23000

16:38:55,249 SEV | [JDBCExceptionReporter] Cannot add or update a child row:

a foreign key constraint fails (`jbpm_4_3/jbpm4_execution`, CONSTRAINT `FK_EXEC_SUBPI` FOREIGN KEY (`SUBPROCINST_`) REFERENCES `jbpm4_execution` (`DBID_`))

 

### EXCEPTION ###########################################

16:38:55,249 SEV | [AbstractFlushingEventListener] Could not synchronize database state with session

org.hibernate.exception.ConstraintViolationException: could not update: [org.jbpm.pvm.internal.model.ExecutionImpl#240001]

at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:71)

at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)

at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2425)

at org.hibernate.persister.entity.AbstractEntityPersister.updateOrInsert(AbstractEntityPersister.java:2307)

at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2607)

at org.hibernate.action.EntityUpdateAction.execute(EntityUpdateAction.java:92)

at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:248)

at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:232)

at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:140)

at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)

at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)

at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)

at org.jbpm.pvm.internal.id.AcquireDbidBlockCmd.execute(AcquireDbidBlockCmd.java:35)

at org.jbpm.pvm.internal.id.AcquireDbidBlockCmd.execute(AcquireDbidBlockCmd.java:10)

at org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42)

....

 

===============================

But if I remove the "check_id" state node and make the start node's transition directly go to the sub-process, everything goes fine.

 

Can someone help me about this one? Thanks a lot in advance.

 

 

 

Reply to this message by going to Community

Start a new discussion in jBPM at Community