[jboss-user] [JBoss jBPM] - Re: jBPM and Message Driven Beans

new4jboss do-not-reply at jboss.com
Tue Jan 30 12:34:00 EST 2007


Hi all,
I did what I didn't want, but works.
I removed the org.jbpm.web.JbpmContextFilter filter configuration from web.xml and made the following in index.jsp:

  | JbpmContext jbpmContext = JbpmConfiguration.getInstance().createJbpmContext();
  | long processInstanceId = 0L;
  | 
  | try {
  |   ProcessInstance processInstance = jbpmContext.newProcessInstance("suspension.par");
  |   processInstanceId = processInstance.getId();
  |   jbpmContext.save(processInstance);
  |   
  | } finally
  | {
  | 	jbpmContext.close();
  | }
  | 
  | jbpmContext = JbpmConfiguration.getInstance().createJbpmContext();
  | 
  | try {
  | 	ProcessInstance processInstance = jbpmContext.loadProcessInstance(processInstanceId);
  |     processInstance.signal();
  | } finally
  | {
  | 	jbpmContext.close();
  | }
  | 

As you can see, this is not very pretty, but works.

Does anyone know a better way to guarantee that the ProcessInstance is persisted before we signal it?
I would appreciate a solution that delegates this responsibility to the container  (CMT).

Thanks,
Délio Guerra


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

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




More information about the jboss-user mailing list