question about predicates with json-rules-engine-simplified
Closed this issue · 1 comments
BenjaminVerble commented
Let me know if there is a better venue for this question.
I'm new to using json-rules-engine-simplified
I'm trying to show a field if another boolean field is true.
This is what I had to do to make this work, and it feels like an anti-pattern.
{
conditions: {
or: [
{
"general.a": { is: null },
},
{
"general.a": { is: undefined },
},
{
"general.a": { is: false }
}
]
},
event: {
type: "remove",
params: {
field: ["general.aDescription"],
},
},
}
Apart from trying to create an "add" event, what I wanted to do was:
I didn't see an alternative in the rules engine library or its associated predicate library.
{
conditions: {
"general.a": { not: true }
},
event: {
type: "remove",
params: {
field: ["general.aDescription"],
},
},
}
What is the best way to conditionally show based on a boolean?
Thank you for your work on this library. It is making my work easier.
BenjaminVerble commented
answered my own question. closing