6 Replies Latest reply on Sep 10, 2011 12:35 PM by huionn

    API Migration from jBPM 3 to jBPM 5

    huionn

      Hi,

      Now I am developing a case management system using Nuxeo Case Management Framework. However, its task management and workflow are quite restrictive.

      I would like to make the system more adaptive by integrating with jBPM5 (processes + rules + events).

       

      In Nuxeo EP, there is jBPM 3 integration with service APIs to encapsulate jBPM3 APIs. My plan is to follow the existing service APIs as much as possible and replace the implementation with jBPM 5. Technically speaking, it is actually not a migration but new integration because jBPM3 related codes will still remain as is.

       

      My questions:

      1. I have read about "jBPM5 migration tool project". Is this project already capable of "to map jBPM3 API usage to jBPM5 API usage"?

       

      2. If I have to do it manually, are there any general guideline in doing so?

       

      3. For example, org.jbpm.graph.exe.ProcessInstance API is different with org.jbpm.workflow.instance.WorkflowProcessInstance. In order to get some attributes like processInstance.getStart() and processInstance.getEnd(), I have to use org.drools.event.process.ProcessEventListener to set the values into workflowProcessInstance's variables (WorkflowProcessInstance.setVariable)?

       

      I am not familiar with jBPM API. Please correct me if I am wrong.

       

      Thanks.

        • 1. Re: API Migration from jBPM 3 to jBPM 5
          salaboy21

          Hi Hui,

          Let's go straight to the answers:

          1) the migration project, now included in jbpm5 is only for process definitions not fo the API usage

          2) Yes, you will probably need to do it manually, and it really depends on what you are doing with jBPM3, because there are some not mappeable methods

           

          3) I'm not sure about this, you can probably get the WorkflowProcessInstance, get the Process definition with some getProcess() method or something similar and then get the start and end node. I'm not sure what do you want to do that, but I think you can do it in some way, it should be so difficult.

           

          Hope it helps!

          • 2. Re: API Migration from jBPM 3 to jBPM 5
            huionn

            Thanks for your answer. You are very helpful in this community. I get the idea what I have to do now.

             

            Anyway, just as a comment, getStart() and getEnd() of jBPM3 ProcessInstance return start date and end date respectively. The dates are important in the application.

             

            I hope "it should be so difficult" is a typos

            • 3. Re: API Migration from jBPM 3 to jBPM 5
              salaboy21

              hehe yes.. it was a typo.. I'm sleepy...

              So if you want to get the start dates and end dates you can use your approach of storing the information somewhere with the org.drools.event.process.ProcessEventListener and then query that information. I'm not sure if adding that as process varible will be useful, do you need that information inside your process or you want to show that information in an administration console or something like that?

              Cheers

              • 4. Re: API Migration from jBPM 3 to jBPM 5
                huionn

                Hi Mauricio,

                I think you are right that the dates are not very useful. The start date is used for sorting and display purpose only.

                • 5. Re: API Migration from jBPM 3 to jBPM 5
                  salaboy21

                  If it's an important requirement for you I suggest you to insert that information somewhere (for example in a database) and using the ProcessEventListener and a new named query you can restore that information when you need to display it

                  Hope it helps

                  • 6. Re: API Migration from jBPM 3 to jBPM 5
                    huionn

                    You meant storing "start date", "end date" and other informations of process instance directly into process variable is less useful because the values are stored in binary format which cannot be queried for reporting/display?

                     

                    I think I know how to do it after checking https://github.com/droolsjbpm/jbpm/blob/master/jbpm-persistence-jpa/src/test/java/org/jbpm/persistence/session/VariablePersistenceStrategyTest.java