A case ID is the permanent, external identifier of a case and is the value of property Work-.pyID.
By default, the system assigns a permanent case ID automatically as a case is created. The standard utility activity named Work-.GenerateID uses the standard properties pyWorkIDPrefix and pyWorkIDSuffix in its computation.
For every case, the case ID is required to contain either a prefix or suffix. For example, the prefix of case ID Q-1432 is Q. The prefix of the case ID MORT-763-K4 is MORT. The suffix of the case ID 15378-DR is DR.
The prefix specified in an application rule overrides any prefix specified elsewhere. If a case 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 case. If a case 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 cases.
The internal class Data-UniqueID supports case numbering, and ensures that case 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 might 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 case.
For the case 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 case IDs in the form ZZZ-NNNN-ZZZ. The case IDs have a prefix that ends with a hyphen, and if specified, a suffix that begins with a hyphen.
Although every case has a unique ID, your application might include gap" in case ID sequencing. For example, if a Commit method fails and a Rollback occurs after case ID W-6788 is assigned, the case is not created and the number is never reused. This results in a gap between W-6787 and W-6789.
Accordingly, you cannot rely on case numbers as an exact count of the new cases created during an interval.
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 case 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 case IDs. However, consider carefully the long-term design implications of such an override.
Instances of the concrete class Data-UniqueID (stored in the PegaRULES database table pc_data_uniqueid
) store the most recently assigned case 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 case IDs are unique system-wide.