Skip to content

Commit 2573e60

Browse files
Merge pull request #8735 from ProcessMaker/task/FOUR-29106
FOUR-29106 | Add Tier-Based Environment Configuration for Case Retention
2 parents 2e61155 + a95f47f commit 2573e60

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,26 @@ How to use icon: <i class="fp-my-jonas-custom-icon" />
439439
npm run dev-font
440440
```
441441

442+
# Case Retention Tier (CASE_RETENTION_TIER)
443+
444+
The case retention policy controls how long cases are stored before they are automatically and permanently deleted. The **CASE_RETENTION_TIER** environment variable determines which retention periods customers can select when configuring a process. Each tier exposes a different set of options in the UI; options for higher tiers are visible but disabled so users see what is available at higher tiers.
445+
446+
### Supported tiers
447+
448+
| Tier | Retention options available |
449+
|------|----------------------------|
450+
| **1** | Six months, One year |
451+
| **2** | Six months, One year, Three years |
452+
| **3** | Six months, One year, Three years, Five years |
453+
454+
Set the variable in your `.env` file:
455+
```env
456+
CASE_RETENTION_POLICY_ENABLED=true
457+
CASE_RETENTION_TIER=1
458+
```
459+
Use `1`, `2`, or `3`. The default is `1` if not set. The default retention period shown in the UI for Tier 1 is one year.
460+
461+
442462

443463
# Prometheus and Grafana
444464

resources/views/processes/edit.blade.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -831,7 +831,10 @@ class="custom-control-input">
831831
this.formData.reassignment_permissions = this.reassignmentPermissions;
832832
if (this.caseRetentionPolicyEnabled) {
833833
this.formData.properties = this.formData.properties || {};
834-
this.formData.properties.retention_period = this.canSelectRetentionPeriod ? this.canSelectRetentionPeriod.id : null;
834+
const retentionPeriod = this.canSelectRetentionPeriod
835+
? this.canSelectRetentionPeriod.id
836+
: this.getDefaultRetentionPeriodId();
837+
this.formData.properties.retention_period = retentionPeriod;
835838
}
836839
837840
ProcessMaker.apiClient.put('processes/' + that.formData.id, that.formData)
@@ -863,6 +866,10 @@ class="custom-control-input">
863866
reassignmentClicked() {
864867
this.$refs["listReassignment"].add();
865868
},
869+
getDefaultRetentionPeriodId() {
870+
const allowed = this.allowedRetentionPeriods || [];
871+
return allowed.includes('one_year') ? 'one_year' : (allowed[0] || null);
872+
},
866873
onRetentionPeriodSelect(newVal) {
867874
if (!newVal || !this.lastConfirmedRetentionPeriod) {
868875
return;

0 commit comments

Comments
 (0)