Skip to content

Commit

Permalink
Update concepts.md
Browse files Browse the repository at this point in the history
  • Loading branch information
jruizgit committed Jan 31, 2014
1 parent 5d3c471 commit a779f60
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions concepts.md
Original file line number Diff line number Diff line change
Expand Up @@ -483,13 +483,14 @@ Below is the tree constructed by Durable Rules when running the ruleset above.
![Rete tree](https://raw.github.com/jruizgit/rules/master/rete.jpg)
1. Let's start by posting the following message:
```javascript
http://www.durablejs.org/examples/simple/mySession
{
id: 1,
amount: 500
}
```
```javascript
http://www.durablejs.org/examples/simple/mySession
{
id: 1,
amount: 500
}
```
1. The request comes through the Node.js post handler and the message is run through the ruleset's Rete tree.
2. The message is first pushed to the alpha node `type = '$m'`, which pushes the message to the next alpha node.
3. The message meets the condition `$m.amount < 1000`, so it is pushed to the action node.
Expand All @@ -503,14 +504,15 @@ http://www.durablejs.org/examples/simple/mySession
5. The message that triggered the action is removed from the ruleset message hashset.
6. The new state is stored in the ruleset state hashset.
3. Now let's post the message:
```javascript
http://www.durablejs.org/examples/simple/1
{
id: 2,
sid: 'mySession',
subject: 'approved'
}
```
```javascript
http://www.durablejs.org/examples/simple/1
{
id: 2,
sid: 'mySession',
subject: 'approved'
}
```
1. The request comes through the Node.js post handler and the message is run through the ruleset's Rete tree.
2. The message is pushed to the alpha node `type = '$m'`, which pushes the message to the next alpha node.
3. The message meets the condition `$m.subject = 'approved'` and is pushed to the beta node.
Expand Down

0 comments on commit a779f60

Please sign in to comment.