1 |
| package org.drools.semantics.annotation.model; |
2 |
| |
3 |
| import org.drools.spi.Consequence; |
4 |
| import org.drools.spi.ConsequenceException; |
5 |
| import org.drools.spi.Tuple; |
6 |
| |
7 |
| class PojoConsequence implements Consequence |
8 |
| { |
9 |
| private final RuleReflectMethod ruleMethod; |
10 |
| |
11 |
12
| public PojoConsequence( RuleReflectMethod ruleMethod )
|
12 |
| { |
13 |
12
| this.ruleMethod = ruleMethod;
|
14 |
| } |
15 |
| |
16 |
4
| public void invoke( Tuple tuple ) throws ConsequenceException
|
17 |
| { |
18 |
4
| try
|
19 |
| { |
20 |
4
| ruleMethod.invokeMethod( tuple );
|
21 |
| } |
22 |
| catch (Exception e) |
23 |
| { |
24 |
1
| throw new ConsequenceException( e );
|
25 |
| } |
26 |
| } |
27 |
| |
28 |
0
| public String toString() {
|
29 |
0
| return ruleMethod.toString();
|
30 |
| } |
31 |
| } |