Workflow - Wait (schedule) Action for scheduled workflow activities


problem statement: in actual version it is not possible to schedule a workflow activity to run on a specific date. this solution proposal describe how to improve to fulfill this requirement

related community thread:!searchin/idempiere/workflow/idempiere/SlwG5WQA6Lw/eDNuX3HLYqMJ

this solution extend node action with a new option “Wait (Schedule)”, which similar to Wait (sleep) can suspend the workflow (by new scheduled status) - but generated activity field - [EndWaitTime] is set value based on Workflow Table.SelectedDateField e.g. table is c_order has field custom ExpiryDate field.(remark: Out of box - Wait Sleep is simple solution able to suspend workflow activity based on specified minute)

User creates a Node in existing workflow (e.g. order Document Process) choose Action=Wait (Schedule), cause AD_Column_ID appear - where userset fieldname from drop down listing workflow table table fields. (list validation for date fields)

Running Workflow
Workflow starts when user processing documents and convert nodes to activities - in our custom node - workflow set AD_WF_Activity.EndWaitTime (we get exact schedule - each workflow should have other EndWaitTime (wait sleep cant achieve that - always calculates same time range in minutes per workflow activity)

How should Works - Activity Processor
standard workflow processor processing a waiting activities - means processing the above scheduled activity (where enwaittime being valid).

ideas what change (require review from developer)
1. extend “WAIT (Schedule)” for AD_WF_Node.Action (Z=wait (sleep) new one can be e.g X= WAIT(SCHEDULE)
2.change process which generates wf activities - we need to fill EndWaitTime - from table.AD_Column_ID
3.extend WF_INstance (AD_WF_Activity.wfstate) state list by “SH” value - Scheduled (“scheduled activity”)
4.change workflow processor - improvement required - for handle new “Scheduled” status handling
5.change workflow processor - extend it by new Expire Date status handling (expiry date fire activity status change)
6.Terminate Activity - TerminateWaitTime field implementation (this should care about rollback (and new transition should starts another node)




Norbert Bede
September 28, 2014, 9:51 AM

an !

we have done TESTS and commit to our production code base

MY TEST CASE: i follow above/attached scenario - set (today is document date/created 28.9.2014 10:01:42 AM) SCHEDULE DATE/TIME to Date 09/29/2014 Time 01:00:00 AM as RESULT AD_WF_Activity.EndWaitTime inherit PROPER = Date 09/29/2014 AND Time 01:00:00 AM. Test RESULT: PASS

i have tested patches. i'm glad to say works based on design

The follow issue mentioned above identified by would be nice to resolve, although not a stopper.

ISSUE #1."ENDWAITTIME UPDATE from DOCUMENT" implement process (model validation OR database trigger level) supporting UPDATE Node Activity Wait time based on Source Table field (e.g. activity is already generated, just updated by user > IMHO - until activity has suspended state CAN BE updated - without issues (questions: if WF can handle any table, then i mean no optimal solution how to handle this. This cant be happening if source column is read only (handled by other process, like calculate renewal date...) This can be implement individually, however () if any idea how to make it universal backward update then would be nice to resolve it)

This Improvement was tested and PASS, so changing status to peer review . Suggest to Commit, for additional usage tests in various test scenarios !!


Norbert Bede
November 14, 2014, 9:41 AM

hi as i know you are touring with . Please take a coffee together and talk about above ISSUE #1.

we thinking here what layer of the system would be best to implement it - handle generally scenario, when user wants to change scheduled workflow node until it is not suspended.

we are testing this ticket again. and could help to us well.


Markus Bozem
May 3, 2020, 1:59 PM

hi, i would like to use this feature. Is there still a show stopper`?

Norbert Bede
May 4, 2020, 5:14 AM

hi Works in our local 3.1. - based on these patches - probably need review against 7.x and create PR.

Norbert Bede
June 16, 2020, 1:38 PM

we are migrating to 8.1 so code will be available soon.


Markus Bozem


Norbert Bede


Tested By