请教一下,我创建了6个钢板用entity表示,钢板的厚度有三种分别用1,2,3表示。在entity的自定义属性里面创建了thickness的属性定义为integer型分别给每个钢板厚度赋值。在分流运输时,创建了一个flow对象,后接三个buffer,编辑了一个method对象添加给flow的exit从而根据厚度对钢板进行分流,我写的method如下:
( m0 t9 x# o% M3 h:integer
& f. P! t$ H- D+ E1 bis, M8 l) A# F% @: Y; I7 p; @
m :integer;Thickness :integer;
3 T2 H, g2 w# w: ~0 V9 B; ydo
8 ?8 {( K l7 R0 I% W! _+ pm=@.Thickness;
& x' m% v. l0 ]/ z" U4 Q) Sif m=1then
- s Z# s, w' e* ~9 G9 j5 Areturn 1;3 j* F8 ]2 z6 q2 f0 Q' ~$ Y
elseif m=2then
8 J- J# F% h7 a" @' ]; Kreturn 2;
" C) v1 [) M; b+ T- Ielse
, C& n$ X! {( y. ereturn 3 ;
- p8 [! \; d' V0 j5 nend;
4 V" e& l- D/ P1 c" a7 R1 Kend;只有读了entity1可以被运输到相应的Buffer上,再读entity2就说不识别Thickness了,我想不明白了,请大家有时间帮忙解惑一下,不甚感激 |