Instead of using And gate to run parallel flows is it ok to use dummy script task and branch it parallel flows ?
like this
Discussion posts and replies are publicly visible
OK? It will technically work, but is less expressive and can be harder to understand. This increases your long term maintenance cost.
prabhakarank0491 said:is it ok to use dummy script task and branch it parallel flows
Yes, it is ok to use a dummy script task and branch it into parallel flows but And gate is better for parallel flows. It's simpler, faster, and easier to understand.For straightforward parallel execution, stick with the And gate. Choose the dummy script task only if you specifically need to add logic to the branching process in the future.
Stefan Helzle said:less expressive and can be harder to understand
Yes, this is my usual objection to this approach. There are cases in my older, more complex process models for instance, designed by less experienced devs, where a flow split occurs like this and I'm not quite sure whether it was intentional or accidental, since they didn't use an AND gateway to do the split.
My stance: there's very little cost to using an AND at the front of a split, and it's nearly always worth it in the long run. If you're worried about the node performing some sort of calculation or pre-processing, the AND can simply be preceded with a script task that does this other work, with virtually zero additional cost.