The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

jeverton (5) [Avatar] Offline
#1
The following accumulate does not fire when used with the OR CE. Is there a way to get this to work? Thanks

(lotData
(LOTNAME ?lotName)
(OPERATION ?lotOperation)
(PACKAGE ?lotPackage)
(IDV ?lotIDV)
(ASSEMBLYVERSION ?lotAV)
(CONCODE ?lotConcode)
(OPN ?lotOPN)
)

(areaOperations
(AREA ?area &smilieeq ?area "OVEN"))
(OPERATION ?areaOperation &smilieeq ?lotOperation ?areaOperation ))
)

?countLotTemp <- (accumulate (bind ?*count* ?*count*) ;; initializer
(bind ?*count* (+ ?*count* 1)) ;; action
?*count* ;result
(lotData (LOTNAME ?lotName)))


(or
(ovenTime
(pkg ?otPKG &smilieeq ?otPKG ?lotPackage))
(processStep ?otOperation &smilieand (neq ?otOperation "DAOV1" "LDAOV1")
(tokenMatch ?otOperation "|" ?lotOperation)))
(bakingTime ?bakingTime )
(coolingTime ?coolingTime)
(opn ?otOPN)
)
(and
(LPA
(IDVs ?lpIDV &smilieeq ?lpIDV (sub-string 1 5 ?lotIDV)))
(PKG ?lpPKG &smilieeq ?lpPKG ?lotPackage))
(CONCODEs ?lpConcode &smilieeq ?lpConcode (sub-string 1 5 ?lotConcode)))
(attributeID ?lpAttributeID &smilieeq ?lpAttributeID "MPBATCH"))
(operation ?lpOperation &smilietokenMatch ?lpOperation "|" ?lotOperation))
(attributeValue ?bakingTime &smilieneq ?bakingTime "NA" "Can not" ))
)
);end and
);end or
ejfried (326) [Avatar] Offline
#2
Re: Accumlate with OR
Hmmmm. It actually looks as though following an accumulate by an "or" is broken. You would have to write this as two rules, splitting the "or"s branches across them. Thanks for the bug report.
jeverton (5) [Avatar] Offline
#3
Re: Accumlate with OR
Thanks for the quick response. So the solution is to assert resulting lot data from each rule into a new table and have a third rule trigger from the new table?