title: Drools 6.1 - How to disable strict mode?
body: <p><strong>Short version:</strong> How can I disable the MVEL strict mode using the new KIE API?</p>
  
  <p>I know that there is a configuration property "drools.dialect.mvel.strict" <a href="https://stackoverflow.com/questions/24934723/disable-strict-mode-in-drools">that can be set using the old KnowledgeBuilder API</a>. However I can not find a way to accomplish the same with the new API.</p>
  
  <p><strong>Long version:</strong> I have an object method, called <em>Object attribute(String name)</em>, and the result can be many different types. Sometimes could be a List, others String or whatever. Now in order to use that method I have to use a lot of casting or drools throws exceptions. For the following example:</p>
  
  <pre><code>$entity : RootEntity( attribute('authors') != null &amp;&amp; 
                        attribute('authors').size() &gt;= 3 &amp;&amp; 
                        attribute('authors')[2] == 'whatever' ) 
  </code></pre>
  
  <p>I get errors like this:</p>
  
  <pre><code>Unable to Analyse Expression attribute("authors").size() &gt;= 3:
  [Error: unable to resolve method using strict-mode: java.lang.Object.size()]
  
  Unable to Analyse Expression attribute("authors")[2] == "whatever":
  [Error: unknown collection type: class java.lang.Object; property=]
  </code></pre>
  
  <p>In order to make this work with the strict typing enabled I have to type the same expression as such:</p>
  
  <pre><code>$entity : RootEntity( attribute('authors') != null &amp;&amp; 
                        ((java.util.List) attribute('authors')).size() &gt;= 3 &amp;&amp; 
                        ((java.util.List) attribute('authors'))[2] == 'whatever' ) 
  </code></pre>
  
  <p>Which can be disabled with the strict typing option.</p>