|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Teamcenter SOA开发源码分享:获取所有的item版本信息: a3 f% R% f0 Z* F+ a. f
, B" U, O4 s+ `# |( R! G
$ A( m4 F d, ~# k# u0 @) t public static void getAllItemRevisionsOfItem(ModelObject[] item_list)1 [6 ]: \+ F1 ^2 [
{6 f3 P1 f o% H+ Y: p2 Y# c$ ]
if(item_list == null) return;. U% P$ f( z2 z9 k1 G; b( T% [
4 |$ {- w: w( t5 b7 r3 } SimpleDateFormat format = 7 ~, j8 G B$ a
new SimpleDateFormat("M/d/yyyy h:mm a", new Locale("en", "US"));$ f: ~, D, B7 W$ ] `: {
, _% a" F3 U, [( p for (int ii = 0; ii < item_list.length; ii++)
" |/ O* e- Q& g& H {
: @9 h, \9 t- C; D' S( Z System.out.println("\nItem Revision List\tLast Modified");: }( S1 G/ l% l4 G# O# t& [
System.out.println("====================\t=============");
0 v: V$ }$ x# e9 B- z4 y
+ H' q$ v& @- }: B; r, Z, W DataManagementService dm = 1 V/ Q: ]; K9 Q# D' ?8 f) T
DataManagementService.getService(Session.geTConnection());; `0 e# G# V" K' D; p. J
( J. _2 s" B. o) `3 V/ N
String[] attributes = {"revision_list"};& b6 A6 G4 r: n; {2 l
dm.getProperties(item_list, attributes);; L5 B5 ^, f5 P
* y/ X% _# R" w1 J: @% }, A8 d' _8 t
try7 x" N* X: o/ F0 N, `* I- [; n
{
% N& O: f3 s7 j9 b2 J) k ModelObject[] rev_list = . h: D) c" V* p; E8 z+ x+ q+ C
((Item) item_list[ii]).get_displayable_revisions();! s* J2 W: w7 `, Q0 S+ S
for (int kk = 0; kk < rev_list.length; kk++)- `( c8 p' \2 F% U$ P3 Y$ f' k& |
{
- v- Q$ H, i5 b String objectString =
% m, h0 f9 C8 k) G" b \6 r ((WorkspaceObject) rev_list[kk]).get_object_string();; g V0 }0 ?$ A T
Calendar lastModified = & `: W" w2 \% \+ \& c& w- w
((POM_application_object) rev_list[kk]).get_last_mod_date();
; Q: x, M4 d, z5 c& m; N! D; n. i System.out.println(objectString + "\t\t" + - D" A1 J9 g8 m9 x1 Q
format.format(lastModified.getTime()));$ I% F5 M. @* y4 q# s% G
}
: w2 d8 z* a6 H. I% c9 } }
- x3 z: R5 J$ _) O& ^: [ catch (NotLoadedException e)
8 a8 e% L+ R6 T {
1 g0 t. [4 @: G1 [7 ^ System.out.println(e.getMessage());
h+ }! z, {: R- _: x; t: J. n }
: R" e5 y2 l+ i, @- x3 U }9 Z2 O. n- q2 N8 y* j* ~% u
}
9 `, N# _9 y) K% B- I6 G |
|