4 Replies Latest reply on Nov 10, 2008 8:15 AM by salaboy21

    find a process instance

    tbee

      I'm a bit confused; the documentation has an example on how to set context variables. In the part where it updates some variables, it takes the following steps:
      - findLatestProcessDefinition
      - findProcessInstances using the ProcessDefinition's id
      - get(0) because in the unit test there can only be one

      Now, I find it strange that it is just assumed that a process instance is based on the LATEST process definition. Normally I have a process instance id and have no idea if a newer version of the definition has been uploaded, so I cannot make that assumption.

      How do I retrieve the process instance based on just the id? I can probably query the tables, find the definition id from the jbpm_procesinstance table and from there continue, but I assume there must be an API for this.