Hi,
<br><br>say I have a class with two fields, x and y:
<br><br>public class Test {
<br> int x = 1;
<br> int y = 2;
<br><br> getters/setters...
<br>}
<br><br><br>I would like a rule which fires when y = x + 1
<br><br>my initial thought would be something like:
<br><br>rule "Rule 1"
<br>
<br> when
<br> test : Test (y == x + 1)
<br> then
<br> System.out.println("Rule 1 matches.");
<br>
<br>end
<br><br><br>but this is invalid syntax and I can not find any examples of such a rule.
I'm doing my best but reading the manual etc. I'm struggling with the syntax here and can't figure it out.<br><br>any help really appreciated!