Rock
Rock copied to clipboard
Maximum Workflow Age doesn't work due to Process Workflows updating the workflow's Modified Date Time
Prerequisites
- [x] Put an X between the brackets on this line if you have done all of the following:
- Did you perform a search at https://github.com/issues?q=is%3Aissue+user%3ASparkDevNetwork+-repo%3ARock to see if your bug or enhancement is already reported?
- Can you reproduce the problem on a fresh install or the demo site?
- Did you include your Rock version number and client culture setting?
Description
V13 added the ability to auto-complete workflows of a certain age, but the way it checks is by comparing against the workflow's Modified Date Time:https://github.com/SparkDevNetwork/Rock/blob/develop/Rock/Jobs/RockCleanup.cs#L983. The problem is that the Process Workflows job updates the workflow's ModifiedDateTime every time it runs, so a workflow will never be auto-completed.
One solution could be to target the ActivatedDateTime instead.
Steps to Reproduce
- Go to the demo site
- Update the External Inquiry workflow type to automatically persist
- Use the Workflow Entry page to create a workflow
- Use sql to update the workflow's Activated, Modified, and Created DateTime properties to be a year old.
- Run the Process Workflows job
- Note that the ModifiedDateTime on the workflow has been updated
- Set the maximum age on the workflow type to 4 days
- Run the RockCleanup job
Expected behavior:
The workflow, at this point now a year old, should be completed.
Actual behavior:
The workflow remains active since it was 'recently modified'.
Versions
- Rock Version: 13.4
- Client Culture Setting: EN-US