Unable to process array elements(that are in json format e.g:key value pair ) into the excel sheet rul engine

38 views
Skip to first unread message

ashutosh pandey

unread,
May 11, 2020, 9:46:23 AM5/11/20
to OpenRules
Hi,
I am unable to process array elements into excel sheet 
For example:

"Team1" : {

        "Player" : "Dhoni",

        "consecutivePlayedfor" : "5"

    },  

    "performance" : [

        {

        "date" : "2020/04/01",

        "efficiency" : "good"

        },

        {

            "date" : "2020/04/02",

            "efficiency" : "better"

        },

        {

            "date" : "2020/04/03",

            "efficiency" : "best"

        }

]


        },

support

unread,
May 11, 2020, 12:09:38 PM5/11/20
to OpenRules
The attached file Test.xls shows an example how to define the corresponding test data in Excel. Try to run it inside your OpenRules project.
Let us know if you need more clarifications.

Support
Test.xls

ashutosh pandey

unread,
May 12, 2020, 4:13:24 PM5/12/20
to OpenRules
Thank you so much for you reply....one doubt i was having ...the Test.xls what you have attached here is .....the array elemnts has two attributes e.g: performance is an array of 5 list and each list has two elements in it......but my requirement is to allow the rule engine to check for the consecutive efficiency of every list.....so will your test.xls will do that
?
e.g: if performance on the first day is good...my rule engine should search for the performance on the next day and so on.....can you please help me with this

support

unread,
May 13, 2020, 7:55:40 PM5/13/20
to OpenRules
Hi Ashutosh,

We will build for you a working example using the data you described. If you want to send us your rules as well, it will be helpful - you may use our direct email sup...@openrules.com.

Support

support

unread,
May 16, 2020, 5:49:33 PM5/16/20
to OpenRules
Hi Ashutosh,

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:

TeamPerformanceGlossary.png

All player performances are defined in the following Data table:


TeamPerformanceData.png


You may add more records here. Here are the players:

TeamPerformancePlayers.png

They belong to two teams:


TeamPerformanceTeams.png

And now let's look at the rules. On the top-level "EvaluateTeam" we want to execute two sub-decisions:

TeamPerformanceEvaluateTeam.png

The sub-decision"EvaluatePlayers" will be called for every player in the currently considered team:

TeamPerformanceEvaluatePlayerspng.png

It will iterate through all performances and will apply the following rules to calculate a player's score:

TeamPerformancePlayerScore.png

When the team's players scores are calculated, the following rules will be executed for all team's players:

TeamPerformanceTeamScore.png

That's it. Here are the execution results:


TeamPerformanceResults.png


We also created a similar project for the Classic OpenRules BRDMS.


Support




On Wednesday, May 13, 2020 at 7:55:40 PM UTC-4, support wrote:
Hi Ashutosh,

We will build for you a working example using the data you described. If you want to send us your rules as well, it will be helpful - you may use our direct email sup...@openrules.com.

OpenRules Support
Reply all
Reply to author
Forward
0 new messages