SSIS script task - Execute Dataflow task based on variable value
Precedence constraints should be able to handle this requirement. Obviously without seeing the package and how you're setting up the constraints, we can't tell you why it isn't working. However, I've found that using an Expression for the Disable property of the data flow task can also be a good way to control flow. Maybe that will work better for you.

To do this, right-click on the data flow task and select Properties. Go to Expressions and click the ellipsis (...) to open the Property Expressions Editor. Under Property, select Disable, and under Expression, click the ellipsis again to open the Expression Builder. Then write the expression that determines if the data flow task should be disabled or not.