Biml - Execute Package Task (Project Deployment Model)
The Execute Package Task allows you to run a package from within another package.
This post will show how to execute a package that uses the new project deployment model. This biml generates two packages. The child package, Task_ExecutePackage_ChildPackage, will have a Variable which has an Expression based on a Package Parameter. The second package, Task_ExecutePackage_Project, will have an Execute Package Task that is driven by Variable for Package Name. It will also showcase how to use Parameter Bindings to pass values to child packages.
<Biml xmlns="http://schemas.varigence.com/biml.xsd"> <!-- Create a pair of packages using the 2012+ project deployment model. Task_ExecutePackage_ChildPackage will have a package parameter mapped used as an expression Task_ExecutePackage_Project will reference the --> <Packages> <Package ConstraintMode="Linear" Name="Task_ExecutePackage_ChildPackage"> <Parameters> <Parameter DataType="String" Name="ParamValue">DesignTime</Parameter> </Parameters> <Variables> <Variable DataType="String" Name="VariableValue" EvaluateAsExpression="true">@[$Package::ParamValue]</Variable> </Variables> </Package> <Package ConstraintMode="Linear" Name="Task_ExecutePackage_Project"> <Variables> <Variable Name="TargetPackage" DataType="String">Task_ExecutePackage_ChildPackage.dtsx</Variable> <Variable Name="ParameterValue" DataType="String">ParentValue</Variable> </Variables> <Tasks> <ExecutePackage Name="EPT Run Project Package" DelayValidation="true"> <ExternalProjectPackage Package="Task_ExecutePackage_ChildPackage.dtsx"></ExternalProjectPackage> <ParameterBindings> <ParameterBinding VariableName="User.ParameterValue" Name="ParamValue"></ParameterBinding> </ParameterBindings> <Expressions> <Expression PropertyName="PackageName">@[User::TargetPackage]</Expression> </Expressions> </ExecutePackage> </Tasks> </Package> </Packages> </Biml>
Right click on the biml file and you should generate packages named Task_ExecutePackage_ChildPackage.dtsx and Task_ExecutePackage_Project.dtsx.
The child package does nothing except have a Variable named "VariableValue" which has an Expression based on the Package Parameter of "@[$Package::ParamValue]".
As you can see, the Control Flow has an Execute Package Task and two Variables..
Double click on the execute package task, click the Package tab and it should be configured as shown.
The package itself is driven by the Variable @[User::TargetPackage] which you can see if you click on the Expressions tab, expand the chevron on Expressions under Misc and you will see the PackageName property is powered by our Variable.
You can also look at Biml - Execute Package Task (Package Deployment Model)