SHOW:
|
|
- or go back to the newest paste.
| 1 | ||
| 2 | package com.permapipe.lebanon.estimating; | |
| 3 | declare Fired | |
| 4 | rule: String | |
| 5 | end | |
| 6 | ||
| 7 | rule "F060" dialect "mvel" | |
| 8 | when | |
| 9 | then | |
| 10 | Fired f = new Fired(); | |
| 11 | f.rule = "F060" | |
| 12 | insert(f); | |
| 13 | end | |
| 14 | - | rule "F060b" dialect "mvel" //this prints F060b: Fired( rule=F060 ) |
| 14 | + | |
| 15 | rule "F060b" //this prints F060b: Fired( rule=F060 ) | |
| 16 | dialect "mvel" | |
| 17 | when | |
| 18 | $rule: Fired() | |
| 19 | then | |
| 20 | System.out.println (drools.getRule().getName()+': '+$rule) | |
| 21 | - | rule "F060c" dialect "mvel" //this rule never fires |
| 21 | + | |
| 22 | ||
| 23 | - | $rule: Fired(rule == "F060") |
| 23 | + | rule "F060c" //doesn't work |
| 24 | dialect "mvel" | |
| 25 | when | |
| 26 | $rule: Fired( rule=="F060" ) | |
| 27 | then | |
| 28 | System.out.println (drools.getRule().getName()+': '+$rule) | |
| 29 | end | |
| 30 | ||
| 31 | rule "F060d" //this prints F060d: Fired( rule=F060 ) | |
| 32 | dialect "mvel" | |
| 33 | when | |
| 34 | $rule: Fired() | |
| 35 | eval( $rule.rule == "F060") | |
| 36 | then | |
| 37 | System.out.println (drools.getRule().getName()+': '+$rule) | |
| 38 | end |