Skip to content

Commit

Permalink
kie-issues#270: DMN Runner execution identifies wrongly missing requi…
Browse files Browse the repository at this point in the history
…rements

Closes: apache/incubator-kie-issues#270

The problem was not in the DMN Runne rui component but in the engine that executes the validation. The mechanism for storing messages contained a bug.
```
    @OverRide
    public DMNMessage addMessage(DMNMessage newMessage) {
        for( DMNMessage existingMessage : messages ) {
            if( isDuplicate( existingMessage, newMessage ) ) {
                return existingMessage;
            }
        }
        this.messages.add( newMessage );
        return newMessage;
    }
```

`isDuplicate` didn't take into account all needed attributes of the `message`
  • Loading branch information
jomarko committed Aug 14, 2023
1 parent 35abd5f commit ade4e6b
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;

import org.kie.api.io.Resource;
Expand Down Expand Up @@ -100,7 +101,8 @@ public DMNMessage addMessage(DMNMessage.Severity severity, String message, DMNMe

private boolean isDuplicate(DMNMessage existingMsg, DMNMessage newMessage) {
return existingMsg.getMessageType().equals( newMessage.getMessageType() ) &&
existingMsg.getSourceReference() == newMessage.getSourceReference();
existingMsg.getSourceReference() == newMessage.getSourceReference() &&
Objects.equals(existingMsg.getText(), newMessage.getText());
}

}

0 comments on commit ade4e6b

Please sign in to comment.