You are viewing the documentation for Blueriq 17. Documentation for other versions is available in our documentation directory.

The data in the DCM Lists application is a copy of the data in the case engine, which allows to quickly display lists of cases without burdening the case engine for this. As a result, when a case is closed in the case engine, this case is also removed from the DCM Lists application. The fact that a case is closed can lead to multiple messages to the DCM Lists: 

  • a message that the case is locked
  • a message that a task is started
  • a message that a task is finished
  • a message that the case is unlocked
  • a message that the case is closed

Note that a case can also be closed, for example, as the result of a message event and there are other scenarios as well. It is important to know that multiple messages are sent to the DCM Lists application.

As we cannot always guarantee the order of messages that are processed by the DCM Lists, it might happen that a case is first deleted and then a message is processed which tells the case (that is just deleted) is unlocked. What to do then? The DCM Lists application does not know that case (it was just deleted, no record is kept), so should it create the case then? Or should it ignore this message?

Delete flag

In order to solve this problem, the DCM Lists application does not delete cases immediately from the database. Instead, when a message is processed that leads to the removal of the case, the case is marked for deletion with a flag and a timestamp. The DCM Lists than further ignores this case, except when a message is processed that references this deleted case. Then the DCM Lists application knows that the case is deleted and can act accordingly.

Cleanup

As you can imagine, when you only mark cases for deletion but never actually remove these from the database, the database can grow quite quickly, depending on the number of cases that your application is processing. To make sure the database keeps a reasonable size and performance, a cleanup mechanism removes the cases marked for deletion from the database. This mechanism uses a interval at which it operates. The default is 2 hours. Every 2 hours, a cleanup job is triggered which removes all the cases marked for deletion that were marked at least 2 hours (the interval) ago. This means that messages belonging to a case that is deleted can be processed up to 2 hours after the case is deleted. After that, the case is gone and messages related to that case will result in an error.

You can change the default interval of 2 hours to accommodate your specific situation. To do this, change the following setting in the blueriq-dcm-lists.yml configuration file:

blueriq:
  dcm:
    lists:
      repository:
        cleanup:
          interval: PT2H # default

Note that he format of the interval needs to be a Java Duration, which is based on ISO-8601 duration format PnDTnHnMn.nS. For the exact syntax see https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/time/Duration.html#parse(java.lang.CharSequence).