- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
03-17-2024 03:27 AM - edited 12-07-2024 06:31 AM
setWorkflow(false)
most of the developers very well aware that setWorkflow(false) stops Business Rules and developers often use it with combination of current.update() to prevent Business Rules that might normally be triggered by subsequent actions.
- It doesn't work on Async Business Rule ( KB0863492 )
- effect on Audit (KB0869538)
- effect on Journal fields (KB0867584)
- effect on SLA engines (KB0598456)
- effect on Notification Engine (KB0858407)
- effect on scope applications (it works but RCA has to be allowed: KB0820691)
- effect on Workflow and Flow Engines and more. (KB0960053
Would using setWorkflow(false) stop Workflows/Flows?
sometime back, I come across this interesting thread which discusses the effect of setworkflow(false) on flows.
Using setWorkflow(false) doesn't stop Flow Designer flows from executing?
the thread has mixed answers. while in some cases it stops, in some cases it doesn't.
ServiceNow has addressed this by introducing a system property to control the effect of setWorkflow(false) on Workflows/Flows.
property name: trigger_engine.ignore.set_workflow. (this is a boolean true/false property)
By default, the flows and workflows will not stop when setWorkflow(false) is used. this behavior was noticed somewhere post Tokyo. (I do not find this property in the latest instance, this must have been hardcoded).
if the above property is set to false, then flows and workflows will stop executing in that transaction.
this is a system wide property, it will have impact all the workflows/flows associated with setWorkflow(false).
Conclusion:
From an Implementation point of view, the use cases/requirements of stopping flows and workflows are quite rare in general.
However, it's important to be mindful of all the impacts of setWorkflow(false). even if the use case is just to stop subsequent business rules, it's good practice to cross verify all the subsequent business rules and other functionalities on the table it may impact.
I will keep updating this article with community threads/support articles regarding setWorkflow(false).
please feel free to add your observations and behavior about setWorkflow(false) as comments.
Thank you for reading 🙂
Please mark it as helpful and share the article if you find it helpful!
Kind Regards,
Ravi Chandra.
- 9,906 Views
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
The reference for the system property can be found in the below support article:
Creating an event to trigger flow is not working
Kind Regards,
Ravi Chandra.