|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Teamcenter SOA开发源码分享:获取所有的item版本信息) r, U" |. R) P2 `
* Q) i. x' s; R! R, @% l; D
& t3 ~1 r0 f2 s; M q. y. N public static void getAllItemRevisionsOfItem(ModelObject[] item_list): p8 M, F) |, g
{
. m) l" h/ r& n' } if(item_list == null) return;
! R, r/ X: ^0 q" w4 b6 W) Q
: u0 y* w$ w0 e s8 n, L SimpleDateFormat format = ( p% d; [% H: w' D: X2 [ [
new SimpleDateFormat("M/d/yyyy h:mm a", new Locale("en", "US"));/ f2 S0 L4 t( b9 R( w
& S( P. e2 Z: P/ P Q for (int ii = 0; ii < item_list.length; ii++)
6 g5 }4 x; F5 |5 g7 k {+ v% P6 Z- q$ k5 p# o8 z
System.out.println("\nItem Revision List\tLast Modified");/ n( [8 e- E# ~2 W
System.out.println("====================\t=============");
! p, w2 L [% t) e; B) D. `2 Y9 C& t' r4 B4 \7 Y/ S
DataManagementService dm =
+ R5 w! ]' A6 L0 c% o8 I6 f DataManagementService.getService(Session.geTConnection());5 k2 `2 w, W; D
6 K' ?8 s/ o2 q( N- K String[] attributes = {"revision_list"};; j$ r) M1 P+ I" K
dm.getProperties(item_list, attributes);1 C( J9 `4 L3 |
6 s* f0 \. ^8 O* f6 |9 h7 _0 H
try
5 r) m0 ]! J! w1 U {
( V5 Q$ e* b$ G3 X" G ModelObject[] rev_list =
0 m: @0 s: O' R. ~5 ^9 l6 R$ [ ((Item) item_list[ii]).get_displayable_revisions();/ U; e$ d$ S9 j3 a9 |3 G/ V
for (int kk = 0; kk < rev_list.length; kk++). w% F4 m8 H! _; F. a7 \# D, e
{
, E! R& F2 m8 Z. d; s6 ~ String objectString =
6 C& s9 x7 N) Z9 u/ f& t ((WorkspaceObject) rev_list[kk]).get_object_string();
, q* {8 L- ~; D6 g# C5 G. j+ v Calendar lastModified =
; D3 ^8 }) s1 ^$ y$ N4 Q0 S1 t ((POM_application_object) rev_list[kk]).get_last_mod_date();# s+ Y' f; I, i7 q' L
System.out.println(objectString + "\t\t" +
- ?" P! Q7 b$ _5 h1 p format.format(lastModified.getTime()));
+ b+ i% A8 U6 ?( U1 q8 D6 l }- r. N% P, ?* j* N4 l) H
}
* c" [2 r7 z: U catch (NotLoadedException e)
! r1 k+ a; R4 r: v9 O* L% S: v2 ]3 z# @ {9 l; L4 K. G& {$ l" {- _) I
System.out.println(e.getMessage());6 N/ w9 |4 f6 N, C5 s* {
}
+ Y2 [. c3 a4 w1 i4 u2 G& j- M! F) N }1 p! A. o$ a" a' x$ E- j
}
1 v' ~! t/ K4 i' P8 @7 x9 H |
|