在 BIML 中引用项目参数 [英] Referencing Project Parameters in BIML

查看:23
本文介绍了在 BIML 中引用项目参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在使用 Catherine W 的关于在 BIML 中创建项目参数的帖子,运气不错.我遇到的问题是将本地参数的表达式设置为等于项目参数.这很可能只是一个 XML 格式问题,但我还没有在网上找到任何例子,我自己也没有弄清楚.因此,任何建议都会最有帮助.

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.

这是我的环境 BIML 文件中我的项目参数的定义.

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>

然后在 Packages \ Package 我有变量.我正在定义一个名为 LoadType 的用户变量,并将其设置为表达式中 LoadType 的包变量.(包中有一些东西不会使用包参数,所以我必须创建一个用户变量)我知道对 @[$Package::LoadType] 的引用是不正确的,但这就是我想要弄清楚的.让 BIML 放入包参数应该是什么?

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>

谢谢大家!

推荐答案

它对我有用

<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>

我创建了一个项目和一个包级参数,然后在我的包中创建了两个变量,每个变量都引用了参数(@[$Project::ProjectParameter] 和 @[$Package::PackageParameter])

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?

这篇关于在 BIML 中引用项目参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆