CDI Integration
by Robert Morse
I was asking the Seam 3 guys about Drools support, and Shane Bryzak replied:
"We need to update that page - Seam will not be providing a Drools module, rather the Drools team will be providing native CDI integration instead."
Any idea when there will be CDI support?
The human mind is an iterative processor, it never does anything right the first time. What it does well is to make improvements on every iteration (deMarco)
13 years
Re: [rules-users] Firing Mulitple packages
by Esteban Aliverti
Could you post the way you are using to add kassets to kbase?
El ago 13, 2010 12:20 p.m., "Vignesh" <viki.ccc(a)gmail.com> escribió:
Hi Esteban,
I have tried the same logic by adding all the packages in my application in
to the kbase and executed the same, but only the drl file got loaded in it,
other kassets like dsl, ruleflow present in it were not added to the same.
Do we need to add everything separetly?
Kindly let me know whether im missing something here.
Thanks,
Vignesh
--
View this message in context:
http://drools-java-rules-engine.46999.n3.nabble.com/Firing-Mulitple-packa...
Sent from the Drools - User mailing list archive at Nabble.com.
____________________________________...
13 years
Drools Activation Group
by Java Bean
Hello Drools Experts,
I have a question on activation group and trying to understand the
mechanism.
I have the following rules in a .drl file :
import function com.test.utils.StringUtil.isEmpty;
import function com.test.utils.Logger.log;
rule "r1"
salience 10
activation-group "fireOnlyOnce"
when
SomeObject($s: someStringKey)
eval(isEmpty($s) // static java method imported as function
then
log("doSomething");
end
rule "r2"
activation-group "fireOnlyOnce"
when
SomeObject($s: someStringKey)
eval(checkWithDB($s) // Make a call to the DB to validate
someStringKeyis valid
then
log("doSomething");
end
In "r1" I am checking for 'someStringKey' is not null or empty. In "r2" , I
am making a call to the DB to check 'someStringKey' is a valid id. During
the debug, I found out that both "r1" and "r2" is fired but only one
consequence is executed depending on the outcome of the r1. I want "r2" to
fire only when "r1" evaluates to false. How can I achieve this in Drools?
Thanks for your time and appreciate your help.
13 years
Call query from other query
by Syargey
I read in Drools guide, that queries can now call other queries.
But the guide doesn't give much details, mostly paying attention to a rather
specific case.
I have two queries having common parts and try to figure out how to get rid
of duplicate code.
Here is the simplified form of queries I'd like to have:
---------
query query1
$facts: List()
from collect( Fact( name == "name1" ) )
end
query query2
$l: List()
from collect( Fact( value == "1" ) from ?query1() )
end
---------
query2 syntax is invalid and and it is not clear for me how $facts from
query1 can be accessed in query2.
--
View this message in context: http://drools.46999.n3.nabble.com/Call-query-from-other-query-tp3542082p3...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years
Drools Activation Group
by freejava
Hello Drools Experts,
I have a question on activation group and trying to understand the
mechanism.
I have the following rules in a .drl file :
import function com.test.utils.StringUtil.isEmpty;
import function com.test.utils.Logger.log;
rule "r1"
salience 10
activation-group "fireOnlyOnce"
when
SomeObject($s: someStringKey)
eval(isEmpty($s) // static java method imported as function
then
log("doSomething");
end
rule "r2"
activation-group "fireOnlyOnce"
when
SomeObject($s: someStringKey)
eval(checkWithDB($s) // Make a call to the DB to validate
someStringKeyis valid
then
log("doSomething");
end
In "r1" I am checking for 'someStringKey' is not null or empty. In "r2" , I
am making a call to the DB to check 'someStringKey' is a valid id. During
the debug, I found out that both "r1" and "r2" is fired but only one
consequence is executed depending on the outcome of the r1. I want "r2" to
fire only when "r1" evaluates to false. How can I achieve this in Drools?
Thanks for your time and appreciate your help.
--
View this message in context: http://drools.46999.n3.nabble.com/Drools-Activation-Group-tp3546607p35466...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years
inconsistent behavior with the eclipse IDE and the Drools compiler
by Hezi Stern
Hi all,
I encountered the following strange inconsistent behavior with the eclipse
IDE and the Drools compiler.
I have the following test rule which should fire if a specific time
condition is present. The time condition is evaluated by a function called
getTimelineDescriptor() which is imported using import function.
rule "ScheduleTime: request for explicit time arrived"
when
ConditionMatrix(descriptors.times.timeline contains
getTimelineDescriptor(EButtonID.TIME_SPECIFIC) ||
descriptors.times.timeline contains
getTimelineDescriptor(EButtonID.DYNAMIC_ABSOLUTE_TIME) ||
descriptors.times.timeline contains
getTimelineDescriptor(EButtonID.DYNAMIC_RELATIVE_TIME),
$srcAlt: srcWorkingAlternative,
)
then
//something...
end
the IDE indicates an error on the conditionMatrix line with the following
description:
Multiple markers at this line
- [ERR 101] Line 123:77 no viable alternative at input '(' in rule
"ScheduleTime: request for explicit time arrived" in pattern ConditionMatrix
- [ERR 102] Line 123:103 mismatched input '||' expecting 'then' in rule
"ScheduleTime: request for explicit time arrived"
- [ERR 101] Line 123:101 no viable alternative at input ')' in rule
"ScheduleTime: request for explicit time arrived" in pattern
getTimelineDescriptor
BUT it compiles ok and runs properly.
When I wrap the function with brackets (as I thought it should be) like this
rule "ScheduleTime: request for explicit time arrived"
when
ConditionMatrix(descriptors.times.timeline contains
(getTimelineDescriptor(EButtonID.TIME_SPECIFIC)) ||
descriptors.times.timeline contains
(getTimelineDescriptor(EButtonID.DYNAMIC_ABSOLUTE_TIME)) ||
descriptors.times.timeline contains
(getTimelineDescriptor(EButtonID.DYNAMIC_RELATIVE_TIME)),
$srcAlt: srcWorkingAlternative,
)
then
//something...
end
the IDE shows no error but the compilation fails with the following error:
16:19:14,734 [ERROR] [LoggerStream]: Unable to Analyse Expression
descriptors.times.timeline contains
(getTimelineDescriptor(EButtonID.TIME_SPECIFIC)) ||
descriptors.times.timeline contains
(getTimelineDescriptor(EButtonID.DYNAMIC_ABSOLUTE_TIME)) ||
descriptors.times.timeline contains
(getTimelineDescriptor(EButtonID.DYNAMIC_RELATIVE_TIME)):
[Error: unable to resolve method using strict-mode:
com.delegatecom.rules.ConditionMatrix.contains(com.delegatecom.nlp.api.Timel
ineDescriptor)]
[Near : {... tors.times.timeline contains (getTimelineDescripto ....}]
I am using Drools 5.2 with Helios (Eclipse).
Any ideas why this is so? Although I have a working option it is impossible
to maintain code when there are error indications.
Thanks,
Hezi
13 years
guvnor restful api problem
by gcautiero
Hello to everyone,
i'm trying to upload a .drl file using guvnor's restFul service. But im not
able to get a POST call working.
what i'm trying to do is:
make a call first to get a content of .drl file already stored in Guvnon:
here the working code using cxf client (as the example in the guvnor doc):
WebClient c = WebClient.create("http://127.0.0.1:8081/");
String authorizationHeader = "Basic " +
org.apache.cxf.common.util.Base64Utility.encode("guest:".getBytes());
c.header("Authorization", authorizationHeader);
String content =
c.path("http://localhost:8081/guvnor-5.3.0.Final-tomcat-6.0/org.drools.guvnor.Guv...").accept("text/plain").get(String.class);
then i try to upload the content in another asset
Here the code that DOSEN'T work:
Response response =
client.path("http://localhost:8081/guvnor-5.3.0.Final-tomcat-6.0/org.drools.guvnor.Guv...").accept("application/xml").post(content);
for this call i get the following error:
Nov 29, 2011 11:23:12 AM org.apache.catalina.core.StandardWrapperValve
invoke
SEVERE: Servlet.service() for servlet RestAPIServlet threw exception
java.lang.ArrayIndexOutOfBoundsException: 1
at org.drools.repository.remoteapi.RestAPI.post(RestAPI.java:235)
at
org.drools.guvnor.server.files.RestAPIServlet$1.execute(RestAPIServlet.java:56)
at
org.drools.guvnor.server.files.RepositoryServlet.doAuthorizedAction(RepositoryServlet.java:75)
at
org.drools.guvnor.server.files.RestAPIServlet.doPost(RestAPIServlet.java:49)
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.jboss.seam.web.ContextFilter$1.process(ContextFilter.java:42)
at
org.jboss.seam.servlet.ContextualHttpServletRequest.run(ContextualHttpServletRequest.java:65)
at org.jboss.seam.web.ContextFilter.doFilter(ContextFilter.java:37)
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.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.Http11AprProcessor.process(Http11AprProcessor.java:877)
at
org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:594)
at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1675)
at java.lang.Thread.run(Thread.java:662)
someone have a suggestion? or a working example?
tnx
Gianfranco
--
View this message in context: http://drools.46999.n3.nabble.com/guvnor-restful-api-problem-tp3544799p35...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years