parent package configuration help
Hi Guys,
I have two variables vFileExistsDS and vFileExistsTLG both have a Boolean DataTypes. I have a script task that gives both variables a value if the file is exists or not in their respective directories. Now, I want to have a email functionality
that gives me an information if one or both directory are empty. I want it be dynamic enough that I need to pass the value of both variables in the child package and use the variables in the "Subject" for the email message.
Examples:
From the parent package the vFileExistsTLG = False and vFileExistsDS = True then the email message should be "No TLG files in the specified direcotry" and vice versa.
From the parent package the vFileExistsTLG= False and vFileExistsDS = False then the email message should be " No TLG and DS files in the specified directory".
I am having difficulty in configuring the parent package configuration. Can anyone help me?
Thanks,
November 1st, 2010 9:26pm
Hi,
What exactly is the issue that you are facing? Are you getting any errors or running into problems at runtime?
You could have the parent package variable as the configuration type in your child package and then use these variables in your child packages.
Using the Parent Package variable configuration type, you will pass these 2 variables (@[User::vFileExistsTLG] and @[User::vFileExistsDS]) from the parent package to the child package.
Create a new variable @[User::vEmailSubject] in your child package. Set its "Evaluation As Expression" property to TRUE and set its expression as below -
( @[User::vFileExistsTLG] == False) && (@[User::vFileExistsDS] == False) ? "TLG and DS files are not present": (@[User::vFileExistsTLG] == False) ? "TLG file is not present" : (@[User::vFileExistsDS] == False) ? "DS file is not
present" : "Both the files are present"
Open the Send Mail tasks property window and go to the Expressions property page.
Click on the 3 dots (...) against the Expressions and select "Subject" from the dropdown in the Property column.
Click on the 3 dots (...) against the Subject. This would open the Expression Builder dialog box. From the Variables drop down, drag and drop the newly created variable @[User::vEmailSubject] and click OK.
Please let us know in case the above solution doesn't work for you.
Cheers,
ShalinShalin P. Kapadia
Free Windows Admin Tool Kit Click here and download it now
November 1st, 2010 11:26pm