[jboss-user] [JBoss jBPM] - Re: Autostart process on JBoss start

Candersen do-not-reply at jboss.com
Fri Dec 21 05:21:17 EST 2007


Hello,

thanks for the answer, it works, but not to the extent I like it to work. I wrote a class that should start my process, it looks like this:


  | package myPackage.process;
  | 
  | import java.io.IOException;
  | 
  | import javax.servlet.Servlet;
  | import javax.servlet.ServletConfig;
  | import javax.servlet.ServletException;
  | import javax.servlet.ServletRequest;
  | import javax.servlet.ServletResponse;
  | 
  | import org.jbpm.JbpmConfiguration;
  | import org.jbpm.JbpmContext;
  | 
  | public class ProzessStarter implements Servlet {
  |     
  |     public void init(ServletConfig config) throws ServletException {
  | 
  |            JbpmConfiguration jc = JbpmConfiguration.getInstance();
  |            JbpmContext jcx = jc.createJbpmContext();
  | 	jc.startJobExecutor();
  | 	jcx.newProcessInstance("MyProcess").signal();
  |     }
  | 
  |     public void destroy() {
  |     }
  | 
  |     public ServletConfig getServletConfig() {
  | 	// TODO Auto-generated method stub
  | 	return null;
  |     }
  | 
  |     public String getServletInfo() {
  | 	// TODO Auto-generated method stub
  | 	return null;
  |     }
  | 
  |     public void service(ServletRequest arg0, ServletResponse arg1)
  | 	    throws ServletException, IOException {
  | 	// TODO Auto-generated method stub
  | 	
  |     }
  | }
  | 

I added the servlet to the web.xml of the jbpm-console.war:


  | <servlet>
  |         <servlet-name>ZKSStartupServlet</servlet-name>
  |         <servlet-class>dev.zksabfall.service.prozess.ProzessStarter</        servlet-class>
  |     	<load-on-startup>2</load-on-startup>
  |     </servlet>
  | 

It starts the process on startup of the server, but I have a timer in the first state the process goes into. The problem is now: The timer isn't fired, the process waits in the state.

Am I missing something in the code of the servlet?

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

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



More information about the jboss-user mailing list