|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Teamcenter SOA开发源码分享:获取所有的item版本信息/ z% q7 y/ e+ I: D8 p/ x6 N, o$ U2 K
7 F `5 \; |8 ^
( R; H, ^7 r+ ^( w) I3 p public static void getAllItemRevisionsOfItem(ModelObject[] item_list)
9 T8 ~3 E6 i: H `: A) b {
. e5 |2 b3 A2 ` if(item_list == null) return;
( O- r# d9 p. D3 ]% _" k6 \" K( Z8 J; y8 g# r
SimpleDateFormat format = ) R0 O! q' G2 y- X2 }7 c6 w2 D
new SimpleDateFormat("M/d/yyyy h:mm a", new Locale("en", "US"));
1 v$ c7 N/ |7 t6 O
- P/ W1 _& k; }* }) \! C0 ~( s for (int ii = 0; ii < item_list.length; ii++)
8 T7 I/ C8 P4 S" o. I {9 G8 @# g! g$ s" K
System.out.println("\nItem Revision List\tLast Modified");8 C# f' N0 P- R/ {0 t/ O
System.out.println("====================\t=============");
' f+ b. }* ~( H, `8 ~) g' d+ D; j! m9 d' l. R7 w* P# C
DataManagementService dm = 2 Z( Z2 u/ p( `# b `: h! K
DataManagementService.getService(Session.geTConnection());
! G6 u, O- c3 j" Y7 J* Z8 G+ J0 x- Z/ P8 F4 u6 U) j
String[] attributes = {"revision_list"};
# O i7 T1 B2 @/ W dm.getProperties(item_list, attributes);
1 a5 u# T. a! ]$ E- B* v0 [
, g% n. e# b. n, j2 ?; v try
1 i( R1 M# \; h6 F1 L% W {$ e3 H3 J: T! ~4 @# |& h! Y" o+ L
ModelObject[] rev_list =
1 ^6 f3 Q6 m) _; h3 ^2 i ((Item) item_list[ii]).get_displayable_revisions();
4 n$ j5 [, h$ h+ {# D) s- O for (int kk = 0; kk < rev_list.length; kk++)
6 }$ r7 A w- i4 n {. ?* w1 Q/ j/ W4 ?% Q% j& q: r+ C+ K
String objectString =% x8 r+ v" t! Y7 r: r
((WorkspaceObject) rev_list[kk]).get_object_string();
0 B S7 F! |4 t( P- u. Y0 | Calendar lastModified =
( S2 u# r2 v" x4 T7 i9 y7 B* U ((POM_application_object) rev_list[kk]).get_last_mod_date();9 Y9 N4 _0 I" Y. ~7 u& l3 Q, F
System.out.println(objectString + "\t\t" + $ R: _: [, w# @3 J
format.format(lastModified.getTime()));
6 L% W; Q" d* p }" m% C! c* I/ u; O5 n" n1 Y. e+ P8 @# {
}' J2 y w! K9 c+ B* l
catch (NotLoadedException e)! S! @5 G. o6 O9 T
{
7 k1 p0 x. j8 `4 G; f/ Q System.out.println(e.getMessage());
I5 h0 R& \! M% }- k0 S }. x- ?0 L# R# D/ J/ k6 H8 B4 W
}
3 b+ n/ ~" S6 m7 Y, X }3 s8 w. h" S" N+ S) {2 B- P
|
|