[rules-users] JBoss As 7 with guvnor 5.4 - package build error: cannot resolve identifier
Hi, I expanded the guvnor.war/WEB-INF/libs with new library demo.jar. In all rules the access on every Class in demo.jar is possible with x.y.z.DemoClass. But the access to a public subclass in the class x.y.z.DemoClass x.y.z.DemoClass.DemoSuclass does not work, causes cannot resolve identifier on trying to build the package in guvnor. Any idea? Thanks for your feedback. -- View this message in context: http://drools.46999.n3.nabble.com/JBoss-As-7-with-guvnor-5-4-package-build-error-cannot-resolve-identifier-tp4018984.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] JBoss As 7 with guvnor 5.4 - package build error: cannot resolve identifier
hi, You can just upload the pojo model jar from guvnar and add dependency jars if required and build it. no need to put pojo model jars inside guvnor.war/WEB-INF/libs On Thu, Aug 2, 2012 at 12:17 PM, rodolphio m.rindflei...@gameartstudio.dewrote: Hi, I expanded the guvnor.war/WEB-INF/libs with new library demo.jar. In all rules the access on every Class in demo.jar is possible with x.y.z.DemoClass. But the access to a public subclass in the class x.y.z.DemoClass x.y.z.DemoClass.DemoSuclass does not work, causes cannot resolve identifier on trying to build the package in guvnor. Any idea? Thanks for your feedback. -- View this message in context: http://drools.46999.n3.nabble.com/JBoss-As-7-with-guvnor-5-4-package-build-error-cannot-resolve-identifier-tp4018984.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] JBoss As 7 with guvnor 5.4 - package build error: cannot resolve identifier
Hi bharadwaj2012, thanks for your fast reply. I'm aware of the option uploading the jar via guvnor web-interface, but I have to do it the way i described above for several reasons. Any ideas for my choosed option? -- View this message in context: http://drools.46999.n3.nabble.com/JBoss-As-7-with-guvnor-5-4-package-build-error-cannot-resolve-identifier-tp4018984p4018986.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] JBoss As 7 with guvnor 5.4 - package build error: cannot resolve identifier
In the Jboss console, there comes folloing log entry when recieving error message in guvnor: 09:32:00,299 INFO [org.jboss.as.controller] (MSC service thread 1-3) Service status report New missing/unsatisfied dependencies: service jboss.data-source-config.java:jboss/datasources/ExampleDS (missing) 09:32:00,301 INFO [org.jboss.as.controller] (MSC service thread 1-1) Service status report New missing/unsatisfied dependencies: service jboss.jndi-view.extension.registry (missing) Maybe this can help for solving my problem? -- View this message in context: http://drools.46999.n3.nabble.com/JBoss-As-7-with-guvnor-5-4-package-build-error-cannot-resolve-identifier-tp4018984p4018988.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] Calling a function from When part
rule sample when eval( sampleFunction() ) then //Take some action end -- View this message in context: http://drools.46999.n3.nabble.com/Calling-a-function-from-When-part-tp4018987p4018989.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] log4j has no logging, but setup according to documentation
I'm still pretty new to drools (5.4.0 final) and I would like to see what Drools does; rules validation, MVEL expression evaluation, etc. There is a webpage that says that in order to activate logging I need to add a line to my log4j.xml: /http://docs.jboss.org/drools/release/5.4.0.Final/drools-planner-docs/html_single/index.html#d0e2947 / First remark is that the XML is old style log4j; the current XML uses loggers and levels instead of category and priority. Beside that, it does not seem to work. After I've added /logger name=org.droolslevel value=debug //logger/ to my xml, nothing is logged. I know for sure that log4j via slf4j is working: /log4j: Trying to find [log4j.xml] using context classloader sun.misc.Launcher$AppClassLoader@1c672d0. log4j: Using URL [file:/C:/Documents%20and%20Settings/User/My%20Documents/frozn/components/engine/_build/log4j.xml] for automatic log4j configuration. ... 2012-08-02 10:55:04,400 INFO nl.o837.frozn.engine.drools.test.DroolsExcelTrial.main(DroolsExcelTrial.java:49) running trail ... / However there is no Drools logging output on the console, only the print statements I've placed in the entity models. If I add this line to the code: /KnowledgeRuntimeLoggerFactory.newConsoleLogger(sessionObject);/ Then there is some logging output: /OBJECT ASSERTED value:nl.o837.frozn.bm.Application@f664ecApplicationId=1 factId: 1 ACTIVATION CREATED rule:PassportValidation_20 activationId:PassportValidation_20 [2] declarations: p=nl.o837.frozn.bm.Passport@5e29e5PassportId=2(2) OBJECT ASSERTED value:nl.o837.frozn.bm.Passport@5e29e5PassportId=2 factId: 2 BEFORE ACTIVATION FIRED rule:PassportValidation_20 activationId:PassportValidation_20 [2] declarations: p=nl.o837.frozn.bm.Passport@5e29e5PassportId=2(2) / So Drools actually is producing logging information. Is the documentation on the webpage incorrect? How do I get the logging information I would like? Tom ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] JBoss As 7 with guvnor 5.4 - package build error: cannot resolve identifier
one more issue: I cant access x.y.z.DemoClass.DemoSuclass, but I can access x.y.z.DemoClass$DemoSuclass. but then following error occures: Error: unable to resolve method using strict-mode: org.drools.spi.KnowledgeHelper I tried it using 1) upload the demo.jar with the guvnor webinterface 2) by adding demo.jar in guvnor.war/WEB-INF/libs both options causes th same problem -- View this message in context: http://drools.46999.n3.nabble.com/JBoss-As-7-with-guvnor-5-4-package-build-error-cannot-resolve-identifier-tp4018984p4018991.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] JBoss As 7 with guvnor 5.4 - package build error: cannot resolve identifier
I made a new java project using eclipse. In this project I included the demo.jar. Then I used the x.y.z.DemoClass.DemoSuclass inside the class of this project. It compiled and run without errors. So I would say this is a problem which has to be resolved in Guvnor. But how? -- View this message in context: http://drools.46999.n3.nabble.com/JBoss-As-7-with-guvnor-5-4-package-build-error-cannot-resolve-identifier-tp4018984p4018992.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] JBoss As 7 with guvnor 5.4 - package build error: cannot resolve identifier
I have now a solution for the problem: till now, I access the x.y.z.DemoClass.DemoSuclass in a then - clause. Now, I changed the rule accessing the x.y.z.DemoClass.DemoSuclass in the when - clause, calling the method from x.y.z.DemoClass.DemoSuclass via a variable declared in the when - clause. That works! If you have any ideas of why accessing the x.y.z.DemoClass.DemoSuclass in the then - clause does not work, please let me know it. -- View this message in context: http://drools.46999.n3.nabble.com/JBoss-As-7-with-guvnor-5-4-package-build-error-cannot-resolve-identifier-tp4018984p4018993.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] Error when using Drools 5.4.0 and jdk 1.7
In the meantime I made some additional investigations. I added the -Ddrools.dump.dir=c:/droolsdump parameter to my VM. within these generated source files I found the following import statement which cause the error: import static de.epro.emconf.drools.SetAgendaGroup.setAgendaGroup; where de.epro.emconf.drools is the packagename I´m using Has anybody ever seen this - and knows how to solve this ? Olaf -- View this message in context: http://drools.46999.n3.nabble.com/Error-when-using-Drools-5-4-0-and-jdk-1-7-tp4018975p4018994.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] Calling a function from When part
Hi FrankVhh, The above approach you suggested works, But the problem is it continuously hits this method when it satisfies the rule in the method I have a DB call, so it creates some problem. For eg: - function boolean sampleFunction(){ //makes a DataBase call System.out.println(1234); return true/false; } rule sample1 when //condition 1 then System.out.println(abcd); //some action to satisfy condition 2 System.out.println(mnop); end rule sample2 when //condition 2 sampleFunction(); then //some action System.out.println(xyz); end O/P abcd 1234 1234 1234 1234 mnop 1234 1234 1234 1234 1234 1234 1234 1234 1234 1234 xyz Is there any way to tackle this. As in by using salience or something.? Regards, Sam -- View this message in context: http://drools.46999.n3.nabble.com/Calling-a-function-from-When-part-tp4018987p4018995.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] cross products in excel decision tables
I need to model something similar to when the lastname on a passport does not match the lastname on the application in a decision table. Written in DRL: rule PassportValidation_24 when $a : Application() $p : Passport(application == $a, lastName != $a.lastName) then $p.setError(Passport's last name ( + $p.getLastName() + ) does not match with application's last name ( + $a.getLastName() + )); end How do I do such a cross referencing in an Excel decision table? Tom ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] log4j has no logging, but setup according to documentation
On 2-8-2012 11:07, Tom Eugelink wrote: Is the documentation on the webpage incorrect? How do I get the logging information I would like? I figured out that the documentation is intended for Drools Planner, not Drools Expert, and that the thing that did work is correctly documented in the expert guide. So that answers question 1 (although I still find it strange that there is no logging at all). Which leaves question 2: how can I debug the MVEL, etc? Tom ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] log4j has no logging, but setup according to documentation
Drools Planner logs to slf4j, from which you can configure logging with log4j or logback (and others) to log to whatever and however you need it. Drools Expert (the rule engine itself) does not log to anything by default. A) You can add KnowledgeRuntimeLoggerFactory.newFileLogger(...) but that will not give you the flexibility of a logging framework (such as rolling files, backup files, controlling verbosity by package, controlling verbosity by INFO/DEBUG/TRACE, log pattern configuration, ...). B) You can implement your own WorkingMemoryLogger and pipe that to slf4j, but WorkingMemoryLogger will probably not log anything of other drools expert systems, such as the KnowledgeAgent, changeset problems, xls to rules converstion, ... Those messages will still be send to System.out. C) If you want Drools Expert to log to slf4j by default, vote for this issue: https://issues.jboss.org/browse/JBRULES-3551 Op 02-08-12 11:07, Tom Eugelink schreef: I'm still pretty new to drools (5.4.0 final) and I would like to see what Drools does; rules validation, MVEL expression evaluation, etc. There is a webpage that says that in order to activate logging I need to add a line to my log4j.xml: /http://docs.jboss.org/drools/release/5.4.0.Final/drools-planner-docs/html_single/index.html#d0e2947 / First remark is that the XML is old style log4j; the current XML uses loggers and levels instead of category and priority. Beside that, it does not seem to work. After I've added /logger name=org.droolslevel value=debug //logger/ to my xml, nothing is logged. I know for sure that log4j via slf4j is working: /log4j: Trying to find [log4j.xml] using context classloader sun.misc.Launcher$AppClassLoader@1c672d0. log4j: Using URL [file:/C:/Documents%20and%20Settings/User/My%20Documents/frozn/components/engine/_build/log4j.xml] for automatic log4j configuration. ... 2012-08-02 10:55:04,400 INFO nl.o837.frozn.engine.drools.test.DroolsExcelTrial.main(DroolsExcelTrial.java:49) running trail ... / However there is no Drools logging output on the console, only the print statements I've placed in the entity models. If I add this line to the code: /KnowledgeRuntimeLoggerFactory.newConsoleLogger(sessionObject);/ Then there is some logging output: /OBJECT ASSERTED value:nl.o837.frozn.bm.Application@f664ecApplicationId=1 factId: 1 ACTIVATION CREATED rule:PassportValidation_20 activationId:PassportValidation_20 [2] declarations: p=nl.o837.frozn.bm.Passport@5e29e5PassportId=2(2) OBJECT ASSERTED value:nl.o837.frozn.bm.Passport@5e29e5PassportId=2 factId: 2 BEFORE ACTIVATION FIRED rule:PassportValidation_20 activationId:PassportValidation_20 [2] declarations: p=nl.o837.frozn.bm.Passport@5e29e5PassportId=2(2) / So Drools actually is producing logging information. Is the documentation on the webpage incorrect? How do I get the logging information I would like? Tom ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users -- With kind regards, Geoffrey De Smet ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] log4j has no logging, but setup according to documentation
On 2012-08-02 16:34, Geoffrey De Smet wrote: C) If you want Drools Expert to log to slf4j by default, vote for this issue: https://issues.jboss.org/browse/JBRULES-3551 Done :-) ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] cross products in excel decision tables
the user guide says To include a pattern without constraints, you can write the pattern in front of the text for another pattern. So your pattern would be something like: $a : Application $p : Passport then your conditions for Passport and your Actions can reference $a here's a link to the spreadsheet chapter in the guide: http://docs.jboss.org/drools/release/5.4.0.Final/drools-expert-docs/html/ch02.html#d0e1298 http://docs.jboss.org/drools/release/5.4.0.Final/drools-expert-docs/html/ch02.html#d0e1298 -- View this message in context: http://drools.46999.n3.nabble.com/rules-users-cross-products-in-excel-decision-tables-tp4018996p4019000.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] Calling a function from When part
You should provide more details about what condition2 is: does the function() use/need some data from the objects satisfying it? Assuming the answer is no, you might try with exists condition2 rather than just condition2. Davide -- View this message in context: http://drools.46999.n3.nabble.com/Calling-a-function-from-When-part-tp4018987p4019001.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] Matching consecutive events
See below. On 01/08/2012, jpullmann jaroslav.pullm...@fit.fraunhofer.de wrote: Dear contributors, this rule is expected to match a sequence of 2 consecutive events: rule test when // a) $ev1 : LocalizationEvent( type == TYPE.HINT, $target : target ) from entry-point events/localization $ev2 : LocalizationEvent( type == TYPE.HINT, target == $target, this after $ev1 ) from entry-point events/localization // b) // Ev1 directly followed by ev2: no other HINT in between not( LocalizationEvent( type == TYPE.HINT, target == $target, this after $ev1, this before $ev2 ) from entry-point events/localization ) then do() end The second event is interpreted as a confirmation of the first event (a). No other (deviating) event is allowed between them (b). With this restriction in place, the rule requires a sequence of 3 input events for activation, Why do you think that three events are necessary? The not CE is the negated existence quantifier - hence, there is no third event. -W otherwise 2 events are sufficient (as expected). The events are ordered correctly and it is not obvious, why a third event is needed since the interval between ev1 and ev2 is closed ? This leads to an unnecessary delay in rule activation.. How could this be avoided and are there other approaches to match a concrete event sequence pattern ? Many thanks Jaro -- View this message in context: http://drools.46999.n3.nabble.com/Matching-consecutive-events-tp4018980.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] Avoid caching method results within non fact objects
Good day everyone, I'm having a problem here and I'm not sure if I'm using the right approach. Currently I have a couple of rules where I inject A LOT of objects as facts. These objects change their states quite commonly and I have to make decisions when the previous state has a particular value comparing it to the current state. Something like this (just an example, sorry if there are typos) rule Interesting Event when $currentFact: CurrentFact(state==somethingNew) $previousFact: PreviousFact($currentFact.id == id state==somethingOld) then //do something //update previousFact to reflect the state of the newFact end The problem that I had with this is that I had SOOO much facts within the rules session (thousands of objects with a lot of data that I need within the session too) that the fireAllRules method started to take too much time to complete. So, what I did is to store the previous facts of the objects within a Wrapper class that contains a hashmap with all of these states. Something like: PreviousStateHolder{ private static HashMapString,PreviousFact previousFacts; public void insertPreviousState(){ ... } public boolean containsPreviousState(CurrentState currentState){ ... } public boolean deletePreviousState(){ ... } .. other management methods } And my new rules look like rule Interesting Event when $currentFact: CurrentFact(state==somethingNew) $previousFact: PreviousFact(state==somethingOld) from PreviousStateHolder.retrievePreviousState($currentFact) then //do something //update previousFact to reflect the state of the newFact end The problem is that drools caches the result returned by the retrievePreviousState() method, so, it does not matter if the PreviousStateHolder member changes; drools always caches the result. I have tried to put my invocations within eval() but I still get the same problem (cached results). I know they are being cached because I put a breakpoint within the methods, and the first time the fireAllRules gets executed, they get hit. But then, the consequence of these rules keep getting executed even if the retrievePreviousState() does not reflect the value needed to do so. Am I doing something wrong?? Is there another approach that does not involve inserting all of these states as facts within my session?? Thanks a lot in advance -- View this message in context: http://drools.46999.n3.nabble.com/Avoid-caching-method-results-within-non-fact-objects-tp4019005.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] Avoid caching method results within non fact objects
The alternative you're attempting using from is potentially less efficient than the first one you tried. :) Can you alter the CurrentFact objects to hold current and previous state? That way you avoid the matching step altogether. rule Interesting Event when $currentFact: CurrentFact(state==somethingNew, previousState==somethingOld) then //do something //update currentFact.previousState to reflect the state of the newFact end - Original Message - From: rogelio_sevilla1 rogelio.sevil...@gmail.com To: rules-users@lists.jboss.org Cc: Sent: Thursday, August 2, 2012 7:19 PM Subject: [rules-users] Avoid caching method results within non fact objects Good day everyone, I'm having a problem here and I'm not sure if I'm using the right approach. Currently I have a couple of rules where I inject A LOT of objects as facts. These objects change their states quite commonly and I have to make decisions when the previous state has a particular value comparing it to the current state. Something like this (just an example, sorry if there are typos) rule Interesting Event when $currentFact: CurrentFact(state==somethingNew) $previousFact: PreviousFact($currentFact.id == id state==somethingOld) then //do something //update previousFact to reflect the state of the newFact end The problem that I had with this is that I had SOOO much facts within the rules session (thousands of objects with a lot of data that I need within the session too) that the fireAllRules method started to take too much time to complete. So, what I did is to store the previous facts of the objects within a Wrapper class that contains a hashmap with all of these states. Something like: PreviousStateHolder{ private static HashMapString,PreviousFact previousFacts; public void insertPreviousState(){ ... } public boolean containsPreviousState(CurrentState currentState){ ... } public boolean deletePreviousState(){ ... } .. other management methods } And my new rules look like rule Interesting Event when $currentFact: CurrentFact(state==somethingNew) $previousFact: PreviousFact(state==somethingOld) from PreviousStateHolder.retrievePreviousState($currentFact) then //do something //update previousFact to reflect the state of the newFact end The problem is that drools caches the result returned by the retrievePreviousState() method, so, it does not matter if the PreviousStateHolder member changes; drools always caches the result. I have tried to put my invocations within eval() but I still get the same problem (cached results). I know they are being cached because I put a breakpoint within the methods, and the first time the fireAllRules gets executed, they get hit. But then, the consequence of these rules keep getting executed even if the retrievePreviousState() does not reflect the value needed to do so. Am I doing something wrong?? Is there another approach that does not involve inserting all of these states as facts within my session?? Thanks a lot in advance -- View this message in context: http://drools.46999.n3.nabble.com/Avoid-caching-method-results-within-non-fact-objects-tp4019005.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] Calling a function from When part
Hi Davide, Thanks for the prompt reply, Now i have changed my requirement a bit, to make it much simpler function boolean foo(List list){ //do some action on the list set true false accordingly. system.out.println(foo ); return true/false; } rule one no-loop salience -1 when //condition 1 then system.out.println(one in); //populate a list system.out.println(one out); end rule two salience -2 when eval(foo(pass the list that we populated in the above rule)) then system.out.println(two in); //do some action system.out.println(two out); end O/P we are getting: - foo one in foo foo one out two in two out Expected O/P one in one out foo two in two out Please suggest a way to do the same. Regards, Sam -- View this message in context: http://drools.46999.n3.nabble.com/Calling-a-function-from-When-part-tp4018987p4019007.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