Rock icon indicating copy to clipboard operation
Rock copied to clipboard

Maximum Workflow Age doesn't work due to Process Workflows updating the workflow's Modified Date Time

Open tcavaletto opened this issue 2 years ago • 0 comments

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

  1. Go to the demo site
  2. Update the External Inquiry workflow type to automatically persist
  3. Use the Workflow Entry page to create a workflow
  4. Use sql to update the workflow's Activated, Modified, and Created DateTime properties to be a year old.
  5. Run the Process Workflows job
  6. Note that the ModifiedDateTime on the workflow has been updated
  7. Set the maximum age on the workflow type to 4 days
  8. 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

tcavaletto avatar Sep 15 '22 18:09 tcavaletto