|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
0 ?& M9 A" e) ]$ a3 G5 qTeamcenter SOA开发源码: 打印对象信息
$ D! \# U; I& ~
, v7 ~1 S k) X1 Q, i- k( F8 i1 l( M, c; F
[mw_shl_code=java,true]import com.teamcenter.clientx.AppXSession;
% D/ d! e% v0 A! G$ F, A/ oimport com.teamcenter.services.strong.core.DataManagementService;# g% j4 t9 r7 J6 u4 [
import com.teamcenter.soa.client.model.ServiceData;$ C% {1 e# S% E7 l
import com.teamcenter.soa.client.model.ModelObject;7 w9 I: o" ?: ~( f) q6 j
import com.teamcenter.soa.exceptions.NotLoadedException;; t! Z: g+ P+ X
, A# g6 z& p ~8 c0 {3 h+ @8 r) C: Z( T4 O) m4 C( p2 f) a$ X
public void printObject_strings(ModelObject[] objects)
; H% J- W; W+ D2 v+ Z6 C2 ]4 ~ {
, |& I6 H% g* H L7 s; J4 x4 q DataManagementService dmService = DataManagementService.getService(AppXSession.geTConnection());4 u: h$ c+ L9 R3 o( S
if (objects.length == 0) return;
6 J. D6 L, n9 o9 i6 @0 D+ V String[] attributes = {"object_string"};
" b' X" V8 B9 O; E dmService.getProperties(objects, attributes);
9 c5 |( K! k4 n: W* ^ for (int i = 0; i < objects.length; i++)
' J/ l' \4 u. \3 R+ `" ~6 O# A {2 W! V" J% D1 h" P" G9 y
String type = objects.getTypeObject().getName();
( S& K; [8 s: H( w String objectString = "";
- P- F c! j9 s. I* j if (objects.getTypeObject().isInstanceOf("POM_object"))* v) o1 `8 ^) J5 O- t) |+ Z; }
{
5 ?! D$ h3 n: }$ h! o2 _" G) I try$ I- D: {1 ]% h2 I) A0 q" W
{8 K1 b* F* c& R$ Z4 C8 B; X; S
objectString = wo.getPropertyObject("object_string").getStringValue(); a# c3 X7 ~+ ?( @! i$ M
}. D5 s2 W1 I- |' g: v
catch (NotLoadedException e) {} // just ignore5 H# Y1 S! k. _3 N1 o) s
}3 b D& ~5 F3 J
System.out.println(" " + objectString + "(" + type + ")" );' _. L6 n- y/ U. t
}
. u- l3 }6 E' v& X" t }[/mw_shl_code]
7 X8 ~$ D. u0 v1 Z |
|