5 Replies Latest reply on Oct 16, 2008 5:13 AM by kconner

    jBPM Integration - Bug and improvement ideas

    camunda

      Hi.

      I currently have a deeper look into the jBPM/ESB integration. Some things still puzzle me, and I wanted to raise two issues here because I see room for improvement ;-)

      1.) Bug in JBpmCallback?

      The JBpmCallback should send a signal to the one jbpm process, which triggered the ESB-Service. Right? (By the way: Some JavaDoc would be very nice here :-))

      I think there is a bug in the implementation, and I didn't find a test for it, so I am not sure if it is really a bug or if I got the use case wrong:

      CommandExecutor, line 127 (CALLBACK_EXECUTOR) is
      EPR toEpr = message.getHeader().getCall().getTo()

      Shouldn't that be
      EPR toEpr = message.getHeader().getCall().getReplyTo()

      The required token information is set in the replyTo EPR, and this makes sense:

      EsbActionHandler:
      EPR replyTo = createReplyTo(esbToBpmVarsXml, globalProcessScope, executionContext);
      message.getHeader().getCall().setReplyTo(replyTo);

      Or did I miss something?

      2.) Codebase around CommandExecutor

      The CommandExecutor class and the stuff arround it is quite hard to understand I think. It is a Command pattern (ESB: execute(message)) with a nested Command pattern (jBPM: execute(Command)). Is there a special reason for this? Why is it not done via methods (e.g. commandExecutor.executeCallback(method))? Even if that would require some if/else parsing for the OpCodes it would be much easier to understand I think. Or what do you think?

      Don't get me wrong, the code overall is okay, but I find the structuring very confusing and ApiDoc are mostly missing...

      Before I get dismissed, I can also volunteer for improving some of this areas :-) Since I expect to tackle a lot of these things anyway at the moment. I am committer in jBPM, so I signed the contributer agreement already, just need access to the SVN if you want to....

      Let me know what you guys think about it!

      Cheers
      Bernd

        • 1. Re: jBPM Integration - Bug and improvement ideas
          camunda

          Short addition: The JbpmCallback doesn't work in the same way the other stuff does (BpmProcessor with command), this is also not consistent.

          • 2. Re: jBPM Integration - Bug and improvement ideas
            kconner

            Sorry, but the To EPR is the correct one. It is the incoming information which was originally specified in the ReplyTo of the outgoing request. It is not a bug in JBpmCallback.

            It's purpose is very different from BpmProcessor.

            • 3. Re: jBPM Integration - Bug and improvement ideas
              camunda

              Can you point me to the right docs/sample or whatever to get the idea of the JbpmCallback? Thanks...

              • 4. Re: jBPM Integration - Bug and improvement ideas
                camunda

                Hi Kevin.

                Okay, I walked through a lot more documentation, code and examples and got the idea now... Sorry for bothering you in the first place! And next time I will RTFM and use the user forum first... Hopefully I didn't gambled away credits!

                But the second point is still an issue to me, better understandable code would be cool. Or should that be postponed for the integration of jBPM 4?

                Just would be interested what you think about it...

                Thanks
                Bernd

                • 5. Re: jBPM Integration - Bug and improvement ideas
                  kconner

                  You haven't gambled away any credits :)

                  As for BpmProcessor, I tend to agree with your observations. This was from the original integration of jBPM but had some serious issues. The integration was, therefore, redone (and simplified) but some of the original code is still present.

                  Tidying it up is certainly something that we need to do but we have had higher priority issues to deal with.

                  We will certainly be redoing this for ESB 5, regardless of which version of jBPM is included.