Re: [rules-users] Trying to build Drools trunk / getting build failure
Hmmm. Ok. I'll use the snapshot. Is there any information on the cause of the test failures? I'll try to see if I can figure out what the problem is. Thanks -Chuck 2010/2/21 Mark Proctor mproc...@codehaus.org On 21/02/2010 21:52, Chuck Irvine wrote: I'm trying to build Drools from the trunk. I updated from svn about 10 minutes ago. My build command was: mvn -Declipse -Ddocumentation clean install -DlocalEclipseDrop=C:\tmp\drools\eclipse The result of my build is given below. I have two questions: 1. I'm a little confused about -DlocalEclipseDrop=C:\tmp\drools\eclipse. Is C:\tmp\drools\eclipse supposed to point to where I have eclipse installed. 2. Does the fact that 2 tests errored out mean that my build produced nothing useful? Tests run: 184, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.203 sec Running org.drools.integrationtests.ProcessEventTest Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.211 sec Results : Tests in error: testUnmarshallingPerformance(org.drools.integrationtests.LargeRuleBaseSerializationTest) testUnmarshallWithCompressionPerformance(org.drools.integrationtests.LargeRuleBaseSerializationTest) Those two are intermittent failures, we aren't sure why. You can get the last src build from here, saving the need to build trunk yourself: https://hudson.jboss.org/hudson/job/drools/lastSuccessfulBuild/artifact/ Mark Tests run: 1306, Failures: 0, Errors: 2, Skipped: 1 [INFO] [ERROR] BUILD FAILURE [INFO] [INFO] There are test failures. Please refer to C:\Users\Chuck\workspace\drools-trunk\drools-compiler\target\surefire-reports for the individual test results. [INFO] [INFO] For more information, run Maven with the -e switch [INFO] [INFO] Total time: 9 minutes 14 seconds [INFO] Finished at: Sun Feb 21 15:35:42 CST 2010 [INFO] Final Memory: 27M/49M [INFO] ___ rules-users mailing listrules-us...@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] Process with subprocesses don't continue after finish work items in the subprocesses
Hey Drools-Users, I've got a big and urgent problem with my drools process. I have a complex process with many decisions and subprocesses. These subprocesses could even contains more subprocesses so that i have a four-level flow. I testet each subprocess isolated in a mock environment and now i get my problem when they are combined in a big super-process. I create the process with the JPAKnowledgeService (and VariablePersistenceStrategy) and everything works as expected. The process execute some actions, a validation-subprocess and another subprocess with a human task (with a custom handler). The process stops and persist all the variables (except Integers; Must be a bug?). Perfect. Now I load the session with the JPAKnowledgeService and complete the workitem with the ksession.getWorkItemManager().completeWorkItem method. The subprocess now execute to the end and then the engine stopps without an error. But there are more steps in the superprocess todo. All subprocesse are independent = true with wait for completion = true and don't have timers. Has anybody an idea? Is this a known problem? I'm using the last successfully build form the 21.02.2010. Do you need the process? (Then i have to remove some internal information and could post it...) Many thanks in advance Dirk -- View this message in context: http://n3.nabble.com/Process-with-subprocesses-don-t-continue-after-finish-work-items-in-the-subprocesses-tp326801p326801.html Sent from the Drools - User mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] AGE problem
I am also interested in this, though my requirement specifies DAY/WEEK/MONTH/YEAR, so it's a bit more complex. It appears from the documentation that the way to compare dates without an eval is: Cheese( bestBefore 27-Oct-2009 ) So, i reckon... a function that subtracts a number of years/months/weeks/days using GregorianCalendar and returns a date, can be compared with, in your case, $now, provided that it is a String in that form. But I'll work on it in the meantime, and get back to you if I work out something. Please let me know if you work out something without eval() too, thanks. -- View this message in context: http://n3.nabble.com/AGE-problem-tp215215p326884.html Sent from the Drools - User mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] Drools Ant task packages not read by KnowledgeAgent
Hi all, for deploying our rules we usually create packages in Guvnor and then deploy the .pkg binaries to our application where we access them via a change set file, e.g. as a classpath or url resource. We have also used the Drools Ant task to create packages directly from the rule sources in Eclipse, cause it would be convenient for testing and development purposes to be able to just drop that file in place of the one created from Guvnor. However it seems that the KnowledgeAgent can't read the pkg format produced from the Ant task, we get an Exception as follows: java.lang.RuntimeException: KnowledgeAgent exception while trying to deserialize KnowledgeDefinitionsPackage at org.drools.agent.impl.KnowledgeAgentImpl.rebuildResources (KnowledgeAgentImpl.java:418) at org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet (KnowledgeAgentImpl.java:120) ... Caused by: java.lang.ClassCastException: org.drools.reteoo.ReteooRuleBase at org.drools.agent.impl.KnowledgeAgentImpl.rebuildResources (KnowledgeAgentImpl.java:413) We are using the same drools-core.jar for building and running so I don't think this is a simple class version mismatch. Has anybody got a similar scenario working? Any clue what we might be doing wrong? (We are using Drools 5.0.1.) Thanks, Gerret ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Rules categorization/packages
Thanks Jervis!! On Sun, Feb 21, 2010 at 7:05 PM, Jervisliu j...@redhat.com wrote: A new feature called Sharable artifacts/Global artifacts will be available in Drools 5.1. This feature allows you share an asset among different packages. It also creates a global area (you can consider it as a global package). Potentially you can promote an asset that you think is more appropriate to be defined in a global scope from your current package to the global area, so that this global asset can be reused by every package. This feature is already on trunk, maybe you want to give it a try. Any comments or feedbacks will be highly appreciated. Cheers, Jervis Amit Kumar wrote: Hello All, I am looking to organize the rules in different categories. But for distribution purposes We are creating packages for different roles/processing phases So a rule will reside in one pckage but for navigation it can belong to multiple categories So packages are like Shirts, Pants, Shoes, Sweaters Categories are Color, Material, Size, Gender and those have sub categories witin them We have rules which will device the category of the item Like red rule, blue rule, cloth rule, leather rule Now the problem we are facing is for category rules is if I define the rule in Shirt package .. then I will not be able ot use it in Pant package.. Will have to redefine it. The other problem in this scenario is If I have a price rule in Shirt package and the category is Blue Color and XL Size then I will have to put it in both categories When I put the Blue Rule on Blue Category and XL Rule on XL Category and I put the rule in both categories.. will it be an and relationship or will be an OR Regards, Amit ___ 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] Process with subprocesses don't continue after finish work items in the subprocesses
Dirk, There is a junit test testPersistenceSubProcess() that is testing exactly that use case: http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-persistence-jpa/src/test/java/org/drools/persistence/session/PersistentStatefulSessionTest.java Could you create a simple test cases that reproduces this incorrect behaviour? Kris - Original Message - From: Dirk dro...@dirkp.de To: rules-users@lists.jboss.org Sent: Monday, February 22, 2010 3:05 PM Subject: [rules-users] Process with subprocesses don't continue after finish work items in the subprocesses Hey Drools-Users, I've got a big and urgent problem with my drools process. I have a complex process with many decisions and subprocesses. These subprocesses could even contains more subprocesses so that i have a four-level flow. I testet each subprocess isolated in a mock environment and now i get my problem when they are combined in a big super-process. I create the process with the JPAKnowledgeService (and VariablePersistenceStrategy) and everything works as expected. The process execute some actions, a validation-subprocess and another subprocess with a human task (with a custom handler). The process stops and persist all the variables (except Integers; Must be a bug?). Perfect. Now I load the session with the JPAKnowledgeService and complete the workitem with the ksession.getWorkItemManager().completeWorkItem method. The subprocess now execute to the end and then the engine stopps without an error. But there are more steps in the superprocess todo. All subprocesse are independent = true with wait for completion = true and don't have timers. Has anybody an idea? Is this a known problem? I'm using the last successfully build form the 21.02.2010. Do you need the process? (Then i have to remove some internal information and could post it...) Many thanks in advance Dirk -- View this message in context: http://n3.nabble.com/Process-with-subprocesses-don-t-continue-after-finish-work-items-in-the-subprocesses-tp326801p326801.html Sent from the Drools - User mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] AGE problem
For representing times, there are two distinct data types: - absolute time, as a sequence of points on a timeline (the real Time); - durations, which are differences between points on a timeline. Absolute time can be represented in a number of ways: - as seconds (or milliseconds or nanoseconds), with 0 being some agreed-upon point in Time, - by Y,M,D,h,m,s according to some calendar; - as Julian Days, in fractions. It's obvious that calculations of any kind are best done with one of the single-valued representations. Durations can be expressed in any convenient unit, as long as there is a well-defined conversion between the units with which you represent absolute time and the units you desire to express durations. There is no such well-defined conversion for (months and) years, and therefore the idea to express a duration (precisely) in years is not used commonly. (Astronomers settle for a year being equal to 365.25 Julian days; so if this suits you, go ahead and base your calculations on that.) For efficiency in rules, you might consider using Date.getTime() (or Calendar.getTimeInMillis()) to obtain a point on the timeline, and to express your notion of a year's duration (whatever it is) in the suitable unit, and to use this for comparisons. -W On Thu, Feb 18, 2010 at 1:43 PM, Pavel Tavoda pavel.tav...@gmail.comwrote: Hello, I would like to calculate AGE of object based on Date inside object, I can use eval but I hope it's so basic functionality that Drools should have it. It's also performance problem if I need to use EVAL in many rules (let's say 100 in XLS). I'm playing with some FUSION features like: $now : Now() $order : SecurityOrder(this before[400d, 0d] $now) should work but I can't specify YEARS as constant. That's a problem for long time because 30*365d isn't same as 30 years if you consider leap years. Is it possible some easy way to calculate AGE of something with correct time handling and compare to years? Something like: SecurityOrder( age(createdDate) 20y, age(createdDate) 25y) or by FUSION: $now : Now() $order : SecurityOrder(this before[25y, 20y] $now) For now I'm using following function in eval() but it's becoming performance problem: function boolean between(Calendar currentDate, Date oldDate, int from, int to) { Calendar fromCal = Calendar.getInstance(); fromCal.setTime(oldDate); fromCal.add(Calendar.YEAR, from); Calendar toCal = Calendar.getInstance(); toCal.setTime(oldDate); toCal.add(Calendar.YEAR, to); return currentDate.after(fromCal) currentDate.before(toCal); } Thank you Pavel ___ 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] Dynamicc Declarative model in Guvnor
Hi All, Can we have a dynamic declarative model build in Drools Guvnor. For example if I have certain tables in database say employee, company, address ,can we have a drop down for these tables so that end user can select any one one and based on that selection model in Guvnor is created. At present we specify the names of the model say employee and then add fields into it. say employee ID etc. Many Thanks, Nilima =-=-= Notice: The information contained in this e-mail message and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments. Thank you ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] Comparing Date with || OR operator
The following code generates NPE in ReteTuple.java rule when Membership ( $regDate : regDate) Segment ( startDate $regDate || startDate endDate ) then System.err.print(“Invalid start date”); end I am new in Drools and don’t know much about DRL scripting. It works fine I use operator instead. -- View this message in context: http://n3.nabble.com/Comparing-Date-with-OR-operator-tp347656p347656.html Sent from the Drools - User mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] Drools Guvnor
Can you please explain the use of XML,properties and Other assets ,documentation links available in Guvnor. Thanks, Nilima =-=-= Notice: The information contained in this e-mail message and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments. Thank you ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Drools Guvnor
Hi, When you upload files to Guvnor XML and .properties files are stored under XML, properties and everything else for example Word files or PDF files go to Other assets, documentation. Toni Nilima R wrote: Can you please explain the use of *XML,properties* and *Other assets ,documentation* links available in Guvnor. Thanks, Nilima =-=-= Notice: The information contained in this e-mail message and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments. Thank you ___ 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] AGE problem
I think though that the majority of uses for a rules engine is in a business context, where they don't use astronomical time. If the doctor's orders are: You cannot get out of bed for 2 months This means 59 days if he told you February 1st, and it means 62 days if he told you July 1st. So at least for me, I am going to have to work out a plan that involves GregorianCalendar. -- View this message in context: http://n3.nabble.com/AGE-problem-tp215215p354847.html Sent from the Drools - User mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] AGE problem
On Tue, Feb 23, 2010 at 8:07 AM, djb dbrownel...@hotmail.com wrote: I think though that the majority of uses for a rules engine is in a business context, where they don't use astronomical time. If the doctor's orders are: You cannot get out of bed for 2 months This means 59 days if he told you February 1st, and it means 62 days if he told you July 1st. This is a particularly bad example, because doctors can't say that - at least not one I'd trust ;-) I'm arguing that you cannot expect a computer program to relieve you from the burden of defining what you mean by a duration of one year (or month). Some legal rules require a person to have a certain age, and it is (for humans) more convenient to decide this on a person's birthday YMD plus an increment in the Y number. If your application requires you to use an increment in the year component of the YMDhms representation of a point in time, then you are indeed stuck with Calendar and the resulting overhead. (Memoizing the results of YMDhms +/- n years might speed things up, for the usual price.) But many applications would be satisfied with using a fixed duration for a year in terms of 365 or 365.25 or some such value. If, for instance, you have a library, and you must decide to move a book into deep storage if it has not been requested for more than a year you might calculate this (faster) by adding 356*24*60*60 to the clock value of the last return. -W So at least for me, I am going to have to work out a plan that involves GregorianCalendar. -- View this message in context: http://n3.nabble.com/AGE-problem-tp215215p354847.html Sent from the Drools - User mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users