Hi,
in AlphaNode.java (similarly beta nodes descendants)
public void assertObject(final InternalFactHandle handle,
final PropagationContext context,
final InternalWorkingMemory workingMemory)
throws FactException {
if ( this.constraint.isAllowed( handle.getObject(),
workingMemory,
...
}
// I need to put code here to get the rule and previous statisfied
conditions
}
I need to get rule that owns the alpha or beta node as well as all the
previous conditions that have been satisfied.
For example:
Rule 1 :
Condition1 -> Node1
Condition2 -> Node2
Condition3 -> Node3
so if fact1 satisfies condition 1 & 2 only, but condition 3 doesn't
satisfy it, I need to store the information that rule 1 with condition
1 & condition 2 have been satisfied.
So , how can I get the rule that owns the condition?
Can I get this information from
workingMemoryEventSupport.fireObjectInserted event?
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.