[rules-users] Unable to share model between different packages in Guvnor 5.0.0
Hi there, Please assist. I promote 2 POJO model jars and a declarative model to the global area in Guvnor. I then create a upload a new POJO model jar and declarative model but select not to create new but to import the models from global area, however there is nothing in the drop down of available assets to import from global area. Please confirm what I might be doing wrong. Thanks Devan -- View this message in context: http://drools.46999.n3.nabble.com/Unable-to-share-model-between-different-packages-in-Guvnor-5-0-0-tp3987530.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] Decision table call external method
If there is just one object of class XMLTool and all addNode() calls should refer to this single object, you should do what Vincent suggested by making this single object accessible via a DRL global variable, or by using the singleton design pattern (as in Java). Adding this object as a fact and using (by applying tricks) it in the condition isn't the way this is supposed to be done (as you have rightly noticed). -W -- View this message in context: http://drools.46999.n3.nabble.com/Decision-table-call-external-method-tp3976910p3987626.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] Unable to share model between different packages in Guvnor 5.0.0
5.0.0 is *really* old. I can confirm it works fine with 5.4.0. An upgrade might be in order. With kind regards, Mike On 15 May 2012 07:43, devan.vanree...@gmail.com devan.vanree...@gmail.comwrote: Hi there, Please assist. I promote 2 POJO model jars and a declarative model to the global area in Guvnor. I then create a upload a new POJO model jar and declarative model but select not to create new but to import the models from global area, however there is nothing in the drop down of available assets to import from global area. Please confirm what I might be doing wrong. Thanks Devan -- View this message in context: http://drools.46999.n3.nabble.com/Unable-to-share-model-between-different-packages-in-Guvnor-5-0-0-tp3987530.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] Formula error in Business Rule(Guided editor)
Hi, thanks for your reply. It worked wih $r.getInstallations() in formula. :) Now business rule looks like following : There is a RuleObject [$p] with: installations 10 THEN 1. Set value of RuleObject [$p] calulatedValue =$p.getInstallations()*3 -- View this message in context: http://drools.46999.n3.nabble.com/Formula-error-in-Business-Rule-Guided-editor-tp3979546p3987687.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] Decision table call external method
I agree with you but I didn't succeed to do it. Am i using the good syntax : Variables myPackage.XMLTool xmlTool And after in the action I can use xmlTool.addNodes() right ? I don't need to insert the fact in the ksession with this method ? -- View this message in context: http://drools.46999.n3.nabble.com/Decision-table-call-external-method-tp3976910p3987699.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] Decision table call external method
On 15/05/2012, SuperGG jerome-m.pe...@thalesgroup.com wrote: I agree with you but I didn't succeed to do it. Am i using the good syntax : Variables myPackage.XMLTool xmlTool And after in the action I can use xmlTool.addNodes() right ? I don't need to insert the fact in the ksession with this method ? No, but in the Java code where you create the session, you have to create the object and assign it to the DRL variable. See API: setGlobal(...) and the example in the Expert manual. -W -- View this message in context: http://drools.46999.n3.nabble.com/Decision-table-call-external-method-tp3976910p3987699.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] Score curruption exception in drools-planner-5.4.0.CR1
If - the equals/hashCode contract is followed (see Object#equals) - even when considering that your output is suffering from https://issues.jboss.org/browse/JBRULES-3505 - it's unlogical that the rule behaves as it does then it could be a stateful memory corruption. To prove that it is, first write a SimpleJavaScoreCalculator (see docs). That will be a lot slower, but it won't suffer from the issue. Next, switch back and use this recipe to isolate that stateful memory corruption into a Drools Expert unit test, so we can fix it: here's how I usually isolate such a bug to a small reproducable unit test: - Turn on environmentMode TRACE so it crashes as fast as possible - Turn on TRACE logging. http://docs.jboss.org/drools/release/5.4.0.Beta1/drools-planner-docs/html_single/index.html#d0e2450 So you see something like this: INFO Solver started: time spend (0), score (-6), new best score (-6), random seed (0). TRACE Ignoring not doable move (col0@row0 = row0). TRACE Move score (-4), accepted (true) for move (col0@row0 = row1). TRACE Move score (-4), accepted (true) for move (col0@row0 = row2). TRACE Move score (-4), accepted (true) for move (col0@row0 = row3). ... TRACE Move score (-3), accepted (true) for move (col1@row0 = row3). ... TRACE Move score (-3), accepted (true) for move (col2@row0 = row3). ... TRACE Move score (-4), accepted (true) for move (col3@row0 = row3). DEBUG Step index (0), time spend (6), score (-3), new best score (-3), accepted move size (12) for picked step (col1@row0 = row3). ... DEBUG Step index (1), time spend (10), score (-2), new best score (-2), accepted move size (12) for picked step (...). ... - If there's a construction heuristic that doesn't crash: remove it by: -- run only the construction heuristic config -- take the output solution as the new input solution -- remove the construction heuristic config - If it doesn't crash in step 0: remove non-crashing steps before it -- run it just before the step it crashes and take the output solution as the input solution -- verify that it now crashes in step 0 (*) - If it doesn't crash in the first move: remove non-crashing move's before it -- Open DefaultDecider.decideNextStep(LocalSearchStepScope) and add moveIterator.next(). For example, if move 6 crashes: public void decideNextStep(LocalSearchStepScope localSearchStepScope) { WorkingMemory workingMemory = localSearchStepScope.getWorkingMemory(); IteratorMove moveIterator = selector.moveIterator(localSearchStepScope); // BEGIN moveIterator.next(); moveIterator.next(); moveIterator.next(); moveIterator.next(); moveIterator.next(); // 5 next()'s // END while (moveIterator.hasNext()) { Move move = moveIterator.next(); ... -- verify that it now crashes in move 0 (*) (*) If it doesn't crash, that means that an earlier step or move helped cause this issue. Remove as many steps and moves as you can. This means that the final unit test will have multiple fireAllRules(): ... do move 1 ... ... fireAllRules ... undo move 1 ... (... fireAllRules) ... do move 2 ... ... fireAllRules // Now the WM is corrupted - Now (and not sooner!), remove rules by commented out all the rules in the DRL that doesn't stop the crashing - Remove all the problem facts and planning entities that doesn't stop the crashing. - Now the problem should be small enough to rewrite it in a simple unit test. Op 15-05-12 06:39, Nurlan Rakhimzhanov schreef: On 15 May 2012 00:30, Christopher Dolan christopher.do...@avid.com mailto:christopher.do...@avid.com wrote: I may be way off track, but I saw score corruption like yours in two cases: 1) broken .equals()/.hashCode() method. I had a couple of model classes that accidentally looked at mutable data in their .equals() and .hashCode() methods. When these were applied as the cause of the constraint, the revert action then failed to find the constraint because the removed instance wasn't .equals() to the inserted instance. I solved this by reverting to Object.equals() and Object.hashCode(). I don't think that problem with .equals() or .hashCode() methods, because I'm using bapache EqualsBuilder/b and bapache HashCodeBuilder/b, this is 1st, and 2nd my each planning entity has al least unique bid/b. 2) broken variable assignment in aggregate predicates (https://issues.jboss.org/browse/JBRULES-3482) This is fixed in 5.4.0.Final. If your rules use collect() or accumulate() with a complicated first argument to either, then Drools becomes confused about which variable to assign the value to. In most cases, this results in a ClassCastException. But in some cases where the facts happened to be the same class, you ended up with the wrong fact assigned as the cause of the constraint.
Re: [rules-users] Decision table call external method
Ok I will take a look ! Thanks a lot for you help guys. -- View this message in context: http://drools.46999.n3.nabble.com/Decision-table-call-external-method-tp3976910p3987757.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 get list of rules that we modified/added/deleted
When I add/update/delete the rules in decision table and when I press save changes I should get the list of rules I recently added/updated/deleted for doing some validation before I save it. Is there any callback/api to get the rules only that I have modified from last save? Thanks in advance, ~Arun -- View this message in context: http://drools.46999.n3.nabble.com/How-to-get-list-of-rules-that-we-modified-added-deleted-tp3987780.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] IRC Server Change - from Codehaus to Freenode
Drools, jBpm and Guvnor are moving from codehaus irc servers to freenode. You can now find us on the following channels on irc://chat.freenode.net http://chat.freenode.net #drools https://plus.google.com/s/%23drools #droolsdev https://plus.google.com/s/%23droolsdev #jbpm https://plus.google.com/s/%23jbpm #jbpmdev https://plus.google.com/s/%23jbpmdev #guvnor https://plus.google.com/s/%23guvnor #guvnordev https://plus.google.com/s/%23guvnordev freenode also maintains a web interface: http://webchat.freenode.net/ ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Guvnor REST API and XLS decision tables
Thanks for your reply. Things are clearer now! For some reason I expected inverse behavior for /binary and /source, but now you've made it clear. I have tried your advice to open a file returned from REST /source with Excel. After renaming it (adding a proper file extension), Excel is not able to open it, i.e. a file I get from Guvnor is corrupted which causes kbuilder exceptions. -- View this message in context: http://drools.46999.n3.nabble.com/Guvnor-REST-API-and-XLS-decision-tables-tp3985574p3987808.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 get list of rules that we modified/added/deleted
No there is no API for this directly. There is a means to register handlers for onSave events for *all* asset types however you'd still be presented with the whole asset - leaving the identification of differences to you. There was a lot of talk about this~4 months ago on this mailing list, please have a search. Thanks, Mike On 15 May 2012 11:47, aomkaram arun.iiitc...@gmail.com wrote: When I add/update/delete the rules in decision table and when I press save changes I should get the list of rules I recently added/updated/deleted for doing some validation before I save it. Is there any callback/api to get the rules only that I have modified from last save? Thanks in advance, ~Arun -- View this message in context: http://drools.46999.n3.nabble.com/How-to-get-list-of-rules-that-we-modified-added-deleted-tp3987780.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] Challenge! Using javassist and drools presents an issue with drl
Folks, I'm also facing this same issue. I tried many things such as creation session object only after I created dynamic classes using javassist CtClass, changing rules, etc. but none of the solution is working. As per my observation the rules are accepting the dynamic class as long as I'm writing the rule as a single function() but the moment I'm splitting the rules in a function I'm getting the following errors: 1) *Unable to resolve ObjectType 'Transac_EE_TDR' * 2) *Error importing : 'defaultpkg.ProcessEE_TPS.processEE_TPS'* Here Transac_EE_TDR is my dynamic class and 'processEE_TPS' is the function name. I will appreciate if someone can help me resolve it. Thanks! BR Ayush -- View this message in context: http://drools.46999.n3.nabble.com/Challenge-Using-javassist-and-drools-presents-an-issue-with-drl-tp763086p3987828.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] can't put formula on Guvnor screen
Hi Team ! Earlier I sent this mail to rules-...@lists.jboss.org. Mark Proctor asked me to mail here so I am mailing here in the hope of reply. Since yesterday only I started learning Drools with the help of Google and *JBOSS DROOLS BUSINESS RULES pdf file*. I faced many problems to understand the concept but now its going smooth. But the problem is the *version of PDF file of the book* and the *Govener version*. *Its quite different*. I request you all to please provide me the latest version of PDF as I am unable to find on net. The problem I am facing is to put the formula as given in the screen shot in the book. I am unable to put the *formula* as described in JBOSS DROOLS BUSINESS RULES pdf file on page no. 102.the formula is *salesValue-10 as the box is not capable of taking cahracters. *It is taking only integer. Thanks in Advance for all the help and material ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] How to get list of rules that we modified/added/deleted
Thanks Mike for the quick reply. -- View this message in context: http://drools.46999.n3.nabble.com/How-to-get-list-of-rules-that-we-modified-added-deleted-tp3987780p3987838.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] can't put formula on Guvnor screen
The book, as Mark also said, is out of date compared to the current (5.4) version of Drools and Guvnor. I suspect you've elected to set the field's value to a literal rather than formula. Please try deleting the constraint and adding back. When clicking on the pencil icon next to the operator be sure to select New formula. With kind regards, Mike On 15 May 2012 12:27, zeeshan khan zeeshan.spr...@gmail.com wrote: Hi Team ! Earlier I sent this mail to rules-...@lists.jboss.org. Mark Proctor asked me to mail here so I am mailing here in the hope of reply. Since yesterday only I started learning Drools with the help of Google and *JBOSS DROOLS BUSINESS RULES pdf file*. I faced many problems to understand the concept but now its going smooth. But the problem is the *version of PDF file of the book* and the *Govener version*. *Its quite different*. I request you all to please provide me the latest version of PDF as I am unable to find on net. The problem I am facing is to put the formula as given in the screen shot in the book. I am unable to put the *formula* as described in JBOSS DROOLS BUSINESS RULES pdf file on page no. 102.the formula is *salesValue-10 as the box is not capable of taking cahracters. *It is taking only integer. Thanks in Advance for all the help and material ___ 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] Different Thread Handling between fireAllRules() and fireUntilHalt()
Issue was described on the top of the thread. Lazy loading Entity Relationship leads to PreparedStatement closed error during rule evaluation. Thanks -- View this message in context: http://drools.46999.n3.nabble.com/Different-Thread-Handling-between-fireAllRules-and-fireUntilHalt-tp3985748p3987895.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] can't put formula on Guvnor screen
*Hi Mike !!* * * *Thanks for the reply.its working fine in WHEN but not in THEN..* On Tue, May 15, 2012 at 5:06 PM, Michael Anstis michael.ans...@gmail.comwrote: The book, as Mark also said, is out of date compared to the current (5.4) version of Drools and Guvnor. I suspect you've elected to set the field's value to a literal rather than formula. Please try deleting the constraint and adding back. When clicking on the pencil icon next to the operator be sure to select New formula. With kind regards, Mike On 15 May 2012 12:27, zeeshan khan zeeshan.spr...@gmail.com wrote: Hi Team ! Earlier I sent this mail to rules-...@lists.jboss.org. Mark Proctor asked me to mail here so I am mailing here in the hope of reply. Since yesterday only I started learning Drools with the help of Google and *JBOSS DROOLS BUSINESS RULES pdf file*. I faced many problems to understand the concept but now its going smooth. But the problem is the *version of PDF file of the book* and the *Govener version *. *Its quite different*. I request you all to please provide me the latest version of PDF as I am unable to find on net. The problem I am facing is to put the formula as given in the screen shot in the book. I am unable to put the *formula* as described in JBOSS DROOLS BUSINESS RULES pdf file on page no. 102.the formula is *salesValue-10 as the box is not capable of taking cahracters. *It is taking only integer. Thanks in Advance for all the help and material ___ 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 -- Best Regards, *Zeeshan Khan* *Liferay Java Developer* *IBEXI Solutions India* ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] can't put formula on Guvnor screen
I tested formula with 5.4 and it works as I defined. What version of Guvnor are you using? On 15 May 2012 13:34, zeeshan khan zeeshan.spr...@gmail.com wrote: *Hi Mike !!* * * *Thanks for the reply.its working fine in WHEN but not in THEN..* On Tue, May 15, 2012 at 5:06 PM, Michael Anstis michael.ans...@gmail.comwrote: The book, as Mark also said, is out of date compared to the current (5.4) version of Drools and Guvnor. I suspect you've elected to set the field's value to a literal rather than formula. Please try deleting the constraint and adding back. When clicking on the pencil icon next to the operator be sure to select New formula. With kind regards, Mike On 15 May 2012 12:27, zeeshan khan zeeshan.spr...@gmail.com wrote: Hi Team ! Earlier I sent this mail to rules-...@lists.jboss.org. Mark Proctor asked me to mail here so I am mailing here in the hope of reply. Since yesterday only I started learning Drools with the help of Google and *JBOSS DROOLS BUSINESS RULES pdf file*. I faced many problems to understand the concept but now its going smooth. But the problem is the *version of PDF file of the book* and the *Govener version*. *Its quite different*. I request you all to please provide me the latest version of PDF as I am unable to find on net. The problem I am facing is to put the formula as given in the screen shot in the book. I am unable to put the *formula* as described in JBOSS DROOLS BUSINESS RULES pdf file on page no. 102.the formula is *salesValue-10 as the box is not capable of taking cahracters. *It is taking only integer. Thanks in Advance for all the help and material ___ 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 -- Best Regards, *Zeeshan Khan* *Liferay Java Developer* *IBEXI Solutions India* ___ 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] can't put formula on Guvnor screen
*Hi Mike !!* * * *I am using 5.4 versionplease have a look to the screen shots attached.* the rounded box in the screenshot takes only numbers in the case of THENbut working fine in WHEN... so i tried by using *ADD FROM FREE DRL*(in the box 2), and this was working fine... thanks !! On Tue, May 15, 2012 at 6:06 PM, Michael Anstis michael.ans...@gmail.comwrote: I tested formula with 5.4 and it works as I defined. What version of Guvnor are you using? On 15 May 2012 13:34, zeeshan khan zeeshan.spr...@gmail.com wrote: *Hi Mike !!* * * *Thanks for the reply.its working fine in WHEN but not in THEN..* On Tue, May 15, 2012 at 5:06 PM, Michael Anstis michael.ans...@gmail.com wrote: The book, as Mark also said, is out of date compared to the current (5.4) version of Drools and Guvnor. I suspect you've elected to set the field's value to a literal rather than formula. Please try deleting the constraint and adding back. When clicking on the pencil icon next to the operator be sure to select New formula. With kind regards, Mike On 15 May 2012 12:27, zeeshan khan zeeshan.spr...@gmail.com wrote: Hi Team ! Earlier I sent this mail to rules-...@lists.jboss.org. Mark Proctor asked me to mail here so I am mailing here in the hope of reply. Since yesterday only I started learning Drools with the help of Google and *JBOSS DROOLS BUSINESS RULES pdf file*. I faced many problems to understand the concept but now its going smooth. But the problem is the *version of PDF file of the book* and the *Govener version*. *Its quite different*. I request you all to please provide me the latest version of PDF as I am unable to find on net. The problem I am facing is to put the formula as given in the screen shot in the book. I am unable to put the *formula* as described in JBOSS DROOLS BUSINESS RULES pdf file on page no. 102.the formula is *salesValue-10 as the box is not capable of taking cahracters. *It is taking only integer. Thanks in Advance for all the help and material ___ 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 -- Best Regards, *Zeeshan Khan* *Liferay Java Developer* *IBEXI Solutions India* ___ 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 -- Best Regards, *Zeeshan Khan* *Liferay Java Developer* *IBEXI Solutions India* ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] Killing a session
Hi there, Is there any way to kill a running session? I've been trying with StatefulKnowledgeSession.abortProcessInstance but i can't get it working. For instance .. I got this drl rule infinite loop when x : Integer() then System.out.println(x); Thread.sleep(100); insert(x + 1); end n' this Thread public class SessionThread implements Runnable { private StatefulKnowledgeSession session; public SessionThread(StatefulKnowledgeSession session) { this.session = session; } public void run() { session.fireAllRules(); } } then i create a session with the drl n' do something like ... session.insert(42); Thread thread = new Thread(new SessionThread(session)); thread.start(); Thread.sleep(1000); session.abortProcessInstance(thread.getId()); I've tried diff processInstanceIds and session.getProcessInstances() but nothing seems to stop the running session Thank you Mike ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] [rules-users] The Temporal Operators in Guvnor
Hi all I have a new question. How can I define a Temporal Operators in GUVNOR? I need to do something like this: DoorOpeningEvent( this meets[25s] $obs ) thank you and kindly regards! Carolina Pellecchia ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Killing a session
You are confusing jBPM processes and Java threads. You can interrupt the thread SessionThread, but that's not reliable (if IE is handled, for instance), Best would be to call fireUntilHalt() and call the session's halt method. But why would you want to do this sort of weird thing? -W On 15/05/2012, mike mike...@gmail.com wrote: Hi there, Is there any way to kill a running session? I've been trying with StatefulKnowledgeSession.abortProcessInstance but i can't get it working. For instance .. I got this drl rule infinite loop when x : Integer() then System.out.println(x); Thread.sleep(100); insert(x + 1); end n' this Thread public class SessionThread implements Runnable { private StatefulKnowledgeSession session; public SessionThread(StatefulKnowledgeSession session) { this.session = session; } public void run() { session.fireAllRules(); } } then i create a session with the drl n' do something like ... session.insert(42); Thread thread = new Thread(new SessionThread(session)); thread.start(); Thread.sleep(1000); session.abortProcessInstance(thread.getId()); I've tried diff processInstanceIds and session.getProcessInstances() but nothing seems to stop the running session Thank you Mike ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Killing a session
Awesome I'll try that :) We got business ppl writing rules ... Those rules are going on infinite loops quite often ... Frankly I am not excited about killing the session, for me it's just a business request that I am trying to implement Thank you very much Wolfgang Cheers Mike On Tue, May 15, 2012 at 10:53 AM, Wolfgang Laun wolfgang.l...@gmail.comwrote: You are confusing jBPM processes and Java threads. You can interrupt the thread SessionThread, but that's not reliable (if IE is handled, for instance), Best would be to call fireUntilHalt() and call the session's halt method. But why would you want to do this sort of weird thing? -W On 15/05/2012, mike mike...@gmail.com wrote: Hi there, Is there any way to kill a running session? I've been trying with StatefulKnowledgeSession.abortProcessInstance but i can't get it working. For instance .. I got this drl rule infinite loop when x : Integer() then System.out.println(x); Thread.sleep(100); insert(x + 1); end n' this Thread public class SessionThread implements Runnable { private StatefulKnowledgeSession session; public SessionThread(StatefulKnowledgeSession session) { this.session = session; } public void run() { session.fireAllRules(); } } then i create a session with the drl n' do something like ... session.insert(42); Thread thread = new Thread(new SessionThread(session)); thread.start(); Thread.sleep(1000); session.abortProcessInstance(thread.getId()); I've tried diff processInstanceIds and session.getProcessInstances() but nothing seems to stop the running session Thank you Mike ___ 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] Killing a session
wow that worked like a charm!!! thank you very much Wolfgang, I owe u a beer or something :) Cheers Mike On Tue, May 15, 2012 at 11:01 AM, mike mike...@gmail.com wrote: Awesome I'll try that :) We got business ppl writing rules ... Those rules are going on infinite loops quite often ... Frankly I am not excited about killing the session, for me it's just a business request that I am trying to implement Thank you very much Wolfgang Cheers Mike On Tue, May 15, 2012 at 10:53 AM, Wolfgang Laun wolfgang.l...@gmail.comwrote: You are confusing jBPM processes and Java threads. You can interrupt the thread SessionThread, but that's not reliable (if IE is handled, for instance), Best would be to call fireUntilHalt() and call the session's halt method. But why would you want to do this sort of weird thing? -W On 15/05/2012, mike mike...@gmail.com wrote: Hi there, Is there any way to kill a running session? I've been trying with StatefulKnowledgeSession.abortProcessInstance but i can't get it working. For instance .. I got this drl rule infinite loop when x : Integer() then System.out.println(x); Thread.sleep(100); insert(x + 1); end n' this Thread public class SessionThread implements Runnable { private StatefulKnowledgeSession session; public SessionThread(StatefulKnowledgeSession session) { this.session = session; } public void run() { session.fireAllRules(); } } then i create a session with the drl n' do something like ... session.insert(42); Thread thread = new Thread(new SessionThread(session)); thread.start(); Thread.sleep(1000); session.abortProcessInstance(thread.getId()); I've tried diff processInstanceIds and session.getProcessInstances() but nothing seems to stop the running session Thank you Mike ___ 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] [rules-users] The Temporal Operators in Guvnor
IIRC with 5.2 onwards, yes (definitely 5.3 onwards). You don't as such define temporal operators, but you can use those provided by Drools Fusion (CEP). If using a POJO model make sure you have completed the necessary steps to expose it as an Event, as covered in the documentation. If using a declarative model, make sure you have annotated it accordingly, as covered in the documentation. With kind regards, Mike On 15 May 2012 15:58, Carolina Pellecchia carolina.pellecc...@gmail.comwrote: Hi all I have a new question. How can I define a Temporal Operators in GUVNOR? I need to do something like this: DoorOpeningEvent( this meets[25s] $obs ) thank you and kindly regards! Carolina Pellecchia ___ 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] Problem with Drools Eclipse
Hello Everybody! I've just installed on eclipse Indigo Version: 3.7.2, the Drools 5.4.0 fianl. After I wanted to create a simple Drools projet but I've got this error: No Drools Runtimes have been defined, configure workspace settings first. Please can somebody tell me what's wrong? Thanks -- View this message in context: http://drools.46999.n3.nabble.com/Problem-with-Drools-Eclipse-tp3988261.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] Killing a session
Well I got this wrong sorry. Yes I can stop a session if I start it with fireUntilHalt() but it never stops. I need it to finish by itself too. Thank you Mike On Tue, May 15, 2012 at 11:06 AM, mike mike...@gmail.com wrote: wow that worked like a charm!!! thank you very much Wolfgang, I owe u a beer or something :) Cheers Mike On Tue, May 15, 2012 at 11:01 AM, mike mike...@gmail.com wrote: Awesome I'll try that :) We got business ppl writing rules ... Those rules are going on infinite loops quite often ... Frankly I am not excited about killing the session, for me it's just a business request that I am trying to implement Thank you very much Wolfgang Cheers Mike On Tue, May 15, 2012 at 10:53 AM, Wolfgang Laun wolfgang.l...@gmail.comwrote: You are confusing jBPM processes and Java threads. You can interrupt the thread SessionThread, but that's not reliable (if IE is handled, for instance), Best would be to call fireUntilHalt() and call the session's halt method. But why would you want to do this sort of weird thing? -W On 15/05/2012, mike mike...@gmail.com wrote: Hi there, Is there any way to kill a running session? I've been trying with StatefulKnowledgeSession.abortProcessInstance but i can't get it working. For instance .. I got this drl rule infinite loop when x : Integer() then System.out.println(x); Thread.sleep(100); insert(x + 1); end n' this Thread public class SessionThread implements Runnable { private StatefulKnowledgeSession session; public SessionThread(StatefulKnowledgeSession session) { this.session = session; } public void run() { session.fireAllRules(); } } then i create a session with the drl n' do something like ... session.insert(42); Thread thread = new Thread(new SessionThread(session)); thread.start(); Thread.sleep(1000); session.abortProcessInstance(thread.getId()); I've tried diff processInstanceIds and session.getProcessInstances() but nothing seems to stop the running session Thank you Mike ___ 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] Killing a session
A very low salience rule depending on nothing and calling halt will stop the run: rule Exit salience -9 when then drools.halt(); end -W On 15 May 2012 21:46, mike mike...@gmail.com wrote: Well I got this wrong sorry. Yes I can stop a session if I start it with fireUntilHalt() but it never stops. I need it to finish by itself too. Thank you Mike On Tue, May 15, 2012 at 11:06 AM, mike mike...@gmail.com wrote: wow that worked like a charm!!! thank you very much Wolfgang, I owe u a beer or something :) Cheers Mike On Tue, May 15, 2012 at 11:01 AM, mike mike...@gmail.com wrote: Awesome I'll try that :) We got business ppl writing rules ... Those rules are going on infinite loops quite often ... Frankly I am not excited about killing the session, for me it's just a business request that I am trying to implement Thank you very much Wolfgang Cheers Mike On Tue, May 15, 2012 at 10:53 AM, Wolfgang Laun wolfgang.l...@gmail.com wrote: You are confusing jBPM processes and Java threads. You can interrupt the thread SessionThread, but that's not reliable (if IE is handled, for instance), Best would be to call fireUntilHalt() and call the session's halt method. But why would you want to do this sort of weird thing? -W On 15/05/2012, mike mike...@gmail.com wrote: Hi there, Is there any way to kill a running session? I've been trying with StatefulKnowledgeSession.abortProcessInstance but i can't get it working. For instance .. I got this drl rule infinite loop when x : Integer() then System.out.println(x); Thread.sleep(100); insert(x + 1); end n' this Thread public class SessionThread implements Runnable { private StatefulKnowledgeSession session; public SessionThread(StatefulKnowledgeSession session) { this.session = session; } public void run() { session.fireAllRules(); } } then i create a session with the drl n' do something like ... session.insert(42); Thread thread = new Thread(new SessionThread(session)); thread.start(); Thread.sleep(1000); session.abortProcessInstance(thread.getId()); I've tried diff processInstanceIds and session.getProcessInstances() but nothing seems to stop the running session Thank you Mike ___ 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] Killing a session
that's nice ... n' a bit clever ... it could work ... I mean, i could automatically append that to all sessions given that i control compiling the drls. Is there any setting or something that detects infinite loops? Like it would abort if if drools runs into an infinite loop? I guess I could do something with fireAllRules(int max) but figuring out a reasonable max would be fuzzy. I could also use the no-loop attribute but it would not pick up some cases of infinite loops. Thank you very much for you help Cheers Mike On Tue, May 15, 2012 at 3:55 PM, Wolfgang Laun wolfgang.l...@gmail.comwrote: A very low salience rule depending on nothing and calling halt will stop the run: rule Exit salience -9 when then drools.halt(); end -W On 15 May 2012 21:46, mike mike...@gmail.com wrote: Well I got this wrong sorry. Yes I can stop a session if I start it with fireUntilHalt() but it never stops. I need it to finish by itself too. Thank you Mike On Tue, May 15, 2012 at 11:06 AM, mike mike...@gmail.com wrote: wow that worked like a charm!!! thank you very much Wolfgang, I owe u a beer or something :) Cheers Mike On Tue, May 15, 2012 at 11:01 AM, mike mike...@gmail.com wrote: Awesome I'll try that :) We got business ppl writing rules ... Those rules are going on infinite loops quite often ... Frankly I am not excited about killing the session, for me it's just a business request that I am trying to implement Thank you very much Wolfgang Cheers Mike On Tue, May 15, 2012 at 10:53 AM, Wolfgang Laun wolfgang.l...@gmail.com wrote: You are confusing jBPM processes and Java threads. You can interrupt the thread SessionThread, but that's not reliable (if IE is handled, for instance), Best would be to call fireUntilHalt() and call the session's halt method. But why would you want to do this sort of weird thing? -W On 15/05/2012, mike mike...@gmail.com wrote: Hi there, Is there any way to kill a running session? I've been trying with StatefulKnowledgeSession.abortProcessInstance but i can't get it working. For instance .. I got this drl rule infinite loop when x : Integer() then System.out.println(x); Thread.sleep(100); insert(x + 1); end n' this Thread public class SessionThread implements Runnable { private StatefulKnowledgeSession session; public SessionThread(StatefulKnowledgeSession session) { this.session = session; } public void run() { session.fireAllRules(); } } then i create a session with the drl n' do something like ... session.insert(42); Thread thread = new Thread(new SessionThread(session)); thread.start(); Thread.sleep(1000); session.abortProcessInstance(thread.getId()); I've tried diff processInstanceIds and session.getProcessInstances() but nothing seems to stop the running session Thank you Mike ___ 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 ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] Issue while comparing BigDecimal and Long(only while using references)
Hi, I cam to know that we can compare BigDecimal, Long, Integer interchangeably in the LHS of rule like *when Message(Decimalstatus == Longstatus)* I found that this rule will fire as long as both Decimalstatus and Longstatus Values are same. But when I try to use this feature in the below mentioned way *when Message($dec:Decimalstatus) Message(longstatus == $dec)* This rule doesn't fire even though I have two Message object which satisfy the condition.However, when I try * when Message($dec:Decimalstatus) Message(longstatus == $dec.longValue())* It fires properly. Is this an issue or am I missing anything? Any suggestions for better approach are welcome.Thanks in advance. -- cheers Sumatheja Dasararaju ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Somewhat strange question: Rules without a RHS
On 05/15/2012 07:24 PM, Wolfgang Laun wrote: Assuming you can get hold of the resulting DRL text, a simple script might detect rules where there is nothing between then and end. I have currently implemented something similar. A REST client that periodically scans the BRLs in certain Guvnor packages and fills out missing RHS. Problem is that the users try to test their broken rules faster than this script can fix them :-/ Otherwise, following the techniques used in the Guvnor's validator, you can investigate the consequence text and use heuristics to detect the bad ones. I was looking for exactly that: an option to replace or inject custom extensions to what you refer to as Guvnor's validator. But I must admit that I was not able to find any pointer to this in the doc or the Guvnor source. Can you point me to the place in the Guvnor source where that validation actually happens? I might then be able to develop some ideas. -- CU, Joe ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Guvnor REST API and XLS decision tables
anchi wrote: Thanks for your reply. Things are clearer now! For some reason I expected inverse behavior for /binary and /source, but now you've made it clear. I have tried your advice to open a file returned from REST /source with Excel. After renaming it (adding a proper file extension), Excel is not able to open it, i.e. a file I get from Guvnor is corrupted which causes kbuilder exceptions. Hi how did you put this XLS file into Guvnor in the first place? Through REST interface or through Guvnor UI? You can verify if the XLS is corrupted in the repository by downloading it through Guvnor UI. If it is corrupted as well, then probably sth went wrong when you uploaded the file. Cheers, Jervis -- View this message in context: http://drools.46999.n3.nabble.com/Guvnor-REST-API-and-XLS-decision-tables-tp3985574p3987808.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] Challenge! Using javassist and drools presents an issue with drl
Folks, It's a burning issue for me, I would appreciate if someone can help me solving it. -- View this message in context: http://drools.46999.n3.nabble.com/Challenge-Using-javassist-and-drools-presents-an-issue-with-drl-tp763086p3994285.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] can't put formula on Guvnor screen
*wo Mike.I can't believe it.its been only two days I have started digging around Drools and found a bugIt would be great if I can help this community in any ways... by the way MikeI am desperately waiting for my prize ;-)* On Tue, May 15, 2012 at 6:38 PM, Michael Anstis michael.ans...@gmail.comwrote: Congratulations :) You win the prize for finding (possibly) the first bug in 5.4. Using free-format DRL is, as you've found, a work-around. Can you please raise a bug at https://issues.jboss.org/browse/GUVNOR and I'll fix as soon as possible. With kind regards, Mike On 15 May 2012 13:51, zeeshan khan zeeshan.spr...@gmail.com wrote: *sorry forgot to attach the fileplease find it again...* On Tue, May 15, 2012 at 6:19 PM, zeeshan khan zeeshan.spr...@gmail.comwrote: *Hi Mike !!* * * *I am using 5.4 versionplease have a look to the screen shots attached.* the rounded box in the screenshot takes only numbers in the case of THENbut working fine in WHEN... so i tried by using *ADD FROM FREE DRL*(in the box 2), and this was working fine... thanks !! On Tue, May 15, 2012 at 6:06 PM, Michael Anstis michael.ans...@gmail.com wrote: I tested formula with 5.4 and it works as I defined. What version of Guvnor are you using? On 15 May 2012 13:34, zeeshan khan zeeshan.spr...@gmail.com wrote: *Hi Mike !!* * * *Thanks for the reply.its working fine in WHEN but not in THEN..* On Tue, May 15, 2012 at 5:06 PM, Michael Anstis michael.ans...@gmail.com wrote: The book, as Mark also said, is out of date compared to the current (5.4) version of Drools and Guvnor. I suspect you've elected to set the field's value to a literal rather than formula. Please try deleting the constraint and adding back. When clicking on the pencil icon next to the operator be sure to select New formula. With kind regards, Mike On 15 May 2012 12:27, zeeshan khan zeeshan.spr...@gmail.com wrote: Hi Team ! Earlier I sent this mail to rules-...@lists.jboss.org. Mark Proctor asked me to mail here so I am mailing here in the hope of reply. Since yesterday only I started learning Drools with the help of Google and *JBOSS DROOLS BUSINESS RULES pdf file*. I faced many problems to understand the concept but now its going smooth. But the problem is the *version of PDF file of the book* and the *Govener version*. *Its quite different*. I request you all to please provide me the latest version of PDF as I am unable to find on net. The problem I am facing is to put the formula as given in the screen shot in the book. I am unable to put the *formula* as described in JBOSS DROOLS BUSINESS RULES pdf file on page no. 102.the formula is *salesValue-10 as the box is not capable of taking cahracters. *It is taking only integer. Thanks in Advance for all the help and material ___ 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 -- Best Regards, *Zeeshan Khan* *Liferay Java Developer* *IBEXI Solutions India* ___ 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 -- Best Regards, *Zeeshan Khan* *Liferay Java Developer* *IBEXI Solutions India* -- Best Regards, *Zeeshan Khan* *Liferay Java Developer* *IBEXI Solutions India* ___ 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 -- Best Regards, *Zeeshan Khan* *Liferay Java Developer* *IBEXI Solutions India* ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] can't put formula on Guvnor screen
*wo Mike.I can't believe it.its been only two days I have started digging around Drools and found a bugIt would be great if I can help this community in any ways... by the way MikeI am desperately waiting for my prize ;-)* *On Tue, May 15, 2012 at 6:38 PM, Michael Anstis michael.ans...@gmail.comwrote: * *Congratulations :) You win the prize for finding (possibly) the first bug in 5.4. Using free-format DRL is, as you've found, a work-around. Can you please raise a bug at https://issues.jboss.org/browse/GUVNOR and I'll fix as soon as possible. With kind regards, Mike* On 15 May 2012 13:51, zeeshan khan zeeshan.spr...@gmail.com wrote: *sorry forgot to attach the fileplease find it again...* On Tue, May 15, 2012 at 6:19 PM, zeeshan khan zeeshan.spr...@gmail.comwrote: *Hi Mike !!* * * *I am using 5.4 versionplease have a look to the screen shots attached.* the rounded box in the screenshot takes only numbers in the case of THENbut working fine in WHEN... so i tried by using *ADD FROM FREE DRL*(in the box 2), and this was working fine... thanks !! On Tue, May 15, 2012 at 6:06 PM, Michael Anstis michael.ans...@gmail.com wrote: I tested formula with 5.4 and it works as I defined. What version of Guvnor are you using? On 15 May 2012 13:34, zeeshan khan zeeshan.spr...@gmail.com wrote: *Hi Mike !!* * * *Thanks for the reply.its working fine in WHEN but not in THEN..* On Tue, May 15, 2012 at 5:06 PM, Michael Anstis michael.ans...@gmail.com wrote: The book, as Mark also said, is out of date compared to the current (5.4) version of Drools and Guvnor. I suspect you've elected to set the field's value to a literal rather than formula. Please try deleting the constraint and adding back. When clicking on the pencil icon next to the operator be sure to select New formula. With kind regards, Mike On 15 May 2012 12:27, zeeshan khan zeeshan.spr...@gmail.com wrote: Hi Team ! Earlier I sent this mail to rules-...@lists.jboss.org. Mark Proctor asked me to mail here so I am mailing here in the hope of reply. Since yesterday only I started learning Drools with the help of Google and *JBOSS DROOLS BUSINESS RULES pdf file*. I faced many problems to understand the concept but now its going smooth. But the problem is the *version of PDF file of the book* and the *Govener version*. *Its quite different*. I request you all to please provide me the latest version of PDF as I am unable to find on net. The problem I am facing is to put the formula as given in the screen shot in the book. I am unable to put the *formula* as described in JBOSS DROOLS BUSINESS RULES pdf file on page no. 102.the formula is *salesValue-10 as the box is not capable of taking cahracters. *It is taking only integer. Thanks in Advance for all the help and material ___ 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 -- Best Regards, *Zeeshan Khan* *Liferay Java Developer* *IBEXI Solutions India* ___ 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 ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users -- Best Regards, *Zeeshan Khan* *Liferay Java Developer* *IBEXI Solutions India* ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users