You are here: Building applications > Creating the User Experience > Understanding work item IDs

Work item IDs

A work item ID is the permanent, external identifier of a work item, the value of property Work-.pyID.

Prefixes and suffixes

By default, the system assigns a permanent work item ID automatically as a work item is created. The standard utility activity named Work-.GenerateID uses the standard properties pyWorkIDPrefix and pyWorkIDSuffix in its computation.

For every work item, the work item ID is required to contain either a prefix or suffix. For example, the prefix of work item Q-1432 is Q. The prefix of the work item MORT-763-K4 is MORT. The suffix of work item 15378-DR is DR.

The work item prefix specified in an application rule overrides any prefix specified elsewhere. If a work ID prefix is not specified on the Details tab of the application rule, the prefix and suffix can be determined by a data transform — conventionally named pyDefault — for the work type or the class corresponding to the class group. The data transform is referenced on the Process tab of the flow that creates the work item. If a work ID prefix is not specified in the application rule, and is not specified in a data transform specified in the flow rule, the Work-.GenerateID activity uses W- as the prefix and no suffix. The Work-Cover-.GenerateID activity uses C- as the default prefix. Conventionally, the F- prefix is used to identify folder work items.

The internal class Data-UniqueID supports work item numbering, and ensures that work item IDs are unique system-wide, not just within an application or organization. (Accordingly, when two applications that both use W- as a prefix on one system are accessed by separate users, users of each application may notice gaps in numbering. Similar gaps are be visible if one application is used by two organizations with separate staff members. This is expected.)

The prefix and suffix can be determined by a data transform — conventionally named pyDefault — for the work type or the class corresponding to the class group. The data transform is referenced on the Process tab of the flow that creates the work item.

For the work item IDs of your application, you can use prefixes only or both prefixes and suffixes. The standard function compareWorkIDs (in the Pega-RULES:Sort library) expects work item IDs in the form ZZZ-NNNN-ZZZ. That is, the IDs start with a prefix that ends in a dash character and (if there are also suffixes) end with a suffix that begins with a dash character.

Cannot use work item IDs to count work items

Although every work item has a unique ID, your application may include "gaps" in work ID sequencing, arising from many causes. For example, if a Commit method fails and a Rollback occurs after work item W-6666 is assigned, the work item is not created and the number is never reused. This results in a gap between W-6665 and W-6667.

Accordingly, you cannot rely on work item numbers as an exact count of new work items created during an interval.

Uniqueness of work item IDs

Caution: When one system hosts two or more independent organizations using a common application, it is important that each organization have its own dedicated work pools and work types.

Note: When required, you can relax this constraint by overriding the standard GenerateID activity, being careful to ensure uniqueness of work item IDs in the appropriate realm. For example, the Application Accelerator uses an activity PegaAccel-.GenerateID that allows users from multiple organizations to use this accelerator without collisions on work item IDs. However, consider carefully the long-term design implications of such an override.

pc_data_unique_id table

Instances of the concrete class Data-UniqueID (stored in the PegaRULES database table pc_data_uniqueid) store the most recently assigned work item ID for a specific prefix.

The property Data-UniqueID.pyPrefix holds the prefix and is the key to instances of this class. The integer property Data-UniqueID.pyLastReservedID holds the highest assigned number. The property Data-UniqueID.pyOrganization, a key part, is not filled in by standard rules. This property value is left blank so that work item IDs are unique system-wide.

Related PDN articles

See the PDN article How to include a check digit in work item IDs.

Definitions cover, folder, prefix, work item
Standard rules Atlas — Standard properties in the Work- base class 

UpConcepts