cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Can factContext passed to the Drools contain more than one CartRAO?

Former Member
0 Likes
192

I have DroolsRule generated for qualifying products condition,

 query rule_ab71bfd3c7e140fcb7381b18bce1a6b8_query(
 ProductConsumedRAO $v6,
 CartRAO $v1,
 RuleEngineResultRAO $v2,
 WebsiteGroupRAO $v3,
 ProductRAO $v4,
 OrderEntryRAO $v5)
    (
       $v1 := CartRAO()
       and
       $v2 := RuleEngineResultRAO()
       and
       $v3 := WebsiteGroupRAO(id == "ourPromotionGroup")
       and
       (
          $v5 := OrderEntryRAO(product == $v4, quantity >= new Integer(5))
          and
          $v1 := CartRAO(entries contains $v5)
          and
          $v6 := ProductConsumedRAO(orderEntry == $v5, availableQuantity >= new Integer(1))
          and
          (
             $v4 := ProductRAO(code in ("my_product") || baseProductCodes contains "my_product")
          )
       )
    )

First we get any cart from context, right?

 $v1 := CartRAO()

then we get it again, but this time with filtration

 $v1 := CartRAO(entries contains $v5).

Does it mean, that we can have several carts inside of passed context, otherwise why this check exists, if facts were extracted recursively starting from Order. (here DefaultPromotionEngineService.class:143)

Accepted Solutions (0)

Answers (0)