|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Teamcenter SOA开发源码分享:获取所有的item版本信息
- E; k5 r* [! D; o" w8 g6 C- x' k/ p
& g1 [/ K; w, G
public static void getAllItemRevisionsOfItem(ModelObject[] item_list)
& l- ~' O2 n M+ [; v {
+ A5 i9 t& O! S L9 c7 t if(item_list == null) return;
/ Z0 `. H/ s4 z6 E
* A+ b+ G, E6 L; X SimpleDateFormat format = " P* ?. N* b& j! [
new SimpleDateFormat("M/d/yyyy h:mm a", new Locale("en", "US"));
6 K4 {3 J7 P/ a' ~0 e$ ]; t/ O9 [4 l/ p
for (int ii = 0; ii < item_list.length; ii++)
2 e* {7 t: P) @# ~ {
2 h% I$ s, j% I* h, }! l; U5 l' @ System.out.println("\nItem Revision List\tLast Modified"); i9 ~: U3 r9 k
System.out.println("====================\t=============");
6 b7 y1 b/ `% r: X* y! W( w" P# F
DataManagementService dm =
$ X6 `: [$ O7 i7 q+ v; S DataManagementService.getService(Session.geTConnection());
9 A# o! u8 u" v: L( q
, C* I3 j F! S String[] attributes = {"revision_list"};, s/ k$ c* d$ h7 G7 O1 n5 B
dm.getProperties(item_list, attributes);+ C7 j" f" b. h% A& J0 r
: G+ u# {5 J f$ _# R
try
8 q. H8 ~$ `8 }6 N) z; c {
" g4 @" F1 p. Y ModelObject[] rev_list =
( u7 B0 R, K4 O ((Item) item_list[ii]).get_displayable_revisions();5 f1 Q2 l) L, U0 ]+ V) L
for (int kk = 0; kk < rev_list.length; kk++) U- d( j& d- B% G1 T; c3 K
{. B- j% T& g* R% b
String objectString =- V9 j' r, z7 L8 [0 h
((WorkspaceObject) rev_list[kk]).get_object_string();
9 t, e0 I7 ] H c9 L/ \ Calendar lastModified =
! r v' g6 p. G& N: S: I ((POM_application_object) rev_list[kk]).get_last_mod_date();
0 e# I4 g* W; ^' Y System.out.println(objectString + "\t\t" + ) u2 ^6 n8 e6 p& x1 u+ R$ @1 Q
format.format(lastModified.getTime()));
& ?% y( ]6 K7 v0 ~ }2 e! q e1 w! `& x3 q, E
}
, c# l' A1 y5 l$ r catch (NotLoadedException e)
1 T3 f; I$ N% B3 B. {7 S {
- n& @! W) |8 Q System.out.println(e.getMessage());
0 M/ R# Q3 }+ Y8 Y' ~ }
/ G% b/ g: x( Q4 o* W/ O }
1 H, q7 \0 S) d }' s1 |6 S: [0 A2 C4 i3 q
|
|