A case can go through several status during its lifecycle. For example, when a case is initialized, it can start with the "Submitted" status, and depending on the manual task of an end-user, it can change to the "Approved" status or to the "Rejected" status.
THe Case Management framework lets you define a set of status associated with a case. A status can have extra characteristics: it may be initial or terminal. Each case definition must have one initial status associated. There isn't a limit to the number of terminal status.
The case status set as initial is automatically assigned to a case upon the initialization of the case, unless another status is set using the non-mandatory CaseStatusId input field of the Case_Initialize action, from the CaseServices_API module.
A case must be initialized with a case status, otherwise an exception is thrown.
If there isn't a case status set as initial, you must set a CaseStatusId when you initialize a case.
A case status set as terminal sets the CompletedOn case date field to the current date without needing to explicitly call the Case_Complete action. As previously stated, it isn't mandatory to define a terminal status. Furthermore, you can set several case status as terminal.
After you set up your app to work with the Case Management framework, the CaseStatusConfiguration static entity from <app-name>_Configuration module, contains the case statuses.
Define a case status
Before you start make sure you set up your app to work with the Case Management framework.
To define a new case status follow these steps:
In <app-name>_Configuration module, add a
<state>record to the CaseStatusConfiguration static entity. Repalce <state> with the state of a case in your app, for example,
Generate a GUID and paste that GUID into the value field of the CaseStatusId attribute of the <state> record.
A Globally Unique IDentifier, or GUID, is used as a unique identifier to ensure integrity across environments.
You can use an online GUID generator to create a GUID for each record.
Check the RFC 4122 for more information on GUIDs.
Set the remaining attributes.
Publish the module by selecting 1-Click Publish.
Update the status of a case
To update the status of a case, use the Case_UpdateStatus action from the CaseServices_API module.
A case status update is successful if the following conditions are met:
The Case Identifier exists.
The case status is valid for the given case.
If you defined a state machine, the change between the previous state and the new status is valid for the case.