Skip to content

Commit

Permalink
[RHDM-2006] Please backport issue DROOLS-7014 to Red Hat Decision Man…
Browse files Browse the repository at this point in the history
…ager libraries (#3001) (#3003)

- Added test case for kie-karaf-itests
  • Loading branch information
tkobayas authored Nov 20, 2023
1 parent bb3ce92 commit a94c05f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ public void disapprove() {
this.approved = false;
}

// This method duplicates with approve() and disapprove(). But added to clarify bitmask issue DROOLS-7014.
public void setApproved(Boolean approved) {
this.approved = approved;
}

public Customer getCustomer() {
return this.customer;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,22 @@ rule "approve non-alcoholic drink"
when
order: Order(isApproved() == null, drink.containsAlcohol == false)
then
order.approve();
order.setApproved(true);
update(order);
end

rule "approve alcoholic drink"
when
order: Order(isApproved() == null, drink.containsAlcohol, customer.ageInYears >= 18)
then
order.approve();
order.setApproved(true);
update(order);
end

rule "disapprove alcoholic drink for too young customer"
when
order: Order(isApproved() == null, drink.containsAlcohol, customer.ageInYears < 18)
then
order.disapprove();
order.setApproved(false);
update(order);
end

0 comments on commit a94c05f

Please sign in to comment.