An open API service indexing awesome lists of open source software.

https://github.com/comcast/rulio

Rulio
https://github.com/comcast/rulio

Last synced: about 1 year ago
JSON representation

Rulio

Awesome Lists containing this project

README

          

[![Build Status](https://travis-ci.org/Comcast/rulio.svg)](https://travis-ci.org/Comcast/rulio)

![Rulio is a rules engine](https://raw.githubusercontent.com/Comcast/rulio/master/doc/Rulio_logo_400x124.png)

## 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 <