- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-07-2022 05:01 PM
Hello good people 🙂
TLDR; Is there a way to "pause" execution of a active flow (on requested item)?
At the moment were using the Flow designer API in order to create task on requests. The task is created by a custom action which, once task state is complete/incomplete/skipped, will call our script include... which in turn will do some stuff and generate the next task.
The issue is that we have implemented a rollback function which allows the use to go back to a prior step. We basically delete the current active task + the one prior - which is then remade.
Simple enough, but whenever I delete the tasks, SN seems to set them "incomplete" just before they're deleted. The result is that these tasks manage to call the script include.
So, as said in the TLDR, is it possible to pause it from executing? I know you can downright cancel the flow, but I'd imagine it might cause problems?
AFAIK I can't really determine if the task is set incomplete by a delete or the user themselves, so its hard to account for it within the action itself.
I've tried updating variables "around its back" before deleting and the checking when the "dying task" calls the script include, but this have caused all kinds of issue; with variables that won't update, likely due to being updated multiple times etc.
Hoping for a more elegant solution 🙂
/Cheers
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-08-2022 01:10 AM
Hi
I'm wondering what for you need a Flow as the implemented Business logic could also be done with business rules.
The problem is deleting of records which are part of any Flows. This can leave the Flow stalled.
Maik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-07-2022 08:08 PM
Hi
without having a look on your flow it is difficult to understand your situation. Therefore please provide more details and screenshots.
But apart from that I can see conflicts. Deleting records which are processed in a flow is always a bad idea as that way a flow can break.
Maik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-07-2022 10:25 PM
Thanks for the reply Maik 🙂
We only really have a very barebones flow, all tasks are generated via the Flow API. Flow basically just contains an action, calling the script include to generate the first task. The API is used to execute a custom action which creates the task(s) from there on.
Once task state changes e.i. to complete or incomplete, it will as a final step call the script include again (manager) which will generate the next task.
The issue occur when a task is deleted by the manager. At this point the task would be at "step 3" in the action, waiting for state to change. It seems the system, just prior to deleting the task, flips state to incomplete.
Because of this, the task continue and calls the manager before it is deleted as if it was closed by user.
I wish to avoid having it call the manager, but have little way of checking (at step 4) if its state was changed by the user or the system, due to the deletion process.
Hope it makes sense 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-08-2022 01:10 AM
Hi
I'm wondering what for you need a Flow as the implemented Business logic could also be done with business rules.
The problem is deleting of records which are part of any Flows. This can leave the Flow stalled.
Maik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-08-2022 06:51 AM
So, basically create all the tasks through a BR? I didn't consider that actually - but you're right, that might be the route to go.
The project was originally started using standard components, flows, subflows, etc., but people strongly requested that ability to "undo" closing a task. Not only the state change, but also revert whatever changes could've been done afterwards by the system.
I will try and explore the BR route. Thanks a lot for the input, much appreciated :).
Brgds Casper