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

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

[复制链接]

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

2470

主题

1275

回帖

8万

积分

管理员

PLM之家站长

积分
82162
QQ
发表于 2015-2-6 10:14:52 | 显示全部楼层 |阅读模式

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

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

x
Teamcenter SOA开发源码分享:获取所有的item版本信息" N. b# d5 Z  F
& z( C5 c1 {' {3 g# U' G  Q

, j$ z( t1 @2 i& I4 g( Q, n+ e+ J public static void getAllItemRevisionsOfItem(ModelObject[] item_list)8 m  O; U: G! ^$ d. ]
    {; F5 E  z- m4 Q9 P3 T, M
        if(item_list == null) return;
& P4 T5 m; t7 Y; A. W0 c% T6 }6 Z
7 ]  Y! Z- n& j" x* ]        SimpleDateFormat format =
, v. L/ m8 g; M            new SimpleDateFormat("M/d/yyyy h:mm a", new Locale("en", "US"));' C0 I1 e$ K. u' E
1 Q5 y; ~+ c6 M! ?: G
         for (int ii = 0; ii < item_list.length; ii++)
. k% q4 o8 k( m" H9 t        {
" E9 ]( d& J1 x            System.out.println("\nItem Revision List\tLast Modified");5 I* Y/ t. f4 a
            System.out.println("====================\t=============");' ]5 U1 ?- Q5 S

" `& m! x( b! x6 y            DataManagementService dm = " G) o3 O7 ^0 R% w8 h
                DataManagementService.getService(Session.geTConnection());8 k: y0 ?  w+ Q2 p

+ q6 J. g" h# Z& M2 Z( p8 K% Q            String[] attributes = {"revision_list"};/ E6 t" A3 e: F9 Q, K! L  \
            dm.getProperties(item_list, attributes);
1 a4 X: c& a$ w- l: R! d- v, ?9 j  H( e- b& _% x) M0 S
            try
4 c/ r1 _5 h- ~1 Q            {
& B* {* E) s$ J# A                ModelObject[] rev_list =   Q8 Q, r4 V$ K0 J3 t$ B
                    ((Item) item_list[ii]).get_displayable_revisions();; Z& y' s1 [) y
                for (int kk = 0; kk < rev_list.length; kk++): e- @' Z% m4 M  b3 M
                {2 i0 ~5 c% s5 `
                    String objectString =! D" z/ [; x) ?$ j# x" a/ X
                        ((WorkspaceObject) rev_list[kk]).get_object_string();" A# j  |5 C% }  p2 ~: x5 @
                    Calendar lastModified =
1 Q0 i0 @0 \; p0 ]. s+ r  [                        ((POM_application_object) rev_list[kk]).get_last_mod_date();( g+ a( _  X. k+ q6 m- F
                    System.out.println(objectString + "\t\t" +
9 B# r+ g- K/ O9 u  Q6 s; z- D                            format.format(lastModified.getTime()));; d1 ^4 t1 ?: j/ G$ S  E
                }
! [. t% m0 \. A. j6 H8 r            }
& W: ]% I% g8 y6 G0 @+ O            catch (NotLoadedException e): R5 d9 r5 _5 ?4 Z0 {) K# L) ^
            {
* L# |8 X2 X' Y4 ~" n                System.out.println(e.getMessage());* A* E# i) u) F0 S( l9 h
            }
( Z3 r! ~! R( k0 f. B7 j. s1 [        }
9 {* M/ R6 V( A0 P( y( M8 `6 `    }! S( R# T8 \& J) V) u9 S8 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二次开发专题模块培训报名开始啦

    我知道了