Referencing Project Parameters in BIML

被刻印的时光 ゝ 提交于 2019-12-13 16:04:52

问题


I've been using Catherine W's post on creating project parameters in BIML with some luck. What I'm having a problem with though is setting the expression of a local parameter equal to the project parameter. It's most likely just an XML formatting issue, but I haven't found any examples of it out on the web and have not figured it out on my own yet. So, any suggestions would be most helpful.

Here's the definition of my project parameters that is in my environment BIML file.

<Projects>
    <PackageProject Name="ProjParams">
        <Parameters>
            <Parameter Name="AgentJobName" DataType="String"></Parameter>
            <Parameter Name="LoadType" DataType="String">Full</Parameter>
        </Parameters>
    </PackageProject>
</Projects>

Then under Packages \ Package I have the Variables. I am defining a user variable named LoadType and setting it to the package variable of LoadType in an expression. (There's something in the package that wouldn't use package parameters so I had to create a user variable) I know the reference to @[$Package::LoadType] is incorrect, but that's what I'm trying to figure out. What should it be to get BIML to put in a package parameter?

    <Variables>
        <Variable EvaluateAsExpression="true" DataType="String" IncludeInDebugDump="Exclude" Name="LoadType">@[$Package::LoadType]</Variable>

Thanks everyone!


回答1:


It's working for me

<Biml xmlns="http://schemas.varigence.com/biml.xsd">
    <Projects>
        <PackageProject Name="so">
            <Parameters>
                <Parameter DataType="String" Name="ProjectParameter" >Demo0</Parameter>
            </Parameters>
            <Packages>
                <Package PackageName="so_43721322" />
            </Packages>
        </PackageProject>
    </Projects>
    <Packages>
        <Package Name="so_43721322">
            <Parameters>
                <Parameter DataType="String" Name="PackageParameter">Demo1</Parameter>
            </Parameters>
            <Variables>
                <Variable Name="PackageParameter" DataType="String" EvaluateAsExpression="true">@[$Package::PackageParameter]</Variable>
                <Variable Name="ProjectParameter" DataType="String" EvaluateAsExpression="true">@[$Project::ProjectParameter]</Variable>
            </Variables>
        </Package>
    </Packages>
</Biml>

I create a project and a package level parameter and then create two variables within my package, each referencing the parameter (@[$Project::ProjectParameter] and @[$Package::PackageParameter])

Am I missing some nuance?



来源:https://stackoverflow.com/questions/43721322/referencing-project-parameters-in-biml

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!