3 Replies Latest reply on Aug 21, 2006 7:27 AM by Tom Baeyens

    Want to contribute Commands, where to start?

    Bernd Ruecker Master

      Okay, first of all: Hello guys!

      I am glad to tell that I have joined the jbpm developer community. Tom has accepted me as committer also. So I hope we will have much fun together in the future :-)

      A few words about me: I am working in my own company named "camunda", which I founded in 2003. We are a small company and a main focus is doing projects at customers or go into larger projects as specialists. One part of our main focus is BPM with Java and so jBPM at the moment. So I have seen some (big) jBPM projects the last years. We developed some tools around jbpm and named it "toolkit for jbpm". Now I plan to contribute much of this code to the jbpm core.

      One important thing in the tk4jbpm is a EJB3 SLSB which I now plan to migrate to jbpm commands. But I have some questions on the jbpm commands in the CVS head:

      - Why do they call "JbpmContext context = JbpmContext.getCurrentJbpmContext();" in the execute method? Shouldn't that be hidden in a Command superclass? Or is the
      JbpmContext.getCurrentJbpmContext() usable in any environment? Also it seems to be deprectated. Sorry if this is a silly question, but I worked with a different use of the context in our bean the last year.

      - I don't know where are the constants "public static final String CMD_START_PROCESS = "jbpmStart";" in the Command-Interface are for. Any hints?

      - Why are there Hibernate mappings for the commands. In which circumstances are they persistent? I thought, I pass them to the CommandService and get a answer, why Hibernate?

      - How exactly are the Commands working. I think I have also seen them used internally in jbpm? Wheres a good starting point?

      Or is there some documentation or other Threads to read first? I think I have no full understanding how the commands should work. I thought of pure Java Command objects, send to [JBoss / Webapp / JMS / ...] and get back a result (if synchronous).

      If i Have gained a better understanding I think I can submit some additional commands.

      In a second step I want to change the remaining tk4jbpm (the Swing Admin-Client mainly) to work with these commands and the CommandService. A example screenshot for that Swing Admin-Client can be found on our homepage: http://www.camunda.com/toolkit_for_jbpm/tk-jbpm-screenshots.html


      So sorry for the long threadand I hope to get some answers to start contributing :-)

      Best regards from Stuttgart, Germany,

      Bernd

        • 1. Re: Want to contribute Commands, where to start?
          Ronald van Kuijk Master

          First, welcome. I've seen and tried some of your things and think your contributions will be a welcome addition.

          - Why do they call "JbpmContext context = JbpmContext.getCurrentJbpmContext();" in the execute method? Shouldn't that be hidden in a Command superclass?
          isn't it?

          - Why are there Hibernate mappings for the commands. In which circumstances are they persistent? I thought, I pass them to the CommandService and get a answer, why Hibernate?


          The async command executor in jbpm, which can be used as a simplified, not enterprise ready alternative to JMS. These commands are persisted so they can be executed at a later time and to survive a crash

          - How exactly are the Commands working. I think I have also seen them used internally in jbpm? Wheres a good starting point?

          The commandexecutor class/thread is one, the other is async functionality (they are related, one 'publishes', the other 'consumes'

          Or is there some documentation or other Threads to read first? I think I have no full understanding how the commands should work. I thought of pure Java Command objects, send to [JBoss / Webapp / JMS / ...] and get back a result (if synchronous).


          They are only used in asynchrounous stuff, maybe the ejb (have not looked into this) and the webservice stuff I'm working on.

          • 2. Re: Want to contribute Commands, where to start?
            Tom Baeyens Master

             

            "camunda" wrote:
            So I hope we will have much fun together in the future :-)


            I'm sure we'll have fun !

            First of all, the current command and slsb are designed by jim rigsbee. i only had a quick look at it. Seems a good start, but it's only one man's ideas and use cases. It's up to us to give it more review and model it to cover the most possible use cases. IIRC, Jim doesn't have much time to contribute any more, but i think he will be willing to explain the ideas behind his designs when we ask him.

            "camunda" wrote:

            - Why do they call "JbpmContext context = JbpmContext.getCurrentJbpmContext();" in the execute method? Shouldn't that be hidden in a Command superclass? Or is the
            JbpmContext.getCurrentJbpmContext() usable in any environment? Also it seems to be deprectated. Sorry if this is a silly question, but I worked with a different use of the context in our bean the last year.


            JbpmContext is indeed usable in any environment. It's a combination of a transaction scope demarcation and a services abstraction (see JbpmContext.getServices()). Services can have different implementations in different environments.

            I just had only a quick look, but i think the best would be to add the JbpmContext as a parameter in the execute method signature.


            "camunda" wrote:
            - I don't know where are the constants "public static final String CMD_START_PROCESS = "jbpmStart";" in the Command-Interface are for. Any hints?


            nope. me neither. (didn't look yet) if we can't figure it out in the next few weeks, we can always remove those.


            "camunda" wrote:
            - Why are there Hibernate mappings for the commands. In which circumstances are they persistent? I thought, I pass them to the CommandService and get a answer, why Hibernate?


            The idea is that inside of jbpm runtime operation, you use the message service. That is an abstraction of an asynchronous message service like JMS. For environments where you don't have JMS available, i have written a minimal, non-optimal implementation of a POJO message service based on persisting messages in the database. Those will only be used in a J2SE environment where JMS is not available.

            "camunda" wrote:
            - How exactly are the Commands working. I think I have also seen them used internally in jbpm? Wheres a good starting point?


            Main use case internally is the asynchronous continuations. Where a command is send to continue execution of a process asynchronously after a token entered a node (and before it is executed).

            "camunda" wrote:
            Or is there some documentation or other Threads to read first? I think I have no full understanding how the commands should work. I thought of pure Java Command objects, send to [JBoss / Webapp / JMS / ...] and get back a result (if synchronous).


            i have described my initial ideas behind the command pattern design in a wiki page: http://wiki.jboss.org/wiki/Wiki.jsp?page=JbpmCommands


            "camunda" wrote:
            In a second step I want to change the remaining tk4jbpm (the Swing Admin-Client mainly) to work with these commands and the CommandService. A example screenshot for that Swing Admin-Client can be found on our homepage: http://www.camunda.com/toolkit_for_jbpm/tk-jbpm-screenshots.html


            and will you contribute the swing client as well :-) ?


            • 3. Re: Want to contribute Commands, where to start?
              Tom Baeyens Master

              also for the commands as well as for the web app console, the first thing i'm trying to get going is to finish the build scripts so that we can create a proper development environment in HEAD.