<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
there are no examples, but its straight forward, its no different to
how 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
figure out the rest.<br>
<br>
Mark<br>
Arsalan S. Zaidi wrote:
<blockquote
 cite="mid:9E2A64E42D1FE1409AE18487B7446C1912D07A@PUNEXC16.kanbay.com"
 type="cite">
  <meta http-equiv="Content-Type" content="text/html; ">
  <meta name="Generator"
 content="MS Exchange Server version 6.5.7651.59">
  <title>RE: [rules-users] variables in rules</title>
<!-- Converted from text/plain format -->
  <br>
  <p><font size="2">Hi Mark.<br>
  <br>
Could you please give me a pointer into some doc or sample code where
this is being done? I couldn't find anything in there when I last
looked.<br>
  <br>
Thanks for you help so far! :-)<br>
  <br>
--Arsalan<br>
  <br>
-----Original Message-----<br>
From: <a class="moz-txt-link-abbreviated" href="mailto:rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a> on behalf of Mark Proctor<br>
Sent: Mon 13-Aug-07 7:23 PM<br>
To: Rules Users List<br>
Subject: Re: [rules-users] variables in rules<br>
  <br>
yes, you can do it in a consequence or from java land.<br>
  <br>
Mark<br>
Arsalan S. Zaidi wrote:<br>
&gt;<br>
&gt; Hi Mark.<br>
&gt;<br>
&gt;&nbsp;<br>
&gt;<br>
&gt; Thanks for the quick reply! :-)<br>
&gt;<br>
&gt;&nbsp;<br>
&gt;<br>
&gt; About question no. 2, is there anyway to do something like that
with<br>
&gt; Drools?<br>
&gt;<br>
&gt;&nbsp;<br>
&gt;<br>
&gt; Regards,<br>
&gt;<br>
&gt;&nbsp;<br>
&gt;<br>
&gt; --Arsalan<br>
&gt;<br>
&gt;&nbsp;<br>
&gt;<br>
&gt;
------------------------------------------------------------------------<br>
&gt;<br>
&gt; *From:* <a class="moz-txt-link-abbreviated" href="mailto:rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a><br>
&gt; [<a moz-do-not-send="true"
 href="mailto:rules-users-bounces@lists.jboss.org">mailto:rules-users-bounces@lists.jboss.org</a>]
*On Behalf Of *Mark Proctor<br>
&gt; *Sent:* 13 August 2007 18:03<br>
&gt; *To:* Rules Users List<br>
&gt; *Subject:* Re: [rules-users] variables in rules<br>
&gt;<br>
&gt;&nbsp;<br>
&gt;<br>
&gt; yes you can use a variable, and no you cannot dynamically generate<br>
&gt; rules in an eval.<br>
&gt;<br>
&gt; Mark<br>
&gt; Arsalan S. Zaidi wrote:<br>
&gt;<br>
&gt; Hi.<br>
&gt;<br>
&gt;&nbsp;<br>
&gt;<br>
&gt; Two questions:<br>
&gt;<br>
&gt;&nbsp;<br>
&gt;<br>
&gt;&nbsp;&nbsp;&nbsp; 1. Is it possible to use a variable in a IN(...) ?<br>
&gt;<br>
&gt;&nbsp;<br>
&gt;<br>
&gt; E.g.<br>
&gt;<br>
&gt;&nbsp;<br>
&gt;<br>
&gt; when<br>
&gt;<br>
&gt; $someVar : SomeObj()<br>
&gt;<br>
&gt; ("pqr" in ("abc", $someVar))<br>
&gt;<br>
&gt; then<br>
&gt;<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ...<br>
&gt;<br>
&gt;&nbsp;<br>
&gt;<br>
&gt;&nbsp;&nbsp;&nbsp; 2. Can I use strings in an eval() to dynamically generate rules?<br>
&gt;<br>
&gt;&nbsp;<br>
&gt;<br>
&gt; E.g.<br>
&gt;<br>
&gt;&nbsp;<br>
&gt;<br>
&gt; when<br>
&gt;<br>
&gt; eval("$aaa == 0")<br>
&gt;<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; then<br>
&gt;<br>
&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;<br>
&gt;&nbsp;<br>
&gt;<br>
&gt; Thanks in advance!<br>
&gt;<br>
&gt;&nbsp;<br>
&gt;<br>
&gt; --Arsalan<br>
&gt;<br>
&gt; This message contains information that may be privileged or<br>
&gt; confidential and is the property of the Capgemini Group. It is<br>
&gt; intended only for the person to whom it is addressed. If you are
not<br>
&gt; the intended recipient, you are not authorized to read, print,
retain,<br>
&gt; copy, disseminate, distribute, or use this message or any part<br>
&gt; thereof. If you receive this message in error, please notify the<br>
&gt; sender immediately and delete all copies of this message.<br>
&gt;<br>
&gt;&nbsp;<br>
&gt;<br>
&gt;<br>
&gt;
------------------------------------------------------------------------<br>
&gt;<br>
&gt;<br>
&gt;&nbsp;<br>
&gt; _______________________________________________<br>
&gt; rules-users mailing list<br>
&gt; <a class="moz-txt-link-abbreviated" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a> &lt;<a moz-do-not-send="true"
 href="mailto:rules-users@lists.jboss.org">mailto:rules-users@lists.jboss.org</a>&gt;<br>
&gt; <a moz-do-not-send="true"
 href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
&gt;&nbsp;&nbsp;<br>
&gt;<br>
&gt;&nbsp;<br>
&gt;<br>
&gt; This message contains information that may be privileged or<br>
&gt; confidential and is the property of the Capgemini Group. It is<br>
&gt; intended only for the person to whom it is addressed. If you are
not<br>
&gt; the intended recipient, you are not authorized to read, print,
retain,<br>
&gt; copy, disseminate, distribute, or use this message or any part<br>
&gt; thereof. If you receive this message in error, please notify the<br>
&gt; sender immediately and delete all copies of this message.<br>
&gt;<br>
&gt;
------------------------------------------------------------------------<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; rules-users mailing list<br>
&gt; <a class="moz-txt-link-abbreviated" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
&gt; <a moz-do-not-send="true"
 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>
  <pre wrap="">
<hr size="4" width="90%">
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,  you are not authorized to read, print, retain, copy, disseminate,  distribute, or use this message or any part thereof. If you receive this  message in error, please notify the sender immediately and delete all  copies of this message.
  </pre>
  <pre wrap="">
<hr size="4" width="90%">
_______________________________________________
rules-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a>
  </pre>
</blockquote>
<br>
</body>
</html>