[rules-users] Data type and Date format vlidation
Hi all, i have got some different situation. i need to validate data types in my drools rule. like need to find out that if a variable is integer or not etc. also need to check the date formats. like if the date format is like dd-mm-yy or dd-mm-. Thanks in advance :) -- View this message in context: http://drools.46999.n3.nabble.com/Data-type-and-Date-format-vlidation-tp3950113.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] Drools as a Webservice
Hi, I am new to the Drools , i wanted to expose rules as a webservice using Axis2. what i have done is that 1. I have created a drools Project (working fine on eclispe) export all files in jar 2. Placed the jar file in C:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps\axis2\WEB-INF\lib directory 3. Created a new Dynamic java project with axis2 facet.created a class with ** package in.abhi.ws; import java.math.BigDecimal; import org.drools.KnowledgeBase; import org.drools.KnowledgeBaseFactory; import org.drools.builder.KnowledgeBuilder; import org.drools.builder.KnowledgeBuilderError; import org.drools.builder.KnowledgeBuilderErrors; import org.drools.builder.KnowledgeBuilderFactory; import org.drools.builder.ResourceType; import org.drools.io.ResourceFactory; import org.drools.runtime.StatefulKnowledgeSession; import com.sample.SaleItem; public class Test { private static KnowledgeBase readKnowledgeBase() throws Exception { KnowledgeBuilder kbuilder = KnowledgeBuilderFactory .newKnowledgeBuilder(); kbuilder.add(ResourceFactory.newClassPathResource(KanasSalesTax.drl), ResourceType.DRL); KnowledgeBuilderErrors errors = kbuilder.getErrors(); if (errors.size() 0) { for (KnowledgeBuilderError error : errors) { System.err.println(error); } throw new IllegalArgumentException(Could not parse knowledge.); } KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase(); kbase.addKnowledgePackages(kbuilder.getKnowledgePackages()); return kbase; } public BigDecimal salesTax(String taxState, String typeItem) { BigDecimal taxCal = null; try { // load up the knowledge base KnowledgeBase kbase = readKnowledgeBase(); StatefulKnowledgeSession ksession = kbase .newStatefulKnowledgeSession(); // Non-prescription item // Expect $1.89 for the tax SaleItem item1 = new SaleItem(); item1.setPurchaseState(taxState); item1.setItemType(typeItem); item1.setSalesPrice(new BigDecimal(29.95)); ksession.insert(item1); ksession.fireAllRules(); taxCal = item1.getSalesTax(); System.out.println(item1.getPurchaseState().toString() + + item1.getItemType().toString() + : + item1.getSalesTax().toString()); } catch (Throwable t) { t.printStackTrace(); } return taxCal; } } ** 4. Then created a bottom up java bean webservice of it using the same above class. 5. Wsdl is generated i am getting the error response on eclispe console while testing by soap-ui ** java.lang.NullPointerException at org.drools.util.CompositeClassLoader.getResourceAsStream(CompositeClassLoader.java:122) at org.drools.commons.jci.compilers.EclipseJavaCompiler$2.findType(EclipseJavaCompiler.java:234) at org.drools.commons.jci.compilers.EclipseJavaCompiler$2.findType(EclipseJavaCompiler.java:215) at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.createPackage(LookupEnvironment.java:748) at org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.buildTypeBindings(CompilationUnitScope.java:87) at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.buildTypeBindings(LookupEnvironment.java:167) at org.eclipse.jdt.internal.compiler.Compiler.internalBeginToCompile(Compiler.java:721) at org.eclipse.jdt.internal.compiler.Compiler.beginToCompile(Compiler.java:381) at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:426) at org.drools.commons.jci.compilers.EclipseJavaCompiler.compile(EclipseJavaCompiler.java:358) at org.drools.commons.jci.compilers.AbstractJavaCompiler.compile(AbstractJavaCompiler.java:49) at org.drools.rule.builder.dialect.java.JavaDialect.compileAll(JavaDialect.java:369) at org.drools.compiler.DialectCompiletimeRegistry.compileAll(DialectCompiletimeRegistry.java:53) at org.drools.compiler.PackageRegistry.compileAll(PackageRegistry.java:71) at org.drools.compiler.PackageBuilder.compileAll(PackageBuilder.java:869) at org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:826) at org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:404)
Re: [rules-users] Drools as a Webservice
Alternatively, have you take a look at the drools-camel-server-example? http://docs.jboss.org/drools/release/5.4.0.CR1/droolsjbpm-integration-docs/html_single/index.html#d0e666 Op 30-04-12 10:13, abhinavgupta schreef: Hi, I am new to the Drools , i wanted to expose rules as a webservice using Axis2. what i have done is that 1. I have created a drools Project (working fine on eclispe) export all files in jar 2. Placed the jar file in C:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps\axis2\WEB-INF\lib directory 3. Created a new Dynamic java project with axis2 facet.created a class with ** package in.abhi.ws; import java.math.BigDecimal; import org.drools.KnowledgeBase; import org.drools.KnowledgeBaseFactory; import org.drools.builder.KnowledgeBuilder; import org.drools.builder.KnowledgeBuilderError; import org.drools.builder.KnowledgeBuilderErrors; import org.drools.builder.KnowledgeBuilderFactory; import org.drools.builder.ResourceType; import org.drools.io.ResourceFactory; import org.drools.runtime.StatefulKnowledgeSession; import com.sample.SaleItem; public class Test { private static KnowledgeBase readKnowledgeBase() throws Exception { KnowledgeBuilder kbuilder = KnowledgeBuilderFactory .newKnowledgeBuilder(); kbuilder.add(ResourceFactory.newClassPathResource(KanasSalesTax.drl), ResourceType.DRL); KnowledgeBuilderErrors errors = kbuilder.getErrors(); if (errors.size() 0) { for (KnowledgeBuilderError error : errors) { System.err.println(error); } throw new IllegalArgumentException(Could not parse knowledge.); } KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase(); kbase.addKnowledgePackages(kbuilder.getKnowledgePackages()); return kbase; } public BigDecimal salesTax(String taxState, String typeItem) { BigDecimal taxCal = null; try { // load up the knowledge base KnowledgeBase kbase = readKnowledgeBase(); StatefulKnowledgeSession ksession = kbase .newStatefulKnowledgeSession(); // Non-prescription item // Expect $1.89 for the tax SaleItem item1 = new SaleItem(); item1.setPurchaseState(taxState); item1.setItemType(typeItem); item1.setSalesPrice(new BigDecimal(29.95)); ksession.insert(item1); ksession.fireAllRules(); taxCal = item1.getSalesTax(); System.out.println(item1.getPurchaseState().toString() + + item1.getItemType().toString() + : + item1.getSalesTax().toString()); } catch (Throwable t) { t.printStackTrace(); } return taxCal; } } ** 4. Then created a bottom up java bean webservice of it using the same above class. 5. Wsdl is generated i am getting the error response on eclispe console while testing by soap-ui ** java.lang.NullPointerException at org.drools.util.CompositeClassLoader.getResourceAsStream(CompositeClassLoader.java:122) at org.drools.commons.jci.compilers.EclipseJavaCompiler$2.findType(EclipseJavaCompiler.java:234) at org.drools.commons.jci.compilers.EclipseJavaCompiler$2.findType(EclipseJavaCompiler.java:215) at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.createPackage(LookupEnvironment.java:748) at org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.buildTypeBindings(CompilationUnitScope.java:87) at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.buildTypeBindings(LookupEnvironment.java:167) at org.eclipse.jdt.internal.compiler.Compiler.internalBeginToCompile(Compiler.java:721) at org.eclipse.jdt.internal.compiler.Compiler.beginToCompile(Compiler.java:381) at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:426) at org.drools.commons.jci.compilers.EclipseJavaCompiler.compile(EclipseJavaCompiler.java:358) at org.drools.commons.jci.compilers.AbstractJavaCompiler.compile(AbstractJavaCompiler.java:49) at org.drools.rule.builder.dialect.java.JavaDialect.compileAll(JavaDialect.java:369) at org.drools.compiler.DialectCompiletimeRegistry.compileAll(DialectCompiletimeRegistry.java:53) at org.drools.compiler.PackageRegistry.compileAll(PackageRegistry.java:71) at
[rules-users] using Drools global variables inside operator timer(int: variable name s)
Hi, I want a global variable inside a timer instead of hard coding. - ksession.setGlobal( timeout, new Integer(10)); --- * Improper (not working) rule: * global Integer timeout; rule tmeout case timer( int: timeout.intValue() s ) when $request : EventRecord(eventType == EVENT_REGISTER, user == katta) from entry-point AggStream and not (EventRecord( eventType == EVENT_RESPONSE, , user == katta, this after[ 0s, 10s ] $request ) from entry-point AggStream) then System.out.println(-- timeout for user : + $request.getUser() ); end -- This new rule doesn't give any error but it is giving unexpected result. For example if a fire only one EventRecord(eventType == EVENT_REGISTER, user == katta) into the working memory, then after 10seconds I should get timeout as per my requirement. But for the above rule as soon as I fire the EventRecord it is giving as timeout. Please help me in this regard -- View this message in context: http://drools.46999.n3.nabble.com/using-Drools-global-variables-inside-operator-timer-int-variable-name-s-tp3950828.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] drools-planner in seam 2.2.2 final shows errors
20:05:51,468 ERROR [STDERR] com.thoughtworks.xstream.converters.ConversionException: Cannot load java class kz.bee.kudos.sms.schedule.solution.Schedule : kz.bee.kudos.sms.schedule.solution.Schedule Debugging information message : Cannot load java class kz.bee.kudos.sms.schedule.solution.Schedule cause-exception : java.lang.ClassNotFoundException cause-message : kz.bee.kudos.sms.schedule.solution.Schedule class : java.lang.Class required-type : java.lang.Class converter-type : com.thoughtworks.xstream.converters.SingleValueConverterWrapper wrapped-converter : com.thoughtworks.xstream.converters.extended.JavaClassConverter line number : 4 class[1]: org.drools.planner.config.solver.SolverConfig converter-type[1] : com.thoughtworks.xstream.converters.reflection.ReflectionConverter version : null --- 20:05:51,482 ERROR [STDERR] at com.thoughtworks.xstream.converters.extended.JavaClassConverter.fromString(JavaClassConverter.java:46) 20:05:51,482 ERROR [STDERR] at com.thoughtworks.xstream.converters.SingleValueConverterWrapper.fromString(SingleValueConverterWrapper.java:41) 20:05:51,482 ERROR [STDERR] at com.thoughtworks.xstream.converters.SingleValueConverterWrapper.unmarshal(SingleValueConverterWrapper.java:49) 20:05:51,482 ERROR [STDERR] at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72) 20:05:51,482 ERROR [STDERR] at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65) 20:05:51,482 ERROR [STDERR] at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66) 20:05:51,482 ERROR [STDERR] at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshallField(AbstractReflectionConverter.java:351) 20:05:51,482 ERROR [STDERR] at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doUnmarshal(AbstractReflectionConverter.java:302) 20:05:51,507 ERROR [STDERR] at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:230) 20:05:51,507 ERROR [STDERR] at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72) 20:05:51,507 ERROR [STDERR] at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65) 20:05:51,507 ERROR [STDERR] at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66) 20:05:51,507 ERROR [STDERR] at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50) 20:05:51,507 ERROR [STDERR] at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:134) 20:05:51,507 ERROR [STDERR] at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarshal(AbstractTreeMarshallingStrategy.java:32) 20:05:51,507 ERROR [STDERR] at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1035) 20:05:51,507 ERROR [STDERR] at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1019) 20:05:51,508 ERROR [STDERR] at com.thoughtworks.xstream.XStream.fromXML(XStream.java:895) 20:05:51,508 ERROR [STDERR] at org.drools.planner.config.XmlSolverFactory.configure(XmlSolverFactory.java:95) 20:05:51,508 ERROR [STDERR] at org.drools.planner.config.XmlSolverFactory.configure(XmlSolverFactory.java:85) 20:05:51,508 ERROR [STDERR] at org.drools.planner.config.XmlSolverFactory.configure(XmlSolverFactory.java:78) 20:05:51,508 ERROR [STDERR] at org.drools.planner.config.XmlSolverFactory.init(XmlSolverFactory.java:62) 20:05:51,508 ERROR [STDERR] at kz.bee.kudos.sms.schedule.ScheduleGenerator.init(ScheduleGenerator.java:69) 20:05:51,508 ERROR [STDERR] at kz.bee.kudos.sms.schedule.ScheduleGenerator.generate(ScheduleGenerator.java:323) 20:05:51,508 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 20:05:51,508 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 20:05:51,508 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 20:05:51,508 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:597) 20:05:51,509 ERROR [STDERR] at org.jboss.seam.util.Reflections.invoke(Reflections.java:22) 20:05:51,509 ERROR [STDERR] at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:32) 20:05:51,509 ERROR [STDERR] at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56) 20:05:51,509 ERROR [STDERR] at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28) 20:05:51,509 ERROR [STDERR] at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) 20:05:51,509 ERROR [STDERR] at
Re: [rules-users] drools-planner in seam 2.2.2 final shows errors
Can you check the xstream and drools-core versions in your classpath and compare it by the ones in the drools-planner zip in the binaries directory? They should be equal or higher, but definitely not lower. Op 30-04-12 16:15, Nurlan schreef: 20:05:51,468 ERROR [STDERR] com.thoughtworks.xstream.converters.ConversionException: Cannot load java class kz.bee.kudos.sms.schedule.solution.Schedule : kz.bee.kudos.sms.schedule.solution.Schedule Debugging information message : Cannot load java class kz.bee.kudos.sms.schedule.solution.Schedule cause-exception : java.lang.ClassNotFoundException cause-message : kz.bee.kudos.sms.schedule.solution.Schedule class : java.lang.Class required-type : java.lang.Class converter-type : com.thoughtworks.xstream.converters.SingleValueConverterWrapper wrapped-converter : com.thoughtworks.xstream.converters.extended.JavaClassConverter line number : 4 class[1]: org.drools.planner.config.solver.SolverConfig converter-type[1] : com.thoughtworks.xstream.converters.reflection.ReflectionConverter version : null --- 20:05:51,482 ERROR [STDERR] at com.thoughtworks.xstream.converters.extended.JavaClassConverter.fromString(JavaClassConverter.java:46) 20:05:51,482 ERROR [STDERR] at com.thoughtworks.xstream.converters.SingleValueConverterWrapper.fromString(SingleValueConverterWrapper.java:41) 20:05:51,482 ERROR [STDERR] at com.thoughtworks.xstream.converters.SingleValueConverterWrapper.unmarshal(SingleValueConverterWrapper.java:49) 20:05:51,482 ERROR [STDERR] at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72) 20:05:51,482 ERROR [STDERR] at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65) 20:05:51,482 ERROR [STDERR] at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66) 20:05:51,482 ERROR [STDERR] at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshallField(AbstractReflectionConverter.java:351) 20:05:51,482 ERROR [STDERR] at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doUnmarshal(AbstractReflectionConverter.java:302) 20:05:51,507 ERROR [STDERR] at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:230) 20:05:51,507 ERROR [STDERR] at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72) 20:05:51,507 ERROR [STDERR] at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65) 20:05:51,507 ERROR [STDERR] at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66) 20:05:51,507 ERROR [STDERR] at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50) 20:05:51,507 ERROR [STDERR] at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:134) 20:05:51,507 ERROR [STDERR] at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarshal(AbstractTreeMarshallingStrategy.java:32) 20:05:51,507 ERROR [STDERR] at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1035) 20:05:51,507 ERROR [STDERR] at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1019) 20:05:51,508 ERROR [STDERR] at com.thoughtworks.xstream.XStream.fromXML(XStream.java:895) 20:05:51,508 ERROR [STDERR] at org.drools.planner.config.XmlSolverFactory.configure(XmlSolverFactory.java:95) 20:05:51,508 ERROR [STDERR] at org.drools.planner.config.XmlSolverFactory.configure(XmlSolverFactory.java:85) 20:05:51,508 ERROR [STDERR] at org.drools.planner.config.XmlSolverFactory.configure(XmlSolverFactory.java:78) 20:05:51,508 ERROR [STDERR] at org.drools.planner.config.XmlSolverFactory.init(XmlSolverFactory.java:62) 20:05:51,508 ERROR [STDERR] at kz.bee.kudos.sms.schedule.ScheduleGenerator.init(ScheduleGenerator.java:69) 20:05:51,508 ERROR [STDERR] at kz.bee.kudos.sms.schedule.ScheduleGenerator.generate(ScheduleGenerator.java:323) 20:05:51,508 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 20:05:51,508 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 20:05:51,508 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 20:05:51,508 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:597) 20:05:51,509 ERROR [STDERR] at org.jboss.seam.util.Reflections.invoke(Reflections.java:22) 20:05:51,509 ERROR [STDERR] at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:32) 20:05:51,509 ERROR [STDERR] at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56) 20:05:51,509 ERROR [STDERR]
Re: [rules-users] drools-planner in seam 2.2.2 final shows errors
Also, check if the class kz.bee.kudos.sms.schedule.solution.Schedule is in your classpath. Looks like a classloading/classpath problem. Op 30-04-12 16:18, Geoffrey De Smet schreef: Can you check the xstream and drools-core versions in your classpath and compare it by the ones in the drools-planner zip in the binaries directory? They should be equal or higher, but definitely not lower. Op 30-04-12 16:15, Nurlan schreef: 20:05:51,468 ERROR [STDERR] com.thoughtworks.xstream.converters.ConversionException: Cannot load java class kz.bee.kudos.sms.schedule.solution.Schedule : kz.bee.kudos.sms.schedule.solution.Schedule Debugging information message : Cannot load java class kz.bee.kudos.sms.schedule.solution.Schedule cause-exception : java.lang.ClassNotFoundException cause-message : kz.bee.kudos.sms.schedule.solution.Schedule class : java.lang.Class required-type : java.lang.Class converter-type : com.thoughtworks.xstream.converters.SingleValueConverterWrapper wrapped-converter : com.thoughtworks.xstream.converters.extended.JavaClassConverter line number : 4 class[1]: org.drools.planner.config.solver.SolverConfig converter-type[1] : com.thoughtworks.xstream.converters.reflection.ReflectionConverter version : null --- 20:05:51,482 ERROR [STDERR] at com.thoughtworks.xstream.converters.extended.JavaClassConverter.fromString(JavaClassConverter.java:46) 20:05:51,482 ERROR [STDERR] at com.thoughtworks.xstream.converters.SingleValueConverterWrapper.fromString(SingleValueConverterWrapper.java:41) 20:05:51,482 ERROR [STDERR] at com.thoughtworks.xstream.converters.SingleValueConverterWrapper.unmarshal(SingleValueConverterWrapper.java:49) 20:05:51,482 ERROR [STDERR] at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72) 20:05:51,482 ERROR [STDERR] at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65) 20:05:51,482 ERROR [STDERR] at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66) 20:05:51,482 ERROR [STDERR] at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshallField(AbstractReflectionConverter.java:351) 20:05:51,482 ERROR [STDERR] at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doUnmarshal(AbstractReflectionConverter.java:302) 20:05:51,507 ERROR [STDERR] at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:230) 20:05:51,507 ERROR [STDERR] at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72) 20:05:51,507 ERROR [STDERR] at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65) 20:05:51,507 ERROR [STDERR] at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66) 20:05:51,507 ERROR [STDERR] at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50) 20:05:51,507 ERROR [STDERR] at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:134) 20:05:51,507 ERROR [STDERR] at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarshal(AbstractTreeMarshallingStrategy.java:32) 20:05:51,507 ERROR [STDERR] at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1035) 20:05:51,507 ERROR [STDERR] at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1019) 20:05:51,508 ERROR [STDERR] at com.thoughtworks.xstream.XStream.fromXML(XStream.java:895) 20:05:51,508 ERROR [STDERR] at org.drools.planner.config.XmlSolverFactory.configure(XmlSolverFactory.java:95) 20:05:51,508 ERROR [STDERR] at org.drools.planner.config.XmlSolverFactory.configure(XmlSolverFactory.java:85) 20:05:51,508 ERROR [STDERR] at org.drools.planner.config.XmlSolverFactory.configure(XmlSolverFactory.java:78) 20:05:51,508 ERROR [STDERR] at org.drools.planner.config.XmlSolverFactory.init(XmlSolverFactory.java:62) 20:05:51,508 ERROR [STDERR] at kz.bee.kudos.sms.schedule.ScheduleGenerator.init(ScheduleGenerator.java:69) 20:05:51,508 ERROR [STDERR] at kz.bee.kudos.sms.schedule.ScheduleGenerator.generate(ScheduleGenerator.java:323) 20:05:51,508 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 20:05:51,508 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 20:05:51,508 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 20:05:51,508 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:597) 20:05:51,509 ERROR [STDERR] at org.jboss.seam.util.Reflections.invoke(Reflections.java:22) 20:05:51,509 ERROR [STDERR] at
Re: [rules-users] drools-planner in seam 2.2.2 final shows errors
class kz.bee.kudos.sms.schedule.solution.Schedule is exists in war archive and i'm using drools-planner 5.4.0.CR1 in pom.xml: dependency groupIdorg.drools/groupId artifactIddrools-compiler/artifactId version5.4.0.CR1/version /dependency dependency groupIdorg.drools/groupId artifactIddrools-core/artifactId version5.4.0.CR1/version /dependency dependency groupIdorg.drools.planner/groupId artifactIddrools-planner-core/artifactId version5.4.0.CR1/version /dependency dependency groupIdch.qos.logback/groupId artifactIdlogback-classic/artifactId version1.0.0/version /dependency dependency groupIdcom.thoughtworks.xstream/groupId artifactIdxstream/artifactId version1.4.1/version /dependency i dont know why, it show same error -- View this message in context: http://drools.46999.n3.nabble.com/drools-planner-in-seam-2-2-2-final-shows-errors-tp3950831p3950914.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] drools-planner in seam 2.2.2 final shows errors
as you said it was classloading/classpath thank you! -- View this message in context: http://drools.46999.n3.nabble.com/drools-planner-in-seam-2-2-2-final-shows-errors-tp3950831p3950949.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] upgrading drools-server 5.0 to drools-camel-server 5.4
After 2 years, I am trying to upgrade from drools 5.0 to latest. The way we are using the drools: the client apps(in c# and ruby) sends the request to drools-server 5.0. This execution server gets the rules .pkg file from guvnor using the properties files that map rules package at guvnor and response with output of rules execution. Unfortunately, the new execution server doesn't seems to work same way as the new one is completely different. I deployed drools-camel-server-5.4.war and saw how test.jsp is working. Then I changed knowledge-service.xml to replace the local drl resource to remote pkg at guvnor as follows: drools:resource type=DRL source=classpath:test.drl/ to drools:resource type=PKG source=http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/test/ex; basicAuthentication=enabled username=admin password=admin / When I ran the test.jsp, I got exception, snippet below. There were few other warning exceptions too, but not sure which is cause this problem. To make my question short, I want to know is there at quick example or docs that explain how I can use drools-camel-server to response the actions(output of execution) to external app that sends the request with conditions, where camel server gets the rules pkg from guvnor? I have create the jersey based webservice to do exactly the same, but I want to understand how this new camel-based server works. I appreciate any kind of your help. ERROR [org.apache.camel.processor.DefaultErrorHandler] (http--127.0.0.1-8080-4) Failed delivery for exchangeId: ID-NormanDev2-52157-1335809674758-0-1. Exhausted after delivery attempt: 1 caught: org.apache.camel.RuntimeCamelException: Body of in message not of the expected type 'org.drools.command.Command' for uridrools://node1/ksession1: org.apache.camel.RuntimeCamelException: Body of in message not of the expected type 'org.drools.command.Command' for uridrools://node1/ksession1 at org.drools.camel.component.DroolsExecuteProducer.process(DroolsExecuteProducer.java:63) [drools-camel-5.4.0.CR1.jar:5.4.0.CR1] at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61) [camel-core-2.9.0.jar:2.9.0] at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) [camel-core-2.9.0.jar:2.9.0] at org.apache.camel.processor.SendProcessor$2.doInAsyncProducer(SendProcessor.java:115) [camel-core-2.9.0.jar:2.9.0] at org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java:285) [camel-core-2.9.0.jar:2.9.0] -- View this message in context: http://drools.46999.n3.nabble.com/upgrading-drools-server-5-0-to-drools-camel-server-5-4-tp3951496.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] Rule to load facts with pagination
Hi. I'm running drools in a project with millions of facts to process. My memory doesn't allow me to load all of my facts, so I have to load N objects at once, then start over with next N objects, and so on. Is it a good idea to let Drools to manage Pagination? I mean, create rules in Drools with the purpose of loading facts?, or should I have to do this by executing a Drools session from java in a loop?. My main goal is performance. Thanks! -- View this message in context: http://drools.46999.n3.nabble.com/Rule-to-load-facts-with-pagination-tp3951591.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] Some problems with Deploying drools-camel-sever 5.3.x in Weblogic 10.x
To make your test example work, make sure that you are deploying the server as drools-server.war or drools-server. Or you might have to change route at client-client.xml -- View this message in context: http://drools.46999.n3.nabble.com/Some-problems-with-Deploying-drools-camel-sever-5-3-x-in-Weblogic-10-x-tp3786473p3951656.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] Rule to load facts with pagination
Chances are high that you aren't asking the right question but based on the meagre information you provide I can't even propose a better question. Consider not only loading but also unloading. Does the logic for loading the next bunch of facts warrant rules? -W On 30/04/2012, mariofox mario...@gmail.com wrote: Hi. I'm running drools in a project with millions of facts to process. My memory doesn't allow me to load all of my facts, so I have to load N objects at once, then start over with next N objects, and so on. Is it a good idea to let Drools to manage Pagination? I mean, create rules in Drools with the purpose of loading facts?, or should I have to do this by executing a Drools session from java in a loop?. My main goal is performance. Thanks! -- View this message in context: http://drools.46999.n3.nabble.com/Rule-to-load-facts-with-pagination-tp3951591.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