[jboss-user] [jBPM Users] - Re: Can't get pooled task instance list with jbpm & seam - p

achimh do-not-reply at jboss.com
Mon Nov 23 04:55:05 EST 2009

I just want to give the answer by myself, because I could fix the problem in the meantime and maybe someone is running into the same problems.

The main point for integrating jBPM 4 in Seam (2.2) seems to be that you have to ensure that jBPM 3 is not used in your application. Seam will load its jBPM3 (jbpm-jpdl.jar) component when there is a "<bpm:jbpm>" block in your components.xml - so remove it or at least uncomment it. As in jBPM3 you will have to add the jbpm.jar in your ear-root and register it as java-module in your application.xml like:

  | 	<module>
  | 		<ejb>jboss-seam.jar</ejb>
  | 	</module>
  | 	<module>
  | 		<java>jbpm.jar</java>
  | 	</module>

Besides these comfiguration issues you cannot use the seam-integrated jbpm-annotations. E.g. to start a process I use this:

  |     // this won't work: @createProcess(key="MyProcessName")
  |     public String createMyProcess() {
  |         ProcessEngine processEngine = new Configuration().buildProcessEngine();
  |         processEngine.getExecutionService().startProcessInstanceByKey("MyProcessName");
  |         return "startedMyProcess";
  |     }

Additionally I could not use the Actor class to inject the actor information, although I'm not sure if this might be my fault ;)
Instead I'm using the Seam Identity credentials as actor-id and wrote an own implementation for the IdentitySession interface which handels which groups a user is a member of etc. to determine assignment decisions. To let jBPM4 use this class I had to change my jbpm.cfg.xml to:

  | <jbpm-configuration>
  | 	<import resource="jbpm.default.cfg.xml" />
  | 	<import resource="jbpm.tx.hibernate.cfg.xml" />
  | 	<import resource="jbpm.jpdl.cfg.xml" />
  | 	<transaction-context>
  | 		<object class="mypackagename.jbpm.IdentitySessionImpl" />
  | 	</transaction-context>
  | 	<import resource="jbpm.businesscalendar.cfg.xml" />
  | </jbpm-configuration>

That's my current knowledge about integrating jBPM 4 into Seam. Keep in mind that my application (and the integration) is not finished and there might be more issues to handle. But with these steps I'm able to run at least some simple business processes.

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

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

More information about the jboss-user mailing list