Replies: 17 comments
-
please check out the documentation on the original website: this content is in the folder doc, and it has most of the documentation to use the tool. |
Beta Was this translation helpful? Give feedback.
-
in my opinion the documentation touches on the basics. what is missed is a lot. example, is missing Actions. i am just saying that we need better documentation which has been something users of RulesEngine have always complained about. |
Beta Was this translation helpful? Give feedback.
-
Nice, so what exactly are we missing in the documentation? Would be nice to know so we can work on it. A valid good point is how to create expressions, but we can see it here: |
Beta Was this translation helpful? Give feedback.
-
expressions are 'sort of' created for us., something i want to fix, seems hardcoded at the moment |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
If anyone can provide better insights (e.g., documentation/examples) on utilizing "OnSuccess or OnFailure," that would be splendid. Specifically, how to deserialize a JSON, as shown in the picture, is where I am stuck. Json File:
Code:
Error: This exception was originally thrown at this call stack: Inner Exception 1: |
Beta Was this translation helpful? Give feedback.
-
@uBoscuBo could you please edit your comment to include that code and not an image of it? |
Beta Was this translation helpful? Give feedback.
-
@asulwer It is updated. This example is from the Rule Engine website, given here |
Beta Was this translation helpful? Give feedback.
-
@uBoscuBo, I understand the issue you're experiencing. This problem is related to JSON deserialization rather than the rules engine itself. Specifically, note that you don't need to replace anything in the example, as we have to have double quotes in for example this case To resolve this issue, you have two options:
By setting I hope this helps! If you have any further questions, feel free to ask. |
Beta Was this translation helpful? Give feedback.
-
@RenanCarlosPereira - Thanks for the heads up. That solved that one issue, but now I am getting the following error. System.Text.Json.JsonException: 'The JSON value could not be converted to RulesEngine.Models.RuleExpressionType. Path: $.Rules[1].RuleExpressionType | LineNumber: 27 | BytePositionInLine: 46.' Was there a change to the schema that affected the deserialization of the WorkFlow object?
|
Beta Was this translation helpful? Give feedback.
-
No, we didn't change anything, remember you are Deserializing an workflow not a rule. |
Beta Was this translation helpful? Give feedback.
-
@RenanCarlosPereira , my apologies. That was a typo. You are correct on that part. I'll rephrase the question since I have resolved my issue. According to the previous error,
The problem was with the second rule's RuleExpressionType. The model itself looks like it has already initialized as a LamdaExpression. The error will be resolved if I remove this line `"RuleExpressionType": "LambdaExpression" from the JSON itself. From my observation, explicitly stating the RuleExpressionType can cause issues as it is already initialized within the code. Thoughts? I guess the only problem is that the second rule won't output its expression. |
Beta Was this translation helpful? Give feedback.
-
@uBoscuBo what are you doing different than the example? the example Deserializes a Workflow, your issue is when you Deserialize a rule directly? |
Beta Was this translation helpful? Give feedback.
-
@asulwer The most significant difference that pops up is using "Actions" in the JSON files, hence why I have to use the For example, from the documentation:
I guess the only thing I am confused about is why the |
Beta Was this translation helpful? Give feedback.
-
Workflows are just a set of rules grouped. you can pass RuleExpressionType or not, as it will fallback to the default both ways works |
Beta Was this translation helpful? Give feedback.
-
@RenanCarlosPereira - Gotcha, that makes sense. I do appreciate y'all patience and assistance. |
Beta Was this translation helpful? Give feedback.
-
@asulwer @RenanCarlosPereira any plans concrete plans on a docs page? I see the docs folder is there like in the upstream, but should it be shown through a wiki page, or a GitHub pages type of view? Saw it is an issue on it, but it does not feel too actionable before the format is decided. I see you already had a some back and forth earlier in this discussion about changes to the docs. If there is a plan/vision for docs changes, it would be nice to have them put down in an issue if you would want help on it. |
Beta Was this translation helpful? Give feedback.
-
Examples, comments and documentation are grossly lacking. if anyone is to use this repository each feature needs to be documented
Beta Was this translation helpful? Give feedback.
All reactions