请教一下,我创建了6个钢板用entity表示,钢板的厚度有三种分别用1,2,3表示。在entity的自定义属性里面创建了thickness的属性定义为integer型分别给每个钢板厚度赋值。在分流运输时,创建了一个flow对象,后接三个buffer,编辑了一个method对象添加给flow的exit从而根据厚度对钢板进行分流,我写的method如下: c. e) a% S8 `! s
:integer: h, p3 [. W* H$ Q* Z5 Y2 I7 ]: A6 z
is
# m, H% \5 \# X6 z% s1 pm :integer;Thickness :integer;0 T3 U& j; |$ u# t
do
) d; T. ?0 I: D7 Y4 wm=@.Thickness;$ x, q. Y# z0 m/ ?1 \( o# l3 P
if m=1then
$ c, G1 G+ R R9 }return 1;2 i' G1 d+ V3 s6 V$ @* K) Y% h5 t
elseif m=2then
) l1 W# L1 X. S$ ureturn 2;
5 ?& P- R3 u( P; k Z( B/ Melse
" I6 x. H V: c7 Hreturn 3 ;
0 ~/ z# P! Y6 P5 I. L7 n {' gend;
; V. m6 C* G* X' p- e4 v# d# ]end;只有读了entity1可以被运输到相应的Buffer上,再读entity2就说不识别Thickness了,我想不明白了,请大家有时间帮忙解惑一下,不甚感激 |