Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to modify fact matched using from #174

Open
bbarvish opened this issue Feb 1, 2016 · 1 comment
Open

Unable to modify fact matched using from #174

bbarvish opened this issue Feb 1, 2016 · 1 comment
Labels

Comments

@bbarvish
Copy link

bbarvish commented Feb 1, 2016

I have the following very basic rule which matches against all tables in a parent topic which have exactly 2 columns and a specific status:

rule Hello {
    when {
        $topic : Topic $topic.Id == "1";
        $t : Table $t.Status === "unknown" && $t.Columns.length === 2 from $topic.Tables;
    }
    then {
        console.log($t.Id + " is found with column count: " + $t.Columns.length + " and Status: " + $t.Status);
        modify($t, function(){ this.Status = "invalid"; } ) ;
    }
}

When I attempt to modify the matched fact's string property in working memory, i get the following error:
"msg":"Error: the fact to modify does not exist\n at declare.instance.modifyFact

Why is the matched fact not "modify-albe"? What am I doing wrong here? The console statement is able to correctly output the matched fact's properties.

@bbarvish bbarvish changed the title Unable to modify fact matched used from Unable to modify fact matched using from Feb 1, 2016
@taoqf
Copy link

taoqf commented Jul 6, 2016

Try this:

$t.Status = 'invalid';
modify($topic);

@DevSide DevSide added the bug label Oct 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants