project-flogo / rules

Golang based Rules for Real-time Contextual Decisions
BSD 3-Clause "New" or "Revised" License
112 stars 39 forks source link

Actions are triggered multiple times when multiple conditions are added #63

Closed ykalidin closed 5 years ago

ykalidin commented 5 years ago

Current behavior: Actions are called multiple times when there are multiple actions for a rule and a new tuple data is asserted.

Expected behavior: Actions should be fired only once per data.

Minimal steps to reproduce the problem: 1)Attached the main.go file and Descriptor file. There are two conditions in main.go which returns true always. Run the main.go file. Below is the output seen:

Insert data 1
Rule fired: [rule1]
name= Tom
Insert data 2
Rule fired: [rule1]
name= Bob
Rule fired: [rule1]
name= Bob
Rule fired: [rule1]
name= Tom

The rule is fired once when data 1 "Tom" is asserted. But when the next data "Bob" is asserted, the rule is fired 3 times(2 times for Bob and 1 time for Tom). Actions are triggered multiple times when there are multiple conditions.This behavior is unexpected.

issue1.zip

balamg commented 5 years ago

64 fixes this as well

ykalidin commented 5 years ago

Working as expected.Closing the issue.