|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
7 r$ ~$ z, h# B$ t$ I" [" uTeamcenter SOA开发源码: 打印对象信息
: @. @3 y& l& c" K) h
- I6 m* V/ G' R8 T7 \' b3 w
1 [. g" t' ]$ w! ?( L[mw_shl_code=java,true]import com.teamcenter.clientx.AppXSession;
6 V( R( `1 Y4 }* ^import com.teamcenter.services.strong.core.DataManagementService;" x1 E: o8 N3 D- x
import com.teamcenter.soa.client.model.ServiceData;
/ J2 z8 O9 H( Dimport com.teamcenter.soa.client.model.ModelObject;5 `" g, \7 L9 B: ^
import com.teamcenter.soa.exceptions.NotLoadedException;
! f4 |9 K! `" p; ]8 N) ^' P( m1 E+ G/ |: |' ?
3 B. y: c e% B, Z3 J
public void printObject_strings(ModelObject[] objects)
( {- d2 y0 N! x) M- a+ A! [. i {
' {' S& T1 V6 p8 p* S. i# B DataManagementService dmService = DataManagementService.getService(AppXSession.geTConnection());
, W! s, u4 o7 i4 v) s4 w if (objects.length == 0) return;" g5 N0 _2 W a1 }/ ]& C1 N' ~
String[] attributes = {"object_string"};
+ w( A. s8 t, f dmService.getProperties(objects, attributes);& k# D- [- Z* r i) s6 x
for (int i = 0; i < objects.length; i++)+ q' J1 u- q! x6 P
{9 s" g2 _: w( }# ]
String type = objects.getTypeObject().getName();% P& u& [9 T. m3 m1 V
String objectString = "";
" V1 `3 a9 G# x% M$ J& E" r4 r4 w if (objects.getTypeObject().isInstanceOf("POM_object"))
$ F& n' ^; x, l" o7 H {# z0 n: d' M8 J! |1 D: O( U
try
/ ?% N. e1 N& }/ s2 m* E. e {9 _( |* r# |2 X
objectString = wo.getPropertyObject("object_string").getStringValue();
y# \4 _5 w" o( `1 u }
6 V* l' g% [( B4 @ catch (NotLoadedException e) {} // just ignore0 Q0 \; O5 [+ W6 ]( A0 Z2 R2 I
}+ h( y: p$ |6 Q9 E
System.out.println(" " + objectString + "(" + type + ")" );; I8 R: J1 t7 M1 R$ v) f& Q1 C. j
}
6 N. V/ h6 K9 F- \$ {+ Z+ h }[/mw_shl_code]7 w0 n, i% l. z: R; [
|
|