easy-rules icon indicating copy to clipboard operation
easy-rules copied to clipboard

JavaScript Library to parse rules in human readable format

Open vikas8352 opened this issue 4 years ago • 2 comments

Hi We have used SpELRuleFactory to load rules from Json. Our requirement is :

  1. Show all rules to users in our web ui.
  2. Business users and update rule directly from web ui and convert the update to Json format.

How can we achieve this ?

vikas8352 avatar Feb 24 '21 06:02 vikas8352

Hi, in my company, I stored rules data (JSON) on MySQL (mongo is ok too) and cached them to Redis or LocalJVM cache.

zhhaojie avatar Mar 13 '21 02:03 zhhaojie

We're doing that at my company. It may not be a perfect match, but we are using jsep. Here's the proof of concept I did on parsing it out. Make sure you scroll to the bottom, there's a little proof of concept for constructing the expression from the ui. Note: It's using React as we are heavily invested React. But between the jsep library and the stringify function I have in the expressions.js file that should give you the ability to parse out an expression to predictable structure that you can use to render what you need and then you need to be able to produce a similar structure to stringify it back to an expression string.

ammmze avatar May 06 '21 15:05 ammmze