0 Replies Latest reply on Jun 6, 2007 11:45 AM by Stanley Dumbrowski

    drools / rules - basics of field access

    Stanley Dumbrowski Newbie


      I am very new to drools. I am having trouble with rule syntax.

      I have an object A. One of the fields in class A is a reference to an object B.
      class A
      { private B;
      int x;
      //getters and setters and stuff

      class B
      { int y; }

      I have a bunch of objects of class A in working memory.

      Now, I want to write a rule that says "if A.getB().getY() == 10, then A.setX(4)".

      What is the code for this rule? (I'm NOT using xml)