Windchill 11.0使用枚举类型自定义实用程序实现生命周期状态管理
一、Enumerated Type Customization Utility
枚举类型自定义实用程序,可用于添加或编辑枚举类型的值,在Windchill 12.0+中可直接在类型和属性管理中编辑,如下图所示,而在Windchill 11.0中只能通过windchill shell启动程序,下面将详细介绍Windchill 11.0中启动并使用枚举类型自定义实用程序的操作方法。
二、启动枚举类型自定义实用程序
1. 停止Windchill and Tomcat
windchill stop
2. 从Windchill Shell启动enumCustomize
cd /opt/ptc/Windchill_11.0/Windchill/bin
./windchill shell
./enumCustomize.sh
3. 在enumCustomize点击Browse并且 打开<WT_HOME>/codebase/wt/lifecycle/StateRB.RB.ser(/opt/ptc/Windchill_11.0/Windchill/codebase/wt/lifecycle/StateRB.RB.ser)
4. 添加自定义lifecycle state
在所有已安装的语言Locale都可以添加,其中Default默认为en_US,除此之外还有zh_CN等;
4.1 在Default Locale中添加自定义lifecycle state 并点击Save,然后点击Continue 生成resource
点击Save后,如果RB.ser没有更新(查看该文件的更新日期), 可尝试在Windchill Shell使用以下命令强制更新 :
cd /opt/ptc/Windchill_11.0/Windchill
ant -f bin/tools.xml bundle_custom -Dbundle.input=registry -Dbundle.forceCompile=true
ant -f codebase/MakeJar.xml custUpdate
成功创建Resource后,就可以在/opt/ptc/Windchill_11.0/Windchill/wtCustom/wt/lifecycle/路径下看到建立的Resource文件
ResourceInfo.class=wt.tools.resource.EnumResourceInfo
ResourceInfo.customizable=true
ResourceInfo.deprecated=false
ResourceInfo.replacement=false
ResourceInfo.UUID=48de8535-78c4-4872-bb60-fa3b4042c6ec# Entry Format (values equal to default value are not included)
# <key>.value=
# <key>.category=
# <key>.comment=
# <key>.argComment<n>=
# <key>.constant=
# <key>.customizable=
# <key>.deprecated=
# <key>.abbreviatedDisplay=
# <key>.fullDisplay=
# <key>.shortDescription=
# <key>.longDescription=
# <key>.order=
# <key>.defaultValue=
# <key>.selectable=# Entry ContentsTS.value=TestState
TS.comment=Create State For Test
TS.shortDescription=TestState
4.2 同样,在zh_CN Locale中编辑自定义lifecycle state 并点击Save,然后点击Continue 生成resource
成功生成Resource后,就可以在/opt/ptc/Windchill_11.0/Windchill/wtCustom/wt/lifecycle/路径下看到更新后的StateRB_zh_CN.rbInfo文件
5. 重启服务器
cd /opt/ptc/Windchill_11.0/Windchill
ant -f codebase/MakeJar.xml custUpdate
windchill start
重启完成后,便可在组织>模板>生命周期模板>状态下看到自定义lifecycle state了,如下图所示
6.补充说明
Windchill更推荐使用上述方式来创建、编辑生命周期状态,但是也可以直接通过在/opt/ptc/Windchill_11.0/Windchill/wtCustom/wt/lifecycle/编辑.rbInfo文件来创建、编辑生命周期状态,但是在编辑完成后注意以ANSI的编码格式保存,否则会出现乱码,保存完成后,执行以下命令:
cd /opt/ptc/Windchill_11.0/Windchill
ant -f bin/tools.xml bundle_custom -Dbundle.input=registry -Dbundle.forceCompile=true
ant -f codebase/MakeJar.xml custUpdate
windchill start