Jaymer
here is 1 rule in a process. it gets tmplots passed in via Context.
Its pretty simple... the Type field can be L, S, or B. And LotNum either has a value or not.
The logger output is insane - there's no way to follow/trace 1 iteration thru the rule (soooo complex).
All I know is the result is not correct.
IF tmpLots.Type='L' AND tmpLots.LotNum IS DEFINED THEN
tmpLots.OKtoPostYN ='Yes'
tmpLots.msg=`<span class='fa fa-check w3-icongreen'></span>`
ELSE
IF tmpLots.Type='L' AND tmpLots.LotNum IS UNDEFINED THEN
tmpLots.msg=`<span class='tmp2'>error: Lot # missing</span>`
ELSE
IF tmpLots.Type='S' AND tmpLots.SerialNum IS DEFINED THEN
tmpLots.OKtoPostYN ='Yes'
tmpLots.msg=`<span class='fa fa-check w3-icongreen'></span>`
ELSE
IF tmpLots.Type='S' AND tmpLots.SerialNum IS UNDEFINED THEN
tmpLots.msg=`<span class='tmp2'>error: Needs Serial #</span>`
ELSE
IF tmpLots.Type='B' AND (tmpLots.LotNum IS DEFINED AND tmpLots.SerialNum IS DEFINED) THEN
tmpLots.OKtoPostYN ='Yes'
tmpLots.msg=`<span class='fa fa-check w3-icongreen'></span>`
ELSE
IF tmpLots.Type='B' AND (tmpLots.LotNum IS UNDEFINED OR tmpLots.SerialNum IS UNDEFINED) THEN
tmpLots.msg=`<span class='tmp2'>error: BOTH Lots # and Serial required</span>`
I made a simple change (see pic) and have them as 3 separate IF rules and it worked correctly first time.
Only problem is execution time, because if Rule 1 (of 3) was the one that executed, there's no way to "BREAK" out of the Process (a wishlist item of mine) so it continues to UNNECESSARILY test Rule 2 and Rule 3. This is why I tried it in 1 rule and you'd think that after 1 IF was found true, it wouldn't continue to evaluate all the following conditions (which again, would be unnecessary). But that didn't work, so 3 rules is where I end up.
FYI