<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>We don't publicise the internal javadocs, just the public ones. But just checkout the code and look over it, I don't think the internal javadocs will help much.</div><div><br></div>You lose type discrimination and type safety, but you can already do:<div>Map( this['key'] == "xxx" )</div><div><br></div><div>What I think would be more interesting is to use Traits and map a Map to a type safe structure. It would take a some changes, as at the moment the Traits back onto a global triple store, but they could with some changes back onto the provided Map instance. Traits is a form of duck typing.</div><div>&nbsp;</div><div>//code below is illustrative of what is possible, if changes where mad for above idea.</div><div><br></div><div>// Create interface</div><div>Person</div><div>&nbsp; &nbsp; @Trait</div><div>&nbsp; &nbsp; String : name</div><div>&nbsp; &nbsp; int &nbsp; &nbsp; &nbsp; : age</div><div>end</div><div><br></div><div>// Identify the Map instance, and wrap it with the Person interface.</div><div>rule</div><div>&nbsp; &nbsp;$m : Map[ this['name'] != null, this['age'] != null )</div><div>then</div><div>&nbsp; &nbsp; don( $m : Person.class );</div><div>end</div><div><br></div><div>// Now the map is identified in a type safe manner.</div><div>rule</div><div>&nbsp; &nbsp; Person( name == "darth", age == 150 )</div><div>then</div><div>&nbsp; &nbsp; ….</div><div>end</div><div><br></div><div><br></div><div><br><div><div>On 19 Aug 2012, at 13:56, Frank Wilson &lt;<a href="mailto:fajwilson@gmail.com">fajwilson@gmail.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Hi All,</div><div><br></div><div>I was reading the following thread from august 2009:</div><div><br></div><a href="http://lists.jboss.org/pipermail/rules-users/2009-August/010178.html" target="_blank">http://lists.jboss.org/pipermail/rules-users/2009-August/010178.html</a>
<div><br></div><div>I would like write a clojure DSL for drools similar to what André was trying to do and I also feel that using maps as fact-objects would be the most idiomatic for Clojure (at least in the general case!).</div>
<div><br></div><div>I am interested by the idea of implementing&nbsp;ObjectType and Accessor interfaces&nbsp;proposed by Edson. It seems that this would be a good fit with Drools and that (if understand correctly!) it would allow the map properties to be properly indexed by the rules engine. However I cannot seem to find these interfaces (ObjectType and *Accessor)&nbsp;in the current API.</div>
<div><br></div><div><a href="http://docs.jboss.org/drools/release/5.4.0.CR1/knowledge-api-javadoc/index.html">http://docs.jboss.org/drools/release/5.4.0.CR1/knowledge-api-javadoc/index.html</a></div><div><br></div><div>Could someone show me where these classes are documented? Or were they moved or replaced? Maybe there is some source code that would make a good example?</div>
<div><br></div><div>Thanks for your help,</div><div><br></div><div>Frank</div>
_______________________________________________<br>rules-users mailing list<br><a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>https://lists.jboss.org/mailman/listinfo/rules-users<br></blockquote></div><br></div></body></html>