title: How to use java code in rules created in drools workbench
body: <p>I am using drools 6.5.0.Final to create my drools project. I am trying to use the <em>guided decision tables (.gdst)</em> in the workbench. I want to use some java code in the WHEN and THEN part of the rules, like I am allowed to in the <em>.drl</em> files, like below:</p>
  
  <pre><code>rule "filter rule"
  when
      //conditions
      $Cp : CpClass( name == "Tom",
                      Math.abs(score) &gt; 10
                  &amp;&amp;
                      // How do I use functions like below?
                      ($Cp.parseTime(CurrTime).getTime() - 
                          $Cp.parseTime(PrevTime).getTime())/1000 &gt; 120
                  )
  then
      //actions
      System.out.println("Rule passed for : "+ $Cp.toString());
      $Cp.isGoodCp = true;
  end
  </code></pre>
  
  <p>The object used in the above example:</p>
  
  <pre><code>public class CpClass {
  
      public String name;
      public String currTime;
      public String prevTime;
      public boolean isGoodCp = false;
  
      // Function to parse string to date
      public Date parseTime(String time) {
          SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss");
          Date parsedDate = null;
          try {
              if(time != null)
                  parsedDate = sdf.parse(time.substring(11));
              else 
                  parsedDate = sdf.parse("00:00:00");
          } catch (Exception e) {
              System.out.println("Error parsing:"+e);
          }
          return parsedDate;
      }
  }
  </code></pre>
  
  <p>Is there a way to use the user-defined/built-in java functions like I have here in a guided decision table?</p>