jruizgit / rules

Durable Rules Engine
MIT License
1.16k stars 206 forks source link

retract_facts always generates MessageObservedException #266

Open mattsha opened 5 years ago

mattsha commented 5 years ago

retract_fact works ok.

Seems to be a copy/paste typo with the actionType code:

unsigned int retractFacts(unsigned int handle, 
                          char *messages, 
                          unsigned int *stateOffset) {
    ruleset *tree;
    RESOLVE_HANDLE(handle, &tree);

    return handleMessages(tree, ACTION_ASSERT_EVENT, messages, stateOffset);
}

ACTION_ASSERT_EVENT should be changed to ACTION_RETRACT_FACT.

https://github.com/jruizgit/rules/blob/753722e2f3b3f65005130401d03761f10afd5529/src/rules/events.c#L1989

Thanks for fixing the last issue so quickly.

jruizgit commented 5 years ago

Thanks for reporting this issue. I will be putting together a fix within the next couple of days.

jruizgit commented 5 years ago

Hi, I have pushed a fix for this. Please use version 2.0.10 published in pypi.