0

I have a weird problem with Foreach Loop Container.

I have a package to take backup of out SSAS cubes. We have both UDM and Tabular cubes. Considering below figure, based on a variable, flow should go to Find UDM Cubes OR Find TAB Cubes, so I used Expression in Constrains (connections)

enter image description here

With one specific parameter, the flow should go trough Find UDM Cubes and with a different parameter, flow should go through Find TAB Cubes.

When testing, I noticed that the the package is not doing as expected and the Script Task is not executing. If I remove one of the highlighted Constraints (connection), Script Tasks get hit and works. So as long as I have ONE input for the Script Task it works otherwise it just not do anything.

Appreciate if anybody can help.

FLICKER
  • 6,439
  • 4
  • 45
  • 75

1 Answers1

0

Multiple Precedence Constraints

Both of your Data flow Tasks would have to succeed in order for the script task to run. Which you are stating that both data flows may not even execute so therefore both don't succeed.

here is a nice article on it https://msdn.microsoft.com/en-us/library/ms139895.aspx

One way to get your desired behavior would be to add a sequence container and move your clean up and find tasks into it and then create the precedence from the sequence container to your script task. That way even if only 1 runs everything is still considered successful and your script task should execute.

enter image description here

this precedence suggestion has been tested and works.

Community
  • 1
  • 1
Matt
  • 13,833
  • 2
  • 16
  • 28
  • If based on the parameter, my Find Tab Cubes is not executed, will the result be Failed? – FLICKER Aug 11 '16 at 22:45
  • mmmm I guess it seemed obvious to me the potential issue, but I haven't tried it myself to know the exact value(s). I think your result for the Data Flow that doesn't execute will be NULL which means not successful or failed but in order for your script task to execute it would need it to actually be successful. – Matt Aug 11 '16 at 23:02
  • yep I just tested it and you will need the sequence container. The value is neither failed or success so I will assume NULL. Good news is the container will make your logic work exactly as you want – Matt Aug 11 '16 at 23:12
  • I tested and it works as expected. However still I'm interested to see why it is not working w/o SC. I tried different combination to prove your idea about Failure of the task but could find the reason so far. Anyway thanks for solution. – FLICKER Aug 11 '16 at 23:22
  • yeah your welcome. I think of it this way. If in programming I don't call a function to set a value of a variable then that variable has no value or is null because it is unknown. Because one of the data flow task never executes it doesn't set the value of the variable/property that the script task constraint then evaluates. I tried using the failure and success to prove this theory that it is neither of those values and I was able to prove that correct but there is no way of knowing the exact value whether it is null or something other than success/fail – Matt Aug 11 '16 at 23:25