Wednesday, July 27, 2011

SSIS: Issue when waiting for 2 tasks completion

Here is a case in SSIS I got. We have a package that performs a first task, then do 2 parallel actions (in screenshot there are data flows, but it doesn’t matter), and then a 3rd step that must wait for 2 parallel actions ending.
The critical fact is that one of 2 parallel actions is done only if condition is true.
Apparently it must be built like that:
The issue: In case the condition is not true, the package will never continue to “Next task”!!
In fact it’s very logic: “Next task” is waiting for 2 DFs to be done, and the first one doesn’t run because condition is false. So it will never send “completed” answer!

The solution is simple:
A new conditioned path was added with the contrary of first DF condition. It’s connected to dummy task (drug a script task without editing it at all).
Data flow is also connected to dummy task with OR logical connection between 2 sources. Then this task and DF2 are connected with AND connection.
This solution is equal to this logical expression:
([Condition] AND [Data Flow 1])
(NOT [Condition])
[Data Flow 2]

No comments:

Post a Comment