droolsfiddle / drools-fiddle

The fiddle for Drools
Apache License 2.0
30 stars 25 forks source link

[BUG] @key add a non-fact object to the visualisation when setted #16

Open AmielPouzat opened 6 years ago

AmielPouzat commented 6 years ago

If you specify a key attribute into your DRL and you set him into a RHS, then you will get a visualisation bug, because a non-fact object is added for nothing. Example :

//
// copy paste your drl
// Drools version : 7.10.0.Final

import org.droolsfiddle.utilities.WSLogger;

global WSLogger LOGGER;

declare Fact
    value : int@key
end

rule "Rule"
    when
        f : Fact(value == 0)
    then
        modify( f ) {setValue( 41 )}
        LOGGER.debug("This is a debug log");
        LOGGER.info("This is an info log");
        LOGGER.warn("This is a warn log");
        LOGGER.error("This is an error log");
    end

Build, Submit a new Fact() , and Fire. You will encounter the bug.