PLM之家PLMHome-工业软件践行者

Teamcenter SOA开发源码分享:获取所有的item版本信息

[复制链接]

2015-2-6 10:14:52 4762 0

admin 发表于 2015-2-6 10:14:52 |阅读模式

admin 楼主

2015-2-6 10:14:52

请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!

您需要 登录 才可以下载或查看,没有账号?注册

x
Teamcenter SOA开发源码分享:获取所有的item版本信息
. S% X9 o2 D* C: {
! i7 r! m$ R- ^4 \5 v6 V
3 Y6 V' y$ Q( p) _3 _1 p8 H public static void getAllItemRevisionsOfItem(ModelObject[] item_list)
0 ]+ q7 d3 e6 H8 b0 c* X    {
4 F: l/ }8 J. c: _        if(item_list == null) return;6 k1 V2 q2 Y; u% H6 y" D8 m( Z

& Z4 [3 P  s' x& A: X        SimpleDateFormat format = 0 \+ q3 s* o# g1 i, M+ t
            new SimpleDateFormat("M/d/yyyy h:mm a", new Locale("en", "US"));
8 U1 ]3 w/ i  `; g) d: @
/ b6 y2 ^( c0 L/ C# |+ S6 b         for (int ii = 0; ii < item_list.length; ii++)# P2 |. D  t2 ?. ]0 n! i. i/ Y
        {
2 Q# B3 R9 a" p8 @" [3 N            System.out.println("\nItem Revision List\tLast Modified");5 m* S" s5 z4 i
            System.out.println("====================\t=============");
8 j/ r* T" \: r7 N# s9 k
. G/ G* G9 E) i( @% Y            DataManagementService dm =
: g* R1 ~. N$ [                DataManagementService.getService(Session.geTConnection());
9 k' k" l' L# G# z+ d
, N, ~# X# o. S$ c            String[] attributes = {"revision_list"};; l: v2 X5 ?' \( [) ?
            dm.getProperties(item_list, attributes);
/ @6 m6 _: j$ y! X* t2 t8 [/ n- f; j) U# {  V
            try' H5 K& P/ O' i; f7 Z
            {) R* v3 A; B; @
                ModelObject[] rev_list = % z/ l! v" |! `) N  i* W
                    ((Item) item_list[ii]).get_displayable_revisions();5 ^9 J6 M4 U/ c$ t( q5 {4 `
                for (int kk = 0; kk < rev_list.length; kk++)0 o* T' E  b" S( `1 C
                {+ X  a9 F6 \  @3 s/ O
                    String objectString =
: r$ k9 t- a- {! t' y3 K$ i7 r                        ((WorkspaceObject) rev_list[kk]).get_object_string();
5 ?% g& L& v8 a3 M                    Calendar lastModified =
- _, T+ W; J/ `8 I                        ((POM_application_object) rev_list[kk]).get_last_mod_date();- d5 Z- a5 I7 }4 E! V7 i2 I
                    System.out.println(objectString + "\t\t" +
6 y; M) C! R! I                            format.format(lastModified.getTime()));
" J0 g& n( h% L# i. }                }
8 d* q/ T1 R2 G0 Z7 a2 ^            }5 w2 y) V  J6 `) d8 u
            catch (NotLoadedException e)
4 G# O; [( c' v$ o& A4 S8 ?4 F$ A            {9 X, R& \) D1 @+ b4 r( K% J
                System.out.println(e.getMessage());3 m0 e! ~' U* k! j6 g* g! c
            }/ n% P/ _1 S. V: [" ]$ k
        }, X/ M1 m8 l7 ?3 t! _
    }3 Y5 f) N3 W# F) h
上海点团信息科技有限公司,承接UG NX,CATIA,CREO,Solidworks 等CAx软件,Teamcenter,3D Experience等PLM软件,工业4.0数字化软件的实施\二次开发\培训相关业务,详情QQ 939801026 Tel 18301858168 网址 doTeam.tech
回复

使用道具 举报

发表回复

您需要登录后才可以回帖 登录 | 注册

返回列表 本版积分规则

  • 发布新帖

  • 在线客服

  • 微信

  • 客户端

  • 返回顶部

  • x
    温馨提示

    本网站(plmhome.com)为PLM之家工业软件学习官网站

    展示的视频材料全部免费,需要高清和特殊技术支持请联系 QQ: 939801026

    PLM之家NX CAM二次开发专题模块培训报名开始啦

    我知道了