- Derive calculated fields
- Action definition (transitions without exit state?)
- Automatic audit history log
- References between resources
- Decide if expressions need to be async (for loading references). Or use continuations?
- DFS / Topo sort for calculated fields and references
- Input objects to transitions & actions
- Input validation on actions
- Refactor input validation to specify field that error should be reported on
- E-mails and other side effects in actions
- Automatic role assignment (ball-in-court if a condition is met, etc)
- Demo frontend (run engine client-side)
- Expression standard library
- Custom functions in system definition -> expression context
- User objects in expressions
- updateResource
- i18n strings (for error messages or otherwise)
- Visibility control (allow / deny / hide ?) for properties and objects
- Per-resource read permissions
- Deletion rules (cascade, conditions)
- Consistent exception handling
- Cache & transaction control for data loader API
- SQL data loader
- Cleaner internal object validation
- Expression language docs
- Service layer generator (REST & GraphQL)
- Expression test runner
- First, make sure you have
yarninstalled. - Install dependencies with
yarn install - Run tests with
yarn test - Run tests on every change with
yarn test:live - Run only one set of tests by specifying its filename i.e.:
yarn test:live expressions.test.ts - Run the script in
index.tswithyarn start - Run on every file change with
yarn build:live
When performing an action, the following steps are evaluated in order
- Retrieve resource properties
- Calculate resource calculated properties
- TODO: Evaluate resource-relationship role expressions (i.e. "ball-in-court" or "creator")
- TODO: Evaluate resource-level write permissions
- Evaluate action-level conditions
- Evaluate action-level permissions
- Update resource state (if applicable)
- Apply defined effects (in order)
- Write action and effects list to history log (if applicable)
Something like this?
{
"editDocument": {
"from": [
"authoring",
"revising"
],
"input": {
"title": {
"type": "string",
"constraints": [
{ "minLength": 1 },
{ "regex": "*." }
]
},
"text": {
"type": "string"
}
},
"validation": [
{
"invalidIf": {
">": [
{
"stringLength": {
"getInput": "title"
}
},
{
"stringLength": {
"getInput": "text"
}
}
]
},
"invalidMessage": "Document text must be longer than the title.",
"reportOnFields": ["text", "title"]
}
]
}