The basic idea of the DSL implementation in Drools is to use phrases (and not just single<br>keywords) with a translation into DRL. These phrases can have parameters.<br><br><div class="gmail_quote">On 9 August 2012 19:08, san_drools <span dir="ltr">&lt;<a href="mailto:pathasantosh@yahoo.co.in" target="_blank">pathasantosh@yahoo.co.in</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">     Laune, the problem is when i define a keyword like i said above<br>
&quot;PersonMobileContact&quot; for Object1($ContactNum : contactNumber &amp;&amp; contacttype<br>
== &quot;mobile&quot;). In business rule, i can use this keyword.<br>
<br>
     This is ok, but if i want to set this $ContactNum into another object<br>
i.e. Object2. I think i need to define the key for this action too (like<br>
&quot;setContactNo&quot; --&gt; $Object2.setAccessPoint($ContactNum));) Because we cannot<br>
access $ContactNum directly. Or is any other way to do this.<br></blockquote><div><br>You can use &quot;$ContactNum&quot; from the DRL translation. It&#39;s not &quot;hidden&quot;.<br><br></div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">

<br>
And another point to achieve is we will have to refer different objects for<br>
a keyword based on context. If we see above example, For<br>
&quot;PersonMobileContact&quot; if the context is &quot;productdelivery&quot; i need to refer<br>
Object1. and if the context is &quot;meetingschedule&quot; i need to refer Object2.<br>
<br></blockquote><div><br>Here you might use a parameter. Your DSL phrase can be<br><br> [when] PersonMobileContact with {X} ={X} ($ContactNum : contactNumber &amp;&amp; contacttype<br>
== &quot;mobile&quot;)<br><br>and you can write<br><br>   PersonMobileContact with Object1<br>   PersonMobileContact with Object2<br><br>-W<br> </div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">

  I am just beginner in drools, so the things are new to me. Please suggest.<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://drools.46999.n3.nabble.com/How-to-define-keywords-that-represent-objects-in-facts-to-be-able-to-use-in-rules-tp4019065p4019071.html" target="_blank">http://drools.46999.n3.nabble.com/How-to-define-keywords-that-represent-objects-in-facts-to-be-able-to-use-in-rules-tp4019065p4019071.html</a><br>

<div class="HOEnZb"><div class="h5">Sent from the Drools: User forum mailing list archive at Nabble.com.<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</div></div></blockquote></div><br>