5 Replies Latest reply on Jun 14, 2007 8:35 PM by roy007

    JBPM Integration

    amontobin

      Hi,

      Currently, i'm studying usage of workflow mangament in particular for doing a big application. My application will have its own persistence (Hibernate or Ejb3), it's own user interface, it's own authentification, it's own task management .... My questions concerns integration between my application and jbpm because i want this integration to be as close as possible.

      In domain model, i will have different type of entities that will possess their own workflows.

      1. Workflow Modelling and integration with jbpm
      Supposer i'm writing a worflow for entity E. Instances of entity E are stored in the database A. JBPM workflow is stored inn database B.
      If i want to create a workflow for entity E, do i have to store the id of each instance in the jbpm's context of the process instance in order to do the link between my application and jbpm process ?
      If i do that, my actions will do for instance :
      // retrieve context variable for id
      int id = context.get("entityid");
      // connect to database A and retrieve entity with id.
      // do some business on database A
      // eventually, modify context for adding/removing/changing values
      Is it good to do that ?

      If i want to find in which state is my object with id i. I will have to find all process instances, get the context for each one, and loook to find the one with the variable "entityid" containing the value i. Is this correct ?

      2. User/Task Integration
      If my application have its own entities for (User, Group, Tasks, Rights ...)
      How do i link with same entities of jbpm ?
      How do i do for using my own definition instead of jbpm definitions ?
      Maybe should i create one user on the jbpm for each user i have in my application ?
      Maybe i can rewrite factory for doing my own persistence ?
      How could i do a good integration with my application ?

      3. Maintenance
      Business has changed and i have added/removed some states to the process defintion. When deploying a new process definition, a new version is created.
      What happen to the objects (Ids) that where already in the workflow ?
      Do i have to do an sql patch procedure to move my objects already in the workflow to a consistent state according to the new prcocess definition ?

      If you have any hints to answer theses questions or present how to integrate jbpm with an application, your help will be very appreciate.

      I hope to explain my questions as clear as possible.

      Thank you.
      Sebastien Boutte

        • 1. Re: JBPM Integration

          Sebastien,

          I'm a relative newbie, so I can only help so much.


          If i want to create a workflow for entity E, do i have to store the id of each instance in the jbpm's context of the process instance in order to do the link between my application and jbpm process ?

          Yes, that's the general approach

          If my application have its own entities for (User, Group, Tasks, Rights ...)
          How do i link with same entities of jbpm ?

          The identify module is well-isolated and designed to be replaced with whatever you need. See the userguide and javadocs.

          Business has changed and i have added/removed some states to the process defintion. When deploying a new process definition, a new version is created.
          What happen to the objects (Ids) that where already in the workflow ?

          They continue to use the old version of the process definition. Old versions are retained in the database for that reason.
          Do i have to do an sql patch procedure to move my objects already in the workflow to a consistent state according to the new prcocess definition ?

          Only if you don't want them to continue using the old version.

          -Ed Staub

          • 2. Re: JBPM Integration
            amontobin

            Hi ed,

            I've seen in the pluggable part of documentation that you can rewrite 'TaskManagementModule'. and that you can rewrite Authentication to change the default authentication.

            Is there already some sql-samples for migrating process ?

            If i create an ear, do i have to import the jbpm console to manage the deployement of workflow in my application ?

            Thank You

            Sebastien

            • 3. Re: JBPM Integration

               

              Is there already some sql-samples for migrating process ?


              Sorry, don't know. I'd have to search around... you should do that.

              If i create an ear, do i have to import the jbpm console to manage the deployement of workflow in my application ?


              Take a look at the jbpm-enterprise.ear that the project creates now.
              I guess it depends on what you'd want to do instead, why you wouldn't want to, etc. The short answer is "yes", you need it.

              -Ed Staub

              • 4. Re: JBPM Integration
                amontobin

                Thank you Ed. I will continue to study in depth jbpm.

                Regards,

                Sebastien

                • 5. Re: JBPM Integration
                  roy007

                  Hi Sebastian,

                  Your post has been very helpful as I am in the process of evaluating different WFM solutions and had the same questions and concerns. A lot of those were clarified by your post.

                  I still have one question maybe you can help me understand this...

                  Suppose I have a status field in my entity E mapping to table in schema A and the workflow is describing an approval process (jBPM using schema B). So if I want to update the status field of my entity do I need to use a transaction manager so that both these operations commit to the DB atomically.

                  Since I am using spring I am thinking I can write an aspect that would get me the state and then I could update my entity status field.

                  Are there other ways of doing this? Is this the right way to do it?

                  thnx in advance.