Re: [rules-users] Migrating from 4.0.7 to 5.4.0.Final
laune wrote It seems that the problems reported by the OP are mostly (if not all) related to building KnowledgePackages from DRL files. Drools has been through several 5.x versions with (among others) many extensions to the DRL language, so some increase in resource consumption is to be expected. Most production scenarios, however, use the recommended practice of loading compiled KnowledgePackages that were serialized in a separate runs. Does the reported increase in execution times (2-3 times slower) relate to rule execution only, without compiling? If I understand the OPs statement correctly, this increase was observed after the patch reducing PermGen space. -W Hi there, Actually the tests are the same on both versions, and you are right they include the compilation of the rule set. In production however, we use the technique you mentioned. However, difference in compilation times between both versions is acceptable for us (about 30-40% slower in big sets), if I drill down a bit on the execution part however I see that it can get to 6 times slower at times. I've done comparative analysis with YourKit lately on both versions to get a grasp of where the time was spent. I can see the JIT part with the ClassGenerator come into place, by that's not what baffles me: I see a lot more DefaultConsequenceInvoker.evaluate() calls on the stack in 5.4.0 than 4.0.7 and that's where most of the time is spent Does that make any sense? Are consequence evaluated even if rules are not fired ? Or is the way the rule is written that causes this (no-loop statements, ...) ? Any way I can deactivate the JIT behavior to have a more solid ground for comparison? More questions than answers I'm afraid, hoping to get to the bottom of this :-) -- View this message in context: http://drools.46999.n3.nabble.com/Migrating-from-4-0-7-to-5-4-0-Final-tp4018215p4018453.html Sent from the Drools: User forum 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] Migrating from 4.0.7 to 5.4.0.Final
Mario Fusco wrote I just fixed the leaks you reported on the master repository and backported the fix to the 5.4.x branch. I also closed the JIRA ticket I opened a few hours ago, but it is still possible to comment on it or even reopen it if you will find further issues. I don't know if you have the possibility to build Drools from the sources but if so it could be great if you could give a try to this fix. Nevertheless it is still a fact that Drools 5.4 requires more PermGen space, for the reasons that both Mark and myself explained in our former emails. I hope this helps, Mario Thanks, that was quick! Yes I am aware if the PermGen consumption, but I'm hoping to tone it down by looking at the rules themselves (in 4.0.7 I had managed to reduce it by simply shortening the rule names, let's see) I'll try to access the drools sources and let you know if your patch fixes the problem, again thanks that was real quick -- View this message in context: http://drools.46999.n3.nabble.com/Migrating-from-4-0-7-to-5-4-0-Final-tp4018215p4018454.html Sent from the Drools: User forum 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] convert drl file to rf?
You can't just visualize the runtime execution order of the rules in design time. What you could do is to dictate the order you want by using, for example, jBPM5. The language used by jBPM5 is BPMN2.0, a business process definition language, which can't be converted to DRL (which is a business rule language). So, using BPMN2.0 you can orchestrate the rules present in one or more DRL file. Best Regards, Esteban Aliverti - Developer @ http://www.plugtree.com - Blog @ http://ilesteban.wordpress.com On Tue, Jul 3, 2012 at 10:28 PM, al so volks...@gmail.com wrote: Sure. All I am trying to do is to visualize the execution order of rules from drl files using whatever suitable UI tool. Looks like there is none. On Tue, Jul 3, 2012 at 1:13 PM, Wolfgang Laun wolfgang.l...@gmail.comwrote: Please realize that the Drools Rule Language and jBPM are complementary; there is no way to express coded instances of either one in the language of the other one. -W On 3 July 2012 22:04, al so volks...@gmail.com wrote: I have only drl files (rule definition files in .drl and not rule flows). I guess there should be a way to convert drl to jBPM file? Or drl to rf to jBPM? On Tue, Jul 3, 2012 at 12:17 AM, Caillard, Quentin quentin.caill...@ariadnext.com wrote: When i right click on the .rf file i have the option Convert to BPMN2 process. 2012/7/2 al so volks...@gmail.com I have both drools and jBPM plugin installed. Where do you do that right click? Anything that is intuitive won't work in eclipse. I did the right click on drl file and didn't see any such options. On Fri, Jun 29, 2012 at 1:01 AM, Caillard, Quentin quentin.caill...@ariadnext.com wrote: The ruleflow file(.rf) is deprecated. You can convert your old ruleflow (.rf) to jbpm(.bpmn) file. I did it by using the Drools plugin for Eclipse. If you have the plugin, a simple right click should work. 2012/6/29 abhinay_agarwal abhinay_agar...@infosys.com in the newer version of drools we cannot create a ruleflow file..we can only create a jbpm process file are ruleflow file(.rf) and jbpm(.bpmn) related ?? -- View this message in context: http://drools.46999.n3.nabble.com/rules-users-convert-drl-file-to-rf-tp4018344p4018352.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ 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 ___ 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 ___ 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 ___ 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] ruleflow-group
I have replayed you in other thread. You can't convert from BPMN2.0 (jBPM5 language) to DEL (Drools language). What you can do with jBPM5 is to orchestrate the execution of the rules present in your DRL files. For more information: http://docs.jboss.org/jbpm/v5.3/userguide/ch.core-basics.html#d0e1862 Best Regards, Esteban Aliverti - Developer @ http://www.plugtree.com - Blog @ http://ilesteban.wordpress.com On Tue, Jul 3, 2012 at 10:02 PM, al so volks...@gmail.com wrote: I already have tons of rules today in drl file. I've both jBPM5 and drools plugin installed on eclipse 3.6. I didn't find a way to convert these drl files to jBPM to visualize the existing rules. On Tue, Jul 3, 2012 at 12:30 AM, Esteban Aliverti esteban.alive...@gmail.com wrote: If what you are looking for is to graphically model the execution order of a set of rules, then the best you can do is to go to jBPM5. jBPM5 is a process engine where, among other things, you can have tasks (nodes in the process) activating and deactivating rule-flow-groups (yes, I know, the name is kind of old) in the agenda. The concept of a rule-flow-group is similar to the agenda-group where rules are only executed only if the group where they belong is 'active'. Using jBPM5 you can use a 'Rule Task' node to automatically activate a particular rule-flow-group. Best Regards, Esteban Aliverti - Developer @ http://www.plugtree.com - Blog @ http://ilesteban.wordpress.com On Mon, Jul 2, 2012 at 10:08 PM, al so volks...@gmail.com wrote: One could control the rule execution order using various different constructs (like salience, etc) within the rule definition file. Is there any UI tool that can take the drl file and visualize the rule execution flow? Does it help the section of audience who doesn't understand the concepts like agenda-group? Is jBPM the right tool in such scenario where all I have is bunch of drl files (no Process is involved here). i.e. try to visualize the Rule Execution order. This is where I was investigating the use of RuleFlow and later found that jBPM obsoletes it. Then was curious about how ruleflow-group is integrated with jBPM? Unable to find the solution yet. On Sun, Jul 1, 2012 at 3:03 PM, Mark Proctor mproc...@codehaus.orgwrote: On 30/06/2012 00:08, al so wrote: looks like one can't activate a ruleflow-group inside a drl file? Only available via UI? I was thinking there'll be some kind of setFocus way to control rule execution using this ruleflow-group. For the 6.0 development cycle we are looking into alternative approaches to handling rule execution orchestration. Nothing to show yet. Mark ___ rules-users mailing listrules-users@lists.jboss.orghttps://lists.jboss.org/mailman/listinfo/rules-users ___ 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 ___ 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 ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] convert drl file to rf?
I think that Mario Fusco is working on a metadata framework, a set of API that will allow to expose information about the rules. With that, it will be possible to build something like what you mentioned. Unfortunately, the problem is not as simple as one might think: as Wolfgang pointed out, too, there is no unique way to transform a set of rules into a graph. You may want a graph of the partial rule ordering induced by salience, but that won't help too much at runtime (for that, you may prefer a snapshot of the activations in the agenda). You may want a dependency graph of the rules, to see which one may insert (retract) facts relevant for the activation of another. You may even want a better graphical representation of the RETE network, to see where sharing kicks in. We are also planning to unify and improve the concept of *-group, so you may want to see the ordering and dependencies between the groups themselves. This is work in progress even now, any suggestion, more detailed requirement or contribution will be welcome and might speed up the implementation process. Of course, if you take the suggestion of writing your own workflow to control the rule flow, you can work around the issue, as you would be the one imposing the ordering precisely :) Best Davide Final remark: DRL rules are compiled in a RETE, which is a graph. So, although VERY fine-grained, it could be possible to view a DRL file as a graph, as well as authoring the rules graphically, by composing the RETE manually. There should be some rule editor+engine which takes this approach in the market, but of course this would be appropriate for very small scale rule projects. -- View this message in context: http://drools.46999.n3.nabble.com/rules-users-convert-drl-file-to-rf-tp4018344p4018459.html Sent from the Drools: User forum 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] Migrating from 4.0.7 to 5.4.0.Final
Hi Mario, Just tested it and unfortunately found the same problems, looking at your commit in (https://issues.jboss.org/browse/JBRULES-3567) there seem to be no real code changes in class MvelConstraint, the major leak being the ExecutorService holding on to the threads and thus all the generated classes. Have I missed something? Maybe I didn't check out the correct branch (https://github.com/droolsjbpm/drools/tree/5.4.x) ? Thanks for any input -- View this message in context: http://drools.46999.n3.nabble.com/Migrating-from-4-0-7-to-5-4-0-Final-tp4018215p4018463.html Sent from the Drools: User forum 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] Possibly Broken drools-core-5.4.0.Final.jar?
I just fixed the bugs you reported on the master repository and backported the fix to the 5.4.x branch. Mario -- View this message in context: http://drools.46999.n3.nabble.com/rules-users-Possibly-Broken-drools-core-5-4-0-Final-jar-tp4018364p4018464.html Sent from the Drools: User forum 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] Migrating from 4.0.7 to 5.4.0.Final
Hi again, You are looking at the correct branch and I didn't change the MvelConstraint class indeed. What I did is to change the ClassGenerator to try to avoid the creation of new ClassLoaders (when possible). Said that what I don't understand is why you expect the generated classes to be garbage collected. They are used to evaluate the constraints in your rules, so I don't think they could/should be CG'd anyway. Am I missing something? Anyway we are realizing that the required PermGen space could be a problem especially if you have a big rule base, so I am going to add a configuration option that will allow you to define how many space you want to give to these JITted constraints. Once the engine will hit this limit it will just stop JITting further constraints leaving them run in interpreted mode. Hopefully the users will be able to find a good trade-off between performances and memory occupation in this way. Does this make sense to you? Mario -- View this message in context: http://drools.46999.n3.nabble.com/Migrating-from-4-0-7-to-5-4-0-Final-tp4018215p4018465.html Sent from the Drools: User forum 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] Migrating from 4.0.7 to 5.4.0.Final
Hi again mario, Yes in my case it would be nice for generated classes to be garbage collected when no longer referenced : for long-lived virtual machines where rules are changed a lot, you really hit the max perm gen quickly enough. I guess what you are describing is a production environment where rules are loaded/compiled once in the VM's life (startup time most probably) and that's it. That's not my case, it's rather the reverse in some cases, as specialized users can test their rule sets in the same environment as the production one and choose to release them. Your option to control JITing space looks like a good way to keep things in check. Would it possible to ensure if we set the space to 0, it actually disables it? That would ensure that everything runs in my calling threads and gets garbage collected right? Again thanks a mil for your help Date: Wed, 4 Jul 2012 06:31:00 -0700 From: mario.fu...@gmail.com To: rules-users@lists.jboss.org Subject: Re: [rules-users] Migrating from 4.0.7 to 5.4.0.Final Hi again, You are looking at the correct branch and I didn't change the MvelConstraint class indeed. What I did is to change the ClassGenerator to try to avoid the creation of new ClassLoaders (when possible). Said that what I don't understand is why you expect the generated classes to be garbage collected. They are used to evaluate the constraints in your rules, so I don't think they could/should be CG'd anyway. Am I missing something? Anyway we are realizing that the required PermGen space could be a problem especially if you have a big rule base, so I am going to add a configuration option that will allow you to define how many space you want to give to these JITted constraints. Once the engine will hit this limit it will just stop JITting further constraints leaving them run in interpreted mode. Hopefully the users will be able to find a good trade-off between performances and memory occupation in this way. Does this make sense to you? Mario -- View this message in context: http://drools.46999.n3.nabble.com/Migrating-from-4-0-7-to-5-4-0-Final-tp4018215p4018465.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ 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] Migrating from 4.0.7 to 5.4.0.Final
JP Chemali wrote Yes in my case it would be nice for generated classes to be garbage collected when no longer referenced : for long-lived virtual machines where rules are changed a lot, you really hit the max perm gen quickly enough. I guess what you are describing is a production environment where rules are loaded/compiled once in the VM's life (startup time most probably) and that's it. That's not my case, it's rather the reverse in some cases, as specialized users can test their rule sets in the same environment as the production one and choose to release them. Ok, now I see your point. I will try to refactor that bit to avoid that the thread holds a reference to the classes it generates. JP Chemali wrote Your option to control JITing space looks like a good way to keep things in check. Would it possible to ensure if we set the space to 0, it actually disables it? That would ensure that everything runs in my calling threads and gets garbage collected right? Yes, of course it will be possible, even if my suggestion is to avoid this in production otherwise you will have ALL the constraints running in interpreted mode. Actually you could already achieve this if you can rebuild drools from the sources (you already did it, so I assume it won't be a problem). If you want to try open the class MvelConstraint and modify the constant JIT_THRESOLD. That constant defines after how many times a constraint can be evaluated in interpreted mode before to get JITted, so if you set it to a very high value (e.g. Integer.MAX_VALUE) you should be able to completely avoid any JITting. Let me know if this works. I hope this helps, Mario -- View this message in context: http://drools.46999.n3.nabble.com/Migrating-from-4-0-7-to-5-4-0-Final-tp4018215p4018469.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] decision Tables - Operators - starts with/end with??
Hi Guys, Have been using Guvnor to create some decision tables and got a few questions on the use of certain Operators in the Condition Columns - what value do you put in for matches and sounds like? Basically i want to create a condition where i can check starts with or end with in relation to a string, is this possible using the perdefined operators or how would i acheive this? so if i want to check Hello to see if it starts with He - what value would put in the field? Using Guvnor 5.2.0 Any help would be appreciated! Gary -- View this message in context: http://drools.46999.n3.nabble.com/decision-Tables-Operators-starts-with-end-with-tp4018473.html Sent from the Drools: User forum 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] Performance issue
Hi laune, thanks a lot for your inputs. Just to clarify, i have 3 rules files to check different set of properties for a java bean.this java bean gets updated based on the request and then is send to one of rules files for validating the different properties. Hope i am doing it in right way?? -- View this message in context: http://drools.46999.n3.nabble.com/Performance-issue-tp4017688p4018475.html Sent from the Drools: User forum 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] decision Tables - Operators - starts with/end with??
This is not possible with 5.2. With 5.4 you can create a decision table with a column defined as a BRL fragment (guided rule editor). This will allow you to use matches or sounds like. Matches could also be used to emulate starts with or ends with given the correct regular expression. This JIRA https://issues.jboss.org/browse/GUVNOR-1086 will also be of interest to you. Otherwise, if 5.2 is your only choice, you could look at using a Rule Template instead. With kind regards, Mike On 4 July 2012 18:09, gok45 gary.william.ok...@citi.com wrote: Hi Guys, Have been using Guvnor to create some decision tables and got a few questions on the use of certain Operators in the Condition Columns - what value do you put in for matches and sounds like? Basically i want to create a condition where i can check starts with or end with in relation to a string, is this possible using the perdefined operators or how would i acheive this? so if i want to check Hello to see if it starts with He - what value would put in the field? Using Guvnor 5.2.0 Any help would be appreciated! Gary -- View this message in context: http://drools.46999.n3.nabble.com/decision-Tables-Operators-starts-with-end-with-tp4018473.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ 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] Guvnor Help !!
You don't need to create a global. You do however need to add an import for the class in the POJO JAR. This can be accomplished on the same screen. Ensure you save the package after adding the import. Ideally, when importing a POJO model from the Global Area, the imports should be added automatically. Please feel free to raise a JIRA at https://issues.jboss.org/browse/GUVNORrequesting this feature if you like. With kind regards, Mike On 3 July 2012 14:40, abhinay_agarwal abhinay_agar...@infosys.com wrote: hey mike, To /use a POJO model in a specific package after importing /it from Global, /we need to create a Global variable inside the EDIT - Configuration part of the package/... Only after this is done can i make rules inside the package using the imported model.. But, in drools-expert doc its said that /It is strongly discouraged to set or change a global value from inside your rules/..and.../Globals are not designed to share data between rules and they should never be used for that purpose/ but again you told me that /*Rules are assets so the same principle applies: if you have a rule you want to share in multiple packages, define it in the the Global Area and then import it into the packages in which it is needed*/ M a bit confused..can yu please explain !! -- View this message in context: http://drools.46999.n3.nabble.com/Guvnor-Help-tp4018290p4018429.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ 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] convert drl file to rf?
I think I get the point to some extent. Let me restate what I am trying to do so that I am not missing anything here. I myself understand the concept of controlling the rule execution order using various attributes like agenda-group, salience, etc. But there is a section of audience I am trying to address who do not understand these Drools concepts at all but they now java. They can get some clue on each individual rule definition but not the sequencing part. They do not want to learn Drools! But they want to at least modify these rule definitions by adding more conditional validations or even define new rules and link with the existing rules. This is where I thought a UI visualization tool which can parse these rule definitions and draw all possible execution orders might help. On Wed, Jul 4, 2012 at 12:42 AM, Davide Sottara dso...@gmail.com wrote: I think that Mario Fusco is working on a metadata framework, a set of API that will allow to expose information about the rules. With that, it will be possible to build something like what you mentioned. Unfortunately, the problem is not as simple as one might think: as Wolfgang pointed out, too, there is no unique way to transform a set of rules into a graph. You may want a graph of the partial rule ordering induced by salience, but that won't help too much at runtime (for that, you may prefer a snapshot of the activations in the agenda). You may want a dependency graph of the rules, to see which one may insert (retract) facts relevant for the activation of another. You may even want a better graphical representation of the RETE network, to see where sharing kicks in. We are also planning to unify and improve the concept of *-group, so you may want to see the ordering and dependencies between the groups themselves. This is work in progress even now, any suggestion, more detailed requirement or contribution will be welcome and might speed up the implementation process. Of course, if you take the suggestion of writing your own workflow to control the rule flow, you can work around the issue, as you would be the one imposing the ordering precisely :) Best Davide Final remark: DRL rules are compiled in a RETE, which is a graph. So, although VERY fine-grained, it could be possible to view a DRL file as a graph, as well as authoring the rules graphically, by composing the RETE manually. There should be some rule editor+engine which takes this approach in the market, but of course this would be appropriate for very small scale rule projects. -- View this message in context: http://drools.46999.n3.nabble.com/rules-users-convert-drl-file-to-rf-tp4018344p4018459.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ 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