[Workflow Activities] - Activity persists after delete related record
Description
Environment
Attachments
- 08 Dec 2022, 09:54 AM
- 08 Dec 2022, 09:54 AM
- 26 Nov 2022, 06:26 PM
- 26 Nov 2022, 06:18 PM
relates to
Activity
Hi @Norbert Bede
I created pull request 1988
The solution is now really simple using what was implemented with IDEMPIERE-5683, just set Model Cascade in the Record_ID column for the tables AD_WF_Activity, AD_WF_EventAudit and AD_WF_Process
In my tests is working fine, can you please test?
Regards,
Carlos Ruiz
hi,
Testing: we found a Blocker issue here.
Result: stacked SQL command
DELETE FROM AD_WF_Activity WHERE AD_Table_ID=$1 AND Record_ID=$2
env: RDSPG/stack with group of servers - we patched v8.2z with your PR.
state: deployed version
state: remove patch version
you can see when i move over chart, showing, the full group produce this error. then i deploy previous version without patch 8.58h, and SQL command not generated anymore.
http://g.recordit.co/H95KpUuZxF.gif
Norbert
we merged and deployed @Matheus Marcelino solution, however this is looks not enough. we are getting
13:48:04.226===========> MWFActivity.saveError: SaveError - Update return 0 instead of 1 - [WFP_b6145ec6-ab94-42c4-b401-3f5b0a249fb7] - AD_WF_Activity.AD_WF_Activity_ID=7619131 [153]
13:48:04.228===========> MWFActivity.saveError: SaveError - Update return 0 instead of 1 - [WFP_b6145ec6-ab94-42c4-b401-3f5b0a249fb7] - AD_WF_Activity.AD_WF_Activity_ID=7619131 [153]
13:48:04.235===========> MWFEventAudit.saveError: SaveError - Update return 0 instead of 1 - [WFP_b6145ec6-ab94-42c4-b401-3f5b0a249fb7] - AD_WF_EventAudit.AD_WF_EventAudit_ID=7619096 [153]
13:48:04.236===========> MWFEventAudit.saveError: SaveError - Update return 0 instead of 1 - [WFP_b6145ec6-ab94-42c4-b401-3f5b0a249fb7] - AD_WF_EventAudit.AD_WF_EventAudit_ID=7619096 [153]
norbert
hi,
the problem in ticket 4941 was the follow (example case)
the import order create a new order and start document workflow created=updated - this generate user choice activity.
when eg. c_order was deleted by user the workflow processor still running and tried to process deleted order (PO was not updated ? need to talk for detail @Igor Pojzl he analyses this use case that time)
CRASH: the server after many try. (eg. 1 day/each minute wf processor) - hit 100% and crash.
I’m not sure we need delete AD_WF_Process or AD_WF_Activity is enough. I will talk @Igor Pojzl tomorrow. I’m tending to say, AD_WF_Process must be deleted.
Need more testing. (we try reproduce)
Norbert
Hi @Norbert Bede - this is a duplicate of the ticket https://idempiere.atlassian.net/browse/IDEMPIERE-4491 opened by you.
According to the comments in that ticket, you think the AD_WF_Process must be deleted and cascade to AD_WF_Activity.
The implementation here from @Matheus Marcelino just deletes AD_WF_Activity, is that enough or must we delete also the AD_WF_Process?
Regards,
Carlos Ruiz