conditional problem

trying to use the conditional function

i want either workflow 1 or workflow 2 to be run depending on value of variable tested in the conditional

how does it work ?

do you have to graphically connect the conditional to wf 1 and wf 2?

if so can you say how to do this or is there an example of this somewhere in the documentation. i can only see the exampe, showing the conditional being completed , nothing as to how it should be graphically connected

[/img]
doc1.JPG


johnwxyz (BOB member since 2008-01-26)

Did you try double clicking the Conditional Object? 8)

Open the Conditional object and you will see 3 areas:

“IF”
“THEN”
“ELSE”

On top we have the “IF” condition that needs to be met. This has to be a statement that can only have a TRUE/FALSE or Yes/No outcome.

(e.g. $LoadType = ‘DELTA’, $Company_Code = 5001, $Weekend = ‘Y’)

Then we have our “THEN” section. In here you can drag and drop your Scripts, Work Flows or Data Flows you want executed when the condition is TRUE. You can drop multiple objects in here, chain them together or put a single Work Flow in there that branches out into many others. Both the “THEN” and “ELSE” windows act like Work Flow containers themselves -so just consider these like Work Flow objects themselves, with the same rules and conditions.

Finally, there is the “ELSE” section. This works the same as a the “THEN” section above but it’s the reverse… you put those Scripts, Work Flows or Data Flows in here that you want executed when the condition is FALSE.


ErikR :new_zealand: (BOB member since 2007-01-10)

i have opened the conditional and complete the if then else, but it just doesnt look right graphically.

Should the conditional output not be linked to WF2 as well as WF1 ?


johnwxyz (BOB member since 2008-01-26)

got it

just confused by the drawing it looks as though the conditional is a self contained subroutine carrying out the if thenelse before continuing with the rest of the flow


johnwxyz (BOB member since 2008-01-26)

Bingo! :slight_smile: I can see where you’re coming from - you would expect the Conditional Object to split the flow into 2 Work Flow streams (TRUE and FALSE) - visible from the parent workflow.

This is how many other tools (like Informatica PowerCenter) work so it can be a little confusing in Data Services.

The Loop Object works the same way as the Conditional Object by the way - it too is a container for the down-stream Work Flows.


ErikR :new_zealand: (BOB member since 2007-01-10)

In that regard I like the philosophy of Microsoft SSIS. There you do not have a conditional, you would simply connect the first WF directly with the other two. And then each connection line gets a condition like on-success and on-error. Similar to how it looks when we use a case transform but on workflow level.

The while loop could be more challenging though.


Werner Daehn :de: (BOB member since 2004-12-17)

That workflow logic dates back to the first version of DTS in SQL Server 7.0 but it is visually effective. Although it can get really messy when you have a lot of work flows on screen. (There is very little that I find to like about SSIS - it’s a key example of what an ETL tool shouldn’t look like)

The While Loop could work if you split it in two visual objects:

  1. The entry point of the loop, which would contain the loop condition.
  2. The exit point of the loop, which would either mark the end of the cycle or the exit point where the work flow will exit upon satisfying the loop condition.

ErikR :new_zealand: (BOB member since 2007-01-10)