Re: [rules-users] Drools/Camel Integration sending messages
here it is: my route: code route from uri=activemq:personnel.records/ policy ref=droolsPolicy unmarshal ref=myjaxb/ to uri=drools:node1/ksession1?action=insertExchange/ routingSlip uriDelimiter=# headerroutingSlip/header /routingSlip log loggingLevel=INFO message=Message Received in Drools/ marshal ref=myjaxb/ to uri=file:target/messages/foo/ log loggingLevel=INFO message=Message received at fileendpoint/ /policy /route /code and now the rule, which works: code rule Rule 04 dialect mvel when $exchange: Exchange() eval($exchange.in.body instanceof Person ) then $p = (Person)$exchange.in.body; $exchange.in.setHeader(routingSlip,file:target/messages/hello); System.out.println(Rule 04 Works + $p.user); end /code but i want to do something like: code #$message = new JmsMessage();/doesnt work: cannot Resolve Constructor $message = $exchange.copy(); $neu = new Person(); $neu.firstname = I; $message.in.body = $neu; $message.in.setHeader(routingSlip,file:target/messages/bar); /code -- View this message in context: http://drools.46999.n3.nabble.com/Drools-Camel-Integration-sending-messages-tp3043844p3047520.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] Terminating service threads
Wolfgang Laun wolfgang.laun at gmail.com writes: Both ResourceChange... classes have a stop() method which ought to terminate the threads.-W 2011/6/9 Manuel Ortiz manuel.ortizramos at gmail.comHello everybody: I have a Drools based application which instantiates KnowledgeAgent and ResourceChangeNotifier and ResourceChangeScanner services, and see in Eclipse Debug Tab that these classes run three threads. When my own threads end, including main thread, these three threads keep running. How can I terminate these threads? Thank you very much in advance for your time. Kind regards, Manuel Ortiz. ___ rules-users mailing listrules-users at lists.jboss.orghttps://lists.jboss.org/mailman/listinfo/rules-users ___ rules-users mailing list rules-users at lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users Dear Wolfgang: Thank you for your quick answer. I've tried ResourceChange...stop() method in the finalize() method of the context class that instantiates the rule engine classes, but threads doesn't stop. Maybe I'm not using the method correctly. Can you tell me something about terminating KnowledgeAgentImpl$ChangeSetNotificationDetector.run(), which seems a thread related to KnowledgeAgent? Thank you again for your time. Kind regards, Manuel Ortiz. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Terminating service threads
Manuel Ortiz manuel.ortizramos at gmail.com writes: Wolfgang Laun wolfgang.laun at gmail.com writes: Both ResourceChange... classes have a stop() method which ought to terminate the threads.-W 2011/6/9 Manuel Ortiz manuel.ortizramos at gmail.comHello everybody: I have a Drools based application which instantiates KnowledgeAgent and ResourceChangeNotifier and ResourceChangeScanner services, and see in Eclipse Debug Tab that these classes run three threads. When my own threads end, including main thread, these three threads keep running. How can I terminate these threads? Thank you very much in advance for your time. Kind regards, Manuel Ortiz. ___ rules-users mailing listrules-users at lists.jboss.orghttps://lists.jboss.org/mailman/listinfo/rules-users Dear Wolfgang: Finally I found the way to make these methods work, and the way to start/stop ChangeSetNotificationDetector. Thank you again for your help. Best regards, Manuel Ortiz. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] Custom-Operator - No access to FactHandles?
Hello, some of our custom operators need to access already inserted facts at runtime. Therefore we extended org.drools.base.BaseEvaluator. The provide methods, i. e. public boolean evaluate(InternalWorkingMemory workingMemory, InternalReadAccessor extractor, Object object, FieldValue value), state, amongst others, a parameter workingMemory of type org.drools.common.InternalWorkingMemory. When calling workingMemory.getObjects() we receive a UnsupportedOperationException. The question is whether it is possible to access facts in a KnwoledgeSession at runtime or not. Alternatively we could provide the objects in question as globals and call workingMemory.getGlobal(), but that seems to me like somewhat bad architecture. Any suggestions are welcome. Many thanks, -Matthias ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Custom-Operator - No access to FactHandles?
Title: CARTE DE VISITE And why not accessing the object itself directly ? Because the evaluation of one object field depends on others objects in WM ? Le 10/06/2011 11:54, Martin, Matthias a crit: Hello, some of our custom operators need to access already inserted facts at runtime. Therefore we extended org.drools.base.BaseEvaluator. The provide methods, i. e. public boolean evaluate(InternalWorkingMemory workingMemory, InternalReadAccessor extractor, Object object, FieldValue value), state, amongst others, a parameter workingMemory of type org.drools.common.InternalWorkingMemory. When calling workingMemory.getObjects() we receive a UnsupportedOperationException. The question is whether it is possible to access facts in a KnwoledgeSession at runtime or not. Alternatively we could provide the objects in question as globals and call workingMemory.getGlobal(), but that seems to me like somewhat bad architecture. Any suggestions are welcome. Many thanks, -Matthias ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users -- Vincent LEGENDRE Consultant Snior EURODECISION 9A rue de la Porte de Buc 78000 VERSAILLES Tl. : +33 (0)1 39 07 12 40 Direct : +33 (0)1 39 07 26 16 www.eurodecision.com ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Custom-Operator - No access to FactHandles?
Exactly! I need to iterate over a bunch of objects/facts in the Working Memory. Von: rules-users-boun...@lists.jboss.org [mailto:rules-users-boun...@lists.jboss.org] Im Auftrag von Vincent Legendre Gesendet: Freitag, 10. Juni 2011 12:04 An: Rules Users List Betreff: Re: [rules-users] Custom-Operator - No access to FactHandles? And why not accessing the object itself directly ? Because the evaluation of one object field depends on others objects in WM ? Le 10/06/2011 11:54, Martin, Matthias a écrit : Hello, some of our custom operators need to access already inserted facts at runtime. Therefore we extended org.drools.base.BaseEvaluator. The provide methods, i. e. public boolean evaluate(InternalWorkingMemory workingMemory, InternalReadAccessor extractor, Object object, FieldValue value), state, amongst others, a parameter workingMemory of type org.drools.common.InternalWorkingMemory. When calling workingMemory.getObjects() we receive a UnsupportedOperationException. The question is whether it is possible to access facts in a KnwoledgeSession at runtime or not. Alternatively we could provide the objects in question as globals and call workingMemory.getGlobal(), but that seems to me like somewhat bad architecture. Any suggestions are welcome. Many thanks, -Matthias ___ rules-users mailing list rules-users@lists.jboss.orgmailto:rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users -- Vincent LEGENDRE Consultant Sénior EURODECISION 9A rue de la Porte de Buc 78000 VERSAILLES Tél. : +33 (0)1 39 07 12 40 Direct : +33 (0)1 39 07 26 16 www.eurodecision.com [cid:image001.gif@01CC276B.CDDE3EA0]http://www.eurodecision.com/ inline: image001.gif___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] ERR 101 102 When parsing Decision Table xls
Hey all, I'm new to Drools, and trying to use decision tables. Only I got some errors I don't understand Description ResourcePathLocationType [ERR 101] Line 15:87 no viable alternative at input 'false' in rule Pricing bracket_11 in pattern Person CheckAccepted.xls /DroolzBeslis/src/main/rules line 15 Drools Error [ERR 101] Line 23:115 no viable alternative at input 'false' in rule Pricing bracket_12 in pattern Person CheckAccepted.xls /DroolzBeslis/src/main/rulesline 23 Drools Error [ERR 101] Line 31:123 no viable alternative at input 'true' in rule Pricing bracket_13 in pattern Person CheckAccepted.xls /DroolzBeslis/src/main/rules line 31 Drools Error [ERR 101] Line 7:58 no viable alternative at input 'false' in rule Pricing bracket_10 in pattern Person CheckAccepted.xls /DroolzBeslis/src/main/rules line 7 Drools Error [ERR 102] Line 15:93 mismatched input ';' expecting ')' in rule Pricing bracket_11 in pattern Person CheckAccepted.xls /DroolzBeslis/src/main/rules line 15 Drools Error [ERR 102] Line 15:94 mismatched input ',' expecting 'then' in rule Pricing bracket_11 CheckAccepted.xls /DroolzBeslis/src/main/rulesline 15 Drools Error [ERR 102] Line 23:121 mismatched input ';' expecting ')' in rule Pricing bracket_12 in pattern Person CheckAccepted.xls /DroolzBeslis/src/main/rules line 23 Drools Error [ERR 102] Line 23:122 mismatched input ',' expecting 'then' in rule Pricing bracket_12 CheckAccepted.xls /DroolzBeslis/src/main/rulesline 23 Drools Error [ERR 102] Line 31:128 mismatched input ';' expecting ')' in rule Pricing bracket_13 in pattern Person CheckAccepted.xls /DroolzBeslis/src/main/rules line 31 Drools Error [ERR 102] Line 31:129 mismatched input ',' expecting 'then' in rule Pricing bracket_13 CheckAccepted.xls /DroolzBeslis/src/main/rulesline 31 Drools Error [ERR 102] Line 7:64 mismatched input ';' expecting ')' in rule Pricing bracket_10 in pattern Person CheckAccepted.xls /DroolzBeslis/src/main/rules line 7 Drools Error [ERR 102] Line 7:65 mismatched input ',' expecting 'then' in rule Pricing bracket_10 CheckAccepted.xls /DroolzBeslis/src/main/rulesline 7 Drools Error Unknown error while parsing. This is a bug. Please contact the Development team. CheckAccepted.xls /DroolzBeslis/src/main/rulesUnknown Drools Error I also attached the XLS, someone any idea? http://drools.46999.n3.nabble.com/file/n3048185/CheckAccepted.xls CheckAccepted.xls -- View this message in context: http://drools.46999.n3.nabble.com/ERR-101-102-When-parsing-Decision-Table-xls-tp3048185p3048185.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] operator question
Hi all, This might seem overly simple but can I use the + and - operators in a Condition in a spreadsheet? I feel i'll need to import something, and I've tried creating an add method in my factmodel java class, but i can't seem to use it. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] operator question
Please describe the problem, accuretely. -W 2011/6/10 Jon Gil jonsprogrammingem...@gmail.com Hi all, This might seem overly simple but can I use the + and - operators in a Condition in a spreadsheet? I feel i'll need to import something, and I've tried creating an add method in my factmodel java class, but i can't seem to use it. ___ 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] operator question
I want my condition to be (Year1 - Year2) $param 2011/6/10 Wolfgang Laun wolfgang.l...@gmail.com Please describe the problem, accuretely. -W 2011/6/10 Jon Gil jonsprogrammingem...@gmail.com Hi all, This might seem overly simple but can I use the + and - operators in a Condition in a spreadsheet? I feel i'll need to import something, and I've tried creating an add method in my factmodel java class, but i can't seem to use it. ___ 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] operator question
more specifically RuleTableCondition Action $a:OOPVehicle (redbookYear - vehicleYear) $param System.out.println($param); 50 reducing Redbook Value by 50 years 20 reducing Redbook Value by 20 years 5 reducing Redbook Value by 5 years On Fri, Jun 10, 2011 at 9:39 AM, Jon Gil jonsprogrammingem...@gmail.comwrote: I want my condition to be (Year1 - Year2) $param 2011/6/10 Wolfgang Laun wolfgang.l...@gmail.com Please describe the problem, accuretely. -W 2011/6/10 Jon Gil jonsprogrammingem...@gmail.com Hi all, This might seem overly simple but can I use the + and - operators in a Condition in a spreadsheet? I feel i'll need to import something, and I've tried creating an add method in my factmodel java class, but i can't seem to use it. ___ 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] ERR 101 102 When parsing Decision Table xls
The joined cells C7:G7 irritate the spreadsheet parser. Reduce this to C7:E7, i.e. the cells below CONDITION. -W On 10 June 2011 13:16, Sleepyhead dorland...@gmail.com wrote: Hey all, I'm new to Drools, and trying to use decision tables. Only I got some errors I don't understand Description ResourcePathLocationType [ERR 101] Line 15:87 no viable alternative at input 'false' in rule Pricing bracket_11 in pattern Person CheckAccepted.xls /DroolzBeslis/src/main/rules line 15 Drools Error [ERR 101] Line 23:115 no viable alternative at input 'false' in rule Pricing bracket_12 in pattern Person CheckAccepted.xls /DroolzBeslis/src/main/rulesline 23 Drools Error [ERR 101] Line 31:123 no viable alternative at input 'true' in rule Pricing bracket_13 in pattern Person CheckAccepted.xls /DroolzBeslis/src/main/rules line 31 Drools Error [ERR 101] Line 7:58 no viable alternative at input 'false' in rule Pricing bracket_10 in pattern Person CheckAccepted.xls /DroolzBeslis/src/main/rules line 7 Drools Error [ERR 102] Line 15:93 mismatched input ';' expecting ')' in rule Pricing bracket_11 in pattern Person CheckAccepted.xls /DroolzBeslis/src/main/rules line 15 Drools Error [ERR 102] Line 15:94 mismatched input ',' expecting 'then' in rule Pricing bracket_11 CheckAccepted.xls /DroolzBeslis/src/main/rules line 15 Drools Error [ERR 102] Line 23:121 mismatched input ';' expecting ')' in rule Pricing bracket_12 in pattern Person CheckAccepted.xls /DroolzBeslis/src/main/rules line 23 Drools Error [ERR 102] Line 23:122 mismatched input ',' expecting 'then' in rule Pricing bracket_12 CheckAccepted.xls /DroolzBeslis/src/main/rules line 23 Drools Error [ERR 102] Line 31:128 mismatched input ';' expecting ')' in rule Pricing bracket_13 in pattern Person CheckAccepted.xls /DroolzBeslis/src/main/rules line 31 Drools Error [ERR 102] Line 31:129 mismatched input ',' expecting 'then' in rule Pricing bracket_13 CheckAccepted.xls /DroolzBeslis/src/main/rules line 31 Drools Error [ERR 102] Line 7:64 mismatched input ';' expecting ')' in rule Pricing bracket_10 in pattern Person CheckAccepted.xls /DroolzBeslis/src/main/rules line 7 Drools Error [ERR 102] Line 7:65 mismatched input ',' expecting 'then' in rule Pricing bracket_10 CheckAccepted.xls /DroolzBeslis/src/main/rules line 7 Drools Error Unknown error while parsing. This is a bug. Please contact the Development team. CheckAccepted.xls /DroolzBeslis/src/main/rulesUnknown Drools Error I also attached the XLS, someone any idea? http://drools.46999.n3.nabble.com/file/n3048185/CheckAccepted.xls CheckAccepted.xls -- View this message in context: http://drools.46999.n3.nabble.com/ERR-101-102-When-parsing-Decision-Table-xls-tp3048185p3048185.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] operator question
Given that the left hand sign of the comparison must be a simple field reference and the right hand side a bracketed expression, employ simple equation transformattion techniques to arrive at redbookYear (vehicleYear) + $param) -W 2011/6/10 Jon Gil jonsprogrammingem...@gmail.com more specifically RuleTableCondition Action $a:OOPVehicle (redbookYear - vehicleYear) $param System.out.println($param); 50 reducing Redbook Value by 50 years 20 reducing Redbook Value by 20 years 5 reducing Redbook Value by 5 years On Fri, Jun 10, 2011 at 9:39 AM, Jon Gil jonsprogrammingem...@gmail.comwrote: I want my condition to be (Year1 - Year2) $param 2011/6/10 Wolfgang Laun wolfgang.l...@gmail.com Please describe the problem, accuretely. -W 2011/6/10 Jon Gil jonsprogrammingem...@gmail.com Hi all, This might seem overly simple but can I use the + and - operators in a Condition in a spreadsheet? I feel i'll need to import something, and I've tried creating an add method in my factmodel java class, but i can't seem to use it. ___ 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
Re: [rules-users] operator question
Which when i start the server drools is on produces: rg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'kbase5': Invocation of init method failed; nested exception is java.lang.RuntimeException: [12,30]: [ERR 101] Line 12:30 no viable alternative at input '-' in rule _13 in pattern OOPVehicle[23,30]: [ERR 101] Line 23:30 no viable alternative at input '-' in rule _14 in pattern OOPVehicle[34,30]: [ERR 101] Line 34:30 no viable alternative at input '-' in rule _15 in pattern OOPVehicle On Fri, Jun 10, 2011 at 9:48 AM, Jon Gil jonsprogrammingem...@gmail.comwrote: more specifically RuleTableCondition Action $a:OOPVehicle (redbookYear - vehicleYear) $param System.out.println($param); 50 reducing Redbook Value by 50 years 20 reducing Redbook Value by 20 years 5 reducing Redbook Value by 5 years On Fri, Jun 10, 2011 at 9:39 AM, Jon Gil jonsprogrammingem...@gmail.comwrote: I want my condition to be (Year1 - Year2) $param 2011/6/10 Wolfgang Laun wolfgang.l...@gmail.com Please describe the problem, accuretely. -W 2011/6/10 Jon Gil jonsprogrammingem...@gmail.com Hi all, This might seem overly simple but can I use the + and - operators in a Condition in a spreadsheet? I feel i'll need to import something, and I've tried creating an add method in my factmodel java class, but i can't seem to use it. ___ 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] operator question
Correction: redbookYear (vehicleYear + $param) On 10 June 2011 14:52, Wolfgang Laun wolfgang.l...@gmail.com wrote: Given that the left hand sign of the comparison must be a simple field reference and the right hand side a bracketed expression, employ simple equation transformattion techniques to arrive at redbookYear (vehicleYear) + $param) -W 2011/6/10 Jon Gil jonsprogrammingem...@gmail.com more specifically RuleTable Condition Action $a:OOPVehicle (redbookYear - vehicleYear) $param System.out.println($param); 50 reducing Redbook Value by 50 years 20 reducing Redbook Value by 20 years 5 reducing Redbook Value by 5 years On Fri, Jun 10, 2011 at 9:39 AM, Jon Gil jonsprogrammingem...@gmail.comwrote: I want my condition to be (Year1 - Year2) $param 2011/6/10 Wolfgang Laun wolfgang.l...@gmail.com Please describe the problem, accuretely. -W 2011/6/10 Jon Gil jonsprogrammingem...@gmail.com Hi all, This might seem overly simple but can I use the + and - operators in a Condition in a spreadsheet? I feel i'll need to import something, and I've tried creating an add method in my factmodel java class, but i can't seem to use it. ___ 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
Re: [rules-users] operator question
well, I'll be. I didn't know that. Thank you very much. 2011/6/10 Wolfgang Laun wolfgang.l...@gmail.com Correction: redbookYear (vehicleYear + $param) On 10 June 2011 14:52, Wolfgang Laun wolfgang.l...@gmail.com wrote: Given that the left hand sign of the comparison must be a simple field reference and the right hand side a bracketed expression, employ simple equation transformattion techniques to arrive at redbookYear (vehicleYear) + $param) -W 2011/6/10 Jon Gil jonsprogrammingem...@gmail.com more specifically RuleTableCondition Action $a:OOPVehicle (redbookYear - vehicleYear) $param System.out.println($param); 50 reducing Redbook Value by 50 years 20 reducing Redbook Value by 20 years 5 reducing Redbook Value by 5 years On Fri, Jun 10, 2011 at 9:39 AM, Jon Gil jonsprogrammingem...@gmail.com wrote: I want my condition to be (Year1 - Year2) $param 2011/6/10 Wolfgang Laun wolfgang.l...@gmail.com Please describe the problem, accuretely. -W 2011/6/10 Jon Gil jonsprogrammingem...@gmail.com Hi all, This might seem overly simple but can I use the + and - operators in a Condition in a spreadsheet? I feel i'll need to import something, and I've tried creating an add method in my factmodel java class, but i can't seem to use it. ___ 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 mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] ERR 101 102 When parsing Decision Table xls
Thx man! Was getting pretty pissed ... :P Only now I have a different problem when actually using the decision table: public RuleBase readDecisionTable() throws Exception { SpreadsheetCompiler converter = new SpreadsheetCompiler(); String drl = converter.compile(CheckAccepted.xls, InputType.XLS ); System.out.println(drl); PackageBuilder builder = new PackageBuilder(); builder.addPackageFromDrl( new StringReader( drl ) ); Package pkg = builder.getPackage(); RuleBase ruleBase = RuleBaseFactory.newRuleBase(); ruleBase.addPackage( pkg ); return ruleBase; } I get this error: http://drools.46999.n3.nabble.com/file/n3048581/Java_-_DroolzBeslissrcmainjavacomsampleTester.java_-_Eclipse_2011-06-10_15-09-27.png -- View this message in context: http://drools.46999.n3.nabble.com/ERR-101-102-When-parsing-Decision-Table-xls-tp3048185p3048581.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] Difference between drools:batch/ /drools:script ?
both can carry command tags, so if i´m going to declare set-global tags , is there any difference doing that in batch/script, do i have in both scenarios my global instances? like ksession batch set-global/ /batch /ksession vs. ksession /ksession -- View this message in context: http://drools.46999.n3.nabble.com/Difference-between-drools-batch-drools-script-tp3049213p3049213.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] Custom-Operator - No access to FactHandles?
I think there is a fundamental misunderstanding in the use you are trying to do with custom operators. Custom operators are supposed to be used to correlate 2 values, that may be lists, but not do search in the working memory, as that would be extremely inefficient. If you need to process sets of facts, then you probably need an accumulate function, not an operator... Can you clarify what kind of operator are you trying to implement? Edson 2011/6/10 Martin, Matthias mar...@adesso.de Exactly! I need to iterate over a bunch of objects/facts in the Working Memory. *Von:* rules-users-boun...@lists.jboss.org [mailto: rules-users-boun...@lists.jboss.org] *Im Auftrag von *Vincent Legendre *Gesendet:* Freitag, 10. Juni 2011 12:04 *An:* Rules Users List *Betreff:* Re: [rules-users] Custom-Operator - No access to FactHandles? And why not accessing the object itself directly ? Because the evaluation of one object field depends on others objects in WM ? Le 10/06/2011 11:54, Martin, Matthias a écrit : Hello, some of our custom operators need to access already inserted facts at runtime. Therefore we extended *org.drools.base.BaseEvaluator*. The provide methods, i. e. *public boolean evaluate(InternalWorkingMemory workingMemory, InternalReadAccessor extractor, Object object, FieldValue value)*, state, amongst others, a parameter “workingMemory” of type * org.drools.common.InternalWorkingMemory*. When calling *workingMemory.getObjects()* we receive a “UnsupportedOperationException”. The question is whether it is possible to access facts in a KnwoledgeSession at runtime or not. Alternatively we could provide the objects in question as globals and call workingMemory.getGlobal(), but that seems to me like somewhat bad architecture. Any suggestions are welcome. Many thanks, -Matthias ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users -- Vincent LEGENDRE *Consultant Sénior* EURODECISION 9A rue de la Porte de Buc 78000 VERSAILLES Tél. : +33 (0)1 39 07 12 40 Direct : +33 (0)1 39 07 26 16 www.eurodecision.com [image: EURODECISION] http://www.eurodecision.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 image001.gif___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] ERR 101 102 When parsing Decision Table xls
Looks as if this is only a warning. Does the DRL compile without error? Also, your code uses the old API. Try KnowledgeBuilder kBuilder = KnowledgeBuilderFactory.newKnowledgeBuilder(); DecisionTableConfiguration dtConf = KnowledgeBuilderFactory.newDecisionTableConfiguration(); dtConf.setInputType( DecisionTableInputType.XLS ); Resource resource = ResourceFactory.newClassPathResource( xlsPath, getClass() ); kBuilder.add( resource, ResourceType.DTABLE, dtConf ); if( kBuilder.hasErrors() ){ KnowledgeBuilderErrors errors = kBuilder.getErrors(); for( KnowledgeBuilderError err: errors ){ System.err.println( err.toString() ); } throw new IllegalStateException( build errors ); } Or, if you want to see the generated DRL, use the above (slightly modified) for the DRL, but do check for errors! -W On 10 June 2011 15:13, Sleepyhead dorland...@gmail.com wrote: Thx man! Was getting pretty pissed ... :P Only now I have a different problem when actually using the decision table: public RuleBase readDecisionTable() throws Exception { SpreadsheetCompiler converter = new SpreadsheetCompiler(); String drl = converter.compile(CheckAccepted.xls, InputType.XLS ); System.out.println(drl); PackageBuilder builder = new PackageBuilder(); builder.addPackageFromDrl( new StringReader( drl ) ); Package pkg = builder.getPackage(); RuleBase ruleBase = RuleBaseFactory.newRuleBase(); ruleBase.addPackage( pkg ); return ruleBase; } I get this error: http://drools.46999.n3.nabble.com/file/n3048581/Java_-_DroolzBeslissrcmainjavacomsampleTester.java_-_Eclipse_2011-06-10_15-09-27.png -- View this message in context: http://drools.46999.n3.nabble.com/ERR-101-102-When-parsing-Decision-Table-xls-tp3048185p3048581.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] Why is Drools called Drools?
This is something I get asked on a semi-regular basis and I don't have a good answer for it, so I thought I'd post it to the mailing list and hope someone can tell the story. Is there anyone out there who can explain how the name Drools was settled on? ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Why is Drools called Drools?
Hehe excellent question.. I think Mark has a good store about that! 2011/6/10 John Peterson john.peterson.g...@statefarm.com This is something I get asked on a semi-regular basis and I don’t have a good answer for it, so I thought I’d post it to the mailing list and hope someone can tell the story. Is there anyone out there who can explain how the name “Drools” was settled on? ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users -- - CTO @ http://www.plugtree.com - MyJourney @ http://salaboy.wordpress.com - Co-Founder @ http://www.jbug.com.ar - Salatino Salaboy Mauricio - ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users