Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Does rule engine support Expression in Value field #249

Closed
dtiwarATS started this conversation in General
Discussion options

Hi There,

I have a use case where the value field has an expression like this:

{
"fact": "fact1",
"operator": "equal",
"value": "100 - {var1} - {var2} - {var2}"
}

Note:- Var1, Var2, etc are nothing but a fact.

Up to the best of my knowledge, I guess the facts comparison allows to compare only one fact with another but I was curious to know if there is a way to support the above conditions.

Thanks.

You must be logged in to vote

Replies: 1 comment

Comment options

Hi @dtiwarATS, yes that should be achievable using fact comparison - see example. One approach would be to have a dynamic fact that represents the expression you posted, which would resolve the fact values in code and evaluate the expression.

Additionally, you might also look at using fact params to provide a data structure describing the expression, which could then be parsed by the dynamic fact. This would avoid hard coding each expression within its own fact.

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /