Skip to content

flow.rule should provide callback support #94

@bthibault

Description

@bthibault

I believe that is the issue here:

 // define the rule
    flow.rule("RULE", criteriaArray,
      function(facts) {
         _self = this;
         // do some fact modification asynchronously 
         ruleAction.run(facts.p, rg.then.params, function(err, results) {
                // alert the engine the rule has been modified
                _self.modify(facts.p); 
                _self.retract(facts.p); 
         });
  });

So whats happening here, is the async function ruleAction.run is run, BUT the rule has already fired, which moves the pointer on the linked list then we try to call _self.modify but the fact has already been unlinked.

So we have an async call, with no way to do a callback.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions