|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
User user = (User) session.getAttribute("activeUser");* `- d' C, R' Q. v2 Q: h* o6 ?8 a; t
Connection connection = (Connection) session.getAttribute(user.getUid() + "connection");; q; A+ ~/ e2 F$ |1 p7 B
Z1 I! P: t- H/ G DataManagementService dmService = DataManagementService.getService(connection);
3 P" f9 k% T+ d6 e9 @
5 E' u4 B- t, k# M ModelObject[] models = new ModelObject[] { user };1 E. E, u: T$ S& M3 X+ }
try {
% j/ G, j: L; w4 o7 h( J7 v d String[] str = new String[] { "taskinbox" };1 h0 t& V) R: P
dmService.getProperties(models, str);
# ^3 v; k1 O5 J3 h5 e TaskInbox inbox = (TaskInbox) user.get_taskinbox();6 |6 J+ m) o& s. t8 _
4 ]8 _. U; k" u% U( Q. G, y
models = new ModelObject[] { inbox };
8 a, Q$ |- _. w; c" [$ ~ str = new String[] { "tasks_to_perform" };/ n1 ]1 u l8 f* B/ u( j. @
dmService.getProperties(models, str);# Z# a* @1 c: Q* @+ N
models = inbox.get_tasks_to_perform();
1 }, K6 a! d1 K9 L str = new String[] { "object_type", "object_name" };. k0 H, |5 f5 N8 J0 g4 c$ M) O: {
dmService.getProperties(models, str);
3 b8 o1 A! m' B% ]1 t System.out.println("---------------:" + models.length);
. @! M6 F9 ]: s% S) w4 l for (int i = 0; i < models.length; i++) {
1 q l O9 l+ j9 t. c0 n0 J4 o System.out.println("------------------------------");: t1 d, Y/ y0 w/ _( ], K7 `( X7 Z
System.out.println(models[i].getUid());' y7 [( V" U' W7 U& J% j; V
System.out.println(models[i].getPropertyDisplayableValue("object_type"));
) g& M" `7 K1 F$ i- R4 k System.out.println(models[i].getPropertyDisplayableValue("object_name"));4 ?5 r5 S, C! Z7 }' l/ h
}
3 k7 h. K, F* A% H/ X* _ f3 _1 U7 D$ }, i0 Q
} caTCh (Exception e) {
2 a: i+ P; @! ^5 { // TODO Auto-generated catch block
! l2 Q9 r& @5 |4 L3 z4 s e.printStackTrace();
3 ^ f; O3 B, g, V2 h# f5 u" A }& C- |2 @5 W: @3 S/ E
$ u$ }( ]- z) [+ m |
|