Hi, I am today before a situation, where I would like to treminate/retract running workflow from my policy.
On DTX publisher channel, I have -ctp- policy testing if attributeX is changing. When it is changing, start workflow, and strip the attributeX from operation. The PRD is single YES/NO approval. If approved, the attributeX is changed on destination object. If denied, no change is made.
This works great, but there is one issue with this I recently found out:
When attributeX changes to "A", WF is started, and approval is pending. And when approval is pending, and attributeX changes to "B", there are two approvals pending, and so on. If they are processed by approver in wrong order, the object ends up with obsolete value. What I would like to do, is, that when attributeX changes to "A", WF is started and approval is pending, but if attributeX changes to "B", while approval is pending, the previous workflow(s) should be terminated and only one (the most recent) approval should be pending.
Now, I am not sure, what approach should I take, or if there is any, or I am doing things in a wrong way. I came across geoffc's "Using SOAP to terminate a running workflow" cool solutions, but I am not sure, if that would be the right approach, also the article feels little bit old. Also I read here on forums, from Steven Williams, that retraction is not yet possible, but that was from 2014, so I am really not sure how things moved since then.