|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Teamcenter SOA开发源码分享:获取所有的item版本信息
% @0 T: q0 M+ c* V1 t* ]1 A/ ~' i: o: A' V% b% G; M$ J s$ h. K
& _# ], x- C; W" V7 O
public static void getAllItemRevisionsOfItem(ModelObject[] item_list)
2 g- Q% i' Y; S4 T. N, U5 S {: W, b9 w5 U/ R. U* u. a
if(item_list == null) return; Z Y# R1 {9 \$ v
) b0 Y+ }! n# B% T: |4 ?7 f
SimpleDateFormat format = / {- I- }4 R' x" _
new SimpleDateFormat("M/d/yyyy h:mm a", new Locale("en", "US"));$ C& O( F$ g" l1 H5 x5 _
0 E: m, n5 x! z& R2 R% R. X. V% i for (int ii = 0; ii < item_list.length; ii++)& X: a1 d$ x% H5 k" F0 u
{- |: C/ {$ ]4 X4 e3 D# {' D
System.out.println("\nItem Revision List\tLast Modified");
/ t4 J( G- U K) Z$ j System.out.println("====================\t=============");# Z( N( b: A, I8 K
6 `7 m- A+ y( H6 p: p DataManagementService dm = ! Z1 L x1 i) k }* Y7 B, V6 M
DataManagementService.getService(Session.geTConnection());8 `6 R* _. e3 C% g
# }* M# g% d( ? N( c2 W
String[] attributes = {"revision_list"};
! Q) d: _ z6 u# u! F; T6 G dm.getProperties(item_list, attributes);- w, k3 Q8 ?7 U7 f: w
( L/ |( F( j V# p. e m
try
* P! h# I8 n- c' H7 Q {& q$ R* X5 l+ O/ h8 O' V& `3 V
ModelObject[] rev_list =
" [* m! V$ X/ K" z& U, q/ e ((Item) item_list[ii]).get_displayable_revisions();
7 X7 w6 ? t( o* k* L' H for (int kk = 0; kk < rev_list.length; kk++)
- f+ V$ I% Z( S( a {
+ n% n( u9 K) Z, p0 y8 l9 q String objectString =
: c# w6 w& d) L* a# Z+ `' ]8 j ((WorkspaceObject) rev_list[kk]).get_object_string();
" S/ k4 w' j, K1 Q4 g5 C Calendar lastModified =
& @7 `& i2 a' s ((POM_application_object) rev_list[kk]).get_last_mod_date();
. m+ q% N3 N, }5 ` System.out.println(objectString + "\t\t" + $ O( B: T6 ]4 g; ~% U" ]
format.format(lastModified.getTime()));1 u* w" c( t/ x. h! y
}
5 K- D) {& t% {' @! K }
% x9 g5 N, N9 h, t) a catch (NotLoadedException e)
& f i. h. Y" m% i) l {
7 W( m( a% l1 | System.out.println(e.getMessage());* g4 s: Q: _4 D$ Y9 \! {0 m
}+ @3 [2 W/ ~4 M3 n4 L( o7 s
}. h8 M0 q" u+ K0 [( Y2 V' j" l1 \
}" L) T9 {3 |% U i
|
|