You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Once you've found it you can select the process to see more details about it including a list of process instances for this specific process definition.
89
+
Once you have found it, you can select the process to see more details about it including a list of process instances for this specific process definition.
90
90
91
91
Within the definition page there is a `delete running instances` option
92
92
@@ -100,13 +100,62 @@ Enter a reason for the deletion e.g. the Jira ticket number and then use the sea
100
100
101
101
Its possible to select only specific records in the list of results or by selecting `Query` it will select all records found, **ALL** records means across all pages shown now just the current page, remember these are SQL queries in the background!
102
102
103
-
## Update removal time on a record
103
+
## Removing Historic Process and Decision Instances
104
+
105
+
There are two types of instances that needs to be cleared out in Camunda, historic process instances and historic decision instances. Removing historic process and decision instances will improve the performance of Camunda and prevent the database from becoming too large. Going forward, manual clearing should be less necessary as new process and decision instances will automatically have a TTL (Time to Live) value set. This TTL is 90 days for production environments and 30 days for all non-production environments.
106
+
107
+
However, TTL values have not been set for all existing instances, and only some teams have adopted the practice of setting TTLs. As a result, manual cleanups may still be required until all teams have updated existing instances and fully embraced the process.
108
+
109
+
There are two ways to remove historic process and decision instances:
110
+
111
+
- Set removal time on process or decision instance (preferable)
112
+
- Delete the process or decision instance
113
+
114
+
## Set Removal Time on a Process or Decision Instance
104
115
105
116
Camunda removal time updates are a batch operation that can be carried out via the Camunda Cockpit UI.
106
117
107
-
Updating a records removal time will control when that record will be removed from the Camunda database by the nightly Camunda clean up task.
118
+
Setting a records removal time will control when that record will be removed from the Camunda database by the Camunda clean up task.
119
+
120
+
### Process Instance
121
+
122
+
To run a removal time operation on process instances you can:
123
+
124
+
- Log into Camunda and select the `Cockpit` option
- Select `Set removal time to historic process instances`. Ensure you select all options as per the below screenshot. Double check that Absolute, Hierarchical and Query are selected.
108
137
109
-
To run a removal time operation you can:
138
+
<imgsrc="images/processInstanceRemovalTime.png">
139
+
140
+
- Initially this will search the database for all historic records of process instances. You can reduce the time to return results by using search criteria.
141
+
142
+
- To narrow down these results you can add search criteria. Clicking in the `add criteria` search box will show a list of available options such as start date, finish date, `incident status` and a host of `IDs` options. For the purposes of cleanup, you can chose 'Finished Only' and 'Finish Date' with value set to before a particular date. If you are getting lot of results or if the results are taking a long time to load, simply set the finish date to an older date to reduce the number of results being returned.
143
+
144
+
<imgsrc="images/processInstanceFilters.png">
145
+
146
+
- You can also save your query as shown in the screenshot below for later use. However, this query is not available across different users as it is stored in the browser cache of the user.
147
+
148
+
<imgsrc="images/saveQuery.png">
149
+
150
+
- Ensure you have the right dates and filters applied and then select "Set removal time to historic process instances all Instances in Filter".
151
+
152
+
- On the next screen select "Execute Operation" to proceed with setting the removal times.
153
+
154
+
- Finally you can track progress of the operation by navigating to the menu and select `more` then `batches`
155
+
156
+
### Decision Instance
157
+
158
+
To run a removal time operation on decision instances you can:
110
159
111
160
- Log into Camunda and select the `Cockpit` option
112
161
@@ -120,19 +169,34 @@ To run a removal time operation you can:
- Select one of the `Set removal time to historic X` options that applies to your need.
172
+
- Select `Set removal time to historic decision instances`. Ensure you select all options as per the below screenshot. Double check that Absolute and Query are selected and importantly Hierarchical is deselected. This differs slightly from the steps from process decisions. If you select Hierarchical the whole operation will run extremely slowly, so ensure it is not selected as it is selected by default.
173
+
174
+
<imgsrc="images/decisionInstanceRemovalTime.png">
175
+
176
+
- Initially this will search the database for all historic records of decision instances. You can reduce the time to return results by using search criteria.
177
+
178
+
- To narrow down these results you can add search criteria. Clicking in the `add criteria` search box will show a list of available options. For the purposes of cleanup, you can chose 'Evaluation Date' with value set to before a particular date. Evaluation Date is the equivalent of Finished Date when it comes to decision instances. If you are getting lot of results or if the results are taking a long time to load, simply set the evaluation date to an older date to reduce the number of results being returned.
179
+
180
+
<imgsrc="images/decisionInstanceFilters.png">
181
+
182
+
- You can also save your query as shown in the screenshot below for later use. However, this query is not available across different users as it is stored in the browser cache of the user.
183
+
184
+
<imgsrc="images/saveQuery.png">
185
+
186
+
- Ensure you have the right dates and filters applied and then select "Set removal time to historic decision instances all Instances in Filter".
187
+
188
+
- On the next screen select "Execute Operation" to proceed with setting the removal times.
189
+
190
+
- Finally you can track progress of the operation by navigating to the menu and select `more` then `batches`
191
+
192
+
### Cleanup Job
124
193
125
-
- Initially this will search the database for all historic records for your chosen option e.g. all completed process instances. You can reduce the time to return results by using search criteria.
194
+
Once the removal times are set, you can confirm this by checking the batches to see if the set removal time jobs have completed. Now you can either wait for the next schedule clean up to complete or you can manually run the cleanup job by navigating to the menu and selecting `more` then `cleanup`. Click on cleanup to trigger the job. Once the cleanup is complete which may take a while depending on the number of instances to clean up, you can run the same queries as before from the batch operation menu. If the cleanup job has completed correctly, the queries should return empty results.
126
195
127
-
- To narrow down these results you can add search criteria. Clicking in the `add criteria` search box will show a list of available options such as start date, finish date, `incident status` and a host of `IDs` options.
Instead of setting a removal time and waiting for cleanup jobs, you can directly delete a historic process or decision instance. However, this approach is riskier because there is no option to revert in the event of an incorrect execution. This direct deletion is a single operation on the database, whereas the other option (Setting Removal Times) involves first updating and then deleting the instance.
130
199
131
-
- For set removal time batch operations there are a number of additional options provided:
200
+
- Running a Delete operation is pretty similar to running a Set Removal Time operation, except you should select "Delete finished process instances" or "Delete decision instances"
132
201
133
-
- **Cleared** - removes the removal time of the select records, there should be no reason to use this.
134
-
- **Calculated** - Uses either the Time To Live of the definition that created this record OR the system default of 30 days where no TTL is available. The value is calculated by Camunda an will likely be in the future by at least 30 days.
135
-
- **Absolute** - An absolute date chosen by the user to set for each record selected, a calendar input appears for this option and it can be set to any date past or present. Past simply means the record will be removed during the next clean up task.
136
-
- **Hierarchical** - Sets the removal time across all instances of the hierarchy
137
-
- **Update in chunks** - Will stream the changes slowly to ensure the database is not overloaded. It is very advisable to use this option.
138
-
- **Chunk Size** - this option will appear when `Update in chunks` is select and should be set to a reasonable number to maintain normal functionality of the service but still achieve the desired outcome.
Copy file name to clipboardExpand all lines: source/Camunda/setup.html.md.erb
+5-6Lines changed: 5 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
title: Camunda Setup
3
-
last_reviewed_on: 2024-04-27
3
+
last_reviewed_on: 2024-07-25
4
4
review_in: 12 months
5
5
weight: 45
6
6
---
@@ -124,16 +124,15 @@ The application components are deployed to AKS via [Flux](https://github.com/hmc
124
124
125
125
Whilst the deployments are architecturally the same they differ in configuration. UI is similar across all environments but API has custom configuration specifically for Production and Demo which are the ones like to see the most end user traffic.
126
126
127
-
For Demo and Production we have setup controlled clean up configuration.
128
-
The application has default values for these built in however due to the nature of Production these defaults have been overridden.
127
+
For all non-production environments, we have set up controlled cleanup configuration via [Flux](https://github.com/hmcts/cnp-flux-config/tree/master/apps/camunda/camunda-api). It is important to note that regarding the cleanup start and end times, any configuration specified via Flux is an additional schedule, not an override. A default schedule is already specified in the source files [here](https://github.com/hmcts/camunda-bpm/blob/master/src/main/resources/application.yaml). An additional schedule, like the one below, has been configured for non-production environments since these environments are usually offline or shut down outside of working hours, which is when the default schedule runs for production.
@@ -147,4 +146,4 @@ As an example, we have this value in the [application.yaml](https://github.com/h
147
146
historyTimeToLive: ${CAMUNDA_HISTORY_TTL:P5D}
148
147
```
149
148
150
-
The `historyTimeToLive` configuration can be set by using `CAMUNDA_HISTORY_TTL` or it will be assigned a default of `P5D (5 Days)`. This allows us to override any value in the application.yaml file from Flux on a per environment basis.
149
+
The `historyTimeToLive` configuration can be set by using `CAMUNDA_HISTORY_TTL` or it will be assigned a default of `P5D (5 Days)`. This allows us to override any value in the application.yaml file from Flux on a per environment basis.
Copy file name to clipboardExpand all lines: source/Camunda/troubleshooting.html.md.erb
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
title: Camunda Troubleshooting
3
-
last_reviewed_on: 2024-04-27
3
+
last_reviewed_on: 2024-07-25
4
4
review_in: 12 months
5
5
weight: 55
6
6
---
@@ -23,11 +23,11 @@ Its important to remember that this list is hierarchical i.e. Flux will override
23
23
24
24
## Database Performance
25
25
26
-
There are many reasons a database can't become a bottleneck for any service so we cannot document all of them here but we can document those issues that we've seen and resolved.
26
+
There are many reasons a database cannot become a bottleneck for any service so we cannot document all of them here but we can document those issues that we have seen and resolved.
27
27
28
28
### Database size
29
29
30
-
We've observed that the Camunda interface can become sluggish and unresponsive, leading to service timeouts and eventual 504 responses.
30
+
We have observed that the Camunda interface can become sluggish and unresponsive, leading to service timeouts and eventual 504 responses.
31
31
32
32
Our initial solution was to increase the DB SKU, thereby allocating more resources for the service to use. However, this is a temporary fix, not a long-term solution.
33
33
@@ -65,8 +65,8 @@ Its possible to find the number of historical records held in the database in th
- If `History Time To Live` for a definition is `Null` that is a **problem**, those records will never be clean up by Camunda because Camunda cannot calculate a `removal time` value. See [this](howto.html#update-removal-time-on-a-record) guide on adding removal times to records.
69
-
- If the `finished` count is large and the `cleanable` count is 0 that doesn't mean the records will not be removed, if there is a `History Time To Live` value set then it means that those finished records cannot be cleaned up **yet** but will be in future.
68
+
- If `History Time To Live` for a definition is `Null` that is a **problem**, those records will never be clean up by Camunda because Camunda cannot calculate a `removal time` value. See [this](howto.html#set-removal-time-on-a-process-or-decision-instance) guide on adding removal times to records.
69
+
- If the `finished` count is large and the `cleanable` count is 0 that does not mean the records will not be removed, if there is a `History Time To Live` value set then it means that those finished records cannot be cleaned up **yet** but will be in future.
0 commit comments