Title: Suggestion for Using WorkItem ID Versus NodeInstance ID
Fact: Interstage BPM Design Pattern Concerning WorkItem ID and NodeInstance ID
Fix:
This article is to advice BPM developers when to reference WorkItem ID versus NodeInstance ID.
(Note that NodeInstance ID is also known as ActivityInstance ID in database table. In java doc or other documentation, NodeInstance ID is used typically.)
WorkItem ID can change over time, while NodeInstance ID remains the same throughout the lifetime of a process instance. For example, WorkItem ID can change when it is being reassigned by the current assignee. WorkItem ID can also change when a particular activity is reactivated. NodeInstances, on the other hand, are created when the process is instantiated. The corresponding ID of the NodeInstance will remain the same throughout the lifetime of a process instance.
Simply put, you are discouraged from using WorkItem ID for anything that holds the value more than a few seconds. Instead, use the more persistent NodeInstance ID.
Acceptable for use of WorkItem ID:
· display a list of workitems for the user to click on – the list is displayed for a few seconds or minutes
· Immediate launching of an application that is going to do something with the workitem
· AJAX type interchanges between a live web page and the server.
Unacceptable uses:
· Email messages that might sit in a mailbox for hours or days.
· Incorporated in a URL that gets emailed for people to click on
· stored in another system that wants to link back
· URLS in files that get FTP around, or stored in a DMS
In all cases, the NodeInstance ID together with the user id can be used to look up the current work item. If people get into the practice of doing this all the time, life will be easier.