0 Replies Latest reply on Feb 9, 2011 11:13 AM by keljboss

    Jboss ESB JBPM - No EPR present in process instance

    keljboss

      Hi,

       

      I am a new in jboss ESB, I am triyng to make JBPM and JBOSS ESB exchange().

       

      my example is that jbpm calls ESB and get the response, when i test the esb using soapUI the process work fine, but using JBPM i have the exception below

       

      org.jboss.soa.esb.ConfigurationException: No EPR present in process instance

                at org.jboss.soa.esb.services.jbpm.actionhandlers.EsbActionHandler.execute(EsbActionHandler.java:137)

       

      my jboss-esb.xml

       

      <?xml version="1.0"?><jbossesb parameterReloadSecs="5"xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.3.0.xsd"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.3.0.xsdhttp://anonsvn.jboss.org/repos/labs/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.3.0.xsd"><providers>  <jbr-provider name="ibaSommeHttpGateway" protocol="http">   <jbr-bus busid="ibaSommeHttpGateway" port="9999"/>  </jbr-provider>  <jbr-provider name="ibaMultiplicationHttpGateway" protocol="http">   <jbr-bus busid="ibaMultiplicationHttpGateway" port="7777"/>  </jbr-provider></providers><services><service category="Calcule"   description="calcule la somme de deux valeurs" invmScope="GLOBAL" name="somme">   <listeners>    <jbr-listener busidref="ibaSommeHttpGateway" is-gateway="true" name="ibaHttpSommeGatewayListener"/>   </listeners>   <actions mep="RequestResponse">    <action class="org.jboss.soa.esb.actions.routing.http.HttpRouter" name="ibaSommeHttpRouter">     <property name="method" value="POST"/>     <property name="endpointUrl" value="http://localhost:8080/somme/SommeService?wsdl"/>     <property name="endpointAdresse" value="http://localhost:8080/somme/SommeService?wsdl"/>     <property name="reply-to-originator" value="true"/>    </action>    <action class="org.jboss.soa.esb.actions.SystemPrintln" name="message">     <property name="message" value="in the somme yoooou pi ESB"/>    </action>   </actions>  </service>  <service category="Calcule"   description="calcule la multiplication de deux valeurs"   invmScope="GLOBAL" name="multiplication">   <listeners>    <jbr-listener busidref="ibaMultiplicationHttpGateway"     is-gateway="true" name="ibaHttpMultiGatewayListener"/>   </listeners>   <actions mep="RequestResponse">    <action class="org.jboss.soa.esb.actions.routing.http.HttpRouter" name="ibaMultiplicationHttpRouter">     <property name="method" value="POST"/>     <property name="endpointUrl" value="http://localhost:8080/multiplication/MultiplicationService?wsdl"/>      <property name="reply-to-originator" value="true"/>    </action>    <action class="org.jboss.soa.esb.actions.SystemPrintln" name="message">     <property name="message" value="in the multiplication ESB"/>    </action>   </actions>  </service></services></jbossesb>

       

       

       

       

      and the precessdefinition.xml

       

       

      <?xml version="1.0" encoding="utf-8"?><process-definition xmlns="urn:jbpm.org:jpdl-3.2"          name="calcule"> 
               <start-state name="start">  
                        <transition to="somme" name="callSomme">          
                          <action name="action">    
                                          <message>Going to the SOe</message> 
                                   </action>   
                       </transition>    
            </start-state>        
        <node name="somme">             
             <action    class="org.jboss.soa.esb.services.jbpm.actionhandlers.EsbActionHandler">  
              <replyToOriginator>true</replyToOriginator>
                                     <esbServiceName>somme</esbServiceName>
                                     <esbCategoryName>Calcule</esbCategoryName>
                                     <replyToOriginator>reply</replyToOriginator>
                                     <bpmToEsbVars>                                        <mapping bpm="a" esb="a"></mapping>                                        <mapping bpm="b" esb="b"></mapping>                              </bpmToEsbVars>                              <esbToBpmVars>                                        <mapping bpm="somme" esb="somme"></mapping>                              </esbToBpmVars>                    </action>                    <transition to="fin" name="tofin">                    </transition>          </node>          <end-state name="fin"></end-state></process-definition>

       

      the java code :

       

       

           JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance();    
        JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();    
        GraphSession graphSession = jbpmContext.getGraphSession();   
        ProcessDefinition processDefinition =           
               graphSession.findLatestProcessDefinition("calcule");  
          String a = request.getParameter("a");    
       String b = request.getParameter("b");   
       ProcessInstance processInstance = new ProcessInstance(processDefinition);  
       Token token = processInstance.getRootToken(); 
       System.out.println(token.getNode().getName());   
       ContextInstance contextInstance = processInstance.getContextInstance(); 
       contextInstance.setVariable("a", new Float(500));    
       contextInstance.setVariable("b", new Float(500));     
       processInstance.getRootToken().signal(); 

       

       

       

      is there anything that i messed ?

       

       

      for information i am using jboss-esb4.9,  jbpm 3.2  and jbossAS 5.1.0GA

       

      thank you for your help

       

      Cheers