3 Replies Latest reply on May 24, 2007 10:48 AM by Olivier Cuzacq

    Design, Business model and Jbpm integration

    Olivier Cuzacq Newbie


      This is a simple general question regarding how to integrate external workflow and link it to the existing model of an application.

      Let's say we have a Item entity.
      A process describres the lifecycle and actions that need to be taken @ at different steps.
      Hence the different states of the process define the status of the Item.
      The first step is to had a foreign key from the entity to the token / process instance to be able to look up the corresponding jbpm resources.

      Then what is the best practice for resolving an item (or list of items) status, or search items by status in an efficient / flexible way ?

      - denormalize and keep the status on the item (updated to correct value at given process state)
      - ?


        • 1. Re: Design, Business model and Jbpm integration
          Ronald van Kuijk Master

          In 3.2 a businesskey can be added to the processinstance. So you can do it both ways. Add add the processinstance id (and maybe tokens if there is some forking) as a fk to your domain model or the other way around. Both work. I would only add a status to the domain if it is independent of the processes. e.g. getting a mortgage is a process (status: under request). Having one isn't (status: assigned(?), changing it is (status: choose one...) ;-))

          • 2. Re: Design, Business model and Jbpm integration
            Olivier Cuzacq Newbie

            Thanks Ronald,
            I checked the code and saw the key you're refering to :

            public ProcessInstance loadProcessInstance(ProcessDefinition processDefinition, String key);

            So, if I remove the status from the domain, and use that business key attribute to materialize the link between domain and process instance, what would be the elegant way of searching all the ITEMs in 'toBeValidated' Status (ie Node) ? :

            Call a custom query on Jbpm, get the matching nodes and use the associated business keys to load the corresponding domain entities ?

            I see that the API is rather Task oriented so I wonder if that would be a hint to another way of thinking this workflow integration.

            Thanks for you advices,

            • 3. Re: Design, Business model and Jbpm integration
              Olivier Cuzacq Newbie

              Any realworld experience with modeling and exploiting a domain entity' status as token's current state ? (including search/agregation, joining to the model and performance issues...) any feedback would be apreciated.