7 Replies Latest reply on Aug 30, 2010 3:15 AM by h4rlock

    Extending jBPM 4 history service

    mpradny

      Hello,

      I'm evaluating jBPM for one project. We want to move process definitions from existing system to separate server running jBPM that could be potentially reused. I've to create possible integration scenario.

      Current system is fully functional and the user frontend is working, but since we want to have more flexible process definitions, moving them to JBPM would help us a lot.

      My idea was:

      1. Current system would signal user activities to jBPM, e.g. activity completed (since this would be just a small change in code where we currently do this with local data, no big deal)
      2. I need to get feedback from the jBPM about instance progress. I don't want to put this as automated activity or listener 1000 times in every process, so I was thinking about a general solution.
      My idea is to create custom history service implementation that would do updates to current database. Then it could be completely process independent and process designers would not have to worry about this.

      Has anyone tried this? So far I haven't found clean way how to add custom history service to jBPM via configuration. Ideally I would like just to plug my eg. CustomHistoryService to standard jBPM build to get it running.

      Is this feasible? If you think that this can't be covered by jBPM use cases, let me know too.

      Thanks,

      Martin

        • 1. Re: Extending jBPM 4 history service
          jbarrez

          It's certainly possible. I don't know for jBPM 4 (yet), but for jBPM Bernd Ruëcker has written a good articale about it: http://www.bpm-guide.de/2008/12/06/easily-generate-bam-events-wih-jbpm/

          Perhaps you can use the ideas in the article for your problem.

          • 2. Re: Extending jBPM 4 history service
            mpradny

            Thank you, if I have seen this before I could save some brain power. At least I came to similar conclusion :).

            Does anyone know how to this could be done in jBPM 4 configuration? Since I'm starting new project and it probably will not be done by summer, when jBPM4 should be final, I wanted to use it.

            If not, I will stick to jBPM3 for now.

            Martin

            • 3. Re: Extending jBPM 4 history service

              Hello Martin,

              What was the results of your investigation about extending the history service ?


              Regards,
              David

              • 4. Re: Extending jBPM 4 history service
                mpradny

                Hello,

                I just created small demo that did work. I needed some other features that were not part of jBPM 4.0, but are in version 4.2, so I plan to get back to it and get some stable solution now.

                Martin

                • 5. Re: Extending jBPM 4 history service
                  h4rlock

                  Hi Martin,

                  how did you extend the jbpm4 history service?

                   

                  I will be very thankful to you if you can help me, since I have a similar issue to resolve..

                   

                   

                  Marco

                  • 6. Re: Extending jBPM 4 history service
                    h4rlock

                    Ok, now I am able to extend the HistorySession and I can intercept ProcessInstanceCreate (or whatever..).

                    Does anyone knows how can I access to the object tied to the event in the HistorySession?

                     

                    i.e. Here I would like to log the process instance id...

                     

                     

                    public class TestHistSession implements HistorySession {
                    
                        public void process(final HistoryEvent historyEvent) {
                            if (historyEvent instanceof ProcessInstanceCreate) {
                                final ProcessInstanceCreate p = (ProcessInstanceCreate) historyEvent;
                                // TODO what can I do here???
                            }
                        }
                    
                    }
                    

                     

                    thank you

                     

                    Marco

                    • 7. Re: Extending jBPM 4 history service
                      h4rlock

                      resolved in 4.4 which has getters in HistoryEvent implementations...