Skip to content

Commit

Permalink
Merge pull request #107 from epoberezkin/master
Browse files Browse the repository at this point in the history
Typos/minor errors in readme
  • Loading branch information
doug-martin committed May 18, 2014
2 parents 8786582 + 1124ddc commit 29697cb
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ define Message {
//find any message that start with hello
rule Hello {
when {
m : Message m.message =~ /^hello(\\s*world)?$/;
m : Message m.message =~ /^hello(\s*world)?$/;
}
then {
modify(m, function(){this.message += " goodbye";});
Expand Down Expand Up @@ -556,23 +556,23 @@ Or in the dsl
rule "Hello World" {
agenda-group: "ag1";
when{
m : Message m.name == 'hello';
m : Message m.message == 'hello';
}
then{
modify(m, function(){
this.name = "goodbye"
this.message = "goodbye"
});
}
}
rule "Hello World 2" {
agenda-group: "ag2";
when{
m : Message m.name == 'hello';
m : Message m.message == 'hello';
}
then {
modify(m, function(){
this.name = "goodbye"
this.message = "goodbye"
});
}
}
Expand All @@ -583,17 +583,17 @@ In the above rules we have defined two agenda-groups called `ag1` and `ag2`
<a name="agenda-groups-focus"></a>
### Focus

When running your rules and you want a particular agenda group to run you must call `focus` on the flow and specify the `agenda-group` to add to the stack.
When running your rules and you want a particular agenda group to run you must call `focus` on the session of the flow and specify the `agenda-group` to add to the stack.

```
//assuming a flow with the rules specified above.
var fired = [];
flow
.getSession(new Message("hello"))
.focus("ag1")
.on("fire", function(ruleName){
fired.push(ruleName); //[ 'Hello World' ]
})
.assert(new Message("hello"))
.match(function(){
console.log(fired);
});
Expand Down Expand Up @@ -742,8 +742,8 @@ var fired = [];
flow
.getSession(
new State("A", "NOT_RUN"),
new State("B", "NOT_RUN")),
new State("C", "NOT_RUN")),
new State("B", "NOT_RUN"),
new State("C", "NOT_RUN"),
new State("D", "NOT_RUN")
)
.on("fire", function (name) {
Expand Down Expand Up @@ -1125,7 +1125,7 @@ when {
* `Object` - "object", "Object", "hash", Object
* Custom - any custom type that you define
2. Alias - the name the object should be represented as.
3. Pattern(optional) - The pattern that should evaluate to a boolean, the alias that was used should be used to reference the object in the pattern. Strings should be in single quotes, regular expressions are allowed. Any previously define alias/reference can be used within the pattern. Available operators are.
3. Pattern(optional) - The pattern that should evaluate to a boolean, the alias that was used should be used to reference the object in the pattern. Strings should be in single quotes, regular expressions are allowed. Any previously defined alias/reference can be used within the pattern. Available operators are.
* `&&`, `AND`, `and`
* `||`, `OR`, `or`
* `>`, `<`, `>=`, `<=`, `gt`, `lt`, `gte`, `lte`
Expand Down Expand Up @@ -1164,7 +1164,7 @@ when {
<a name="not-constraint"></a>
#### Not Constraint

The `not` constraint allow you to check that particular `fact` does **not** exist.
The `not` constraint allows you to check that particular `fact` does **not** exist.

```javascript

Expand Down Expand Up @@ -1458,7 +1458,7 @@ For rules defined using the rules language nools will automatically determine wh
### Async Actions
If your action is async you can use the third argument which should called when the action is completed.
If your action is async you can use the third argument which should be called when the action is completed.
```javascript
function (facts, engine, next) {
Expand Down

0 comments on commit 29697cb

Please sign in to comment.