To be able to start a workflow by a process and thus by another workflow MProcess is accordingly extended.
To be able to set the record id use for the workflow process
I had created a test case for in http://test.idempiere.org/ which contained a test case for this one, too. But of course it’s gone in the meantime. I’m on holiday now, but I’ll try to enter it again. The reason to add this was, that you can create a process which starts a workflow but at at least if starting this process from within another workflow it actually will do nothing.
We have the following at MWFActivity:
The propose enhancement will support the chaining of workflow (through process) and we can deactivate the not yet implemented subworkflow action at workflow window.
I first wanted to implement it as subworkflow. But for me the easier way was the process, because I had to connect the new workflow with a different document type and record id. But the disadvantage is that it must be implemented on system level while a subworkflow could be implemented at client level. So with a chance to start a subworkflow with another record_id I would even prefer that. So I think we should not give up on implementing subworkflows.
Test Case by , copy over from IDEMPIERE-4188:
a workflow ‘Complete Shipment PC’
a process ‘Shipment complete PC’
and two additional nodes ‘Complete Shipment PC’ and ‘Complete Shipment SC’ in the workflow 'Process_InOutConfirm’.
Fully implemented is only PC, the SC version differs only in irrelevant parts.
To test a picklist has to be created (for example in FITTER SNACKER using ‘MM Shipment with Pick’. Completing this picklist then starts the workflow.
Import the attached 2Pack file in the order of “Process_InOut Node”, “Process_InOut Node Parameter” and “Process_InOut Transition”
The 3 2pack file add node and transition to the Process_InOutConfirmation workflow
Create new shipment with Document Type “MM Shipment With Confirmation Pick”
Complete the shipment document
Complete the shipment confirmation document
Note that the shipment document is auto completed by the chaining of Process_InOutConfirmation and Process_InOut workflow