Re: [rules-users] Guvnor compatibility with EXPERT
Ok, sorry I understood it the wrong way :) I hope you mean 5.2.1, not 4.2.1. There is a good change that 5.5. works with 5.2.1, not much that I know has changed in the plugin. The only way to really know is to test it. Toni On May 8, 2013, at 5:53 PM, ashish6276 wrote: hi toni Jboss tools contains the plugin for 5.5 and 5.4. But the question is will that plugin be compatible with the guvnor 4.2.1 ? -- View this message in context: http://drools.46999.n3.nabble.com/Guvnor-compatibility-with-EXPERT-tp4023720p4023724.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] Deploying guvnor 5.5.1 Snapshot on websphere AS 7.0
While Deploying guvnor 5.5.1 -Snapshot on websphere 7.0 i am getting the following error [5/9/13 12:11:18:521 IST] 0007 AdminHelper A ADMN1009I: An attempt is made to start the drools-guvnorEAR application. [5/9/13 12:11:18:568 IST] 0007 CompositionUn A WSVR0190I: Starting composition unit WebSphere:cuname=drools-guvnorEAR in BLA WebSphere:blaname=drools-guvnorEAR. [5/9/13 12:11:51:421 IST] 0007 ApplicationMg A WSVR0200I: Starting application: drools-guvnorEAR [5/9/13 12:11:51:421 IST] 0007 ApplicationMg A WSVR0204I: Application: drools-guvnorEAR Application build level: Unknown [5/9/13 12:11:51:811 IST] 0007 webappI com.ibm.ws.webcontainer.webapp.WebGroupImpl WebGroup SRVE0169I: Loading Web Module: JBoss Guvnor for Drools. [5/9/13 12:11:52:076 IST] 0007 InjectionProc E CWNEN0044E: A resource reference binding could not be found for the BeanManager resource reference, defined for the JBoss Guvnor for Drools component. [5/9/13 12:11:53:074 IST] 0007 FfdcProvider W com.ibm.ws.ffdc.impl.FfdcProvider logIncident FFDC1003I: FFDC Incident emitted on D:\Program Files\IBM\SDP\runtimes\base_v7\profiles\was70profile1\logs\ffdc\server1_6f6e6f6e_13.05.09_12.11.52.5753476655115778206616.txt com.ibm.ws.injectionengine.InjectionEngineImpl.processBindings 480 [5/9/13 12:11:53:121 IST] 0007 InjectionEngi E CWNEN0011E: The injection engine failed to process bindings for the metadata. [5/9/13 12:11:53:215 IST] 0007 FfdcProvider W com.ibm.ws.ffdc.impl.FfdcProvider logIncident FFDC1003I: FFDC Incident emitted on D:\Program Files\IBM\SDP\runtimes\base_v7\profiles\was70profile1\logs\ffdc\server1_6f6e6f6e_13.05.09_12.11.53.1839095875068220164390.txt com.ibm.ws.util.ComponentNameSpaceHelper.populateJavaNameSpace 640 [5/9/13 12:11:53:215 IST] 0007 ComponentName E CNTR0125E: Unable to process injection information for class: [class org.drools.guvnor.server.repository.SafeWeldListener]. [5/9/13 12:11:53:386 IST] 0007 FfdcProvider W com.ibm.ws.ffdc.impl.FfdcProvider logIncident FFDC1003I: FFDC Incident emitted on D:\Program Files\IBM\SDP\runtimes\base_v7\profiles\was70profile1\logs\ffdc\server1_6f6e6f6e_13.05.09_12.11.53.2612645496587947147575.txt com.ibm.ws.webcontainer.webapp.WebGroup 131 [5/9/13 12:11:53:386 IST] 0007 webappE com.ibm.ws.webcontainer.webapp.WebGroupImpl WebGroup SRVE0015E: Failure to initialize Web application JBoss Guvnor for Drools [5/9/13 12:11:53:558 IST] 0007 FfdcProvider W com.ibm.ws.ffdc.impl.FfdcProvider logIncident FFDC1003I: FFDC Incident emitted on D:\Program Files\IBM\SDP\runtimes\base_v7\profiles\was70profile1\logs\ffdc\server1_6f6e6f6e_13.05.09_12.11.53.3864474793422569466133.txt com.ibm.ws.webcontainer.WebContainer 736 [5/9/13 12:11:53:651 IST] 0007 FfdcProvider W com.ibm.ws.ffdc.impl.FfdcProvider logIncident FFDC1003I: FFDC Incident emitted on D:\Program Files\IBM\SDP\runtimes\base_v7\profiles\was70profile1\logs\ffdc\server1_6f6e6f6e_13.05.09_12.11.53.5581434492717138337900.txt com.ibm.ws.runtime.component.WebContainerImpl.install 124 [5/9/13 12:11:53:683 IST] 0007 DeployedAppli W WSVR0206E: Module, drools-guvnor.war, of application, drools-guvnorEAR.ear/deployments/drools-guvnorEAR, failed to start [5/9/13 12:11:53:683 IST] 0007 ApplicationMg W WSVR0101W: An error occurred starting, drools-guvnorEAR [5/9/13 12:11:53:683 IST] 0007 ApplicationMg A WSVR0217I: Stopping application: drools-guvnorEAR [5/9/13 12:11:53:714 IST] 0007 FfdcProvider W com.ibm.ws.ffdc.impl.FfdcProvider logIncident FFDC1003I: FFDC Incident emitted on D:\Program Files\IBM\SDP\runtimes\base_v7\profiles\was70profile1\logs\ffdc\server1_6f6e6f6e_13.05.09_12.11.53.7148569466503349536987.txt com.ibm.ws.wsaddressing.urimap.EndpointMappingListener 1:196:1.8 [5/9/13 12:11:54:010 IST] 0007 ApplicationMg A WSVR0220I: Application stopped: drools-guvnorEAR [5/9/13 12:11:54:322 IST] 0007 FfdcProvider W com.ibm.ws.ffdc.impl.FfdcProvider logIncident FFDC1003I: FFDC Incident emitted on D:\Program Files\IBM\SDP\runtimes\base_v7\profiles\was70profile1\logs\ffdc\server1_6f6e6f6e_13.05.09_12.11.54.0106549968453388597889.txt com.ibm.ws.runtime.component.ApplicationMgrImpl 1449 [5/9/13 12:11:54:322 IST] 0007 CompositionUn E WSVR0194E: Composition unit WebSphere:cuname=drools-guvnorEAR in BLA WebSphere:blaname=drools-guvnorEAR failed to start. [5/9/13 12:11:54:447 IST] 0007 DMAdapter I com.ibm.ws.ffdc.impl.DMAdapter getAnalysisEngine FFDC1009I: Analysis Engine using data base: D:\Program Files\IBM\SDP\runtimes\base_v7\profiles\was70profile1\properties\logbr\ffdc\adv\ffdcdb.xml [5/9/13 12:11:54:556 IST] 0007 FfdcProvider W com.ibm.ws.ffdc.impl.FfdcProvider logIncident FFDC1003I: FFDC Incident emitted on D:\Program Files\IBM\SDP\runtimes\base_v7\profiles\was70profile1\logs\ffdc\server1_6f6e6f6e_13.05.09_12.11.54.3535465789859844096183.txt com.ibm.ws.management.AdminServiceImpl.invoke 679 [5/9/13 12:11:54:556
Re: [rules-users] threw error java.lang.ClassCastException: org.drools.reteoo.FromNode$FromMemory cannot be cast to org.drools.reteoo.BetaMemory
knowledge-api-5.5.0.Final.jar knowledge-internal-api-5.5.0.Final.jar drools-compiler-5.5.1-SNAPSHOT.jar drools-core-5.5.1-SNAPSHOT.jar 4 times kb unlock/unlock is due to 4 objects inserted into session. After 5th insert it crashes. 5 objects are always inserted into session before fireAllRules is invoked. It does'nt crash if no rule is added/updated. RuleRunner inserts them - 5th object is the actual model object against which all rules are run http-8084-2 and 2967417 are same; i just rename thread once I've serialized the model object to take the id. I've noticed that the four times lock/unlock happens immediately after KB is modified (ie. rule is removed and added). General flow of RuleRunner is ... read xml payload from HttpServletRequest create model object from xml set thread name to model.id get lock on kba (kba is my wrapper class to control access to kb) get stateful session session.insert( obj1 ) session.insert( obj2 ) session.insert( obj3 ) session.insert( obj4 ) fact_handle = session.insert( model ) iterate through a list of agenda and set focus to agenda sesssion.fireAllRules() retract fact_handle from session dispose session release lock on kba Ejaz -- View this message in context: http://drools.46999.n3.nabble.com/threw-error-java-lang-ClassCastException-org-drools-reteoo-FromNode-FromMemory-cannot-be-cast-to-orgy-tp4023497p4023743.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] Use of the binding variable
Hi, I am having little bit difficulty in understanding binding variable concept in the guvnor. During our POC a business user asked me question around this and i was able to save myself by telling them that the binding variable is used in case you want use the fact again in Then statement. (This is how i see it in the examples of rules). Can anyone please explaining me the real use of the binding variable so that i can help my business partner understand it properly? Thank you for your help in advance Isha -- View this message in context: http://drools.46999.n3.nabble.com/Use-of-the-binding-variable-tp4023744.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] Use of the binding variable
What you have described is half of the usage of binding variables. You can bind a variable to a fact or to individual fields of a fact. You can then use those variables in the LHS or the RHS of your rules. For example: 1.- Find different Person objects when $p1: Person($name1: name) $p2: Person($name2: name, *this != $p1*) then System.out.println(Found +$p1+ with name '+$name1+' and +$p2+ with name '+$name2+'); end Regards, Esteban Aliverti - Blog @ http://ilesteban.wordpress.com On Thu, May 9, 2013 at 3:08 PM, IPatel ishita.pa...@usbank.com wrote: Hi, I am having little bit difficulty in understanding binding variable concept in the guvnor. During our POC a business user asked me question around this and i was able to save myself by telling them that the binding variable is used in case you want use the fact again in Then statement. (This is how i see it in the examples of rules). Can anyone please explaining me the real use of the binding variable so that i can help my business partner understand it properly? Thank you for your help in advance Isha -- View this message in context: http://drools.46999.n3.nabble.com/Use-of-the-binding-variable-tp4023744.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] Use of the binding variable
Sorry to ask here, but then what about :=? -- View this message in context: http://drools.46999.n3.nabble.com/Use-of-the-binding-variable-tp4023744p4023746.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] How to write Hibernate query lang(HQL) in .DRL file
Hi, please visit the below link http://magazine.redhat.com/2008/07/11/jboss-drools-meets-hibernate/ Thanks, Abhinay -- View this message in context: http://drools.46999.n3.nabble.com/How-to-write-Hibernate-query-lang-HQL-in-DRL-file-tp4018571p4023747.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] Use of the binding variable
Hi, Can you please elaborate your query about :=? Thanks, Abhinay -- View this message in context: http://drools.46999.n3.nabble.com/Use-of-the-binding-variable-tp4023744p4023748.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] Agenda-group in fact insert time
Hi, I just noticed that even I have different agenda-groups, all groups are evaluated during fact inset time. In an extreme case, if I have 1000 rules in agenda-group A, and 1 rule in agenda-group B even though I just want to fire the 1 rule in agenda-group B by adding AgendaFilter in fireAllRules() all those 1000 rules in agenda-group A will be evaluated (i.e. methods in the when part are being called) even worst if I have complex logic in the when part for these 1000 rules, e.g. accumulate/from, not to mention eval Isn't that quite a performance impact? And forcing people to put their logic/checking/matching in the then part? How would you justify this? Or is there something I've missed that you can actually evaluate the rule in agenda-group B ONLY, when fact is being inserted? Thank you -- View this message in context: http://drools.46999.n3.nabble.com/Agenda-group-in-fact-insert-time-tp4023749.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] Agenda-group in fact insert time
This thing even happens when we are trying to call a function in the when part. Even though the rule doesnt gets fired, the function is called and the logic inside it gets executed. Regards, Abhinay -- View this message in context: http://drools.46999.n3.nabble.com/Agenda-group-in-fact-insert-time-tp4023749p4023750.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] Use of the binding variable
Hi, it would be the same question: How would you use :=? Any use case? Situation? Good example? I know I can use := in functions as a return parameter to be used in the then part. But thats the only use case I can think of. Thank you -- View this message in context: http://drools.46999.n3.nabble.com/Use-of-the-binding-variable-tp4023744p4023751.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] Use of the binding variable
Hi, Our business partners will be using Guvnor to write the business rules so i am also not sure what is :=?. If you can explain that will be good. Thank you Isha -- View this message in context: http://drools.46999.n3.nabble.com/Use-of-the-binding-variable-tp4023744p4023752.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] [Planner] Planning problem - looking for tips, and advices for complicated case
Hello, I'm having a problem to plan my solver, I'm wondering if it's possible to configure the solver, so that it picks the best solution from multiple collections of planning variables. Here is an example, to be more precise: I have 3 planning variables: X, Y, Z. and many collections of values of these variables. For example, collection A contains three X values, five Y values, and two Z values; other collection would contain different values etc. And the problem is that the values from different collections can't be mixed with each other, and I don't know how to prevent that. I have tried different approaches but with no luck... Tried to mix all of the values together identifying them with a collection ID, and setting in rules a negative score for the ones that are not from the same collection, but its very inefficient, and the solver never stops (despite the fact that the timeout was set for 120sec). I was thinking about using multiple @PlanningEntities, but as far as I know it is not supported, so I have resigned from this idea. I have also tried using @ValueRange type FROM_PLANNING_ENTITY_PROPERTY, and in MoveFactory I have changed planningEntityProperty according to the collection I was using, but it led to exception Corrupted Undo Move, and all in all I think it was a bad idea. My last idea, which I have not tested yet, is to make two different solvers, one would find best solution for the given collection, and from all of the best solutions from these collections, the next solver would pick the best one, but I think this might be a very inefficient way of doing it. I'm really sorry if I made this post very hard to understand, but my problem is a bit more complicated then it sound, and its hard to describe it :P I would appreciate any tips/ideas how I could configure/plan my solver, and rules so it would work better. Thanks in advance, Mateusz -- View this message in context: http://drools.46999.n3.nabble.com/Planner-Planning-problem-looking-for-tips-and-advices-for-complicated-case-tp4023753.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] Agenda-group in fact insert time
Thats ok, because if you dont call your function, you dont know if that rule should be fired or not. But I am concerning about agenda-group, where I know exactly one or more groups or rules will not be fired but they are still being evaluated. I ended up moving all the matching/checking to the then part for all my rules to speed things up. Now my when part is super clear -- View this message in context: http://drools.46999.n3.nabble.com/Agenda-group-in-fact-insert-time-tp4023749p4023754.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] Use of the binding variable
Sorry, I am not using Guvnor, didnt know you dont have := By the way, do your partner need to pay for a license fee to use Guvnor? My company is not using Guvnor because they say there is a license fee to use Guvnor -- View this message in context: http://drools.46999.n3.nabble.com/Use-of-the-binding-variable-tp4023744p4023755.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] Use of the binding variable
Hi, I am still trying to convinece them to use the tool. I was under the impression that this tool is open source and no need to pay any license cost. It is interesting to find out that there is a cost associated with it. Does anyone know what other costs are associated with using this tool?? Thank you Isha -- View this message in context: http://drools.46999.n3.nabble.com/Use-of-the-binding-variable-tp4023744p4023756.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] Agenda-group in fact insert time
One of the benefits of the Rete algorithm is its capability (given that the network is built properly) of not having to evaluate identical conditions occuring in several rules individually. This would be thwarted by blocking the evaluation of all rules except the ones in the current group. Also, consider what should happen after one group becomes active, some rules fire and another group is activated. Should all updates be ignored for the rules of the first group? So, when this group becomes active again, all rules have to be evaluated from scratch? There might be scenarios where the approach for evaluating rules in batches would be more efficient, but these might be solved using a completely different approach. -W On 09/05/2013, Sonata plz.write...@gmail.com wrote: Thats ok, because if you dont call your function, you dont know if that rule should be fired or not. But I am concerning about agenda-group, where I know exactly one or more groups or rules will not be fired but they are still being evaluated. I ended up moving all the matching/checking to the then part for all my rules to speed things up. Now my when part is super clear -- View this message in context: http://drools.46999.n3.nabble.com/Agenda-group-in-fact-insert-time-tp4023749p4023754.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] Use of the binding variable
There are no licensing fees if you download and use the JBoss community version: http://www.jboss.org/drools/downloads You can buy maintenance/support from Red Hat; and I believe there are other companies providing paid-for support. On 9 May 2013 15:13, IPatel ishita.pa...@usbank.com wrote: Hi, I am still trying to convinece them to use the tool. I was under the impression that this tool is open source and no need to pay any license cost. It is interesting to find out that there is a cost associated with it. Does anyone know what other costs are associated with using this tool?? Thank you Isha -- View this message in context: http://drools.46999.n3.nabble.com/Use-of-the-binding-variable-tp4023744p4023756.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] understanding the use of Functions in Guvnor
Hi, I am trying to learn how to call/use functions in When/Then that are defined within guvnor tool itself. Here is my example (I know it is really silly example but just trying to stick with something very simple) Function is written as follows: http://drools.46999.n3.nabble.com/file/n4023759/5-9-2013_11-21-10_AM.jpg Somehow the invoke method screen does not show my function. http://drools.46999.n3.nabble.com/file/n4023759/5-9-2013_11-25-54_AM.jpg Any ideas how to make my function display under the invoke method drop down list. Thank you -- View this message in context: http://drools.46999.n3.nabble.com/understanding-the-use-of-Functions-in-Guvnor-tp4023759.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] [Planner] Planning problem - looking for tips, and advices for complicated case
On 09-05-13 16:00, Mz wrote: Hello, I'm having a problem to plan my solver, I'm wondering if it's possible to configure the solver, so that it picks the best solution from multiple collections of planning variables. Here is an example, to be more precise: Interesting use case. Are you free to explain the practical appliance a bit more so we can understand it better? I have 3 planning variables: X, Y, Z. and many collections of values of these variables. For example, collection A contains three X values, five Y values, and two Z values; other collection would contain different values etc. And the problem is that the values from different collections can't be mixed with each other, and I don't know how to prevent that. A) One approach would be to use a custom move factory/iterator that generates moves which move all 3 variables to any value for which the 3 values stem from the same collection. If you only use that move selector, you wouldn't even need to check that the variables use the same collection with a constraint (as it would be build-in). I have tried different approaches but with no luck... Tried to mix all of the values together identifying them with a collection ID, and setting in rules a negative score for the ones that are not from the same collection, but its very inefficient, B) Normally, I 'd recommend this approach, but indeed it will be very inefficient. The metaheuristics would be continually score trapped (see latest docs on score trap), making it unlikely that they switch collection. Mixing in custom moves (like the one from approach A) with normal moves would make this approach viable too. C) A drastic, but simpler approach, if those collections are always small (otherwise it will run into scaling issues), is the following: Use a single variable. Create a cross product of all 3 values in each of the collections and use such a combination as the value. For example, collection A results into 3 * 5 * 2 = 15 combinations. Add the results of combinations of the other collections and that's the range for that single variable. and the solver never stops (despite the fact that the timeout was set for 120sec). That sounds like a bug. Older versions had this problem, but recent ones don't (I don't recall for which version it was fixed). Enable trace logging and see what the logging says. I was thinking about using multiple @PlanningEntities, but as far as I know it is not supported, so I have resigned from this idea. I don't see how multiple @PlanningEntities would fix it. Support for multiple @PlanningEntities is getting better since 6.0.0.Beta1, but not perfect yet. I have also tried using @ValueRange type FROM_PLANNING_ENTITY_PROPERTY, and in MoveFactory I have changed planningEntityProperty according to the collection I was using, but it led to exception Corrupted Undo Move, and all in all I think it was a bad idea. FROM_PLANNING_ENTITY_PROPERTY had a regression in 5.5, but works well again since 6.0.0.Beta1 My last idea, which I have not tested yet, is to make two different solvers, one would find best solution for the given collection, and from all of the best solutions from these collections, the next solver would pick the best one, but I think this might be a very inefficient way of doing it. This is basically partitioning, which is a suboptimal approach. I wouldn't recommend it. I'm really sorry if I made this post very hard to understand, but my problem is a bit more complicated then it sound, and its hard to describe it :P I would appreciate any tips/ideas how I could configure/plan my solver, and rules so it would work better. Thanks in advance, Mateusz -- View this message in context: http://drools.46999.n3.nabble.com/Planner-Planning-problem-looking-for-tips-and-advices-for-complicated-case-tp4023753.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] Use of the binding variable
The unification operator := is a combination of the binding operator : and the equality operator ==. In fact, it behaves as either, depending on the context: In this example, we are looking for two different Persons with the same name: rule Pairs when $p := Person( $name := name ) Person( this != $p, $name := name ) then System.out.println( We have two persons with the same name : + $name ); end The LHS is equivalent to: $p : Person( $name : name ) Person( this != $p, name == $name ) The first time a variable such as $name is used with :=, it works as :. Any time later, since the variable now has a value assigned to it, := will work as ==. Apparently, this operator may seem redundant and useless :) but it is actually meant to be used with **queries**. For example: query personsByName( String $name, Person $p ) $p := Person( $name := name ) end The arguments ($name, $p) can be BOTH IN and OUT parameters, depending on the context of the caller. So, the query can be used in 4 different ways: IN/IN : Is this Person in the WM and does it have this name? ?personsByName( john, p1 ) IN/OUT : Retrieve all Persons with this name ?personsByName( john, $pers ) OUT/IN : Retrieve this person, if it is in the WM, and return its name ?personsByName( $n, p1 ) OUT/OUT : Retrieve all persons from the WM with their names ?personsByName( $n, $pers ) Fir this reason, it is impossible for the query to know whether, upon invocation, $name and $p will be IN - and thus already have a value - or OUT. So, the unification operator := is necessary because of its polymorphic ability to behave as : or == as appropriate. Best Davide On 05/09/2013 06:51 AM, Sonata wrote: Hi, it would be the same question: How would you use :=? Any use case? Situation? Good example? I know I can use := in functions as a return parameter to be used in the then part. But thats the only use case I can think of. Thank you -- View this message in context: http://drools.46999.n3.nabble.com/Use-of-the-binding-variable-tp4023744p4023751.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] Grid Node Null Pointer Exception
I am attempting to, using Camel, receive AMQP messages from RabbitMQ and pass them into a Drools Fusion engine. As my starting point I have a 4 line bit of Java code that instantiates Camel and passes it the camel XML pasted below. Is it apparent to anyone where I've gone wrong that I receive a NPE while the system is calling the init method for 'node1'? ?xml version=1.0 encoding=UTF-8? beans xmlns=http://www.springframework.org/schema/beans; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:rabbit=http://www.springframework.org/schema/rabbit; xmlns:drools=http://drools.org/schema/drools-spring; xsi:schemaLocation= http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/rabbit http://www.springframework.org/schema/rabbit/spring-rabbit-1.0.xsd http://drools.org/schema/drools-spring http://drools.org/schema/drools-spring.xsd http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd; bean id=droolsPolicy class=org.drools.camel.component.DroolsPolicy / drools:grid-node id=node1/ drools:kbase id=kbase1 node=node1 drools:configuration drools:mbeans enabled=true/ /drools:configuration drools:resources drools:resource type=DRL source=classpath:drools-rules.drl/ /drools:resources /drools:kbase drools:ksession id=ksession1 type=stateful name=ksession1 kbase=kbase1 node=node1/ bean id=drools class=org.drools.camel.component.DroolsComponent/ bean id=jsonMessageConverter class=amqp.spring.converter.XStreamConverter/ bean id=textMessageConverter class=amqp.spring.converter.StringConverter/ bean id=messageConverter class=amqp.spring.converter.ContentTypeConverterFactory property name=converters map entry key=application/json value-ref=jsonMessageConverter/ entry key=application/xml value-ref=textMessageConverter/ /map /property property name=fallbackConverter ref=textMessageConverter/ /bean rabbit:connection-factory id=connectionFactory host=127.0.0.1 port=5672 / rabbit:template id=amqpTemplate connection-factory=connectionFactory message-converter=messageConverter reply-timeout=6/ rabbit:admin connection-factory=connectionFactory/ camelContext xmlns=http://camel.apache.org/schema/spring; route from uri=stream:in?promptMessage=Enter something: / to uri=spring-amqp:cml.direct:a.b.c?type=direct/ /route route from uri=spring-amqp:cml.direct:springd:a.b.c?type=direct / transform simple${body.toUpperCase()}/simple /transform to uri=spring-amqp:cml.topic:a.b.c/ /route route from uri=spring-amqp:cml.topic:springt:#?type=topic / to uri=stream:out/ /route /camelContext /beans I'm still extremely new to Drools, Camel, BRMS and my ultimate goal is to have BRMS running, receiving events from RabbitMQ. This is one step along my learning to achieve that goal so any help that can be offered is very much appreciated. It's potentially worth noting that the JAR files I'm running for this are from the Drools-jBPM Integration 5.5 distribution. Sincerely, Jason ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] threw error java.lang.ClassCastException: org.drools.reteoo.FromNode$FromMemory cannot be cast to org.drools.reteoo.BetaMemory
Ok, more pieces in the puzzle :). I still do not understand why you are getting lock/unlock on insertions. In 5.5.1-SNAPSHOT and 5.6.0-SNAPSHOT, those events are fired only when a WRITE lock is acquired to modify the RETE. Insertions and fireAllRules use READ locks that do not generate that kind of events. Are you getting them even when you run the rules in Eclipse? Notice that WRITE locks are also acquired when STATELESS sessions are used, rather than STATEFUL ones, (which btw was dcrissman's case)... but you are using STATEFUL sessions, so this shouldn't be the case, right? Otherwise, I'd really like to know why the lock is acquired... I would go as afar as forcing a controlled exception in the KBEventListener to see the stack trace during one of those insertions. (So far, I have assumed that the maintenance actions on the KB are not triggered by the rules themselves, but by some other control module) Davide On 05/09/2013 05:44 AM, mohdejaz74 wrote: knowledge-api-5.5.0.Final.jar knowledge-internal-api-5.5.0.Final.jar drools-compiler-5.5.1-SNAPSHOT.jar drools-core-5.5.1-SNAPSHOT.jar 4 times kb unlock/unlock is due to 4 objects inserted into session. After 5th insert it crashes. 5 objects are always inserted into session before fireAllRules is invoked. It does'nt crash if no rule is added/updated. RuleRunner inserts them - 5th object is the actual model object against which all rules are run http-8084-2 and 2967417 are same; i just rename thread once I've serialized the model object to take the id. I've noticed that the four times lock/unlock happens immediately after KB is modified (ie. rule is removed and added). General flow of RuleRunner is ... read xml payload from HttpServletRequest create model object from xml set thread name to model.id get lock on kba (kba is my wrapper class to control access to kb) get stateful session session.insert( obj1 ) session.insert( obj2 ) session.insert( obj3 ) session.insert( obj4 ) fact_handle = session.insert( model ) iterate through a list of agenda and set focus to agenda sesssion.fireAllRules() retract fact_handle from session dispose session release lock on kba Ejaz -- View this message in context: http://drools.46999.n3.nabble.com/threw-error-java-lang-ClassCastException-org-drools-reteoo-FromNode-FromMemory-cannot-be-cast-to-orgy-tp4023497p4023743.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] Odd behavior on timeInMillis after[15m, 96h] otherTimeInMillis
I am attempting to use the after[start, end] construct with two time values being returned in milliseconds. We are effectively using Drools 5.3 (BRMS 5.3.1). Here is what I have (field names changed, etc due to nature of data): //- global String someInsertedConstant; global Calendar myCurrentTime;// calculated just before inserting as global. rule compare time in millis dialect java when $someObject : SomeObjectClass ( field1 == someInsertedConstant, field2 == null, myCurrentTime.timeInMillis after[15m, 96h] someObject.getTime().getTimeInMillis ) from entry-point SomeEntryPoint then System.out.println(Boo-yah!!!); //- This does not send out a Boo-yah!!! as I would expect, when myCurrentime is 15 minutes or more past someObject.getTime(). However, I have another rule just like this, where the only difference is the after is [0m,15m] instead, and it gives a Boo-yah!!! as it should when myCurrentTime is up to 15 minutes past someObject.getTime(). Both rules are together in the same package. Am I missing something here? In the first case, after[15m, 96h], I can change that line to manually subtract the two times as longs and compare against being = 90 and it fires as it should. This appears to be a bug, but I am not entirely sure as I am fairly new to the rule world. What am I missing? Thanks, ScalaEnthusiast -- View this message in context: http://drools.46999.n3.nabble.com/Odd-behavior-on-timeInMillis-after-15m-96h-otherTimeInMillis-tp4023763.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] threw error java.lang.ClassCastException: org.drools.reteoo.FromNode$FromMemory cannot be cast to org.drools.reteoo.BetaMemory
I have modify clauses in the rules - would that be the reason ? However, this happens only once ... immediately after KB is initialized Maintenance actions are not triggered by rules ... add/update/delete is outside the rules Ejaz -- View this message in context: http://drools.46999.n3.nabble.com/threw-error-java-lang-ClassCastException-org-drools-reteoo-FromNode-FromMemory-cannot-be-cast-to-orgy-tp4023497p4023765.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] Agenda-group in fact insert time
Thank you so much Wolfgang (is that your name? I saw that in some other posts. Cool )! Yes, now I know the benefit of this approach, now I am wondering why we are only left with one option? Could I propose a new and easy API that you can create a session from kbase with rules in a particular agenda-group(s)? Then start inserting fact to that session, so that rules in other agenda-groups will not be evaluated under this user's choice. Until then, do you think maintaining different kbases for each agenda-group (i.e. one agenda-group in one kbase) is a good idea? When rules in an agenda-group are needed to be fired, that kbase is used to create session(s). When rules across more than one agenda-groups are needed to be fired, those kbases can be added together to form a bigger kbase to create a session. This method is not perfect nor an ultimate solution. This is just a trade off for performance vs flexibility. By doing that, we for sure cannot write dynamic agenda-group focusing rules (those rules will not break down, just there will be no such group for that session) and which groups to fire must be planned beforehand. -- View this message in context: http://drools.46999.n3.nabble.com/Agenda-group-in-fact-insert-time-tp4023749p4023767.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] Use of the binding variable
Again, thank you so much Davide, you have helped me to solve another big problem again! The examples are very great, should have been added to the user manual. And yes, when I said I know := can be used in function to return parameter for the then part, I meant QUERY, not function. This would be the IN/OUT case. The only case that I know. Thank you for the crazy idea (in a good way) for the other three use cases! -- View this message in context: http://drools.46999.n3.nabble.com/Use-of-the-binding-variable-tp4023744p4023768.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] Use of the binding variable
And yes, thank you Michael for clarifying the licensing fee question. Not sure why my company said that. May be it is different when it comes to business -- View this message in context: http://drools.46999.n3.nabble.com/Use-of-the-binding-variable-tp4023744p4023769.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] threw error java.lang.ClassCastException: org.drools.reteoo.FromNode$FromMemory cannot be cast to org.drools.reteoo.BetaMemory
No, modify is altering the working memory, but not the knowledge base. Guessing is not going to take us anywhere... we need to debug the engine and, in particular, the org.drools.common.ConcurrentNodeMemories class. Would you be able to download the source code from github and compile it, to build a tweaked version of the engine? On 05/09/2013 03:23 PM, mohdejaz74 wrote: I have modify clauses in the rules - would that be the reason ? However, this happens only once ... immediately after KB is initialized Maintenance actions are not triggered by rules ... add/update/delete is outside the rules Ejaz -- View this message in context: http://drools.46999.n3.nabble.com/threw-error-java-lang-ClassCastException-org-drools-reteoo-FromNode-FromMemory-cannot-be-cast-to-orgy-tp4023497p4023765.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] Deploying guvnor 5.5.1 Snapshot on websphere AS 7.0
Any idea about why this error is occuring : CWNEN0044E: A resource reference binding could not be found for the BeanManager resource reference, defined for the JBoss Guvnor for Drools component. -- View this message in context: http://drools.46999.n3.nabble.com/Deploying-guvnor-5-5-1-Snapshot-on-websphere-AS-7-0-tp4023741p4023771.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