[rules-users] Drools Server with alternate JSON library
Drools Server uses XStream to handle JSON. I would like to know if it is possible to use an alternate JSON library, like Jackson or GSON? Thanks. -- View this message in context: http://drools.46999.n3.nabble.com/Drools-Server-with-alternate-JSON-library-tp4025868.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] counter in slidingTime window with restriction
I tried to narrow it down a little but have no idea where the erroneous firing of slidingTimeCount comes from. It annoys me especially because I want to know when rules fire and why. I tried debugging with eclipse but it doesnt bring me much further (the debugger stops at least 3 times for each event in this rule, whereas it is fired only once - I never got too many outputs when debugging, but I sometimes get the 0 output (apparently when I am slow) - this is weird behaviour how can the condition be evaluated before the accumulation is reduced? -- View this message in context: http://drools.46999.n3.nabble.com/Getting-data-from-a-database-My-SQL-to-Guvnor-tp4025814p4025869.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] counter in slidingTime window with restriction
Please open a JIRA ticket and post your test case, we'll investigate Davide On 09/08/2013 11:31 PM, amarok wrote: I tried to narrow it down a little but have no idea where the erroneous firing of slidingTimeCount comes from. It annoys me especially because I want to know when rules fire and why. I tried debugging with eclipse but it doesnt bring me much further (the debugger stops at least 3 times for each event in this rule, whereas it is fired only once - I never got too many outputs when debugging, but I sometimes get the 0 output (apparently when I am slow) - this is weird behaviour how can the condition be evaluated before the accumulation is reduced? -- View this message in context: http://drools.46999.n3.nabble.com/Getting-data-from-a-database-My-SQL-to-Guvnor-tp4025814p4025869.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Guvnor REST api, compile package
I could not figure out why compile is not working. I solved it by changing Guvnor source - i removed 'is up to date' check. Now I have one more concern, is there a REST method to delete snapshot? Documentation mentions just snapshot creation. -- View this message in context: http://drools.46999.n3.nabble.com/Guvnor-REST-api-compile-package-tp4025756p4025872.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] A Drools CEP Scenario - did I get it right?
The question is more or less where to begin. 1. If there is a Fact in working memory (e.g. Person) and I invoke fireAllRules() twice, I would expect to have the following rule fire both times: rule alwaysFire when $room : Room( ) then System.out.println(there is a room); end I would also expect this rule to fire every time I invoke fireAllRules() rule alwaysFire2 when then System.out.println(always!); end Both rules fire only once (the first time) even though the Working Memory is the same. (The room still exists...). I expected the rule to fire each time fireAllRules() is invoked and for the number of Rooms e.g. with 4 rooms - 4x output there is a room. 2. It seems to be impossible to set the pseudo clock to a specific time. How can I test CRON timer rules?! On 08.09.2013, at 18:51, Michael Anstis michael.ans...@gmail.com wrote: What did not happen as you expected? The HTTP session to Knowledge session association seems reasonable; but I assume you are trying with a more simple configuration initially. Sent on the move On 8 Sep 2013 17:42, amarok m...@alexander-wolf.net wrote: I got the following scenario: - I need a Web Service that reasons over received sensor events (1000+ per day and client) in realtime and send messages if certain patterns occur. - The web service has many clients (100-1000) but their events / facts do not interfere (each client has his own state and events that change his state). - Each client also has his own rules (10-100) (but they are parameterized generic rules - I thought maybe I could use rule templates or DSL to let clients individualize their rules). - Some rules are time dependant (e.g. if event (type=x) does not occour at least within half an hour after 8:00 a.m. (where 8 o'clock is a rule parameter) - send a message), others are accumulative (e.g. if number of events within 5h is 3). I'd like to use drools CEP for this. I already read some documentation and tutorials but my first examples do not really work as I expected. Now I fear to have some general misconception about Drools/CEP. If someone could have a look over my ideas, I'd be very glad! How I would do it: - Every client would have his own KnowledgeBase with his (individualized) rules. Rules would be stored in guvnor or on a mysql database as plain text. - Every client would have his own KnowledgeBase / StatefullKnowledgeSession on the service, that knows about recent sensor events and some facts about the client. Events automatically are disposed of once they are not relevant anymore. - A static hashmap will hold references to the session for each client. (clientID - KnowledgeSession) - Sessions are created when a new client joins the system, but are normally not disposed unless the client completely leaves the system. - When a new Event is received (HTTP PUT), the session corresponding to the client would be retrieved from the HashMap and the new event would be inserted via an event stream. Then (for every new event) session.fireAllRules() would be called on the clients KnowledgeSession. - The Knowledge Base would run in STREAM mode to be able to reason over time windows and automatically expire (=delete?!) events. This would keep memory usage in within bounds(?) - pseudo clock allows me to write tests or simulate the system with records of old events. (Is it possible to test timer, cron and sliding-window rules with pseudo clock? Can I explicitly set the time of the pseudo clock?) I appreciate your help! -- View this message in context: http://drools.46999.n3.nabble.com/A-Drools-CEP-Scenario-did-I-get-it-right-tp4025863.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] A Drools CEP Scenario - did I get it right?
1. A fact doesn't change until it *is* changed or the knowledge base destined to operate it changes: so why should reasoning due to the unchanged fact be repeated, with all consequential actions. Continuing your line of thought would result in a hopeless muddle if all consequences are re-executed each time fireAllRules is called even where facts and rules haven't changed. 2. This works fine to adjust the pseudo-clock to the time of the next event, about to be inserted in a playback run: PseudoClockScheduler clock; private void advance( Date eventDate ){ long currentTime = clock.getCurrentTime(); long eventTime = eventDate.getTime(); clock.advanceTime( eventTime - currentTime, TimeUnit.MILLISECONDS ); } -W On 09/09/2013, Alexander Wolf m...@alexander-wolf.net wrote: The question is more or less where to begin. 1. If there is a Fact in working memory (e.g. Person) and I invoke fireAllRules() twice, I would expect to have the following rule fire both times: rule alwaysFire when $room : Room( ) then System.out.println(there is a room); end I would also expect this rule to fire every time I invoke fireAllRules() rule alwaysFire2 when then System.out.println(always!); end Both rules fire only once (the first time) even though the Working Memory is the same. (The room still exists...). I expected the rule to fire each time fireAllRules() is invoked and for the number of Rooms e.g. with 4 rooms - 4x output there is a room. 2. It seems to be impossible to set the pseudo clock to a specific time. How can I test CRON timer rules?! On 08.09.2013, at 18:51, Michael Anstis michael.ans...@gmail.com wrote: What did not happen as you expected? The HTTP session to Knowledge session association seems reasonable; but I assume you are trying with a more simple configuration initially. Sent on the move On 8 Sep 2013 17:42, amarok m...@alexander-wolf.net wrote: I got the following scenario: - I need a Web Service that reasons over received sensor events (1000+ per day and client) in realtime and send messages if certain patterns occur. - The web service has many clients (100-1000) but their events / facts do not interfere (each client has his own state and events that change his state). - Each client also has his own rules (10-100) (but they are parameterized generic rules - I thought maybe I could use rule templates or DSL to let clients individualize their rules). - Some rules are time dependant (e.g. if event (type=x) does not occour at least within half an hour after 8:00 a.m. (where 8 o'clock is a rule parameter) - send a message), others are accumulative (e.g. if number of events within 5h is 3). I'd like to use drools CEP for this. I already read some documentation and tutorials but my first examples do not really work as I expected. Now I fear to have some general misconception about Drools/CEP. If someone could have a look over my ideas, I'd be very glad! How I would do it: - Every client would have his own KnowledgeBase with his (individualized) rules. Rules would be stored in guvnor or on a mysql database as plain text. - Every client would have his own KnowledgeBase / StatefullKnowledgeSession on the service, that knows about recent sensor events and some facts about the client. Events automatically are disposed of once they are not relevant anymore. - A static hashmap will hold references to the session for each client. (clientID - KnowledgeSession) - Sessions are created when a new client joins the system, but are normally not disposed unless the client completely leaves the system. - When a new Event is received (HTTP PUT), the session corresponding to the client would be retrieved from the HashMap and the new event would be inserted via an event stream. Then (for every new event) session.fireAllRules() would be called on the clients KnowledgeSession. - The Knowledge Base would run in STREAM mode to be able to reason over time windows and automatically expire (=delete?!) events. This would keep memory usage in within bounds(?) - pseudo clock allows me to write tests or simulate the system with records of old events. (Is it possible to test timer, cron and sliding-window rules with pseudo clock? Can I explicitly set the time of the pseudo clock?) I appreciate your help! -- View this message in context: http://drools.46999.n3.nabble.com/A-Drools-CEP-Scenario-did-I-get-it-right-tp4025863.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users ___ rules-users mailing
[rules-users] Dynamic ValueRangeProvider
Optaplanners, I'm looking to add some dynamic goodness to ValueRangeProvider. The only way I see to specify a ValueRangeProvider is via annotation. I'd like to be able to generate the id and Collection of candidate values dynamically. Is it possible to generate the ValueRangeProvider data outside of an annotation? For example: public class MyDataSource { public Collection getValues(String id) { … return values; } } Thanks, Drew ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] How to the setdrools.dialect.mvel.strictusingDrools+Spring?
Did you ever resolve the issue, I get the same error? -- View this message in context: http://drools.46999.n3.nabble.com/rules-users-How-to-the-set-drools-dialect-mvel-strict-using-Drools-Spring-tp3064468p4025878.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] how to check difference between two .pkg files
I have 2 .pkg files that are 2 snapshots for the same package from 2 different Guvnor instances. The 2 Guvnor instances are prod and test. I see that within Guvnor, it can show diff between 2 snapshots in its repository. If Guvnor can do it, there must be some API that I can use outside in a standalone program to compare between .pkg file. Anybody knows how to do this? thanks -- View this message in context: http://drools.46999.n3.nabble.com/how-to-check-difference-between-two-pkg-files-tp4025877.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 check difference between two .pkg files
Hi, It depends which version of Guvnor u r using. If its 5.x then, there are two ways to do this; 1. Use guvnor provided REST interface to get information related to packages. 2. Use JackRabbit API to directly access the repository as Guvnor 5.x uses JackRabbit as the assets repository. Regards, Zahid Ahmed -Original Message- From: rules-users-boun...@lists.jboss.org [mailto:rules-users-boun...@lists.jboss.org] On Behalf Of maunakea Sent: 09 September 2013 20:38 To: rules-users@lists.jboss.org Subject: [rules-users] how to check difference between two .pkg files I have 2 .pkg files that are 2 snapshots for the same package from 2 different Guvnor instances. The 2 Guvnor instances are prod and test. I see that within Guvnor, it can show diff between 2 snapshots in its repository. If Guvnor can do it, there must be some API that I can use outside in a standalone program to compare between .pkg file. Anybody knows how to do this? thanks -- View this message in context: http://drools.46999.n3.nabble.com/how-to-check-difference-between-two-pkg-files-tp4025877.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