Chapter 16. Canceling or destroying a case
Cases can be canceled if they are no longer required and do not require any case work to be performed. Cases that are canceled can be reopened later with the same case instance ID and case file data. In some cases, you might want to permanently destroy a case so that it cannot be reopened.
Cases can only be canceled or destroyed using an API request. Red Hat Process Automation Manager includes the Swagger client, which includes endpoints and documentation for REST API requests. Alternatively, you can use the same endpoints to make API calls using your preferred client or Curl.
Prerequisites
- A case instance has been started using Showcase.
-
You are able to authenticate API requests as a user with the
admin
role.
Procedure
Open the Swagger REST API client in a web browser:
/http://localhost:8080/kie-server/docs
Under Case Instances :: Case Management, open the
DELETE
request with the following endpoint:/server/containers/{id}/cases/instances/{caseId}
You can cancel a case using the
DELETE
request. Optionally, you can also destroy the case using thedestroy
parameter.Click Try it out and fill in the required parameters:
Table 16.1. Parameters
Name Description id
itorders
caseId
IT-0000000001
destroy
true
(Optional. Permanently destroys the case. This parameter is
false
by default.)- Click Execute to cancel (or destroy) the case.
- To confirm the case is canceled, open the Showcase application and change the case list status to Canceled. If the case has been destroyed, it will no longer appear in any case list.
16.1. Removing case logs from the database
Use the CaseLogCleanupCommand
to clean-up cases, such as canceled cases that are using up database space. The CaseLogCleanupCommand
command contains logic to automatically clean-up all or selected cases.
There are several configuration options that you can use with the CaseLogCleanupCommand
command:
Table 16.2. CaseLogCleanupCommand parameters table
Name | Description | Is Exclusive |
---|---|---|
SkipProcessLog |
Indicates whether or not the process and node instances, along with the process variable log clean-up will be skipped when the command runs. Default value: | No, can be used with other parameters |
SkipTaskLog |
Indicates whether or not the task audit, the task event, and the task variable log clean-up will be skipped when the command runs. Default value: | No, can be used with other parameters |
SkipExecutorLog |
Indicates if the Red Hat Process Automation Manager executor entries clean-up will be skipped when the command runs. Default value: | No, can be used with other parameters |
SingleRun |
Indicates if the job routine will run only once. Default value: | No, can be used with other parameters |
NextRun |
Schedules the next job execution. For example, set to | No, can be used with other parameters |
OlderThan |
Logs older than the specified date are removed. The date format is |
Yes, cannot be used when the |
OlderThanPeriod | Logs older than the specified timer expression are removed. For example, set 30d to remove logs older than 30 days. |
Yes, cannot be used when the |
ForCaseDefId | Specifies the case definition ID of the logs that are removed. | No, can be used with other parameters |
ForDeployment | Specifies the deployment ID of the logs that are removed. | No, can be used with other parameters |
EmfName |
The persistence unit name used to perform the delete operation. Default value: | N/A |
DateFormat |
Specifies the date format for time-related parameters. Default value: | No, can be used with other parameters |
Status | Status of the case instances of the logs that are removed. | No, can be used with other parameters |