1 Reply Latest reply on Apr 12, 2008 5:07 AM by bryan borg

    Token.signal() for bpel process definitions

    bryan borg Newbie

      Hi all,

      I am trying to do something similar to the HelloWorld example (that ships with jbpm-jpdl), but through a bpel process definition.

      This is the code for the jpdl helloWorld example:

      
      ProcessDefinition processDefinition = ProcessDefinition.parseXmlString(
       "<process-definition>" +
       " <start-state>" +
       ................
       ................
       "</process-definition>"
       );
      
       ProcessInstance processInstance =
       new ProcessInstance(processDefinition);
      
       Token token = processInstance.getRootToken();
      
       token.signal();
      
      ...
      ...
      


      This code works fine ... however when i try to do the same thing using a bpel process definition using the following code:

      
      
       ZipInputStream zis = zis = new ZipInputStream(new
      BufferedInputStream(Thread.currentThread().getContextClassLoader().getResourceAsStream("helloWorldBpel.zip");));
      
       ProcessArchive processArchive = null ;
      
      
       try {
       processArchive = new ProcessArchive(zis);
       } catch (IOException e) {
       .....
       }
       ProcessDefinition processDefinition = processArchive.parseProcessDefinition();
      
       ProcessInstance processInstance =
       new ProcessInstance(processDefinition);
      
       Token token = processInstance.getRootToken();
      
       token.signal();
      
      


      i get the following exception:






      org.jbpm.JbpmException: token 'Token(/)' can't be signalled cause it is currently not positioned in a node
      at org.jbpm.graph.exe.Token.signal(Token.java:135)
      at com.concurrentllt.impl.ejb.session.TestSession.testCaseParseBpel(TestSession.java:860)
      at com.concurrentllt.impl.ejb.uibean.TestBean.execute(TestBean.java:92)
      at org.apache.jsp.results_jsp._jspService(results_jsp.java:80)
      at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:334)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
      at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
      at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
      at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
      at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
      at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
      at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
      at java.lang.Thread.run(Thread.java:595)



      Is this possible to do with a bpel process definition? (there is infact a package org.jbpm.bpel.graph.exe which i guess contains execution related artifacts for bpel graph definitions). Am i missing something?