title: Drools reference static field
body: <p>I wish to make a reference to a static field present in a java class from within the when clause of a drool. I don't want to insert a fact representing this value, because the value is related to our system rather than our business logic. Specifically, it is for logging purposes.</p>
  
  <p>The link below seems to suggest that referring to a static variable from within a drl file is possible. Obviously this will work from the then clause. Is it possible to also refer to this value in a when clause? Keep in mind I prefer not to use eval statements as I understand they are a tool of last resort.</p>
  
  <p><a href="http://drools.46999.n3.nabble.com/Access-a-static-variable-from-Java-file-to-DRL-File-td4023641.html" rel="nofollow">http://drools.46999.n3.nabble.com/Access-a-static-variable-from-Java-file-to-DRL-File-td4023641.html</a></p>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>Below is the code I need to fit the static call into. Basically, the drool should only fire if the log level is of a certain value.</p>
  
  <p>Java class:</p>
  
  <pre><code>public class LoggingUtilities{
  public static LogLevel logLevel = LogLevel.NONE;
  }
  </code></pre>
  
  <p>drl file:</p>
  
  <pre><code>import com.myproject.LoggingUtilities;
  rule "MyRule"
  when
    MyFact()
  then
      Log.writeOut("Some Stuff");
  end
  </code></pre>