on 09-06-2018 11:37 AM
Hi
I have completed the workflow design, however i need to reset the workflow to the starting step if there are any changes in the records.It has to be a background task where the task will check the change in fields from CDHDR/CDPOS, then is should trigger reset of workflow.
Any help will be appreciated.
Thanks
Usually I prefer to cancel the old and start a new workflow.
Add a CHANGED event both as a triggering and a terminating event. Every time there is a change, this event will cancel any active workflows and start a new one. It makes logging simpler, as you will see multiple workflows in a status CANCELLED and one COMPLETED.
You can link events to change documents using tx SWEC. Plenty of documentation and info on here on how to do that.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, Arsalan,
One of possible ways is to use BOR events.
It is possible to:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Egor Malov
Thank you for response. However, your reply does help in understanding the workflow but my requirements are different. I have designed 2 workflows, one will be triggered when record is created & the second will be triggered when the record is changed. My requirement is, when the record is changed, the workflow that is triggered on create event should get reset i.e. all work items in SAP Inbox related related to the record should be cleared.
Hi, Arsalan,
I think I get the idea better now - when the record has changed, nobody wants to know it had been created anymore.
Trying to get this requirement closer to SAP workflow features and terminology, I think, what you could do to the first (i.e. the one that runs at creation) workflow instance is *cancel* it (with all its workitems).
If you choose the BOR events way of implementation, you can 'cancel workflow' just as easy as you can 'restart workflow' (as desribed above): it is just another option of the very same drop-down field.
If you choose another approach you can use the SAP_WAPI_* function module, that cancels a workflow.
*one more note on BOR events: if you work with some standard business object, it is possible that it is already capable of firing BOR events like CREATED or CHANGED. It can take some configuration to enable. Check this, and you'll probably won't need to process change documents.
Hi ,
Wait for the change event in a branch of fork of Create Workflow.It will get logically deleted
Thanks
Hi Arsalan,
Its simple,In the create workflow just add a fork with 2 branches and make 1 necessary,one for the Wait step and the other for your current flow.
Any standard Documentation on Fork and Wait will help you here.
Thanks
Hi
Thank you Egor & Ram.
I resolved it by using WAPI's
1--> SAP_WAPI_WORKITEMS_TO_OBJECT
2--> SAP_WAPI_WORKITEM_RECIPIENTS
3--> SAP_WAPI_WORKITEM_DELETE
Regards
Arsalan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
It would be better to model the solution in your workflow template by using forks and events and wait for events. The triggering can then be done with SAP_WAPI_CREATE_EVENT.
Kind regards, Rob Dielemans
Indeed using fork & wait proved to be easiest solution.
thank you
User | Count |
---|---|
77 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.