-
15. Re: jBPM integration question
pmuir Apr 6, 2007 6:00 AM (in response to fady.matar)You just need
@Name("org.jboss.seam.core.jbpm.init") @Install(true) public class JbpmInitializer extends Jbpm {
to get it to start.
I'm not sure which lines actually start jbpm, but I guess you know ;)
I would do a super.startup() as well, to make sure that all the standard seam init occurs... -
16. Re: jBPM integration question
fady.matar Apr 6, 2007 6:48 AM (in response to fady.matar)thanks for the feedback. I gave it a try at a simple level and I don't think it's working out. How can I check if the component has been initialized?
-
17. Re: jBPM integration question
pmuir Apr 6, 2007 7:04 AM (in response to fady.matar)It will appear in the startup log and on the debug page in application scope as xxx.component
-
18. Re: jBPM integration question
fady.matar Apr 6, 2007 7:09 AM (in response to fady.matar)I guess it's working, checked the logs and found the following
2007-04-06 14:04:30,031 INFO [org.jboss.seam.Component] Component: org.jboss.seam.core.jbpm.init, scope: APPLICATION, type: JAVA_BEAN, class: org.jbpm.console.core.JbpmInitializer
-
19. Re: jBPM integration question
fady.matar Apr 6, 2007 7:10 AM (in response to fady.matar)upon installation the executed code is done in the startup method right?
-
20. Re: jBPM integration question
pmuir Apr 6, 2007 7:14 AM (in response to fady.matar)Yes, thats working. As the base component is annotated @Startup and in the application startup, then the component will be created during application startup, and hence, the method annotated @create will be run
-
21. Re: jBPM integration question
sunfire Apr 6, 2007 9:45 AM (in response to fady.matar)This one works well for me
@Intercept(NEVER) @Name("org.jboss.seam.core.jbpm.init") @Startup(depends={"org.jboss.seam.core.jbpm"}) @Install(dependencies="org.jboss.seam.core.jbpm") public class JbpmInitializer extends Jbpm { private static final LogProvider log = Logging.getLogProvider(JbpmInitializer.class); public void startup() throws Exception { super.startup(); if(getProcessDefinitions() == null || getProcessDefinitions().length < 1 ) { try { getJbpmConfiguration().createJbpmContext().getContextSession(); } catch(Exception e) { log.error("jBPM Initialization Exception: " + e.getMessage()); e.printStackTrace(); } } } }
With it you can either deploy your processes with Seam or with something external. It will only be used if you enable JBPM in your components.xml and if no process definitions are set it will handle your schema creation/update. -
22. Re: jBPM integration question
fady.matar Apr 6, 2007 10:22 AM (in response to fady.matar)Thanks a lot, got it working. I had commented out the jbpm configuration in components.xml
-
23. Re: jBPM integration question
fady.matar Jun 24, 2007 6:12 PM (in response to fady.matar)Now this approach does not work out anymore since I upgraded from CVS to version 1.3.0.BETA1
@Interceptor(NEVER) is no longer there because of a change in API. I have created my modification as follows and still the jbpm database is not being deployed automatically without having any process definition or page flow declared.package org.jboss.jbpm.console.console; import org.jboss.seam.annotations.Install; import org.jboss.seam.annotations.Logger; import org.jboss.seam.annotations.Name; import org.jboss.seam.annotations.Startup; import org.jboss.seam.annotations.intercept.Interceptor; import org.jboss.seam.bpm.Jbpm; import org.jboss.seam.log.Log; import static org.jboss.seam.annotations.intercept.InterceptorType.ANY; @Interceptor(type = ANY) @Name("org.jboss.console.bpm.init") @Startup(depends = { "org.jboss.seam.bpm.jbpm" }) @Install(dependencies = "org.jboss.seam.bpm.jbpm") public class JbpmInitializer extends Jbpm { @Logger Log log; /** * Startup method to start the jbpm context */ public void startup() throws Exception { super.startup(); if (getProcessDefinitions() == null || getProcessDefinitions().length < 1) { try { log.debug("Starting up jBPM"); getJbpmConfiguration().createJbpmContext().getContextSession(); log.debug("jBPM initialized"); } catch (Exception e) { log.error("jBPM Initialization Exception: " + e.getMessage()); e.printStackTrace(); } } } }
-
24. Re: jBPM integration question
gavin.king Jun 24, 2007 6:19 PM (in response to fady.matar)@BypassInterceptors is the replacement.
-
25. Re: jBPM integration question
fady.matar Jun 24, 2007 6:30 PM (in response to fady.matar)Thanks Gavin but still that didn't work. Is there any parameter for the
BypassInterceptors ? -
26. Re: jBPM integration question
gavin.king Jun 24, 2007 6:46 PM (in response to fady.matar)I just added a new protected method, so you can do:
@Scope(ScopeType.APPLICATION) @BypassInterceptors @Startup @Name("org.jboss.seam.bpm.jbpm") public class MyJbpm extends org.jboss.seam.bpm.Jbpm { protected boolean isProcessDeploymentEnabled() { return true; } }
-
27. Re: jBPM integration question
fady.matar Jun 24, 2007 7:03 PM (in response to fady.matar)Great, I'll checkout again from CVS and give it a try.
-
28. Re: jBPM integration question
fady.matar Jun 25, 2007 3:33 AM (in response to fady.matar)Gavin, I have followed the approach and I can see the hibernate mappings on the console, however the tables are not being created and I'm sure that the datasource configuration is correct pointing to the right database.
On the other end when commenting out the bpm configuration from the components.xml<bpm:jbpm> <bpm:process-definitions></bpm:process-definitions> <bpm:pageflow-definitions></bpm:pageflow-definitions> </bpm:jbpm>
an exception is thrown indicating that the content of the XML elements cannot be empty -
29. Re: jBPM integration question
fady.matar Jun 25, 2007 3:42 AM (in response to fady.matar)I figured out the error. The namespace wasn't declared in component.xml since it moved from 'core' to 'jbpm'
But still the database contains no tables.