October 22, 2008 at 2:49 pm
Hi All,
I am an SSIS newbie and am trying to implement a workflow described below.
1. Workflow has 2 Sequence Containers namely SEQ_Stage1 and SEQ_Stage2.
2. Variables vRunStage1, vRunStage2 to control which stages should be executed.
3. A script task is added to setup some log messages during startup.
4. If vRunStage1==TRUE then SEQ_Stage1 will be executed directly.
5. If vRunStage1==FALSE and vRunStage2==TRUE then SEQ_Stage2 will be executed directly.
6. If vRunStage==TRUE and vRunStag2==TRUE then SEQ_Stage1 should be executed followed by SEQ_Stage2.
7. When everything is done there is an email task that sends email for the job.
Here is a diagrammatic representation of my workflow
Startup_ScriptTask---------------(vRunStage1==True)--------> SEQ_Stage1
| |
| |
| (vRunStage2==True)
| |
\\// \\//
\/ \/
(vRunStage1==False)&&(vRunStage2==True)---------------->SEQ_Stage2
I can get Step-4 to work correctly. (Setup Expression to evaluate the variable vRunStage1 on the constraint link)
I can get Step-5 to work correctly. (Setup Expression to evaluate the variable vRunStage2 on the constraint link)
To achieve Step-6, i have linked SEQ_Stage1 to SEQ_Stage2 and setup expression to evaluate vRunStage to TRUE.
When i do this, none of the links get activated and the control directly goes to the email task.
If i remove the link from SEQ_Stage1 to SEQ_Stage2 and alter the values for vRunStage1 and vRunStage2, i see correct behavior.
Not sure if i am doing thing correctly or if there is some other way of achieving this, i would greatly appreciate your inputs.
Please let me know if any additional information from me would help you help me.
Thanks in advance for your time,
-V
October 23, 2008 at 8:41 am
Hi
If I understand your question correctly then the attached diagram should work.
You first need to check if vRunStage1 is TRUE before you do any thing else. If it is run SEQ_Stage1 and Check vRunStage2 and if that is true run SEQ_Stage2. If vRunStage1 is FALSE then Check vRunStage2 and if that is true run SEQ_Stage2.
Hope that helps 🙂
October 23, 2008 at 9:02 am
Is your constraint from SEQ_Stage1 to SEQ_Stage2 set as an OR or AND constraint?
If this was me, I would probably put the script task and the the SEQ_Stage1 and SEQ_Stage2 tasks in a sequence container, and follow the container with the email task.
I have attached an image of a mocked-up package:
The constraint between the script task and SEQ_Stage1 is also an expression, and only runs when vRunStage1 is true. The constraint between the script task and SEQ_Stage2 only runs when vRunStage1 is false and vRunStage2 is true. The constraint between SEQ_Stage1 and SEQ_Stage2 only runs when both vRunStage1 and vRunStage2 are true.
The constraints going to SEQ_Stage2 need to be OR constraints as they are mutual exclusive.
Regardless of which SEQ tasks run, the send mail task will always run (assuming no errors occur).
Hope this helps,
Tom
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply