[jboss-user] [jBPM Users] - [jBPM 4.2] MySQLIntegrityConstraintViolationException ending

xalperte do-not-reply at jboss.com
Mon Nov 16 08:28:06 EST 2009


This is the exception thrown by the engine when I try to __end__ a running instance  using the EndProcessInstance command. The instance has one active task (Evaluate web order), and that task has a swimlane associated (Sales Representative).

It seems a problem with the swimlane relationship.

NOTE: I already have configured the dialect to "org.hibernate.dialect.MySQLInnoDBDialect".

The exception:


  | com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Cannot delete or update a parent row: a foreign key constraint fails (`bpm4_jbpm/jbpm4_task`, CONSTRAINT `FK_TASK_SWIML` FOREIGN KEY (`SWIMLANE_`) REFERENCES `jbpm4_swimlane` (`DBID_`))
  | 

The process definition:


  | <?xml version="1.0" encoding="UTF-8"?>
  | <process description="This is a test process to test: tasks, swimlanes, reminder/notifications, timers." name="Test Websale" xmlns="http://jbpm.org/4.2/jpdl">
  |    <swimlane assignee="${buyer}" name="Buyer"/>
  |    <swimlane candidate-groups="sales" name="Sales Representative"/>
  |    <swimlane assignee="jim" name="Finantial Department"/>
  |    <swimlane assignee="luci" name="Shippment Department"/>
  | 
  |   <start form="tasks/form.create.xhtml" g="81,126,48,48" name="Create new web sale order">
  |     <transition g="-51,-24" name="Start web sale" to="Evaluate web order"/>
  |   </start>
  | 
  |   <task g="209,110,153,80" name="Evaluate web order" swimlane="Sales Representative">
  |     <on event="timeout">
  |       <timer duedate="3 days"/>
  |       <event-listener class="com.rudder.bpm4.processes.tests.websale.Escalate">
  |       	<field name="swimlaneName"><string value="Sales Representative"/></field>
  |       	<field name="roleName"><string value="manager"/></field>
  |       	<field name="defaultUser"><string value="jim"/></field>
  |       </event-listener>
  | 	</on>
  |     <reminder duedate="1 day" repeat="4 hours"/>
  |     <transition g="220,245:-67,-3" name="More info needed" to="Fix web order data"/>
  |     <transition g="-31,-24" name="Order ok" to="Processing Fork"/>
  |   </task>
  | 
  |   <task g="204,300,169,43" name="Fix web order data" swimlane="Buyer">
  |     <!-- notification/ --> <!--  Workaround for the notification tag, force the email sent using timer -->
  |     <!-- on event="start" -->    	
  |     	<!--  mail template="task-notification" / -->
  |     	<!-- event-listener class="org.jbpm.jpdl.internal.activity.MailListener"></event-listener -->
  |     <!-- /on -->
  |     <transition g="363,246:-62,-2" name="More info added" to="Evaluate web order"/>
  |   </task>
  | 
  |   <fork g="432,126,48,48" name="Processing Fork">
  |     <transition g="457,78:-83,-22" name="Process payment" to="Wait for money"/>
  |     <transition g="457,220:-67,4" name="Process shipping" to="Ship item"/>
  |   </fork>
  | 
  |   <task g="509,38,116,80" name="Wait for money" swimlane="Finantial Department">
  |     <!-- notification/ -->
  |     <transition g="-42,-24" name="Update stock" to="Update books"/>
  |   </task>
  | 
  |   <state g="615,180,100,80" name="Ship item">
  |     <transition g="862,221:-136,-23" name="Items sent" to="Processing Join"/>
  |   </state>
  | 
  |   <join g="839,126,48,48" name="Processing Join">
  |     <transition g="-39,-31" name="Close order" to="Web sale processed"/>
  |   </join>
  | 
  |   <end g="949,126,48,48" name="Web sale processed" state="completed"/>
  | 
  |   <state g="714,39,117,78" name="Update books">
  |     <transition g="862,76:-30,-26" name="Stock updated" to="Processing Join"/>
  |   </state>
  | </process>
  | 

You need to start the process with the variable "buyer". This variable will maintain the userId of the user that starts the process. It will be used by the "Buyer" swimlane (assignee="${buyer}").


View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4265854#4265854

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4265854



More information about the jboss-user mailing list