We believe you example will be helpful for other users as well. So, we create a decision project called "TeamPerformance" and it's now include in the fresh download of OpenRules Decision Manager
. Everybody can try it using our SaaS Rule Engine - first 30,000 executions are free!
Here is what we did. For different sport teams we want to define team performance in the decision variable Team Score defined by this decision model.
Here is our Glossary:
All player performances are defined in the following Data table:
You may add more records here. Here are the players:
They belong to two teams:
And now let's look at the rules. On the top-level "EvaluateTeam" we want to execute two sub-decisions:
The sub-decision"EvaluatePlayers" will be called for every player in the currently considered team:
It will iterate through all performances and will apply the following rules to calculate a player's score:
When the team's players scores are calculated, the following rules will be executed for all team's players:
That's it. Here are the execution results:
We also created a similar project for the Classic OpenRules BRDMS.