<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7651.59">
<TITLE>RE: [rules-users] variables in rules</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->
<BR>

<P><FONT SIZE=2>Thanks!<BR>
<BR>
-----Original Message-----<BR>
From: rules-users-bounces@lists.jboss.org on behalf of Mark Proctor<BR>
Sent: Wed 15-Aug-07 6:54 AM<BR>
To: Rules Users List<BR>
Subject: Re: [rules-users] variables in rules<BR>
<BR>
there are no examples, but its straight forward, its no different to how<BR>
you do stuff in java land.<BR>
<BR>
in the consquence do:<BR>
RuleBase ruleBase =&nbsp; drools.getWorkingMemory().getRuleBase();<BR>
<BR>
The rest is done with PacakgeBuilder as per normal, I'm sure you can<BR>
figure out the rest.<BR>
<BR>
Mark<BR>
Arsalan S. Zaidi wrote:<BR>
&gt;<BR>
&gt; Hi Mark.<BR>
&gt;<BR>
&gt; Could you please give me a pointer into some doc or sample code where<BR>
&gt; this is being done? I couldn't find anything in there when I last looked.<BR>
&gt;<BR>
&gt; Thanks for you help so far! :-)<BR>
&gt;<BR>
&gt; --Arsalan<BR>
&gt;<BR>
&gt; -----Original Message-----<BR>
&gt; From: rules-users-bounces@lists.jboss.org on behalf of Mark Proctor<BR>
&gt; Sent: Mon 13-Aug-07 7:23 PM<BR>
&gt; To: Rules Users List<BR>
&gt; Subject: Re: [rules-users] variables in rules<BR>
&gt;<BR>
&gt; yes, you can do it in a consequence or from java land.<BR>
&gt;<BR>
&gt; Mark<BR>
&gt; Arsalan S. Zaidi wrote:<BR>
&gt; &gt;<BR>
&gt; &gt; Hi Mark.<BR>
&gt; &gt;<BR>
&gt; &gt;<BR>
&gt; &gt;<BR>
&gt; &gt; Thanks for the quick reply! :-)<BR>
&gt; &gt;<BR>
&gt; &gt;<BR>
&gt; &gt;<BR>
&gt; &gt; About question no. 2, is there anyway to do something like that with<BR>
&gt; &gt; Drools?<BR>
&gt; &gt;<BR>
&gt; &gt;<BR>
&gt; &gt;<BR>
&gt; &gt; Regards,<BR>
&gt; &gt;<BR>
&gt; &gt;<BR>
&gt; &gt;<BR>
&gt; &gt; --Arsalan<BR>
&gt; &gt;<BR>
&gt; &gt;<BR>
&gt; &gt;<BR>
&gt; &gt; ------------------------------------------------------------------------<BR>
&gt; &gt;<BR>
&gt; &gt; *From:* rules-users-bounces@lists.jboss.org<BR>
&gt; &gt; [<A HREF="mailto:rules-users-bounces@lists.jboss.org">mailto:rules-users-bounces@lists.jboss.org</A>] *On Behalf Of *Mark Proctor<BR>
&gt; &gt; *Sent:* 13 August 2007 18:03<BR>
&gt; &gt; *To:* Rules Users List<BR>
&gt; &gt; *Subject:* Re: [rules-users] variables in rules<BR>
&gt; &gt;<BR>
&gt; &gt;<BR>
&gt; &gt;<BR>
&gt; &gt; yes you can use a variable, and no you cannot dynamically generate<BR>
&gt; &gt; rules in an eval.<BR>
&gt; &gt;<BR>
&gt; &gt; Mark<BR>
&gt; &gt; Arsalan S. Zaidi wrote:<BR>
&gt; &gt;<BR>
&gt; &gt; Hi.<BR>
&gt; &gt;<BR>
&gt; &gt;<BR>
&gt; &gt;<BR>
&gt; &gt; Two questions:<BR>
&gt; &gt;<BR>
&gt; &gt;<BR>
&gt; &gt;<BR>
&gt; &gt;&nbsp;&nbsp;&nbsp; 1. Is it possible to use a variable in a IN(...) ?<BR>
&gt; &gt;<BR>
&gt; &gt;<BR>
&gt; &gt;<BR>
&gt; &gt; E.g.<BR>
&gt; &gt;<BR>
&gt; &gt;<BR>
&gt; &gt;<BR>
&gt; &gt; when<BR>
&gt; &gt;<BR>
&gt; &gt; $someVar : SomeObj()<BR>
&gt; &gt;<BR>
&gt; &gt; (&quot;pqr&quot; in (&quot;abc&quot;, $someVar))<BR>
&gt; &gt;<BR>
&gt; &gt; then<BR>
&gt; &gt;<BR>
&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ...<BR>
&gt; &gt;<BR>
&gt; &gt;<BR>
&gt; &gt;<BR>
&gt; &gt;&nbsp;&nbsp;&nbsp; 2. Can I use strings in an eval() to dynamically generate rules?<BR>
&gt; &gt;<BR>
&gt; &gt;<BR>
&gt; &gt;<BR>
&gt; &gt; E.g.<BR>
&gt; &gt;<BR>
&gt; &gt;<BR>
&gt; &gt;<BR>
&gt; &gt; when<BR>
&gt; &gt;<BR>
&gt; &gt; eval(&quot;$aaa == 0&quot;)<BR>
&gt; &gt;<BR>
&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; then<BR>
&gt; &gt;<BR>
&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ...<BR>
&gt; &gt;<BR>
&gt; &gt;<BR>
&gt; &gt;<BR>
&gt; &gt; Thanks in advance!<BR>
&gt; &gt;<BR>
&gt; &gt;<BR>
&gt; &gt;<BR>
&gt; &gt; --Arsalan<BR>
&gt; &gt;<BR>
&gt; &gt; This message contains information that may be privileged or<BR>
&gt; &gt; confidential and is the property of the Capgemini Group. It is<BR>
&gt; &gt; intended only for the person to whom it is addressed. If you are not<BR>
&gt; &gt; the intended recipient, you are not authorized to read, print, retain,<BR>
&gt; &gt; copy, disseminate, distribute, or use this message or any part<BR>
&gt; &gt; thereof. If you receive this message in error, please notify the<BR>
&gt; &gt; sender immediately and delete all copies of this message.<BR>
&gt; &gt;<BR>
&gt; &gt;<BR>
&gt; &gt;<BR>
&gt; &gt;<BR>
&gt; &gt; ------------------------------------------------------------------------<BR>
&gt; &gt;<BR>
&gt; &gt;<BR>
&gt; &gt;<BR>
&gt; &gt; _______________________________________________<BR>
&gt; &gt; rules-users mailing list<BR>
&gt; &gt; rules-users@lists.jboss.org &lt;<A HREF="mailto:rules-users@lists.jboss.org">mailto:rules-users@lists.jboss.org</A>&gt;<BR>
&gt; &gt; <A HREF="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</A><BR>
&gt; &gt;&nbsp;<BR>
&gt; &gt;<BR>
&gt; &gt;<BR>
&gt; &gt;<BR>
&gt; &gt; This message contains information that may be privileged or<BR>
&gt; &gt; confidential and is the property of the Capgemini Group. It is<BR>
&gt; &gt; intended only for the person to whom it is addressed. If you are not<BR>
&gt; &gt; the intended recipient, you are not authorized to read, print, retain,<BR>
&gt; &gt; copy, disseminate, distribute, or use this message or any part<BR>
&gt; &gt; thereof. If you receive this message in error, please notify the<BR>
&gt; &gt; sender immediately and delete all copies of this message.<BR>
&gt; &gt;<BR>
&gt; &gt; ------------------------------------------------------------------------<BR>
&gt; &gt;<BR>
&gt; &gt; _______________________________________________<BR>
&gt; &gt; rules-users mailing list<BR>
&gt; &gt; rules-users@lists.jboss.org<BR>
&gt; &gt; <A HREF="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</A><BR>
&gt; &gt;&nbsp;<BR>
&gt;<BR>
&gt;<BR>
&gt; ------------------------------------------------------------------------<BR>
&gt;<BR>
&gt; This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient,&nbsp; you are not authorized to read, print, retain, copy, disseminate,&nbsp; distribute, or use this message or any part thereof. If you receive this&nbsp; message in error, please notify the sender immediately and delete all&nbsp; copies of this message.<BR>
&gt;&nbsp;&nbsp;<BR>
&gt; ------------------------------------------------------------------------<BR>
&gt;<BR>
&gt; _______________________________________________<BR>
&gt; rules-users mailing list<BR>
&gt; rules-users@lists.jboss.org<BR>
&gt; <A HREF="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</A><BR>
&gt;&nbsp;&nbsp;<BR>
<BR>
<BR>
</FONT>
</P>

</BODY>
</HTML>