cancel
Showing results for 
Search instead for 
Did you mean: 

Associating process instances with objects in domain model

chrisc
Champ in-the-making
Champ in-the-making
This is a fairly high level question and may be going down the wrong path but I was wondering how to associate a ProcessInstance with an object instance in my domain model.

Scenario:

The process of an Invoice in the domain model with line items, customer details etc., is to have its processing managed via a ProcessInstance in the workflow engine.

Typically in a traditional state machine based design where each process is defined by a separate class definition a class would exist like InvoiceProcessInstance and it would have a reference to the Invoice object in the domain model.

Given that in Activiti (and jBPM) processes are implemented using generic objects generated from the XML process definition file how can one achieve the same kind of relationship from a ProcessInstance to an object in the domain model?
3 REPLIES 3

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
By using process variables, the businesskey etc… You can 'store' the relation to jpa entities in activiti. Look at the examples.

chrisc
Champ in-the-making
Champ in-the-making
Arh yes the JPA integration certainly does look nice and makes the process definition xml more concise.

We mainly use JDO. Do you have any plans to create a JDO integration as well?

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
I don't think something similar will be developed for JDO, at least not by the core team.

Maybe time to switch 😉

But you can always store something like the id of the object in a processvariable, prefixed by the classname or something… or the other way around, use the businesskey in both the process and your domain data so it is a shared key