Skip to main content

Case Header object

Info

This article describes an object that is a key element of requests in communication with the database via SOAP and REST services. The CaseHeader header is necessary for implementing case update tasks in the database, supports the identification and update of the case type definition. This object contains predefined fields of the Case entity, which are used to identify the case, its status and other important information. The article also presents examples of case header construction in various formats (XML and JSON) and discusses the meaning of individual fields.

Definition of the CaseHeader object​

Layers in which usedBusiness
TypeBusiness object
Java interfaceIMrcCaseHeader, IMrcObject, ICaseHeader
className/typeMrcCaseHeader
Java implementationpro.ibpm.mercury.business.data.api.MrcCaseHeader
DTO implementationpro.ibpm.mercury.business.data.api.CaseHeader
XML definitionhgdb-mrc-object-3.0.xsd

Case header. A business object representing predefined (constant) fields of the Case entity and fields optimizing case type identification. It is the basis for verifying the uniqueness of the case and identifying the MRC universal object as an object describing the case (see Case as MRC universal objects).

List and meaning of individual fields/parameters
ParametersDescriptionType/Attribute "type"RequiredAllowed values ​​
caseIdRepresentation of the predefined Case entity field. Case identifierLong/IntegerNo/Yes1
bpmProcessIdRepresentation of the predefined Case entity field. BPM process instance identifier to which the case is associated.Long/IntegerNo
inventoryCodeRepresentation of the predefined Case entity field. Generated/unique case codeString/StringNo
groupIdRepresentation of the predefined Case entity field. Case group identifier.Long/IntegerNo/Yes1Existing group identifier
typeIdRepresentation of the predefined Case entity field. Type identifierLong/IntegerNo/Yes1Existing case type version identifier
typeCodeCase type codeString/StringYes
endDateRepresentation of the predefined Case entity field. Case handling/completion date from the BPM process perspectiveCaseDate/DateNo
dueDateRepresentation of the predefined Case entity field. Planned case handling/completion date from the BPM process perspectiveCaseDate/DateNo
statusRepresentation of the predefined Case entity field. Current status of the case. Case statuses are derived from the process nature of the case object and are related to whether the bpmProcessId field is set:
N - means that the case was processed by the process with the given id, currently it also means that it can be used by another process:
A - means that the case is being processed by the process with the given id, but in the world of dictionaries it can also mean usable data (when bpmProcessId is not set)
O - means that the execution of the process instance with the given id has been "postponed" until later
Z - means interruption/cancellation of the associated process, it also means that the case should not be used in processes, it must not be edited (an attempt to change it will end with an exception). Most often the Z status is set when the case type changes. Old, unchangeable version of the case.
String/StringNo/Yes1A(Active)
N(Completed)
O(Postponed)
Z(Interrupted)
piervousVersionIdRepresentation of the predefined field of the Case entity. When changing the case type, a new case (new version of the case) is automatically created. The case in the previous type is interrupted (its status receives the Z flag) and the new case is marked as active (flag A). The field contains the value of the closed case identifier, which is the prototype of the current one. The field is filled in automatically or manually - see the article Case versionsLong/IntegerNo
rootVersionIdRepresentation of the predefined field of the Case entity. The field contains an indication of the case, which is the main version of the case (original). The field is filled in automatically or manually - see the article Case versionsLong/IntegerNo
priceValueRepresentation of the predefined field of the Case entity. Case value, priceDouble/DecimalNo
priceValueCodeRepresentation of the predefined field of the Case entity. 3-letter currency code in which the case value is expressed.String/StringNoExamples of codes: PLN, EUR, etc.
priceExchangeDateRepresentation of the predefined field of the Case entity. Date of the exchange rate, used to convert the price value when the currency code is different from the system one.​​CaseDate/DateNo
storeCountRepresentation of the predefined field of the Case entity. Number of cases in stock (not assigned to any user). User assignment is done via the GroupCase entity.Integer/IntegerNo
storeIdRepresentation of the predefined Case entity field. The identifier of the case's native storage. Creating a case requires that it be assigned to a storage.Long/IntegerNo/Yes1
createDateRepresentation of the predefined Case entity field. Date the case was createdCaseDate/DateNo
createdByRepresentation of the predefined Case entity field. Name of the creating userString/StringNo
lastModifyDateRepresentation of the predefined Case entity field. Date the case data was modifiedCaseDate/DateNo
lastModifiedByRepresentation of the predefined Case entity field. Name of the modifying userString/StringNo
modifyCommentRepresentation of the predefined Case entity field. Last comment of the case data change. Field filled in automatically based on context data (comment) sent during the update/adding of the case.String/StringNo
createdByRoleNameRepresentation of the predefined field of the Case entity. Name of the role the user held during the case addition operation. Field filled in automatically based on context data (currentRole) sent when adding a case.String/StringNo
lastModifiedByRoleNameRepresentation of the predefined Case entity field. Name of the role the user held during the case update operation. Field filled in automatically based on context data (currentRole) sent when updating the case.String/StringNo
subCaseReferenceIdIf the object occurs as a dependent case (an element of a parent case), this field contains the identifier of the reference defining this dependency (this association).Long/IntegerNo
classNameName of the class/type of the complex object represented by the case. Name of the case type version.String/StringNo
versionSystem number of the last change/version of the caseString/StringNo
dirtyControl flag with information whether the sent case should be updated during the modification action. Important for complex cases, e.g. not to update dependent cases when updating the parameters of the parent case and vice versa, when we want to update the parameters of the child case without registering changes in the parent case.Boolean/BooleanYestrue or false
pkPropertyNameName of the case parameter, which is a unique value.String/StringNo
headerMetadataThe CaseHeader object inherits some fields from the MrcObject object (see Universal MRC objects). Additional information related to the sent object, such as status.MrcObjectMetadataNo

To properly explain the meaning of the CaseHeader object (and its fields), we will try to present and describe specific examples.

Basic examples of use​

Below are examples of defining the case header in business services. Let's recall the Case vs. object, the IBM BPM system business object analyzed in the article. Definition of the sample business object TestMrcObject:

Definition of the sample business object TestMrcObject

Preparing data in the system, without defining the case primary key field​

Let's define the case header for the insert action into the system. Let's build a CaseHeader object for an example case according to the following guidelines:

  • ⬜ caseId – empty, we don't know the case ID yet
  • βœ…οΈ – if we know the process instance ID, we set it to e.g. 1234
  • ⬜ inventoryCode – empty, the value will be generated (provided that there is a code generator in the system)
  • βœ…οΈ groupId – if we know the group ID to which the current case is to be assigned, we set it
  • ⬜ typeId – we don't know the case type ID – we leave it empty
  • βœ…οΈ typeCode – we know the type code – this is the name of the business object (most often), unless we decide otherwise. We assume the value of β€˜TestMrcObject’
  • ⬜ endDate – set the appropriate value (can be empty)
  • ⬜ dueDate - set the appropriate value (can be empty)
  • βœ…οΈ status – set the value of A – the case should be active
  • ⬜ piervousVersionId – empty, the value will be set automatically if necessary
  • ⬜ rootVersionId - empty, the value will be set automatically if necessary
  • ⬜ priceValue - set the appropriate value (can be 0) or leave it empty
  • ⬜ priceValueCode – set the appropriate value (can be empty) – then the system code will be assumed. - ⬜ priceExchangeRate - set the appropriate value different from 0 (can be 1)
  • βœ…οΈ storeCount - set the appropriate value different from 0 (can be 1)
  • βœ…οΈ storeId - if we know the case warehouse to which the current case is to be assigned, set it
  • ⬜ fields createDate, createdBy, lastModifyDate, lastModifiedBy, modifyComment, createdByRoleName, lastModifiedByRoleName are fields updated automatically based on the Context object
  • ⬜ subCaseReferenceId - the TestMrcObject case is a superior case - do not set it!
  • βœ…οΈ className – we do not know the case type identifier – the class name (object name) will be the basis for identifying the type (or creating a new one with a given name). The business object is called TestMrcObject, so we enter this value. - βœ…οΈ objectID – we set the external identifier of the object type version, based on which a specific version of the case type will be created. We may not know it, but we can always define it in some way, e.g. TestMrcObject.1 – it is important that when we use this object, with such a definition, we should always use the same value – this will support/speed up the identification of the case type by the Mercury system. In the IBM BPM system, we can extract this identifier based on the definition of the business object class. Let's assume that this is the value 5a2eed95-5975-42ff-8c4a-1527f38266fb and we will set it like this
  • βœ…οΈ rootVersionContextID – we set the external context identifier that is to initialize a given version of the case type. It is possible that we do not know it, but we can always define it in some way, e.g. App.1 – it is important that when we use this object in a given application, we always use the same value – this will support/speed up the identification of the case type by the Mercury system. In the IBM BPM system, we can use the snapshot identifier (state image) of the process application from which the business object comes. Let's assume that this is the value 2064.895ead8d-6fab-4eb8-b54b-b94cd07bb548T.
  • ⬜ version – when inserted for the first time, we leave it empty.
  • βœ…οΈ dirty – when modifying (adding) an object, the flag should be set to "true"
  • ⬜ pkPropertyName – let's leave it blank. The next example will show the purpose of using this field.

The construction of the header of a case represented as an ANY type​

The case header is used in methods that require different formats. In the case of SOAP business methods that support arguments of any type (ANY XML), it is recommended that each TAG of the sent object has the type attribute set with the name of the field type (this makes it easier to identify the field type). In this case, the values ​​are predefined (see the table with the list of fields, and the corresponding method descriptions). The values ​​defined earlier will give us the following sample XML that should be used during the first insert. In the case of REST services, where it is not possible to send the type of the field, the values ​​will be the same, but without this information:

<mrcCaseHeader type="MrcCaseHeader" xmlns="http://business.dto.ws.hgdb.io/mrcObject" 
xsi:schemaLocation="http://business.dto.ws.hgdb.io/mrcObject http://hgdb.io/xsd/dto/hgdb-mrc-object-3.0.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<bpmProcessId type="Integer">1234</bpmProcessId>
<groupId type="Integer">1001</groupId>
<typeCode type="String">TestMrcObject</typeCode>
<status type="String">A</status>
<storeCount type="Integer">1</storeCount>
<storeId type="Integer">1001</storeId>
<className type="String">TestMrcObject</className>
<objectID type="String">5a2eed95-5975-42ff-8c4a-1527f38266fb</objectID>
<rootVersionContextID type="String">2064.895ead8d-6fab-4eb8-b54b-b94cd07bb548T</rootVersionContextID>
<dirty type="Boolean">true</dirty>
</mrcCaseHeader>

After executing the case insertion request using the SOAP (XML) service, in the service response, we will receive the completed header of the freshly created case (it is assigned to the field named mrcCaseHeader of the case):

Header in the insertion request response

The values ​​that were automatically completed after the successful case save operation have been marked in red. As we can see, the case identifier (the caseId field) has been completed and the identifier of the identified case type version has been set. The header constructed in this way should be used in case update services. Remember to set the value of the dirty field to true for the update to take place. We also modify the header if we want to change other predefined case fields.

Date type field

Date type field problem. It is important that the date fields are sent in the appropriate format. The default format is yyyy/MM/dd HH:mm:ss.SS z, but it can be changed by setting the formats field in the context object appropriately (see the description of the Context object). If the date is sent in a specific format, the attribute isEncoded="false" should be set

<createDate isEncoded="false" type="Date">2017/06/03 00:44:12.958 CEST</createDate>

If we set isEncoded="true" the date should be sent as a number of milliseconds (https://currentmillis.com/):

<createDate isEncoded="true" type="Date">1498031451441</createDate>

Preparing data in the system, with the definition of the case's primary key field​

An example could be integration with a system that has a data set and an established relational model, and has its own field that uniquely identifies the case. Mercury DB has its own unique identifier, this is the value of the caseId header field. We do not want the data to be duplicated on the case database side. We also want this field to be unique in Mercury DB. Let's create a case header for such a case called TestUser:

  • ⬜ caseId – empty, we don't know it yet and unfortunately we won't be able to use it
  • ⬜ bpmProcessId – empty, the action has no connection with the BPM process
  • ⬜ inventoryCode – empty, the value will be generated (provided that a code generator exists in the system)
  • ⬜ groupId – if we know the group identifier – leave it empty
  • ⬜ typeId – we don't know the case type identifier – leave it empty
  • βœ…οΈ typeCode – we know the type code – this is the name of the business object (most often), unless we decide otherwise. We assume the value β€˜TestUser’
  • ⬜ endDate – set the appropriate value (can be empty)
  • ⬜ dueDate – set the appropriate value (can be empty)
  • βœ…οΈ status – set the value β€œA” – the case should be active
  • ⬜ piervousVersionId – empty, the value will be set automatically if necessary
  • ⬜ priceValue - set the appropriate value (can be 0) or leave it empty
  • ⬜ priceValueCode – set the appropriate value (can be empty) – then the system code will be assumed. - ⬜ priceExchangeRate - set the appropriate value different from 0 (can be 1)
  • βœ…οΈ storeCount - set the appropriate value different from 0 (can be 1)
  • ⬜ storeId - if we know the case warehouse to which the current case is to be assigned, set it
  • ⬜ fields createDate, createdBy, lastModifyDate, lastModifiedBy, modifyComment, createdByRoleName, lastModifiedByRoleName are fields updated automatically based on the Context object
  • ⬜ subCaseReferenceId - the TestUser case in this case is a standalone case - we do not set it!
  • βœ…οΈ className – we don't know the case type identifier – the class name (object name) will be the basis for identifying the type (or creating a new one with a given name). The business object is called TestUser, so we enter this value.
  • βœ…οΈ objectID – we set the external identifier of the object type version, based on which a specific version of the case type will be created. We may not know it, but we can always define it in some way, e.g. TestUser.1 – it is important that when we use this object, with such a definition, we should always use the same value – this will support/speed up the identification of the case type by the Mercury system.
  • βœ…οΈ rootVersionContextID – we set the external identifier of the context, which is to initialize a given version of the case type. It is possible that we do not know it, but we can always define it in some way, e.g. App.1 – it is important that when we use this object in a given application, we always use the same value – this will support/speed up the identification of the case type by the Mercury system.
  • ⬜ version – when inserting it for the first time, we leave it empty.
  • βœ…οΈ dirty – when modifying (adding) an object, the flag should be set to true
  • βœ…οΈ pkPropertyName – the case type TestUser has its own, unique field called id – let's assign this value to this field. We can define a composite key represented by the formula list of parameters separated by the concatenation operator || e.g. field1||field2

Construction of a case header represented as ANY​

The values ​​defined earlier will give us the following example header to use when inserting for the first time:

<mrcCaseHeader type="MrcCaseHeader" xmlns="http://business.dto.ws.hgdb.io/mrcObject" 
xsi:schemaLocation="http://business.dto.ws.hgdb.io/mrcObject http://hgdb.io/xsd/dto/hgdb-mrc-object-3.0.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<typeCode type="String">TestUser</typeCode>
<status type="String">A</status>
<storeCount type="Integer">1</storeCount>
<className type="String">TestUser</className>
<objectID type="String">TestUser.1</objectID>
<rootVersionContextID type="String">App.1</rootVersionContextID>
<dirty type="Boolean">true</dirty>
<pkPropertyName type="String">id</pkPropertyName>
</mrcCaseHeader>

After executing the case insertion request using the SOAP (XML) service, in the service response, we will receive the completed header of the freshly created case (it is assigned to the field named mrcCaseHeader of the case):

Header in the insertion request response

The values ​​that were automatically completed after the successful case save operation have been marked in red. We also did not provide the group identifier (groupId) - the group was assigned automatically.

We can skip all the fields added in the subsequent update actions by using the static header that we defined during the first insertion. However, I would like to point out that the Mercury DB system identified the case type and assigned it an identifier, which can be found in the typeId field. The store was also assigned automatically - see the storeId field. These are very important case parameters and providing their values ​​when adding and updating subsequent cases speeds up the save action. It is recommended to set these values ​​to a fixed value in this case, for each subsequent case save action.

The Mercury DB system will try to identify an existing case of a given type based on the value of the field named id and if it succeeds, it will update the data, not create a duplicate.

Summary​

Based on the examples, we can see that the case header is an important element of identifying an existing case in the Mercury DB system.

Its appropriate parameters not only indicate an existing case in the database, but also support the process of identifying the case type. Defining the case type version is influenced not only by the list of fields attached to the case. The version change is affected by changes to the following header fields:

  • typeCode – change of type code
  • className – change of type version name
  • objectID – change of external object type version identifier, based on which a specific case type version will be created
  • rootVersionContextID – change of external context identifier, which is to initialize a given case type version
  • pkPropertyName – change of unique field

Analyzing examples and being aware of the importance of the header in identifying case type versions, it is recommended that development teams building integrations with different systems communicate on common solutions. Assuming a scenario in which a business object named TestMrcObject created in the system contains an object named TestUser and another "external system" is integrated with the Mercury DB database, the development team should add the pkPropertyName field with the id value to "their" TestUser case header, and the list of fields should be consistent with the object coming from the "external system".

Footnotes​

  1. No/Yes - required field value means that the parameter is required during the case update action. ↩ ↩2 ↩3 ↩4 ↩5