• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 388
  • Last Modified:

Define execution of specific tasks

In my package, I have defined 3 different tasks - Task A, Task B, Task C
I defined variables to run each task. My requirement is that I need to run specific tasks (say Task B and not Task C and Task A).
The outputs from Task A (on successful execution of task A) , one green arrow connects to task B and the other green arrow connects to Task C.
I have a requirement to run only Task B. When I set the variable to run Task B, Task A is also executed and then Task B.

How do I prevent Task A execution and execute only Task B?

Thanks
0
dorsun
Asked:
dorsun
  • 5
  • 5
1 Solution
 
HoggZillaCommented:
Please post a picture of your Control flow.
The way you prevent the exectuion of a Task is through the Precedence Constraint (arrows). If you have a variable / variables that determine the task execution then the first task is to populate your variables and then all other tasks are connected to that task. Use Expression and Constraint. Like picture below.
Explain how you are doing it now.

precedence-constraint.bmp
0
 
dorsunAuthor Commented:
Here I have variables named as runprofile, runactivity, runcontact.
I set runactivity to true. Since I have a requirement to run only the activity part.
all the other variables are set to false.
But when I run the package, profile container is executed by default irrespective of the variable value.
Here, how do I give condition runprofile to tell the container to execute? I have assigned the value to runprofile in variables but how do I specify that in the precedence constarint to profile.
How do i attach a precedence constraint tp the profile container.

Thanks
CF.bmp
0
 
HoggZillaCommented:
You have to have a task that connects to the Profile Container. This is what I meant by suggesting a task that populates a variable first, then connecting to the other containers.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
dorsunAuthor Commented:
Yes you are right!
Can you please suggest a suitable component that loads values to variables (may be from the configuration file) as the initial task.

Thanks
0
 
HoggZillaCommented:
You could use an Execute SQL Task. Here is a document I put together to help.

SSIS-Populate-Variable.pdf
0
 
dorsunAuthor Commented:
Thanks Hoggzilla,
Great doc.
I have a variable defined and I have given the value for the variable in the configuration file.
My requirement is how do I make my first container- profile (pic above) read the variable from the configuration file.
0
 
HoggZillaCommented:
>My requirement is how do I make my first container- profile (pic above) read the variable from the configuration file.

You don't. You add a NEW task, like an Execute SQL Task or Script Task to be your FIRST task. All other containers are constrained by that task. For example, use a Script Task and have it do nothing. Since you wil be populating the varaible during package load, no need for this first task to do anything. Just use it as the starting task. Connect your containers to this task by expression and constraint.
0
 
dorsunAuthor Commented:
You mean all the three containers should connect to the new task?
I tried to add a new task. connected the task by expression and constraint to the first container. Initialized the variable profile to false.
profile container did not run. (what i wanted)
But, it did not run the other two containers that are conneted to the profile container. ( I want to run the other containers individually)
0
 
HoggZillaCommented:
You mean all the three containers should connect to the new task?
Yes.
I tried to add a new task. connected the task by expression and constraint to the first container. Initialized the variable profile to false.
profile container did not run. (what i wanted)
But, it did not run the other two containers that are conneted to the profile container. ( I want to run the other containers individually)

Each task connected to the NEW primary task. Use your variable to determine if they should run or not?
0
 
dorsunAuthor Commented:
Thank you
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 5
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now