Hi!
I created a servlet to start the standard jbpm process "websale". I simply
deployed it to the server. This is the code:
| import java.io.IOException;
|
| import javax.servlet.ServletException;
| import javax.servlet.http.HttpServletRequest;
| import javax.servlet.http.HttpServletResponse;
|
| import org.jbpm.graph.def.ProcessDefinition;
| import org.jbpm.JbpmConfiguration;
| import org.jbpm.JbpmContext;
| import org.jbpm.db.GraphSession;
| import org.jbpm.graph.exe.ProcessInstance;
|
| public class HelloWorld extends javax.servlet.http.HttpServlet implements
javax.servlet.Servlet {
| static final long serialVersionUID = 1L;
|
| private void startProcessDefinition() {
| String processDefinitionName = new String("websale");
| JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance();
| JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
| try {
| GraphSession graphSession = jbpmContext.getGraphSession();
| ProcessDefinition definition =
graphSession.findLatestProcessDefinition(processDefinitionName);
| ProcessInstance instance = definition.createProcessInstance();
| instance.signal();
| jbpmContext.save(instance);
| } finally {
| jbpmContext.close();
| }
| }
|
| public HelloWorld() {
| super();
| }
|
| protected void doGet( HttpServletRequest request,
| HttpServletResponse response)
| throws ServletException, IOException {
| startProcessDefinition();
| }
| }
But when I execute it the following error comes up:
anonymous wrote : org.jbpm.JbpmException: couldn't find process definition
'websale'
| org.jbpm.db.GraphSession.findLatestProcessDefinition(GraphSession.java:170)
| HelloWorld.startProcessDefinition(HelloWorld.java:24)
| HelloWorld.doGet(HelloWorld.java:43)
| javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
| javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
| org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
The process is deployed and works fine.
I tried to configure the hibernate.cfg.xml (located in the WebContent directory) file and
also tried to find some help in the docu.
Hope you can help me.
Bye
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4151154#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...