How about a for (or rather for each datasource) loop that processes one datasource at a time and has some logic inside the loop for the differences? I often use scripts to set the value of variables which can be tested as part of the constraint condition and used in connections in expressions.