Re: [rules-users] Template Key in DSL
OK, thanks for the confirmation. Do you have any comments w.r.t. to usability during development (debugging?!) and maintenance? The example is simple enough, but what's your feeling? -W On 6 January 2012 08:46, FrankVhh frank.vanhoensho...@agserv.eu wrote: laune wrote What I suggested is a non-standard way of rule authoring, and I just think that it is possible - I've never tried it. This should work. I tried it once with Drools 5.0, so I assume it is still OK. http://drools.46999.n3.nabble.com/file/n3637269/voc.dsl voc.dsl http://drools.46999.n3.nabble.com/file/n3637269/Sample.dst Sample.dst http://drools.46999.n3.nabble.com/file/n3637269/DroolsTest.java DroolsTest.java -- View this message in context: http://drools.46999.n3.nabble.com/Template-Key-in-DSL-tp3634710p3637269.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] Resource Change Scanner Service modified date error
Could you please share with us how are you adding your resources to the agent? According to what you are saying I assume you are using a ReaderResource. According to Drools code, ReaderResource doesn't support most of org.drools.io.internal.InternalResource methods. Some of these methods (i.e. getLastModified()) are used by ResourceScanner to check if a resource has actually changed. So if we take a look at ReaderResource.getLastModified() we will see this: public long getLastModified() { throw new IllegalStateException( reader does have a modified date ); } You can find the whole source code here: https://github.com/droolsjbpm/drools/blob/master/drools-core/src/main/java/org/drools/io/impl/ReaderResource.java So, don't expect this to work :) There are 2 things you can do: 1. Submit a patch for ReaderResource.java implementing all the unimplemented methods :) 2. Use a different Resource like UrlResource, FileResource, InputStreamResource, etc. In my opinion, Bug 733008 must be reopened until someone (maybe you Dean) provides a correct implementation of ReaderResource. Best Regards, Esteban Aliverti - Developer @ http://www.plugtree.com - Blog @ http://ilesteban.wordpress.com On Fri, Jan 6, 2012 at 8:53 AM, Dean d...@qualica.com wrote: I'm pretty sure this issue is the same as Bug 733008 (https://bugzilla.redhat.com/show_bug.cgi?id=733008). I have updated the class from Bug 733008 to reproduce the bug in Drools 5.4.0.Beta1: http://drools.46999.n3.nabble.com/file/n3637279/AgentTest.java AgentTest.java It doesn't seem to be possible to scan a resource for changes at all. Even if I execute ResourceFactory.getResourceChangeScannerService().scan(); directly, I get the same error message: [2012-01-06 09:47:57,144:exception] java.lang.IllegalStateException: reader does have a modified date at org.drools.io.impl.ReaderResource.getLastModified(ReaderResource.java:64) at org.drools.io.impl.ResourceChangeScannerImpl.scan(ResourceChangeScannerImpl.java:166) at org.drools.io.impl.ResourceChangeScannerImpl$ProcessChangeSet.run(ResourceChangeScannerImpl.java:311) at java.lang.Thread.run(Thread.java:662) (As a side note the error message should probably read: reader does /not/ have a modified date) Regards Dean -- View this message in context: http://drools.46999.n3.nabble.com/Resource-Change-Scanner-Service-modified-date-error-tp3634802p3637279.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] Resource Change Scanner Service modified date error
As well as the message not making sense the exception should also really be UnsupportedOperationException, of course the preference is for someone to implement it and make it supported! Thomas From: rules-users-boun...@lists.jboss.org [mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Esteban Aliverti Sent: 06 January 2012 09:14 To: Rules Users List Subject: Re: [rules-users] Resource Change Scanner Service modified date error Could you please share with us how are you adding your resources to the agent? According to what you are saying I assume you are using a ReaderResource. According to Drools code, ReaderResource doesn't support most of org.drools.io.internal.InternalResource methods. Some of these methods (i.e. getLastModified()) are used by ResourceScanner to check if a resource has actually changed. So if we take a look at ReaderResource.getLastModified() we will see this: public long getLastModified() { throw new IllegalStateException( reader does have a modified date ); } You can find the whole source code here: https://github.com/droolsjbpm/drools/blob/master/drools-core/src/main/java/org/drools/io/impl/ReaderResource.java So, don't expect this to work :) There are 2 things you can do: 1. Submit a patch for ReaderResource.java implementing all the unimplemented methods :) 2. Use a different Resource like UrlResource, FileResource, InputStreamResource, etc. In my opinion, Bug 733008 must be reopened until someone (maybe you Dean) provides a correct implementation of ReaderResource. Best Regards, Esteban Aliverti - Developer @ http://www.plugtree.com - Blog @ http://ilesteban.wordpress.com On Fri, Jan 6, 2012 at 8:53 AM, Dean d...@qualica.commailto:d...@qualica.com wrote: I'm pretty sure this issue is the same as Bug 733008 (https://bugzilla.redhat.com/show_bug.cgi?id=733008). I have updated the class from Bug 733008 to reproduce the bug in Drools 5.4.0.Beta1: http://drools.46999.n3.nabble.com/file/n3637279/AgentTest.java AgentTest.java It doesn't seem to be possible to scan a resource for changes at all. Even if I execute ResourceFactory.getResourceChangeScannerService().scan(); directly, I get the same error message: [2012-01-06 09tel:%5B2012-01-06%2009:47:57,144:exception] java.lang.IllegalStateException: reader does have a modified date at org.drools.io.impl.ReaderResource.getLastModified(ReaderResource.java:64) at org.drools.io.impl.ResourceChangeScannerImpl.scan(ResourceChangeScannerImpl.java:166) at org.drools.io.impl.ResourceChangeScannerImpl$ProcessChangeSet.run(ResourceChangeScannerImpl.java:311) at java.lang.Thread.run(Thread.java:662) (As a side note the error message should probably read: reader does /not/ have a modified date) Regards Dean -- View this message in context: http://drools.46999.n3.nabble.com/Resource-Change-Scanner-Service-modified-date-error-tp3634802p3637279.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.orgmailto:rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users ** This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the postmas...@nds.com and delete it from your system as well as any copies. The content of e-mails as well as traffic data may be monitored by NDS for employment and security purposes. To protect the environment please do not print this e-mail unless necessary. NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, United Kingdom. A company registered in England and Wales. Registered no. 3080780. VAT no. GB 603 8808 40-00 ** ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Resource Change Scanner Service modified date error
+1 to Thomas' proposal: the first step would be to change the thrown Exception to UnsupportedOperationException. Of course this will be a temporary change until Dean implements all the methods in the correct way :) Best Regards Esteban Aliverti - Developer @ http://www.plugtree.com - Blog @ http://ilesteban.wordpress.com 2012/1/6 Swindells, Thomas tswinde...@nds.com As well as the message not making sense the exception should also really be UnsupportedOperationException, of course the preference is for someone to implement it and make it supported! ** ** Thomas ** ** *From:* rules-users-boun...@lists.jboss.org [mailto: rules-users-boun...@lists.jboss.org] *On Behalf Of *Esteban Aliverti *Sent:* 06 January 2012 09:14 *To:* Rules Users List *Subject:* Re: [rules-users] Resource Change Scanner Service modified date error ** ** Could you please share with us how are you adding your resources to the agent? According to what you are saying I assume you are using a ReaderResource. According to Drools code, ReaderResource doesn't support most of org.drools.io.internal.InternalResource methods. Some of these methods (i.e. getLastModified()) are used by ResourceScanner to check if a resource has actually changed. So if we take a look at ReaderResource.getLastModified() we will see this: ** ** public long getLastModified() { throw new IllegalStateException( reader does have a modified date ); } ** ** You can find the whole source code here: https://github.com/droolsjbpm/drools/blob/master/drools-core/src/main/java/org/drools/io/impl/ReaderResource.java ** ** So, don't expect this to work :) ** ** There are 2 things you can do: 1. Submit a patch for ReaderResource.java implementing all the unimplemented methods :) 2. Use a different Resource like UrlResource, FileResource, InputStreamResource, etc. In my opinion, Bug 733008 must be reopened until someone (maybe you Dean) provides a correct implementation of ReaderResource. ** ** Best Regards, Esteban Aliverti - Developer @ http://www.plugtree.com - Blog @ http://ilesteban.wordpress.com On Fri, Jan 6, 2012 at 8:53 AM, Dean d...@qualica.com wrote: I'm pretty sure this issue is the same as Bug 733008 (https://bugzilla.redhat.com/show_bug.cgi?id=733008). I have updated the class from Bug 733008 to reproduce the bug in Drools 5.4.0.Beta1: http://drools.46999.n3.nabble.com/file/n3637279/AgentTest.java AgentTest.java It doesn't seem to be possible to scan a resource for changes at all. Even if I execute ResourceFactory.getResourceChangeScannerService().scan(); directly, I get the same error message: [2012-01-06 09:47:57,144:exception] java.lang.IllegalStateException: reader does have a modified date at org.drools.io.impl.ReaderResource.getLastModified(ReaderResource.java:64) at org.drools.io.impl.ResourceChangeScannerImpl.scan(ResourceChangeScannerImpl.java:166) at org.drools.io.impl.ResourceChangeScannerImpl$ProcessChangeSet.run(ResourceChangeScannerImpl.java:311) at java.lang.Thread.run(Thread.java:662) (As a side note the error message should probably read: reader does /not/ have a modified date) Regards Dean -- View this message in context: http://drools.46999.n3.nabble.com/Resource-Change-Scanner-Service-modified-date-error-tp3634802p3637279.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 ** ** -- ** This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the postmas...@nds.com and delete it from your system as well as any copies. The content of e-mails as well as traffic data may be monitored by NDS for employment and security purposes. To protect the environment please do not print this e-mail unless necessary. NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, United Kingdom. A company registered in England and Wales. Registered no. 3080780. VAT no. GB 603 8808 40-00 ** ___ 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] Resource Change Scanner Service modified date error
Enlighten me, please. If ResourceFactory.newReaderResource() creates a drools.io.Resource from a java.io.Reader, how would you get at some modification time, and of what? The general idea of a Reader seems to be a data source without implication as to data representation, persistence, file system or any other such thing. -W 2012/1/6 Esteban Aliverti esteban.alive...@gmail.com +1 to Thomas' proposal: the first step would be to change the thrown Exception to UnsupportedOperationException. Of course this will be a temporary change until Dean implements all the methods in the correct way :) Best Regards Esteban Aliverti - Developer @ http://www.plugtree.com - Blog @ http://ilesteban.wordpress.com 2012/1/6 Swindells, Thomas tswinde...@nds.com As well as the message not making sense the exception should also really be UnsupportedOperationException, of course the preference is for someone to implement it and make it supported! ** ** Thomas ** ** *From:* rules-users-boun...@lists.jboss.org [mailto: rules-users-boun...@lists.jboss.org] *On Behalf Of *Esteban Aliverti *Sent:* 06 January 2012 09:14 *To:* Rules Users List *Subject:* Re: [rules-users] Resource Change Scanner Service modified date error ** ** Could you please share with us how are you adding your resources to the agent? According to what you are saying I assume you are using a ReaderResource. According to Drools code, ReaderResource doesn't support most of org.drools.io.internal.InternalResource methods. Some of these methods (i.e. getLastModified()) are used by ResourceScanner to check if a resource has actually changed. So if we take a look at ReaderResource.getLastModified() we will see this: ** ** public long getLastModified() { throw new IllegalStateException( reader does have a modified date ); } ** ** You can find the whole source code here: https://github.com/droolsjbpm/drools/blob/master/drools-core/src/main/java/org/drools/io/impl/ReaderResource.java ** ** So, don't expect this to work :) ** ** There are 2 things you can do: 1. Submit a patch for ReaderResource.java implementing all the unimplemented methods :) 2. Use a different Resource like UrlResource, FileResource, InputStreamResource, etc. In my opinion, Bug 733008 must be reopened until someone (maybe you Dean) provides a correct implementation of ReaderResource. ** ** Best Regards, Esteban Aliverti - Developer @ http://www.plugtree.com - Blog @ http://ilesteban.wordpress.com On Fri, Jan 6, 2012 at 8:53 AM, Dean d...@qualica.com wrote: I'm pretty sure this issue is the same as Bug 733008 (https://bugzilla.redhat.com/show_bug.cgi?id=733008). I have updated the class from Bug 733008 to reproduce the bug in Drools 5.4.0.Beta1: http://drools.46999.n3.nabble.com/file/n3637279/AgentTest.java AgentTest.java It doesn't seem to be possible to scan a resource for changes at all. Even if I execute ResourceFactory.getResourceChangeScannerService().scan(); directly, I get the same error message: [2012-01-06 09:47:57,144:exception] java.lang.IllegalStateException: reader does have a modified date at org.drools.io.impl.ReaderResource.getLastModified(ReaderResource.java:64) at org.drools.io.impl.ResourceChangeScannerImpl.scan(ResourceChangeScannerImpl.java:166) at org.drools.io.impl.ResourceChangeScannerImpl$ProcessChangeSet.run(ResourceChangeScannerImpl.java:311) at java.lang.Thread.run(Thread.java:662) (As a side note the error message should probably read: reader does /not/ have a modified date) Regards Dean -- View this message in context: http://drools.46999.n3.nabble.com/Resource-Change-Scanner-Service-modified-date-error-tp3634802p3637279.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 ** ** -- ** This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the postmas...@nds.com and delete it from your system as well as any copies. The content of e-mails as well as traffic data may be monitored by NDS for employment and security purposes. To protect the environment please do not print this e-mail unless necessary. NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, United Kingdom. A company registered in England and Wales. Registered no. 3080780. VAT no. GB 603 8808 40-00
Re: [rules-users] Resource Change Scanner Service modified date error
On 6 January 2012 10:51, Dean d...@qualica.com wrote: How would you propose returning a modified date for a ByteArrayResource, ReaderResource or InputStreamResource as these are in-memory objects and don't actually have a modified date? Set and always return object creation time? -W Regards Dean -- View this message in context: http://drools.46999.n3.nabble.com/Resource-Change-Scanner-Service-modified-date-error-tp3634802p3637468.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] Resource Change Scanner Service modified date error
As Dean says, getting the modification time of an in-memory resource is impossible (actually you need to create an external mechanism to keep track of it). So I would suggest to change the thrown Exception to something more meaningful and to explicitly document which resources are capable to be scanned for changes. Right now, the Resources capable to being scanned are: - ClasspathResource - UrlResource - FileSystemResource - EncodedResource (depending on the implementation of Resource it is using) @Wolfgang, for non in-memory Resources like files or url resources you can get the last modified time. This is used by the scanner to check if a particular resource has been modified since the last time it was scanned. As Dean mentioned, this is not feasible when the resource is an in-memory resource like a ByteArrayResource. Best Regards, Esteban Aliverti - Developer @ http://www.plugtree.com impossible http://www.plugtree.com - Blog @ http://ilesteban.wordpress.com On Fri, Jan 6, 2012 at 10:51 AM, Dean d...@qualica.com wrote: @Esteban - I've tried both the ClassPathResource and UrlResource and haven't actually tried ReaderResource. I see what you mean with the source code, I did notice that specific error message appears for ReaderResource, but I don't know how my code is getting there. I will debug it and find out what is going on when I get a moment. I notice that getLastModified also isn't implemented for InputStreamResource (with a different error message). How would you propose returning a modified date for a ByteArrayResource, ReaderResource or InputStreamResource as these are in-memory objects and don't actually have a modified date? Regards Dean -- View this message in context: http://drools.46999.n3.nabble.com/Resource-Change-Scanner-Service-modified-date-error-tp3634802p3637468.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] Resource Change Scanner Service modified date error
2012/1/6 Esteban Aliverti esteban.alive...@gmail.com @Wolfgang, for non in-memory Resources like files or url resources you can get the last modified time. @Esteban: I was specifically addressing ReaderResource, not ClassPathResource or FileResource. -W ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Drools 5.3 in OSGi
What kinds of instructions are you looking for? As you mention, knowledge-api, drools-core and drools-compiler are OSGi bundles. Cheers - CTO @ http://www.plugtree.com - MyJourney @ http://salaboy.wordpress.com - Co-Founder @ http://www.jbug.com.ar - Mauricio Salaboy Salatino - On 05/01/2012, at 20:51, el_eduardo el_edua...@yahoo.com wrote: Hi! I have been looking on the forum for information on how to setup the runtime (or target platform) for Drools 5.3. I am unable to do it because I do not seem to find where the bundles are. I downloaded the Drools-OSGi-Bundles (http://download.jboss.org/drools/release/5.3.0.Final/drools-osgi-bundles-distribution-5.3.0.Final.zip) but those seem to be dependecy bundles. I am then assuming that the regular distro jars (http://download.jboss.org/drools/release/5.3.0.Final/drools-distribution-5.3.0.Final.zip) have some of those jars as OSGI bundles (for example the knowledge API does). The integration doc though (http://download.jboss.org/drools/release/5.3.0.Final/droolsjbpm-integration-distribution-5.3.0.Final.zip) states that there are declarative services but I cannot find them. Is there any place that documents the setup procedures to have Drools in an OSGi environment (the above integration doc does not really give instructions). Thanks! -- View this message in context: http://drools.46999.n3.nabble.com/Drools-5-3-in-OSGi-tp3636591p3636591.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] Resource Change Scanner Service modified date error
Hello Dean, you are right, https://issues.jboss.org/browse/GUVNOR-1699 solves something different. Bugzilla https://bugzilla.redhat.com/show_bug.cgi?id=733008 still waits to be solved. I have updated this bugzilla to be linked to belonging JIRA issues. You can look also on other bugs which have the same root cause. But I am not developer, so I cannot tell you when it'll be fixed. Jiri Svitak On 01/05/2012 02:27 PM, Dean wrote: Hi I am experiencing a problem with starting the ResourceChangeScannerService as described here: https://bugzilla.redhat.com/show_bug.cgi?id=733008 I can create a KnowledgeAgent instance and apply a changeset to it which loads the desired package from Guvnor. However, as soon as I attempt to start the ScannerService in order to be notified of changes to this package I immediately receive the exception: java.lang.IllegalStateException: reader does have a modified date. Then on every scanner interval following, the scanner fails each time with the same error message. Apparently, this issue has already been fixed here: https://issues.jboss.org/browse/GUVNOR-1699 However, I am still experiencing this problem even with Drools 5.4.0.Beta1 Could somebody perhaps help me with this. I am attempting to rebuild the source code on my side, however, I am having endless problems with Maven. Regards Dean -- View this message in context: http://drools.46999.n3.nabble.com/Resource-Change-Scanner-Service-modified-date-error-tp3634802p3634802.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] Drools 5.3 in OSGi
Hi Mauricio, Thanks for the reply. I was looking for what needs to be thrown into a OSGi container to get it working so I think the list is a) What ever bundles are detected from drools-distribution-5.3.0.Final/binaries (the final distro download http://download.jboss.org/drools/release/5.3.0.Final/drools-distribution-5.3.0.Final.zip) b) All the bundles from the osgi package (http://download.jboss.org/drools/release/5.3.0.Final/drools-osgi-bundles-distribution-5.3.0.Final.zip) The later being the dependencies that the first bundles require OSGIfied. Thanks -- View this message in context: http://drools.46999.n3.nabble.com/Drools-5-3-in-OSGi-tp3636591p3638227.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] MVEL curly braces position - bug or feature?
Hi I've been learning drools ands I saw that there is a Fibonacci example, so I thought I'd write my own using mvel as the dialect and then compare it to the model solution. However, I couldn't get mine working. It parsed but the behaviour was very odd. It kept ignoring the modify block in my recurse rule and consequently it went into an infinite loop. I compared it to the 'approved' solution and the two were pretty much the same, except that it worked and mine didn't. After a lot of checking I noticed that I had started my curly brace on a new line after modify but the example had continued straight after the closing brace of the modify. Works // modify ( f ){ value = 1 }; or modify ( f ){value = 1 }; Doesn't Work // modify ( f ) { value = 1 }; Does anyone know if this is a bug or a feature? -- View this message in context: http://drools.46999.n3.nabble.com/MVEL-curly-braces-position-bug-or-feature-tp3638341p3638341.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] MVEL curly braces position - bug or feature?
Looks like a bug. MVEL does ; injection in order to make ; optional, so my guess is that it is mistakenly injecting ; after your modify() call and handling {} as a separate code block. Edson On Fri, Jan 6, 2012 at 11:51 AM, nickS nsand...@msxi-euro.com wrote: Hi I've been learning drools ands I saw that there is a Fibonacci example, so I thought I'd write my own using mvel as the dialect and then compare it to the model solution. However, I couldn't get mine working. It parsed but the behaviour was very odd. It kept ignoring the modify block in my recurse rule and consequently it went into an infinite loop. I compared it to the 'approved' solution and the two were pretty much the same, except that it worked and mine didn't. After a lot of checking I noticed that I had started my curly brace on a new line after modify but the example had continued straight after the closing brace of the modify. Works // modify ( f ){ value = 1 }; or modify ( f ){value = 1 }; Doesn't Work // modify ( f ) { value = 1 }; Does anyone know if this is a bug or a feature? -- View this message in context: http://drools.46999.n3.nabble.com/MVEL-curly-braces-position-bug-or-feature-tp3638341p3638341.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 -- Edson Tirelli JBoss Drools Core Development JBoss by Red Hat @ www.jboss.com ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Sending requests to the Drools Execution Server from an external source
I am not sure, have you looked in the log file of the drools server (catalina.out if you are running on tomcat)? Also have you configured the server to consume JSON rather than XML? On Fri, Jan 6, 2012 at 1:26 PM, kofibentum [via Drools] ml-node+s46999n3638561...@n3.nabble.com wrote: Thanks a lot for your post. It works for me. But why does curl not return any message when I post the folowing json formatted command: curl -v -H Content-Type: text/plain --data {\batch-execution\:{\commands\:[{\insert\:{\out-identifier\:\message\,\object\:{\org.test.Message\:{\text\:\Hello\,{\fire-all-rules\:\\}]}} http://localhost:8080/drools-server/kservice/rest/execute -- If you reply to this email, your message will be added to the discussion below: http://drools.46999.n3.nabble.com/Sending-requests-to-the-Drools-Execution-Server-from-an-external-source-tp1776466p3638561.html To unsubscribe from Sending requests to the Drools Execution Server from an external source, click herehttp://drools.46999.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_codenode=1776466code=amVmZm1heEBnbWFpbC5jb218MTc3NjQ2NnwxNDc1NzMzMzc4 . NAMLhttp://drools.46999.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewerid=instant_html%21nabble%3Aemail.namlbase=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.InstantMailNamespacebreadcrumbs=instant+emails%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml -- View this message in context: http://drools.46999.n3.nabble.com/Sending-requests-to-the-Drools-Execution-Server-from-an-external-source-tp1776466p3638618.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] Sending requests to the Drools Execution Server from an external source
It has been a while since I worked with this and it may have been updated. This might not be your issue but I my camel-server.xml looks like this, note that the converters and aliases tags are not necessary, but if you find yourself needing an xstream alias or convert, that is where you would configure them. I would check your server log file too. dataFormats xstream id=xstream-json driver=json converters /converters aliases /aliases /xstream /dataFormats route from uri=cxfrs://bean://rsServer/ policy ref=droolsPolicy unmarshal ref=xstream-json / to uri=drools:node1/ksession1 / marshal ref=xstream-json / /policy /route On Fri, Jan 6, 2012 at 2:03 PM, kofibentum [via Drools] ml-node+s46999n3638652...@n3.nabble.com wrote: Yes I am using tomcat 6. Can you point me to the part of the documentation that has instructions for configuring the server to consume json? I have not come across that yet. -- If you reply to this email, your message will be added to the discussion below: http://drools.46999.n3.nabble.com/Sending-requests-to-the-Drools-Execution-Server-from-an-external-source-tp1776466p3638652.html To unsubscribe from Sending requests to the Drools Execution Server from an external source, click herehttp://drools.46999.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_codenode=1776466code=amVmZm1heEBnbWFpbC5jb218MTc3NjQ2NnwxNDc1NzMzMzc4 . NAMLhttp://drools.46999.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewerid=instant_html%21nabble%3Aemail.namlbase=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.InstantMailNamespacebreadcrumbs=instant+emails%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml -- View this message in context: http://drools.46999.n3.nabble.com/Sending-requests-to-the-Drools-Execution-Server-from-an-external-source-tp1776466p3638685.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] Guvnor utility to update packages and models
We are using Drool and Guvnor 5.1.1 and have approximately 150 rule packages (different rules for different customers, ...). Has anyone written a utility or do you have a suggestion for updating POJO models within each of these that doesn't involve me going to each package within guvnor? As an example, 50 of my packages might all use the same POJO, we'll call it transactionAv10.jar, and when I go to v11 I currently have to go back into each package in guvnor and archive v10 and then upload v11. I'm looking for a way that I could do this outside of guvnor. Whether it be doing the updates at the webdav level, or even calling some guvnor functions that do these tasks. For reference, I am using Apache Tomcat to host Guvnor and am using the default database structure. Any thoughts? Thank you! Dean Whisnant basys, inc. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] i want to user drools/Guvnor
Hi I am newbie in Drools, I got an assignment and I found Drools / Guvnor could be the perfect match for this requirements. I have a huge database in mySQL in a school (where it has data from kinder garden kids to PhD students). Management hired a sport medical doctor to check the health of existing students to prepare a good soccer team. The teacher want to find these kind of students. a) students who are within age of 18-21 years old (sample only), parents allowed to play soccer (let say the targeted population) b) Among these population he want to screen who has encounter with minor diseases and visited hospital in last year. c) in that medical visits he want: 1. student more than 2 visits with chest or leg pain or 2. under medication with (drug1, drug3, drug7, drug 11). or 3. student lab test result show nicotine level (smoking) 48 or 4. student lab test result show alcohol level =1.8 or 5. any chest pain (while running) or leg fracture. These are the criteria he decided to pull from another software but I can get XML file, which is infact a rule. He want me to write a rule, where he can apply same pattern but for another game in future i.e. volleyball players (where hand fracture is major determinant). and return result in a format which has been written in Java script. after studying Drools, I decided Guvnor would be the best tools to apply. Now my problem is: a) How can I map xml criteria to Drools. b) How can I access Guvnor UI (for rule writing by non IT guy) with Existing school's Software. c) How can I visualize the results in Java script (already written). so I don't have to work hard for visualization. Any suggestion / ideas / steps are welcome. DG ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] NPE loading Drools 5.4.0.Beta1 using drools-spring
I am trying to load up 5.4.0.Beta1. I'm using Spring configuration xml that works fine in 5.2.0.Final. In the xml, my grid-node is defined as: drools:grid-node id=droolsClusterNode1/ The exception is a NPE on a method in WhitePagesClient. Any idea what the cause might be? Has anyone successfully loaded 5.4.0 using Spring? The full exception is: ERROR 2012-01-06 15:51:05,998 [org.springframework.web.context.ContextLoader] - Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'droolsClusterNode1': Invocation of init method failed; nested exception is java.lang.NullPointerException at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1420) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:563) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425) at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4206) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4705) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601) at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:943) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:563) at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1399) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:297) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836) at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761) at org.apache.catalina.manager.ManagerServlet.check(ManagerServlet.java:1500) at org.apache.catalina.manager.HTMLManagerServlet.doPost(HTMLManagerServlet.java:252) at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.filters.CsrfPreventionFilter.doFilter(CsrfPreventionFilter.java:186) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:563) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at
Re: [rules-users] Guvnor utility to update packages and models
Hi, This is the exact reason why you may want to use the Global Area. Global area is a special area that is designed to store assets that can be shared among all packages. First, put your common pojo in the Global Area. Then add pojo to each package using the Import from the Global Area option. Further more, you can update your pojo through REST interface remotely when you pojo model is changed: http://docs.jboss.org/drools/release/5.3.0.Final/drools-guvnor-docs/html/ch09.html#d0e2282 Cheers, Jervis On 2012/1/7 4:15, Dean Whisnant wrote: We are using Drool and Guvnor 5.1.1 and have approximately 150 rule packages (different rules for different customers, ...). Has anyone written a utility or do you have a suggestion for updating POJO models within each of these that doesn't involve me going to each package within guvnor? As an example, 50 of my packages might all use the same POJO, we'll call it transactionAv10.jar, and when I go to v11 I currently have to go back into each package in guvnor and archive v10 and then upload v11. I'm looking for a way that I could do this outside of guvnor. Whether it be doing the updates at the webdav level, or even calling some guvnor functions that do these tasks. For reference, I am using Apache Tomcat to host Guvnor and am using the default database structure. Any thoughts? Thank you! Dean Whisnant basys, inc. ___ 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