Drools Upgrade to 5.4
by dxande6
I'm upgrading to Drools 5.4 from Drools 5.0.1. When I try to compile the
.drl files into a .pkg I'm getting a couple of strange errors. Hoping
someone can help.
Here is the .drl
rule "Rule 1 - Testing"
no-loop true
when
$orderInfo : OrderingInfo (orderedProducts != null)
then
Customer customer = $orderInfo.getCustomer();
ArrayList<ProductAttribute> productAttributes =
$orderInfo.getAttributes();
String localCode = getCode();
end
function String getCode (Customer customer) {
return customer.getCode();
}
I get an error when I try to compile saying the following:
Unable to resolve type ArrayList<ProductAttribute>
If I remove the line and just use ArrayList and leave off the
"<ProductAttribute>" component, it works.
Any help is appreciated.
It also cannot access the getCode() function.
I'm not sure why that is the case.
Finally, I can get all of these things to work when I run the rules using
the .DRL files. Typically we compile them into packages prior to
deployment.
Thank you again in advance for any/all of your help.
--
View this message in context: http://drools.46999.n3.nabble.com/Drools-Upgrade-to-5-4-tp4019321.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 9 months
modify and update is not working in the rule file
by Rana
Please let me know what is the problem in this. It does not update the values
when I get the values, it gives me null in my unit test method.
rule "Drug Strength" extends "Provider State"
no-loop true
dialect "mvel"
agenda-group "AndroGel"
when
Drug( $drug.getStrength == "20.25 mg/1.25 gram (1.62 %)" )
$p : Program()
then
#drools.getWorkingMemory().setGlobal("boolDrugStrength", true )
modify( $p) {
setProgramId( "610.contentId(a)samplemd.com" ),
setProgramName( "AndroGel 1.62% Savings Card" )
};
update( $p )
#retract( $p )
#retract( $drug )
log.info("Prgram ID and Program Name is set for program Coupon for
Androgel");
#drools.halt();
end
Thanks.
--
View this message in context: http://drools.46999.n3.nabble.com/modify-and-update-is-not-working-in-the...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 9 months
Drools 5.4 and Java Generics
by dxande6
I’m receiving errors when compiling my .drl files as a result of using Java
generics.
Example:
rule "Rule 1 - Testing"
no-loop true
when
$orderInfo : OrderingInfo (orderedProducts != null)
then
Customer customer = $orderInfo.getCustomer();
ArrayList<ProductAttribute> productAttributes =
$orderInfo.getAttributes();
String localCode = getCode(customer);
end
It complains that ArrayList<ProductAttribute> cannot be resolved … actual
error is below:
RuleBaseTask failed: Unable to resolve type ArrayList<ProductAttribute>:
Unable to find class 'ArrayList<ProductAttribute>' : [Rule name='Rule 1
- Testing']
Is there a resolution to this problem?
Thank you in advance.
--
View this message in context: http://drools.46999.n3.nabble.com/Drools-5-4-and-Java-Generics-tp4019327....
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 9 months
Integrate Guvnor with Weblogic server user authentication
by jasonxzhong
Has anyone been able to configure Guvnor so it can use Weblogic user
authentication? Our goal is to allow users created and managed in Weblogic
security realm being able to log in to Guvnor after being autheticated by
Weblogic.
There is an article that describes how to enable authentication using JAAS
for weblogic but when we tried to follow the instructions it did not work.
Basically jaas.config file is not being picked up.
I'd appreciate it if someone who has done similar work can post the
components.xml and some instructions.
Thanks in advance,
Jason
-----
Jason
--
View this message in context: http://drools.46999.n3.nabble.com/Integrate-Guvnor-with-Weblogic-server-u...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 9 months
Rules Deployment
by RulesUsers
Hi all,
We are using rules in our java based project that connects to jboss for jms.
To implement rules, we include drools specific jar files in the code itself.
When this code is executed, rules also get executed and our purpose is
served.
Rules file is written manually and is called from within the java code.
Going forward, we want to deploy java application together with rules on
jboss.
I want to know the standard way of doing it ?
Please provide pointers on this.
Regards
Samya Maiti
--
View this message in context: http://drools.46999.n3.nabble.com/Rules-Deployment-tp4019302.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 9 months
NPE loading Drools 5.4.0.Beta1 using drools-spring
by lhorton
I am trying to load up 5.4.0.Beta1. I'm using Spring configuration xml that
works fine in 5.2.0.Final. In the xml, my grid-node is defined as:
<drools:grid-node id="droolsClusterNode1"/>
The exception is a NPE on a method in WhitePagesClient. Any idea what the
cause might be? Has anyone successfully loaded 5.4.0 using Spring?
The full exception is:
ERROR 2012-01-06 15:51:05,998
[org.springframework.web.context.ContextLoader] - Context initialization
failed
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'droolsClusterNode1': Invocation of init method failed; nested
exception is java.lang.NullPointerException
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1420)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:563)
at
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
at
org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)
at
org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)
at
org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
at
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4206)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4705)
at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:943)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:563)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1399)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:297)
at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761)
at
org.apache.catalina.manager.ManagerServlet.check(ManagerServlet.java:1500)
at
org.apache.catalina.manager.HTMLManagerServlet.doPost(HTMLManagerServlet.java:252)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.apache.catalina.filters.CsrfPreventionFilter.doFilter(CsrfPreventionFilter.java:186)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:563)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:291)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.NullPointerException
at
org.drools.grid.service.directory.impl.WhitePagesClient.getGsd(WhitePagesClient.java:32)
at
org.drools.grid.service.directory.impl.WhitePagesClient.create(WhitePagesClient.java:80)
at org.drools.grid.impl.GridImpl.createGridNode(GridImpl.java:107)
at
org.drools.container.spring.beans.GridNodeBeanFactory.afterPropertiesSet(GridNodeBeanFactory.java:63)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1477)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417)
... 47 more
--
View this message in context: http://drools.46999.n3.nabble.com/NPE-loading-Drools-5-4-0-Beta1-using-dr...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 9 months