salesagility / SuiteCRM

SuiteCRM - Open source CRM for the world
https://www.suitecrm.com
GNU Affero General Public License v3.0
4.29k stars 2.04k forks source link

Workflow on_save not working anymore in scheduler #10357

Open attrib opened 5 months ago

attrib commented 5 months ago

Issue

  1. Have two modules with a relation.
  2. Create a scheduler workflow for module A which modifies the related record B
  3. Have a on save workflow for B, which calculates a value for a field in B

Expected Behavior

After the scheduler did run, record from module B, should have the calculated field set

Actual Behavior

The second workflow for module B, didn't run, so only the change from the scheduled workflow was applied.

Possible Fix

Introduced by https://github.com/salesagility/SuiteCRM/pull/10296

I reverted this commit locally, but this needs rework.

Context

We have a lot of processes which depend on each other. Some of our instances using this behavior a lot.

Merging the logic of the two workflows into one workflow is only viable in this small use-case. But we have multiple workflows which would trigger the on save workflow. So we would need to add the logic from the on save workflow into all other scheduler workflows. Which then get super hard to maintain.

The PR which was merged is in my mind a big breaking change for how workflows behave.

Your Environment