I see a number of similarities between the proposed business keys in jPDL, natural IDs in
Hibernate and correlation sets in BPEL.
"Hibernate Reference" wrote : A natural key is a property or combination of
properties that is unique and non-null. [...]Hibernate will generate the necessary unique
key and nullability constraints
"BPEL4WS 1.1" wrote : Each correlation set is a named group of properties that,
taken together, serve to identify an application-level conversation within a business
protocol
| instance.
Notice the "combination" or "group" of "properties"
references and the association to the identity of an instance. In both cases, the name and
type of the properties are defined by the user.
Correlation sets exist due to the opaque nature of the instance id. Conversely,
natural-ids and business keys are convenient, user-defined handles to the instance id.
Adding a "businessKey" property to the ProcessInstance class is not the way to
go, because its name and type would not be defined by the user anymore. Further, composite
business keys would not be possible anymore.
I see three ways:
1. Take Jeff's suggestion. Developers subclass ProcessInstance, add properties to the
subclass and define natural-ids on them.
-> Subclassing ProcessInstance might not be desirable. Further, jBPM would neither be
able to provide an API to get the business key(s) associated with a process instance, nor
retrieve the process instance given a business key.
2. Create a BusinessKey class. Define a bidirectional association between one
ProcessInstance and many BusinessKeys. Developers subclass BusinessKey, add properties to
the subclass and define natural-ids on them.
->jBPM would be able to provide an API to get the business key(s) associated with a
process instance, but not retrieve a process instance given a business key.
3. Create a BusinessKey class. Define a bidirectional association between one
ProcessInstance and many BusinessKeys. Developers add properties to a map in BusinessKey.
->jBPM would be able to provide an API to get the business key(s) associated with a
process instance *and* retrieve a process instance given a business key. However, lookups
by business key cannot be fast, as Britt wants, because property values are stored in rows
rather than columns.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4017377#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...