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

- Added test case for kie-karaf-itests
  • Loading branch information
tkobayas committed Nov 15, 2023
1 parent cbfadbb commit cdf0b14
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 cdf0b14

Please sign in to comment.