Row level security - Rule evaluation count

I’ve an row level security rule on DocumentBillingDetail entity in Simplicor ERP with Role engine debug logging enabled. The rule is evaluating 2 simple lookup. My question is why the rule is evaluated minimally over 80 times (max was 1057 times) during screen load, if there are only 6 rows in the entity? The screen load is really not fast. Is there any other way how do read-only screens based on rule(s)?

Hi Koki,

where did you get this behaviour? Desktop client, architect (testing the screen) or Flash client?

Hi Vasek,
It’s in Flashclient version 2016_11_23_0 - log4net DEBUG level of CZ.Advantages.Asap.Rule.

It should be called for each dispayed row only once. Please call me over skype for further analysis.

Hi Vasek,
see data from log file below (it’s only part of log, I’m limited with size 3MB here). You can see the rule EET Document_Check_BKP is executed so many times. I’ve no idea, why this happens. ruleslogfile_debug.txt (2.6 MB)
.

Hi Vašek (@urbanekv) any update on this? Thanks.

Sorry not to respond, I didn’t notice the notification. I have looked into log and it seems that for each Id mainly two rules are evaluated many times - Document_ShouldDisable_SalesOrder_AfterOrderAccepted and EETDocument_Check_BKP. Sometimes there is also BR_Document_IsNotProformaBill. What are those rules?
As I have said before, it would be helpfull if you call me over skype so that I can also look at communication between flash and backend and also see the models and rules.

We found the root cause now. The web server goes through all entity-level rules for each row and FIELD. In this case the entity has 80 columns. So for 40 rows on the screen we get 3200 iterations over the same entity-rule. 80 times for each row.

An optimization would be needed that would cache the rule results for the same row so they are not calculated over and over for each entity field.

Great. Because when you use more than 2 row level security rules on whole entity with 80+ columns, the form load takes aprox. 10s and browsing thought the form is very slow too. So optimization would be great increase of performance, if you use row level security rules.