[rules-users] rule chaining problem?

Gerardo gsegura at ilce.edu.mx
Wed Feb 7 13:02:40 EST 2007


Hi everyone,
I have this scenario:   
A diagram with nodes and arcs between them.
I'm willing to control the visual elements with rules.
Nodes are asserted at the moment of insertion.  
    Object node = new AnyObject() ;
    FactHandle hNode = workingMemory.assertObject( node ) ;
    
Nodes are retracted from working memory when are deleted from the diagram.
    workingMemory.retractObject( hNode ) ;

Arcs can not exist in the diagram if any of the related nodes no longer 
exists.
So I must have a rule that keeps consistency in the diagram, something like:


    ## to illustrate the problem just checking source
    rule "Delete no longer valid arcs"
    when        
        a : Arc(s: source, tag, t: target)        
        not s: Object()
    then
        retract(a) ;
    end

But the rule is not working, help is much appreciated
Regards,
Gerardo Segura




More information about the rules-users mailing list