使用 CCD 实用程序导入 BAC 包
您可以使用 Code and Configuration Deployment (CCD) 实用程序导入 Business Administrative Change (BAC) 包。导入之前,必须先设置以下特性:
com.ptc.windchill.bac.ignoreGUIDList=All
|
|
此特性可确保系统允许所有 BAC 包,而无论其预期目标为何。
|
要使用 Code and Configuration Deployment (CCD) 实用程序导入 Business Administrative Change (BAC) 包,请执行以下步骤:
1. 从源系统中导出 BAC 包并进行复制。
2. 将 BAC 包粘贴到以下位置:
<customizationRootDirectory>/generated/BAC/
3. 在目标系统中,执行与 CCD 实用程序相关的以下加载命令:
ant load.data -Dadministrator.username=<administrator user>
成功导入 BAC 包后,系统在以下位置生成报告:
<WT_HOME>/buildlogs/customizationLogs/bac/reports
默认情况下,会在以下位置生成 CCD 实用程序日志:
<WT_HOME>/buildlogs/customizationLogs
可以在日志中查看成功和失败情况的详细消息。
要点
• 发生冲突时,使用 CCD 实用程序导入的 BAC 包会覆盖目标系统中的对象。但是,如果在导入基于列表的版本控制方案时发生冲突,导入操作会失败。例如,在导入基于列表的版本控制方案时,XML 文件无效。
• 在自定义包中一次只能耗用一个 BAC 包。应将所有管理变更对象导出到单个 BAC 包中。可根据需要将与管理对象相关的变更以 zip 文件的形式提交到新的自定义包中。
• 如果要首次部署 CCD 包,且 CCD 包中包含 BAC 包,请执行以下步骤:
1. 使用环境设置将以下特性与 wt.properties 文件中的任何其他特性一并添加:
wt.pom.emptyTableManagerEnabled=false
2. 部署 CCD 包。
3. 在环境设置中,通过将该特性设置为 true 来还原上述变更。
wt.pom.emptyTableManagerEnabled=true
• 要使用包含 BAC 包的 CCD 包来运行迁移工厂,需在源服务器上将以下首选项设置为“是”,或者将该首选项作为加载程序包含在 CCD 包中:
“使用其他属性的参与者标识”
解决 CCD 包导入过程中出现的冲突
Windchill+ 借助自动化机制,解决通过“导入变更”选项卡导入 CCD 包时出现的已知冲突,这样利于减少手动工作量,提高成功率。系统会引用 <Windchill_Home>/bin/customizationTools/templates 下的 defaultConflictResolution.xml 文件来解决冲突。
如果该文件中存在冲突代码,系统会应用解决方案并继续导入进程。如果缺失冲突代码,导入会失败,且必须手动解决。
通过“事件管理”界面手动解决冲突。
示例:
|
冲突场景
|
系统操作
|
|
MS_With_Same_Identity_Exists
|
从 XML 应用解决方案并继续导入进程
|
|
Organization_Does_Not_Exist
|
导入失败;必须手动解决
|
支持 BAC 映射
系统允许源系统的用户和上下文与本地系统的用户和上下文进行映射。要进行映射,BAC (.zip) 包和映射 (.xsl) 文件必须位于同一文件夹中。
必须创建“使用其他属性的参与者标识”首选项的实例,才能确保用户和上下文的未来 BAC 映射按预期运行。设置环境后,可通过加载程序或 BAC 包来设置此首选项。
映射 (.xsl) 文件的示例如下:
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="@* | node()" priority="-9">
<xsl:copy><xsl:apply-templates select="@* | node()"/></xsl:copy>
</xsl:template>
<xsl:template match="objectContainerPath">
<xsl:choose>
<xsl:when test=". = '/wt.inf.container.OrgContainer=SJ_Organization/wt.pdmlink.PDMLinkProduct=SJ_Product'">
<xsl:element name="objectContainerPath">
<xsl:text>/wt.inf.container.OrgContainer=Demo Organization/wt.pdmlink.PDMLinkProduct=GOLF_CART</xsl:text>
</xsl:element>
</xsl:when>
<xsl:otherwise>
<xsl:copy>
<xsl:apply-templates select="@*|node()" />
</xsl:copy>
</xsl:otherwise> </xsl:choose>
</xsl:template>
<xsl:template match="@isInternal[parent::WTPrincipalReference]">
<xsl:choose>
<xsl:when test="../name = 'SJ_prodmanager'">
<xsl:attribute name="isInternal">
<xsl:text>false</xsl:text>
</xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:copy>
<xsl:apply-templates select="@*|node()" />
</xsl:copy>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="@classType[parent::WTPrincipalReference]">
<xsl:choose>
<xsl:when test="../name = 'SJ_prodmanager'">
<xsl:attribute name="classType">
<xsl:text>wt.org.WTUser</xsl:text>
</xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:copy>
<xsl:apply-templates select="@*|node()" />
</xsl:copy>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="@fullName[parent::WTPrincipalReference]">
<xsl:choose>
<xsl:when test="../name = 'SJ_prodmanager'">
<xsl:attribute name="fullName">
<xsl:text>Demo, User</xsl:text>
</xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:copy>
<xsl:apply-templates select="@*|node()" />
</xsl:copy>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="@surname[parent::WTPrincipalReference]">
<xsl:choose>
<xsl:when test="../name = 'SJ_prodmanager'">
<xsl:attribute name="surname">
<xsl:text>Demo</xsl:text>
</xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:copy>
<xsl:apply-templates select="@*|node()" />
</xsl:copy>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="@userEmail[parent::WTPrincipalReference]">
<xsl:choose>
<xsl:when test="../name = 'SJ_prodmanager'">
<xsl:attribute name="userEmail">
<xsl:text>demouser</xsl:text>
</xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:copy>
<xsl:apply-templates select="@*|node()" />
</xsl:copy>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="WTPrincipalReference/name">
<xsl:choose>
<xsl:when test=". = 'SJ_prodmanager'">
<xsl:element name="name">
<xsl:text>demo</xsl:text>
</xsl:element>
</xsl:when>
<xsl:otherwise>
<xsl:copy>
<xsl:apply-templates select="@*|node()" />
</xsl:copy>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="WTPrincipalReference/ufid">
<xsl:choose>
<xsl:when test="../name = 'SJ_prodmanager'">
<xsl:element name="ufid">
<xsl:text>uid=demo,ou=people,cn=ldap,cn=narwhal_03_24,o=ptc|Ldap.ptcnet.ptc.com|Ldap.ptcnet.ptc.com</xsl:text>
</xsl:element>
</xsl:when>
<xsl:otherwise>
<xsl:copy>
<xsl:apply-templates select="@*|node()" />
</xsl:copy>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>