[rules-users] rule chaining problem?

Francisco Brum francisco.brum at link.pt
Wed Feb 7 13:10:37 EST 2007


What you cold do it's before deleting a node, first you will remove it arcs!

Maybe using a flag identifying future node to delete, and all the arcs from a node with that flag is deleted. And then delete the node. To do that, use the term salient.

I'm just a beginner in rules, but this seams right.

__________________________________
Francisco Brum - francisco.brum at link.pt
Link Consulting - http://www.link.pt/
Tel.: 213 100 031
Av. Duque D'Ávila, 23 4º Esq.
1000-138 Lisboa

-----Original Message-----
From: rules-users-bounces at lists.jboss.org [mailto:rules-users-bounces at lists.jboss.org] On Behalf Of Gerardo
Sent: quarta-feira, 7 de Fevereiro de 2007 18:03
To: rules-users at lists.jboss.org
Subject: [rules-users] rule chaining problem?

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

_______________________________________________
rules-users mailing list
rules-users at lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users




More information about the rules-users mailing list