Want a Rule API action interpreter
- Dominant language
- Go
- Stars
- 337
- Forks
- 58
- PR merge metrics
- No merged PRs in 30d
Description
Say an action mostly just wants to call a Rules API (like `Env.AddRule`). Writing a bunch of Javascript that mostly just offers an ugly, embedded JSON object and associated API call is distasteful. Instead, provide an action interpreter that can call the core APIs with an explicit JSON object representation that uses the (silly) notation `"??..."` to request a logic variable interpolation for bindings given to the action. Also support an optional `code` property with a Javascript value that can expand the action's bindings.
For example
``` Javascript
{
"when": {"at":"?there"},
"action": {
"language":"rulesapi",
"code": {
"code": "{'?id':'bart' + '_' + 'simpson'}",
"addRule": {
"pattern": {"wants":"?wanted","at":"??there"},
"condition": {"has":"?wanted"},
"action": "Env.http('GET', 'https://localhost:1234/' id + '/' + wanted)"
}
}
}
}
```
Contributor guide
Assessment
This issue has not been assessed yet.