akmjenkins / json-schema-rules-engine Goto Github PK
View Code? Open in Web Editor NEWA highly configurable and dynamic rules engine based on JSON Schema
License: MIT License
A highly configurable and dynamic rules engine based on JSON Schema
License: MIT License
Can anybody help me how to apply conditional validation in a repeated list component using json rules engine
scenarios - I have radio button or dropdown field on the basis of each values in the radio button or dropdown i need to apply show and hide condition
example - radio button have option
and i have 3 input fields
if i select radio button option show then only show option should visible others 2 are not. Similarly if i click radio button option Hide then input fields Hide should visible same for Both option .but that i need to add in a repeated list option if i click add button then again radio button and respective option should come i have performed validations on the basis of index but that one i not working .
Outside the list same is working but not in a list
[
{
"conditions" : {
"task210[0].radiobutton" : "empty"
},
"event" : {
"type": "remove",
"params" : {
"field": [
"task210[0].show",
"task210[0].hide"
]
}
}
},
{
"conditions" : {
"task210[0].radiobutton" : {
"equal" : "Show"
}
},
"event" : {
"type": "remove",
"params" : {
"field": [
"task210[0].hide",
"task210[0].both"
]
}
}
},
{
"conditions" : {
"task210[0].radiobutton" : {
"equal" : "Hide"
}
},
"event" : {
"type": "remove",
"params" : {
"field": [
"task210[0].show",,
"task210[0].both"
]
}
}
},
{
"conditions" : {
"task210[0].radiobutton" : {
"equal" : "Both"
}
},
"event" : {
"type": "remove",
"params" : {
"field": [
"task210[0].show",,
"task210[0].hide"
]
}
}
}
]
//here task210 is my repeated list elementName
//radiobutton -> is my radiobutton elementName
//hide, show, and both are input fields elementName
//Hide, Show, And Both are - radio button options value
if anybody help me in this that would be great
Cheers!!
Can you share with me if there is a universally agreed upon standard for sending rules over HTTP via JSON?
Because I notice that there is a specific type for the output mentioned in the readme, but some of this (like the memorizer and resolver) are not JSON serializable since they are functions.
type Options = {
facts?: Record<string,Fact>;
rules?: Record<string,Rule>;
actions?: Record<string,Action>;
pattern?: RegExp; // for interpolation
memoizer?: <T>(a: T, b: T) => boolean;
resolver?: (subject: Record<string,any>, path: string) => any
};
So what I’m looking for is a JSON Schema spec that I can point to to say “this is what the API that reads the rule selections expects to receive.”
For full context, my team is building a temporary component that we will replace with your React component. So having a standardized output will allow us to make that swap easily (ie the adapter pattern). And it will let us start building the services before the UI is written. Thank you for the guidance.
I am trying to evaluate the different json rules engine. Since this library uses AJV, how do you do a logical or/and? for example:
when :[
{
firstName: { is: { type: 'string', pattern: '^J' } },
},
{
firstName: { is: { type: 'string', pattern: '^A' } },
}
]
I assume this is an AND operator right? how do you do an OR?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.