sometimes you need to know which variable are available within a Rule you are working on.

below example will print all variables available




 print("rule:startLookpVariables");

  for (int i=0; i< this.variables.length; i++){ 


   String name = this.variables[i];

print("variable name -"+name);

if ("transient".equals(name)) { continue; }


   Object value = eval(name);


   if (value == void)


       print(name + " = void");


   else if (value == null)


       print(name + " = null");


    else


       print (name + ":" + value.getClass().getSimpleName() + " = " + value);


}