<!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">
Waleed Zedan wrote:
<blockquote
 cite="mid:92d901a00811092312tfa11c4u2a21688b68976362@mail.gmail.com"
 type="cite">
  <div dir="ltr">Hi,<br>
  <br>
in AlphaNode.java (similarly beta nodes descendants)<br>
public void assertObject(final InternalFactHandle handle,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; final PropagationContext context,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; final InternalWorkingMemory workingMemory)
throws FactException {<br>
if ( this.constraint.isAllowed( handle.getObject(),<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; workingMemory,<br>
&nbsp;&nbsp; ... &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
}<br>
&nbsp;// I need to put code here to get the rule and previous statisfied
conditions<br>
}<br>
  <br>
I need to get rule that owns the alpha or beta node as well as all the
previous conditions that have been satisfied.<br>
  <br>
For example:<br>
Rule 1 :<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Condition1 -&gt; Node1<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Condition2 -&gt; Node2<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Condition3 -&gt; Node3<br>
  <br>
so if fact1 satisfies condition 1 &amp; 2 only, but condition 3 doesn't
satisfy it, I need to store the information that rule 1 with condition
1 &amp; condition 2 have been satisfied.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br clear="all">
So , how can I get the rule that owns the condition?<br>
Can I get this information from
workingMemoryEventSupport.fireObjectInserted event?<br>
  </div>
</blockquote>
The rete network information is not exposed publicly. Do you know how
to get access to the nodes themselves already? Via the Rete object on
the RuleBase, you'll need to cast the workingmemory and rulebase to
implementations to do this. From there do you know how traverse the
network, and from there now to lookup the node memories? The node
memories are in the workingmemory, you can see the method in each node
how it retrieves that memory.<br>
<br>
Mark<br>
<blockquote
 cite="mid:92d901a00811092312tfa11c4u2a21688b68976362@mail.gmail.com"
 type="cite">
  <div dir="ltr"><br>
Thanks,<br>
-- <br>
Waleed Zedan<br>
SCJP 1.4 , CCNA<br>
  </div>
  <pre wrap="">
<hr size="4" width="90%">
_______________________________________________
rules-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-dev">https://lists.jboss.org/mailman/listinfo/rules-dev</a>
  </pre>
</blockquote>
<br>
</body>
</html>