7 Replies Latest reply on Dec 15, 2005 4:28 PM by Sean

    unique id for each process Instance??

    for Jbpm Novice

      Hi!

      Is there any unique id associated with instance of processdefinition?
      which you can use to fetch a particular process later..
      How do you track a particular process to find out its state etc..?
      How do you get the pool of all the process instances?
      can A suprocess be instantiated on a different engine..(May be jbpm engine installed on another machine?)


      Thanks!

        • 1. Re: unique id for each process Instance??
          Sean Newbie

          Is there any unique id associated with instance of processdefinition?
          which you can use to fetch a particular process later..
          > yes, look at the jbpm_processinstance table

          How do you track a particular process to find out its state etc..?
          > The transaction is maintained outside the jBPM engine. ie: state is not saved until the jBPM engine exits and YOU commit the changes. You can make it save state at a more granular level, but it will be work on yor part.

          How do you get the pool of all the process instances?
          query the jbpm_processinstance table

          can A suprocess be instantiated on a different engine..(May be jbpm engine installed on another machine?)
          > I would not cross VMs for a single process instance. they need to talk to each other. essentially the end() method of the ProcessInstance resignals the parent token.

          • 2. Re: unique id for each process Instance??
            for Jbpm Novice

            hah!
            That was real fast!! Thanks a lot!!!
            How do you happen to know everything???
            Since when are working with this?

            Thanks a lot! again

            • 3. Re: unique id for each process Instance??
              Rainer Alfoeldi Novice

              Sean,

              there shouldn't be any problem crossing JVMs. You have exactly the same concurrency issues as in a single machine. It really shouldn't make a difference as everything happens against the db.

              Greetings

              Rainer

              • 4. Re: unique id for each process Instance??
                Sean Newbie

                I've been deep in the code of jBPM over the last week. I've written my own persistent node, fork node, join node, and sub process node.

                I always hate it when my questions go unanswered, so if I can help out, I do.

                Sean

                • 5. Re: unique id for each process Instance??
                  Sean Newbie

                  Hmmm. maybe. I was unable to get the subprocess to work for me in 3.0, so I can't be positive.

                  I imagine the scenario like this:

                  VM1: mainprocess
                  ---> calls subprocess (through RMI/etc) on VM2

                  VM2: subprocess
                  ---> ends and signals main token to continue
                  ---> the main token will now continue on VM2!

                  This is me reading the code, so I could be tested wrong... but it appears you have no control over ProcessInstance.end() logic. It is going to signal the ProcessState to continue.

                  It just looks ugly. I wouldn't do it.

                  Our plan is to run different process instances on different VMs, but a process instance's lifecycle will live on one VM.

                  Sean

                  • 6. Re: unique id for each process Instance??
                    for Jbpm Novice

                     

                    Our plan is to run different process instances on different VMs, but a process instance's lifecycle will live on one VM.


                    Could you please elaborate this??

                    I think with Jbpm, I will have to create my own webinterface etc.. so I am gonna need to update it lot many times for displaying current state. ( the way you said *commit* the changes save the state everytime.)

                    Lot of reading to do now. Can you please refer me to some documents which may be helpful for me for jbpm?

                    Thanks!

                    • 7. Re: unique id for each process Instance??
                      Sean Newbie

                      I am running jBPM inside Jetty. It is a lightweight webserver that allows me to issue URL commands to do stuff against jBPM.

                      I have methods such as:
                      startProcess
                      signalToken
                      pauseProcess
                      restartTokenNode
                      endProcess

                      We can then deploy as many Jetty instances as we want. We then register each IP + port in a database and have our GUI or scheduler issue the URL command on the appropriate IP + Port. (The IP + Port will have names and for a level of indirection so that scheduler entries will say: startProcess on VM5, not IP + port).

                      If you want to save state all the time, I recommend creating a custom node base class that hides the work for you. What I do (which is considered evil) is essentially pass the jBPM session into the node via a transient context variable. I then pull it out in the node and commit changes when I find it appropriate ( I do it twice, once before executing custom logic and once after executing custom logic).

                      Sean