https://github.com/comcast/rulio
Rulio
https://github.com/comcast/rulio
Last synced: about 1 year ago
JSON representation
Rulio
- Host: GitHub
- URL: https://github.com/comcast/rulio
- Owner: Comcast
- License: apache-2.0
- Created: 2015-11-13T23:13:00.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2023-02-25T06:19:04.000Z (over 3 years ago)
- Last Synced: 2025-03-29T23:09:07.814Z (about 1 year ago)
- Language: Go
- Size: 685 KB
- Stars: 336
- Watchers: 18
- Forks: 59
- Open Issues: 28
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://travis-ci.org/Comcast/rulio)

## Overview
A rules engine. You write rules and send events. You can also write
some facts that rules can use. When an event arrives, the system
finds candidate rules. A candidate rule's condition is evaluated to
find zero or more sets of variable bindings. For each set of variable
bindings, the rule's actions are executed.
See the [docs](doc) for more. In particular, see `doc/Manual.md`.
There are lots of examples in `examples/`.
Also see [`Comcast/sheens`](https://github.com/Comcast/sheens).
## License
This software is released under the Apache License, Version 2.0. See
`LICENSE` in this repo.
## Usage
### Starting
To compile, you need [Go](https://golang.org/). Then
```Shell
(cd rulesys && go get . && go install)
bin/startengine.sh &
ENDPOINT=http://localhost:8001
LOCATION=here
curl -s $ENDPOINT/version
```
If you see some JSON, the engine is probably running. Check
`engine.log` to see some logging.
### A simple rule
Now let's use that engine. In these examples, we'll talk to the
engine using its primitive HTTP API.
```Shell
# Write a fact.
curl -s -d 'fact={"have":"tacos"}' "$ENDPOINT/api/loc/facts/add?location=$LOCATION"
# Query for the fun of it.
curl -s -d 'pattern={"have":"?x"}' "$ENDPOINT/api/loc/facts/search?location=$LOCATION" | \
python -mjson.tool
# Write a simple rule.
cat <