1

So I have an SSIS flow in which I am working with three constraint within a task, but 2 of them must be an OR and one must be an AND. In pseudo-code would be something like:

if ( (constraint-a OR constraint-b) AND constraint-c)

Problem is, we can only set OR/AND to all precedents:

Precedence Constraint Editor: Multiple constraints

Are there any solutions in which we could group some of these constraints?

3
  • I'm not sure I follow. It seems as though it's a clever solution that works as intended. if I'm following correctly.
    – Zane
    Commented Apr 25, 2019 at 18:06
  • @Zane It might be clever but it feels a little dirty. I wonder if I can do it without the Empty container in the middle.
    – pmdci
    Commented Apr 25, 2019 at 18:27
  • Forgot to mention that this diagram is an over-simplification. I would have to add about 20 of those empty containers in production!
    – pmdci
    Commented Apr 25, 2019 at 19:19

1 Answer 1

0

Here is my original solution for this problem, which apparently is not as bad as I thought. The only problem with it is that the designer canvas can get quite crowded.

I managed to achieve the desired solution with a little kludge, which gives me exactly what I want. However I can't help but feel a little dirty doing it, so I wonder if there is a better way. Here is a diagram of what I have done:

Diagram of flow

NOTE: It is important to emphasise that I need Main Script B to start as soon as Main Script A completes.

Script Task B1 is the one requiring the complex constraint. As you can see in the centre of the diagram, I grouped failure of Main Script A and completion of Script Task A2 in an empty container.

This allows for script tasks A1 and A2 to be bypassed if Main Script A fails, and Script Task B1 to be executed after previous script tasks have been completed. But Script Task B1 must wait for Main Script B to finish as well.

Here are the results using this cheap kludge:

When Main Script A succeeds: Main Script A Success

When Main Script A fails: Main Script A Failure

I wonder if there are alternatives to this solution, though.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.