请教一下,我创建了6个钢板用entity表示,钢板的厚度有三种分别用1,2,3表示。在entity的自定义属性里面创建了thickness的属性定义为integer型分别给每个钢板厚度赋值。在分流运输时,创建了一个flow对象,后接三个buffer,编辑了一个method对象添加给flow的exit从而根据厚度对钢板进行分流,我写的method如下:
5 C8 N- l7 _+ l% p:integer
: V5 j: ~) X7 J3 t9 q' n" nis1 Z4 K. t; k8 D) r( F
m :integer;Thickness :integer;
# W/ R q8 ?4 w( Wdo
9 U) S) h, ]2 X' m0 b, f; D% }) ?m=@.Thickness;
j+ Z' Y9 {% tif m=1then/ G. W7 H1 X- D7 {
return 1;% p# s5 ^/ b5 f5 P; F* Y' h; h
elseif m=2then
7 F3 z. o, m5 R1 n: Oreturn 2;
; T1 y8 y: }5 d2 |/ celse
; H# H4 X' A, y/ greturn 3 ;
: i7 K+ K% O: Nend;
& [; ?6 ^3 P5 l; }% Iend;只有读了entity1可以被运输到相应的Buffer上,再读entity2就说不识别Thickness了,我想不明白了,请大家有时间帮忙解惑一下,不甚感激 |