Re: [rules-users] expert: usage of ruleflow-groups
oh! I'm so sorry... typos in XML are impossible to detect :( Again, thank you so much for your help. I'll correct this and will use the agenda-groups the way you suggested. _ miguel On Wed, May 5, 2010 at 10:01 AM, Wolfgang Laun wolfgang.l...@gmail.comwrote: How did you specify the agenda group in the XML? There aren't much checks being done in XML handling, so it's easy to slip up. Here's how I interpret the XML schema: rule name=myrule rule-attribute name=agenda-group value=group42/ ... -W 2010/5/5 miguel machado mls.mach...@gmail.com: Hi, Yeah, i think this might be a bug indeed. I just tried converting to DRL using the dumper and the agenda-group item doesn't show up in the generated DRL file. It is possible that that this tag isn't being interpreted for the same reason it isn't being converted into the DRL format. Can someone please confirm this? Anyway, if this doesn't work.. is there any kind of workaround? Maybe using ruleflow-group's or any other technique? Thank you. _ miguel On Wed, May 5, 2010 at 9:11 AM, Wolfgang Laun wolfgang.l...@gmail.com wrote: If you don't have auto-focus, rules from other agenda groups should not fire. XML should not matter. A bug might be possible, e.g., due to misinterpretation of the rules in XML. -W -- To understand what is recursion you must first understand recursion ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users -- To understand what is recursion you must first understand recursion ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] expert: usage of ruleflow-groups
Hi again, Thank you for clearing that up. I didn't think it worked that way because i've tried it before and it didn't work. Anyway, according to what you're saying... * this is the stack as soon as i insert my objects: | MAIN | * this is the stack as soon as i setFocus on a specific agenda-group: | FOCUSED_GROUP | MAIN | (from left to right) * as soon as all activations from FOCUSED_GROUP fire, that agenda-group is popped out of the stack and the rule engine fires the remaining activations from MAIN Is this the way it works? I've tried this before with no success. I get rules firing from agenda-groups that *are not focused before* (besides MAIN, of course). Maybe this has something to do with the rules being declared in XML? Or some kind of bug? Thank you. _ miguel On Wed, May 5, 2010 at 6:40 AM, Wolfgang Laun wolfgang.l...@gmail.comwrote: @Wolfgang: My problem is that i cannot have the different rule groups stacked. I may do as you suggested, but i'll have rules firing from other agenda-groups after the first agenda-group activations are all gone (because they go into the stack as well, right?). No, no, no! Nothing goes on the stack unless you setFocus()! What i'm looking for is a way to isolate the execution and just fire the rules within a specific set (aka just one group). Does this make any sense? This is *exactly* what my sketchy statement sequence does, in an existing application. -W Thank you for your support. I appreciate all the help i can get. _ miguel On Tue, May 4, 2010 at 4:46 PM, Wolfgang Laun wolfgang.l...@gmail.com wrote: I've been using agenda groups without any trouble for a similar problem, doing setFocus( ... ); insert( ... );... insert( ... ); fireAllRules(); repeatedly. You don't have to be afraid of the focus stack growing indefinitely:You control the push (setFocus()), and if an agenda group's activations are all gone, the group is automatically popped from the stack. -W 2010/5/4 Miguel Machado mls.mach...@gmail.com: Hi there, I'm having some trouble implementing the desired workflow of rule firing in an application using drools expert. I've read the thread about the difference between ruleflow groups and agenda groups, but it is still unclear to me how to achieve what i need. What i intend to have is the ability to fire a specific set of rules according to the object i'm inserting into the ksession. I do not want to use agenda-groups because it stacks all the agenda groups declared on the rule file (as far as i understand) and therefore it may fire activations i do not want to be fired. Instead, i want to isolate them completely. I tried using ruleflow groups for this, but i cannot find a way to activate a specific group programmatically, before calling fireAllRules(), the way i can with agenda-groups (setFocus() method). That being said, i'm asking for help in trying to use either one of ruleflow/agenda groups or even both in order to get things working the way i described. Thanks in advance, _ miguel ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users -- To understand what is recursion you must first understand recursion ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users -- To understand what is recursion you must first understand recursion ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] expert: usage of ruleflow-groups
2010/5/5 miguel machado mls.mach...@gmail.com: Hi again, Thank you for clearing that up. I didn't think it worked that way because i've tried it before and it didn't work. Anyway, according to what you're saying... * this is the stack as soon as i insert my objects: | MAIN | * this is the stack as soon as i setFocus on a specific agenda-group: | FOCUSED_GROUP | MAIN | (from left to right) * as soon as all activations from FOCUSED_GROUP fire, that agenda-group is popped out of the stack and the rule engine fires the remaining activations from MAIN Is this the way it works? I've tried this before with no success. I get rules firing from agenda-groups that *are not focused before* (besides MAIN, of course). Maybe this has something to do with the rules being declared in XML? Or some kind of bug? If you don't have auto-focus, rules from other agenda groups should not fire. XML should not matter. A bug might be possible, e.g., due to misinterpretation of the rules in XML. -W Thank you. _ miguel On Wed, May 5, 2010 at 6:40 AM, Wolfgang Laun wolfgang.l...@gmail.com wrote: @Wolfgang: My problem is that i cannot have the different rule groups stacked. I may do as you suggested, but i'll have rules firing from other agenda-groups after the first agenda-group activations are all gone (because they go into the stack as well, right?). No, no, no! Nothing goes on the stack unless you setFocus()! What i'm looking for is a way to isolate the execution and just fire the rules within a specific set (aka just one group). Does this make any sense? This is *exactly* what my sketchy statement sequence does, in an existing application. -W Thank you for your support. I appreciate all the help i can get. _ miguel On Tue, May 4, 2010 at 4:46 PM, Wolfgang Laun wolfgang.l...@gmail.com wrote: I've been using agenda groups without any trouble for a similar problem, doing setFocus( ... ); insert( ... );... insert( ... ); fireAllRules(); repeatedly. You don't have to be afraid of the focus stack growing indefinitely:You control the push (setFocus()), and if an agenda group's activations are all gone, the group is automatically popped from the stack. -W 2010/5/4 Miguel Machado mls.mach...@gmail.com: Hi there, I'm having some trouble implementing the desired workflow of rule firing in an application using drools expert. I've read the thread about the difference between ruleflow groups and agenda groups, but it is still unclear to me how to achieve what i need. What i intend to have is the ability to fire a specific set of rules according to the object i'm inserting into the ksession. I do not want to use agenda-groups because it stacks all the agenda groups declared on the rule file (as far as i understand) and therefore it may fire activations i do not want to be fired. Instead, i want to isolate them completely. I tried using ruleflow groups for this, but i cannot find a way to activate a specific group programmatically, before calling fireAllRules(), the way i can with agenda-groups (setFocus() method). That being said, i'm asking for help in trying to use either one of ruleflow/agenda groups or even both in order to get things working the way i described. Thanks in advance, _ miguel ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users -- To understand what is recursion you must first understand recursion ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users -- To understand what is recursion you must first understand recursion ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] expert: usage of ruleflow-groups
Hi, Yeah, i think this might be a bug indeed. I just tried converting to DRL using the dumper and the agenda-group item doesn't show up in the generated DRL file. It is possible that that this tag isn't being interpreted for the same reason it isn't being converted into the DRL format. Can someone please confirm this? Anyway, if this doesn't work.. is there any kind of workaround? Maybe using ruleflow-group's or any other technique? Thank you. _ miguel On Wed, May 5, 2010 at 9:11 AM, Wolfgang Laun wolfgang.l...@gmail.comwrote: If you don't have auto-focus, rules from other agenda groups should not fire. XML should not matter. A bug might be possible, e.g., due to misinterpretation of the rules in XML. -W -- To understand what is recursion you must first understand recursion ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] expert: usage of ruleflow-groups
How did you specify the agenda group in the XML? There aren't much checks being done in XML handling, so it's easy to slip up. Here's how I interpret the XML schema: rule name=myrule rule-attribute name=agenda-group value=group42/ ... -W 2010/5/5 miguel machado mls.mach...@gmail.com: Hi, Yeah, i think this might be a bug indeed. I just tried converting to DRL using the dumper and the agenda-group item doesn't show up in the generated DRL file. It is possible that that this tag isn't being interpreted for the same reason it isn't being converted into the DRL format. Can someone please confirm this? Anyway, if this doesn't work.. is there any kind of workaround? Maybe using ruleflow-group's or any other technique? Thank you. _ miguel On Wed, May 5, 2010 at 9:11 AM, Wolfgang Laun wolfgang.l...@gmail.com wrote: If you don't have auto-focus, rules from other agenda groups should not fire. XML should not matter. A bug might be possible, e.g., due to misinterpretation of the rules in XML. -W -- To understand what is recursion you must first understand recursion ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] expert: usage of ruleflow-groups
Hi miguel, Did you try creating a new Drools Flow process with Rule Tasks inside it to isolate each specific set of rules. Then you can insert the facts into the working memory, start the process and the rules will be executed secuencially. You need to remember also that, if the rules are activated but the agenda group is without focus, the rules will never fire. 2010/5/4 Miguel Machado mls.mach...@gmail.com Hi there, I'm having some trouble implementing the desired workflow of rule firing in an application using drools expert. I've read the threadhttp://bit.ly/bKMRSq about the difference between ruleflow groups and agenda groups, but it is still unclear to me how to achieve what i need. What i intend to have is the ability to fire a specific set of rules according to the object i'm inserting into the ksession. I do not want to use agenda-groups because it stacks all the agenda groups declared on the rule file (as far as i understand) and therefore it may fire activations i do not want to be fired. Instead, i want to isolate them completely. I tried using ruleflow groups for this, but i cannot find a way to activate a specific group programmatically, before calling fireAllRules(), the way i can with agenda-groups (setFocus() method). That being said, i'm asking for help in trying to use either one of ruleflow/agenda groups or even both in order to get things working the way i described. Thanks in advance, _ miguel ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users -- - http://salaboy.wordpress.com - http://www.jbug.com.ar - Salatino Salaboy Mauricio - ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] expert: usage of ruleflow-groups
I've been using agenda groups without any trouble for a similar problem, doing setFocus( ... ); insert( ... );... insert( ... ); fireAllRules(); repeatedly. You don't have to be afraid of the focus stack growing indefinitely:You control the push (setFocus()), and if an agenda group's activations are all gone, the group is automatically popped from the stack. -W 2010/5/4 Miguel Machado mls.mach...@gmail.com: Hi there, I'm having some trouble implementing the desired workflow of rule firing in an application using drools expert. I've read the thread about the difference between ruleflow groups and agenda groups, but it is still unclear to me how to achieve what i need. What i intend to have is the ability to fire a specific set of rules according to the object i'm inserting into the ksession. I do not want to use agenda-groups because it stacks all the agenda groups declared on the rule file (as far as i understand) and therefore it may fire activations i do not want to be fired. Instead, i want to isolate them completely. I tried using ruleflow groups for this, but i cannot find a way to activate a specific group programmatically, before calling fireAllRules(), the way i can with agenda-groups (setFocus() method). That being said, i'm asking for help in trying to use either one of ruleflow/agenda groups or even both in order to get things working the way i described. Thanks in advance, _ miguel ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] expert: usage of ruleflow-groups
You could manually activate and deactivate ruleflow groups using workingMemory.getAgenda().[de]activateRuleflowGroup(name). workingMemory.getAgenda().[de]activateRuleflowGroup(name). session.fireAllRules(); http://drools-java-rules-engine.46999.n3.nabble.com/Agenda-group-doesn-t-stay-set-td56599.html Source -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/expert-usage-of-ruleflow-groups-tp776406p776798.html Sent from the Drools - User mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] expert: usage of ruleflow-groups
if you use the new api's (5.x StatefulKnowledgeSession instead of workingMemory) you don't have that methods exposed. 2010/5/4 vasilievip vasilie...@ukr.net You could manually activate and deactivate ruleflow groups using workingMemory.getAgenda().[de]activateRuleflowGroup(name). workingMemory.getAgenda().[de]activateRuleflowGroup(name). session.fireAllRules(); Sourcehttp://drools-java-rules-engine.46999.n3.nabble.com/Agenda-group-doesn-t-stay-set-td56599.html -- View this message in context: Re: expert: usage of ruleflow-groupshttp://drools-java-rules-engine.46999.n3.nabble.com/expert-usage-of-ruleflow-groups-tp776406p776798.html Sent from the Drools - User mailing list archivehttp://drools-java-rules-engine.46999.n3.nabble.com/Drools-User-f47000.htmlat Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users -- - http://salaboy.wordpress.com - http://www.jbug.com.ar - Salatino Salaboy Mauricio - ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] expert: usage of ruleflow-groups
Exactly! That's precisely why i'm trying to find a workaround. I have no way to activate a specific set of rules except for stacking up activations using agenda-groups. Any other suggestions? Thank you. 2010/5/4 Mauricio Salatino sala...@gmail.com if you use the new api's (5.x StatefulKnowledgeSession instead of workingMemory) you don't have that methods exposed. 2010/5/4 vasilievip vasilie...@ukr.net You could manually activate and deactivate ruleflow groups using workingMemory.getAgenda().[de]activateRuleflowGroup(name). workingMemory.getAgenda().[de]activateRuleflowGroup(name). session.fireAllRules(); Sourcehttp://drools-java-rules-engine.46999.n3.nabble.com/Agenda-group-doesn-t-stay-set-td56599.html -- View this message in context: Re: expert: usage of ruleflow-groupshttp://drools-java-rules-engine.46999.n3.nabble.com/expert-usage-of-ruleflow-groups-tp776406p776798.html Sent from the Drools - User mailing list archivehttp://drools-java-rules-engine.46999.n3.nabble.com/Drools-User-f47000.htmlat Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users -- - http://salaboy.wordpress.com - http://www.jbug.com.ar - Salatino Salaboy Mauricio - ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users -- To understand what is recursion you must first understand recursion ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] expert: usage of ruleflow-groups
2010/5/5 miguel machado mls.mach...@gmail.com: Hi, First of all, thank you both for your answers. @Wolfgang: My problem is that i cannot have the different rule groups stacked. I may do as you suggested, but i'll have rules firing from other agenda-groups after the first agenda-group activations are all gone (because they go into the stack as well, right?). No, no, no! Nothing goes on the stack unless you setFocus()! What i'm looking for is a way to isolate the execution and just fire the rules within a specific set (aka just one group). Does this make any sense? This is *exactly* what my sketchy statement sequence does, in an existing application. -W Thank you for your support. I appreciate all the help i can get. _ miguel On Tue, May 4, 2010 at 4:46 PM, Wolfgang Laun wolfgang.l...@gmail.com wrote: I've been using agenda groups without any trouble for a similar problem, doing setFocus( ... ); insert( ... );... insert( ... ); fireAllRules(); repeatedly. You don't have to be afraid of the focus stack growing indefinitely:You control the push (setFocus()), and if an agenda group's activations are all gone, the group is automatically popped from the stack. -W 2010/5/4 Miguel Machado mls.mach...@gmail.com: Hi there, I'm having some trouble implementing the desired workflow of rule firing in an application using drools expert. I've read the thread about the difference between ruleflow groups and agenda groups, but it is still unclear to me how to achieve what i need. What i intend to have is the ability to fire a specific set of rules according to the object i'm inserting into the ksession. I do not want to use agenda-groups because it stacks all the agenda groups declared on the rule file (as far as i understand) and therefore it may fire activations i do not want to be fired. Instead, i want to isolate them completely. I tried using ruleflow groups for this, but i cannot find a way to activate a specific group programmatically, before calling fireAllRules(), the way i can with agenda-groups (setFocus() method). That being said, i'm asking for help in trying to use either one of ruleflow/agenda groups or even both in order to get things working the way i described. Thanks in advance, _ miguel ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users -- To understand what is recursion you must first understand recursion ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users