[JBoss JIRA] (DROOLS-2420) [DMN Designer] Hit Policy Collect does not need an Aggregation function
by Jozef Marko (JIRA)
[ https://issues.jboss.org/browse/DROOLS-2420?page=com.atlassian.jira.plugi... ]
Jozef Marko updated DROOLS-2420:
--------------------------------
Description:
Page 86 of the OMG DMN1.1 Specification states "...if the aggregation attribute is not specified, the value of the decision table is the unordered set itself;"
h2. Acceptance test
# After saving and reopening is user able to achieve Collect hit policy (/)
## with aggregating function
## without aggregating function
# After saving and reopening is user able to change (/)
## From any collect hit policy to non collect hit policy
## From non collect hit policy to collect hit policy
# Change of hit policy is reflected in dmn file (/)
# Change of hit policy will show aggregation function just if Collect hit policy, otherwise None (/)
was:
Page 86 of the OMG DMN1.1 Specification states "...if the aggregation attribute is not specified, the value of the decision table is the unordered set itself;"
h2. Acceptance test
# After saving and reopening is user able to achieve Collect hit policy (/)
## with aggregating function
## without aggregating function
# After saving and reopening is user able to change (/)
## From any collect hit policy to non collect hit policy
## From non collect hit policy to collect hit policy
# Change of hit policy is reflected in dmn file (/)
# Change of hit policy will show aggregation function just if Collect hit policy, otherwise None
> [DMN Designer] Hit Policy Collect does not need an Aggregation function
> -----------------------------------------------------------------------
>
> Key: DROOLS-2420
> URL: https://issues.jboss.org/browse/DROOLS-2420
> Project: Drools
> Issue Type: Bug
> Components: DMN Editor
> Reporter: Michael Anstis
> Assignee: Michael Anstis
>
> Page 86 of the OMG DMN1.1 Specification states "...if the aggregation attribute is not specified, the value of the decision table is the unordered set itself;"
> h2. Acceptance test
> # After saving and reopening is user able to achieve Collect hit policy (/)
> ## with aggregating function
> ## without aggregating function
> # After saving and reopening is user able to change (/)
> ## From any collect hit policy to non collect hit policy
> ## From non collect hit policy to collect hit policy
> # Change of hit policy is reflected in dmn file (/)
> # Change of hit policy will show aggregation function just if Collect hit policy, otherwise None (/)
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
8 years, 1 month
[JBoss JIRA] (DROOLS-2427) Drools @Watch not working with accumulate in code
by Mario Fusco (JIRA)
Mario Fusco created DROOLS-2427:
-----------------------------------
Summary: Drools @Watch not working with accumulate in code
Key: DROOLS-2427
URL: https://issues.jboss.org/browse/DROOLS-2427
Project: Drools
Issue Type: Bug
Components: core engine
Reporter: Mario Fusco
Assignee: Mario Fusco
I'm using Drools 7.6 and for some reason @watch doesn't stop the rule from reactivating itself or other rules when only the unwatched property is changed. Which results in an infinite loop.
Can someone figure out what am I doing wrong?
The rule:
{code}
package com.model
import com.model.*;
import java.util.List;
rule "10% for 15 High-range Items"
when
$o: Order($lines: orderLines) @watch(!discount)
Number(intValue >= 15) from accumulate(
OrderLine($item: item, $q: quantity) from $lines and
Item(category == Item.Category.HIGH_RANGE) from $item,
sum($q)
)
then
modify($o) {increaseDiscount(0.10)}
end
{code}
The model used is from the book Mastering JBoss Drools. The method increase discount has been annotated with @Modifes. The order class:
{code}
public class Order implements Serializable {
private static final long serialVersionUID = 1L;
private Long orderId;
private Date date;
private Customer customer;
private List<OrderLine> orderLines = new ArrayList<>();
private Discount discount;
public Order() {
}
public Long getOrderId() {
return orderId;
}
public void setOrderId(Long orderId) {
this.orderId = orderId;
}
public Customer getCustomer() {
return customer;
}
public void setCustomer(Customer customer) {
this.customer = customer;
}
public Date getDate() {
return date;
}
public void setDate(Date date) {
this.date = date;
}
public List<OrderLine> getOrderLines() {
return orderLines;
}
public void setItems(List<OrderLine> orderLines) {
this.orderLines = orderLines;
}
public double getTotal() {
return this.getOrderLines().stream()
.mapToDouble(item -> item.getItem().getSalePrice() * item.getQuantity())
.sum();
}
public int getTotalItems() {
return this.getOrderLines().stream()
.mapToInt(item -> item.getQuantity())
.sum();
}
@Modifies({"discount"})
public void increaseDiscount(double increase) {
if (discount == null) {
discount = new Discount(0.0);
}
discount.setPercentage(discount.getPercentage() + increase);
}
public Discount getDiscount() {
return discount;
}
public double getDiscountPercentage() {
return discount.getPercentage();
}
public void setDiscount(Discount discount) {
this.discount = discount;
}
}
{code}
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
8 years, 1 month