<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Sikkandar Nawabjan wrote:
<blockquote
 cite="mid:CD08246E5BBE464D96B2F5E8C00C7FA401CC15B0@TRVMSG.ustr.com"
 type="cite">
  <pre wrap="">Hi,
I have couple of questions
 
1) I want to validate a Object and based upon certain condition set the flag and that flag available in my working memory context so that all the rules will execute based on the value of this flag. Is there any way to set the Global variable in working memory environment and use it in predicate logic.
I beleive passing Global variable using setGLobal() is possible but we can't use it in predicate logic.
  </pre>
</blockquote>
globals can be used in evals, however they should be considered
immutable if you do that and should be set before you assert any
working memory data.<br>
<blockquote
 cite="mid:CD08246E5BBE464D96B2F5E8C00C7FA401CC15B0@TRVMSG.ustr.com"
 type="cite">
  <pre wrap=""> 
2) my second quetion is i have 2 classes say
 
Public class B extends Class A{
 
private boolean  flag;
 
 
}
 
 
am validating my rule using of type B.
 But i want to assert object of class A. in normal java we do downcasting  B b = (B)obj;
if i don't do that will downcast will happen at the working memory side automatically??????????
  </pre>
</blockquote>
If you assert A and there is a pattern on B, A will be matched against
it.<br>
<blockquote
 cite="mid:CD08246E5BBE464D96B2F5E8C00C7FA401CC15B0@TRVMSG.ustr.com"
 type="cite">
  <pre wrap=""> 
 
Basha
 
 
  </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>