Windchill 设置大版本的代码

    public static void setVersion(final Versioned versioned, String version)
            throws WTException {
        try {
            if (version == null || version.trim().length() == 0) {
                // If the version ID string is null then the load file did not
                // specify it.
                version = null;
                if (versioned.getVersionInfo() != null) {
                    // If the object already has a VersionInfo object then
                    // assume it is correct
                    // and no further action is needed. Otherwise, make a
                    // default VersionInfo object.
                    return;
                }
            }
            // Get the version series of the object.
            MultilevelSeries mls = null;
            final Mastered master = versioned.getMaster();
            if (master != null) {
                final String masterSeriesName = master.getSeries();
                if (masterSeriesName == null) {
                    if (versioned instanceof WTContained
                            && ((WTContained) versioned).getContainer() != null) {
                        // Retrieve the series based on the OIR in effect for
                        // the container and object type/soft type.
                        mls = VersionControlHelper
                                .getVersionIdentifierSeries(versioned);
                        wt.vc.VersionControlServerHelper.changeSeries(master,
                                mls.getUniqueSeriesName());
                    }
                } else {
                    // Series name was already set in the master, just use it.
                    mls = MultilevelSeries
                            .newMultilevelSeries(masterSeriesName);
                }
            }
            if (mls == null) {
                // Unable to get the series from the master, just use the
                // default series.
                mls = MultilevelSeries.newMultilevelSeries(
                        "wt.vc.VersionIdentifier", version);
            }
            if (version != null) {
                // Set the revision ID value if it was given in the load file.
                mls.setValueWithoutValidating(version.trim());
            }
            // Replace the default VID object (if there is one) with the correct
            // one.
            VersionIdentifier vid = VersionIdentifier.newVersionIdentifier(mls);
            VersionControlServerHelper.setVersionIdentifier(versioned, vid,
                    false /* validateIncreasing */);
        } catch (WTPropertyVetoException e) {
            LoadServerHelper.printMessage("\nsetVersion: " + e.getMessage());
            e.printStackTrace();
            throw new WTException(e);
        } catch (Exception e) {
            throw new WTException(e);
        }
    }

代码由卡卡大神提供,特记录。

Windchill 设置大版本的代码,布布扣,bubuko.com

时间: 2024-08-04 00:33:00

Windchill 设置大版本的代码的相关文章

cocos2d-x大版本3.1系列一

本人博客,欢迎转载:http://blog.csdn.net/dawn_moon 项目忙完了,继续写我的博客.去cocos2d-x的官网看了下,不出所料,又有惊喜啊.3.0经过几个版本的迭代,终于迎来了3.1. 首先我要说,3.0是个大版本.有多大呢?其变化之大,比0.x到2.x所有的变化加起来还大.如果你是一个刚接触cocos2d-x的新手,那么恭喜你,你接触的几乎是一个全新的引擎.如果你是1.x或者2.x就接触过,那么也恭喜你,你将见证cocos2d-x从cocos2d兄弟变身到真正的X系列

html头部meta属性大全——各种奇葩属性设置大归类

常用通用属性: <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> <!--设置屏幕缩放--> <link rel="dns-prefetch" href="//www.zhoulujun.cn"> <!--设置dns缓存-->

Composer设置忽略版本匹配的方法

Composer简介 Composer 是 PHP 的一个依赖管理工具.它允许你申明项目所依赖的代码库,它会在你的项目中为你安装他们.Composer 不是一个包管理器.是的,它涉及 "packages" 和 "libraries",但它在每个项目的基础上进行管理,在你项目的某个目录中(例如 vendor)进行安装.默认情况下它不会在全局安装任何东西.因此,这仅仅是一个依赖管理. 执行composer install遇到错误:Your requirements co

C#程序集系列08,设置程序集版本

区别一个程序集,不仅仅是程序集名称,还包括程序集版本.程序集公匙.程序集文化等,本篇体验通过界面和编码设置程序集版本. □ 通过Visual Studio设置程序集版本 →右键项目,选择"属性",选择"应用程序"→点击"程序集信息",设置如下,点击确定→点击项目Properties文件夹下的AssemblyInfo.cs,可以看到程序集版本已经设置生效[assembly: AssemblyVersion("3.3.3.3")]

PyCharm设置Python版本

PyCharm默认会使用虚拟的Python解释器,即使没有安装也能够运行Python代码,但有强迫症的程序员一定不能忍受Project中存在这么多的文件目录 设置Python版本 File->Settings->Project->Project Interpreter,设置本地安装的Python解释器版本 创建Python工程 创建工程时,选择Existing interpreter已经存在的解释器. 现在就可以愉快的编写Python代码了 原文地址:https://www.cnblog

LINUX下为ORACLE数据库设置大页--hugepage

在Linux中配置hugepage可以提高oracle的性能,减少oracle sga的页交换,类似于aix中的lagepage. 为什么 使用大页? LINUX内存的默认块大小是4K如果SGA为:128Gselect 128*1024*1024/4 from dual;33554432个(三千多万),select 128*1024/2 from dual; 65536个每个内存页,有一个页表项(大概10个字节),记录页的状态.位置默认块大小是4K时--页表大小:320M.在大页下2M时,页表只

将搜索关键字设置为高亮显示实例代码

将搜索关键字设置为高亮显示实例代码:搜索关键词以高亮状态呈现是一种比较人性化的举措,例如百度或者本站都有这样的功能,可以极大的提高辨识度,下面就通过代码实例介绍一下如何实现此功能.代码实例如下: <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="author" content="http://www.softwhy.com/

7、Cocos2dx 3.0游戏开发找小三之3.0版本的代码风格

重开发者的劳动成果,转载的时候请务必注明出处:http://blog.csdn.net/haomengzhu/article/details/27691337 Cocos2d-x代码风格 前面我们已经多次提到 Cocos2d-x 源自于 Cocos2d-iPhone.Cocos2d-iPhone 是一个十分出色的游戏引擎,许多优秀的 iOS平面游戏都基于 Cocos2d-iPhone 开发,而它的实现语言是 Objective-C.因此,Cocos2d-x 也就沿袭了 Objective-C 的

MyEclipse 的智能提示设置 使开发写代码的速度更快

MyEclipse 是学习java 的人 最常用的IDE ,常常看到很多人写代码的速度很快,其实他们大多数都使用了代码提示功能,代码提示有好有坏,好的方面就是使在项目开发中速度更快,不用去记那些较长的关键字,而坏的方面就是如果使用代码提示的时间较长,自己便会便懒了,下面就是设置MyEclipse 使其在输入任何字符的时候都可以代码提示. 打开MyEclipse 在菜单栏中找到WIndow-->Preference.找到后找到如下红色的笔标注的地方 找到 Auto activation trigg