[rules-users] rule chaining problem?

Gerardo gsegura at ilce.edu.mx
Wed Feb 7 13:38:47 EST 2007


Well yes, but the whole idea of a rule system is precisely to let the 
rules do the work for you.
That is in fact the main reason why I chose to use a rule system.  As 
the system gets more complex
expressing the logic in rules (and letting the rules fire themselves 
until the system is stable again, so to speak)
will keep maintainability,  (I hope :P ).


Francisco Brum wrote:

>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
>
>_______________________________________________
>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