Menu

History - calculation memory

Help
2019-01-21
2019-01-31
  • Jean Robert

    Jean Robert - 2019-01-21

    Whats is the best way to have a calculation memory?
    In future, I want to know wich rules/values were used in my decisions.

     
  • Jean Robert

    Jean Robert - 2019-01-23

    Any ideia on how to keep track of this? can we Log something about the decisions?

     

    Last edit: Jean Robert 2019-01-23
  • OpenL Tablets

    OpenL Tablets - 2019-01-25

    Hello,
    Please use "Trace" functioanlity for this.
    You can find more details in "OpenL Tablets - WebStudio User Guide" - "Tracing Rule" section.

    Best Regards,
    Alena.

     
  • Jean Robert

    Jean Robert - 2019-01-25

    we use Trace very often in development environment, and this is a great tool. But we need something like a Logs in production for every rule execution. We need to keep track of wich decisions were made for each person. If user asks why they didnt get a product or something, we need to have stored the reasons why we decided to not give him this.

    I see that i can create a Method table and use LoggerFactory inside of it, and call my Method everytime i want a log in spreadsheet. But this will make my rules ugly, as I have to call this method in every step. Anyway to have those logs out of the box from openl? or anyway to execute my method for every step of a spreadsheet, with Step and Value as parameters?

     
  • OpenL Tablets

    OpenL Tablets - 2019-01-25

    Hi Robert,

    OpenL WebService has logging functionality, which allow to store request and responses.
    You can turn on it using ruleservice.logging.enabled = true property.

    Regards,
    Yury.

     
  • Jean Robert

    Jean Robert - 2019-01-25

    anyway to log every rule/decision? this ruleservice.logging seems to log only input and output of webservice, but theres no way to know wich rules were executed, as my rules call another rules. It would be good if only i could log the calls to the Rule method invoke bean (if theres something like that)...

     
  • Sergey Zyrianov

    Sergey Zyrianov - 2019-01-25

    The approach to use is to configure ruleservice.logging to store SpreadsheetResults with details of rules calculations. It will depend on the structure of current rules but usually all Spreadsheet tables can be switched to use SpreadsheetResult and store the calculation tree using these details.
    Another option is to implement Aspect which will be storing the details about every executed rule and its results. The log can be stored as needed and all the rules inherit the same interface so the aspect can be easily attached to it.

     
  • Jean Robert

    Jean Robert - 2019-01-25

    Did you make something like that Aspect? it would be great if you could share some example with me. Do I have to generate a new WAR or i can still use it in openl tablets original one?

     

    Last edit: Jean Robert 2019-01-29
  • Marat Kamalov

    Marat Kamalov - 2019-01-31

    Sorry, we don't have examples with AspecJ. Please, refer https://www.eclipse.org/aspectj/docs.php AspectJ documentation.

    You will have a new WAR file.
    Intercepting method is org.openl.rules.method.ExecutableRulesMethod#invoke
    This method is invoked for all type of tables with a list of parameters.

    Thanks, Marat.

     

Log in to post a comment.