4 Replies Latest reply on Apr 23, 2008 10:05 AM by richard bradwell

    The 'correct' way to join application data to a workflow ins

    Nathan Coast Newbie

      My app has a persistent business object model. I also have a persistent jbpm workflow which describes the status of an entities in my biz model.

      I need to select entities based on their workflow state and their data. E.g. A global document system where documents are approved by regional editors. I need to select all documents in the state "awaiting approval" where the document region is EU.

      I'm not sure of the correct approach to model this:

      1) place the relevant document attributes (doc_id, region) as variables within the workflow. Search for approval workflow tasks with matching process vars - region = 'EU'. Necessitates duplication of vars between biz entity and process vars.

      2) add an attribute to the doc entity (process_id). Search for approval workflow tasks, joined to biz model where doc.region = 'EU' and doc.process_id = foo.

      3) place the doc_id as a variable in the workflow and query both process and biz database joined by doc_id and were doc.region = 'EU'

      Is there a "correct" way to achieve this?

      Thanks in advance,