[jboss-user] [JBoss jBPM] - Re: Un expected behavior observed with Token details

mputz do-not-reply at jboss.com
Thu May 24 08:29:28 EDT 2007


Please disregard my previous comment - it has nothing to do with configuration.

I oversaw that you were throwing an exception, but didn't mark the current transaction as to be rolled back.

So instead of your workaround of re-setting the node on the context again, just add jbpmContext.setRollbackOnly() in the catch block.

public void processWorkflowEvent(long pid, String eventName) throws ...
  | {
  |   JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance();
  |   JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
  |   try
  |   {
  |      ... your own code
  | 
  |     // process  signal
  |     token.signal(eventName);
  | 
  |   }
  |   catch(Exception e)
  |   {
  |      // mark this transaction as dirty
  |      jbpmContext.setRollbackOnly();
  |      // do whatever you need to handle own exceptions
  |   }
  |   finally
  |   {
  |      jbpmContext.close();
  |   }
  | }	

No need for a JIRA entry IMO.

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

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



More information about the jboss-user mailing list