How to add a rule defined in JSON into Knowledge Library #238
-
Hi, I wish to check an example to load the rule in Json format as a string. If possible please share a whole example like we have for AgeCheckSample_test. Thanks, When i try i get the following error. sample json rule: |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
I assume you have not read this ? https://github.com/hyperjumptech/grule-rule-engine/blob/master/docs/GRL_JSON_en.md |
Beta Was this translation helpful? Give feedback.
-
Got it to work..using the lines below |
Beta Was this translation helpful? Give feedback.
Got it to work..using the lines below
ruleset, err := pkg.ParseJSONRuleset([]byte(ruleInJson))
.
.
err = ruleBuilder.BuildRuleFromResource("Test", "0.1.1", pkg.NewBytesResource([]byte(ruleset)))
Thanks.