3 Replies Latest reply on Aug 19, 2009 4:03 PM by kukeltje

    Linking JBPM processes with external entities

    dinosaurus

      Hello,

      We have a legacy system which uses Hibernate and JBPM for tracking entity state in workflow. E.g. we have Offer business entity which is processed through an approval cycle.

      In our entity we have a process id field/property which points to the process instance it is bound to. Every time we have some workflow transitions with execute them on this process instance.

      Currently we have e problem with cross querying between JBPM and our system's entities. E.g. we need to search for Offers by their attributes and by workflow states. Since JBPM API is designed so that it hides direct Hibernate object mappings it is unclear how to do such type of queries.

      Could you please advice what to do in such situations?

      Thanks in advance

        • 1. Re: Linking JBPM processes with external entities
          kukeltje

          what version? In 3 you can get a hibernate session and do whatever you want. in 4 there are query api's.

          • 2. Re: Linking JBPM processes with external entities
            dinosaurus

            - We're planning to use JBPM 4.0 but I see no possibility to do mentioned above queries using query API. I see only ProcessInstanceQuery class providing very basic functionality. Or You meant some other API, are You?

            - If I do queries through Hibernate session I'll be automatically dependent on some internal JBPM classes like: org.jbpm.pvm.internal.model.ExecutionImpl. Is it legal? Which is official JBPM position on that?

            - Also developer's guide says:
            "Currently jBPM's persistence is based on hibernate. But in the future we might switch to JPA. That is why we recommend to stick with the API as much as possible as the API will hide you from those changes. "
            (http://docs.jboss.com/jbpm/v4.0/devguide/html_single/)

            • 3. Re: Linking JBPM processes with external entities
              kukeltje

              - I never mentioned that the query api's would do what you need, I just wanted to point at the differences between 3 and 4

              - Custom queries through sessions are not supported on jbpm4 yet (not sure if they will be or if the query api will/need to be extended.

              - Correct, see previous statement