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?
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