请教一下,我创建了6个钢板用entity表示,钢板的厚度有三种分别用1,2,3表示。在entity的自定义属性里面创建了thickness的属性定义为integer型分别给每个钢板厚度赋值。在分流运输时,创建了一个flow对象,后接三个buffer,编辑了一个method对象添加给flow的exit从而根据厚度对钢板进行分流,我写的method如下:, q) G+ t! Q1 u3 t t$ k& P5 \* `, D
:integer
( Y" }# a: d8 Uis
! Y/ Q- M/ v/ v8 z, f' E$ ym :integer;Thickness :integer;/ W) j \6 @: N
do' b0 h8 I0 L$ p7 h7 c% I9 i0 d
m=@.Thickness;
$ q* P) {9 T- `$ w! `5 C% H' ?; s& {if m=1then
) G9 |2 a: f+ E* ?! r& Greturn 1;
) n7 O4 F3 f- P3 S) Belseif m=2then
8 k" P& w7 N7 }# J" Preturn 2;
4 ]0 U) `- U6 j. R* celse
2 z; \3 a$ j! L+ }3 `6 f% Jreturn 3 ;
2 y9 M& e, a: Q# Z1 k2 S1 x0 t7 o# ]end;
# k; h1 Z' f* }! ]0 O9 N8 n% Nend;只有读了entity1可以被运输到相应的Buffer上,再读entity2就说不识别Thickness了,我想不明白了,请大家有时间帮忙解惑一下,不甚感激 |