[jboss-user] [jBPM] - jBPM - jBoss ESB integration

Andy Peer do-not-reply at jboss.com
Fri Jan 11 04:26:49 EST 2013

Andy Peer [https://community.jboss.org/people/Andy00] created the discussion

"jBPM - jBoss ESB integration"

To view the discussion, visit: https://community.jboss.org/message/790355#790355

Hi, I have a process which calls an esb service and I pass to this service some variables.
What I can't do, is to send back a variable to jbpm.

This is a snippet from processdefinition.xml
<node name="ESB State 2">
        <action class="org.jboss.soa.esb.services.jbpm.actionhandlers.EsbActionHandler">
                <mapping bpm="praticaTest" esb="praticaTest"></mapping>
                <mapping bpm="ESBexception" esb="ESBexception"></mapping>
        <transition to="Service call ok?"></transition>

<decision name="Service call ok?" expression="#{(ESBexception eq 'ESBexception' ? 'to Exception State' : 'to END')}">
        <transition to="Exception State" name="to Exception State"></transition>
        <transition to="END Test" name="to END"></transition>

This is from jboss-esb.xml
<service category="EntityServices"
   description="TestProcess JBPM service" name="TestProcess">
    <jms-listener busidref="testProcess_esb_channel" name="testProcessJMSListener"/>
   <actions mep="RequestResponse">
    <!-- log message in -->
    <action class="com.utils.esb.EsbLogger" name="EchoSoapMessage1">
     <property name="message" value="Start ESB - TestProcess -"/>
     class="com.esb.testProcess.handler.TestProcessHandler" name="TestProcessHandler">
     <property name="esbToBpmVars">
      <mapping bpm="ESBexception" esb="ESBexception"/>
    <!-- log message out -->
    <action class="com.utils.esb.EsbLogger" name="EchoSoapMessage2">
     <property name="message" value="End ESB - TestProcess -"/>

This is the handler defined above, TestProcessHandler:
    public Message process(Message message) throws Exception {
        Body body = message.getBody();
        ListString listValues = (ListString)body.get("praticaTest");
        message.getBody().add("ESBexception", "");
        try {
            logger.info("ESB TestProcessHandler - BEGIN");
            if (listValues.getString().get(0).equalsIgnoreCase("103")) {
                throw new Exception("******  Code generated exception  ***********");
            CommonAnagClient client = ClientServiceFactory.getCommonAnagClient();
            CommonAnag servicePort = client.getCommonAnagPort();
        catch (Exception e) {
            logger.info("ESB TestProcessHandler - EXCEPTION");
            message.getBody().add("ESBexception", "ESBexception");
        finally {
            logger.info("ESB TestProcessHandler - END");
        return message;

I can get the object praticaTest (jbpm -> esb) correctly, but in jbpm, the ESBexception value (in the decision node) is always null.
The ESBexception variable is set as a process variable when I first create a process instace.

What am I missing?

Reply to this message by going to Community

Start a new discussion in jBPM at Community

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20130111/25a6cd81/attachment-0001.html 

More information about the jboss-user mailing list