在code editor模块 ,循环是不生效的吗?count0的结果始终为0+ ?: C& v6 L: P8 ?$ _" q
/**Custom Code*/; T7 i# Z5 D: f1 I. M
Object current = param(1);" Z/ P6 f+ F& K
treenode activity = param(2);( g4 Z6 ~& E7 Y0 h
Token token = param(3);
; z9 G6 [3 K: c3 vVariant assignTo = param(4);2 l+ m4 Y" @0 `' P: }& @& {
string labelName = param(5);
6 j8 C3 `, n$ f- T, N4 q7 ttreenode processFlow = ownerobject(activity);
8 ~0 X f, w* r: O! G0 a5 q5 {( D; F& W2 U4 D; F
double count0=0;double count1=0;. _) Z$ [) b( L% @& M& z, h- D
+ i- v# Y+ j0 x/ W& r; H2 v# L$ r4 z( |& U3 x
//本工序前暂存区
" `1 ^0 ?- c( U2 e4 O4 \# g: k6 f5 M
for (i = 0; i < Model.find("Plane5/1号暂存区").subnodes.length; i++) {
( r& N2 g2 }( S1 m' e1 t) k5 U; k6 \" b5 K2 h
// 检查 type 属性是否为 3ded+ r! E0 y1 Q% D4 T) G' f% m7 t
if (getlabel(Model.find("Plane5/1号暂存区").subnodes[i],"type") == getlabel(current,"LastProduction")) {
2 e# C. d9 a/ e count0++;
9 K+ Y/ ?% Y8 |3 H3 Y: S& V2 } }" R+ c$ m q2 g( v0 Y6 u( H. d
}& j r# y a- a: \
//上一工序前暂存区
! K5 [! W- ~- P0 C9 e( H4 D8 |+ i* [# x9 a: L; u
for (i = 0; i < Model.find("Plane5/2号暂存区").subnodes.length; i++) {& f- Q: a' {1 P, o* w* L' Y5 m
' q j/ Q1 R# D# E: T- l5 [) F // 检查 type 属性是否为 3ded
/ l- P' h' H0 M# K- x8 d if (getlabel(Model.find("Plane5/2号暂存区").subnodes[i],"type") == getlabel(current,"LastProduction")) {
: y$ j9 L/ l* Y x2 W! n count1++;1 J% D# \; m% h9 M6 p3 U: S k
}
0 O4 v# s+ N- C6 l8 H" X V6 a: X}" h4 A; {& o. i* ~+ ~$ ~9 d
& b. U- H1 x, w& ~4 ^6 [/ Rreturn count0;/ T: ]+ K* ^, j4 F0 A6 p+ [4 M
" C$ }7 w) l9 W* Q; z, q3 ?
2 s2 Z5 `8 x0 G- O+ L) f' P/ A |