Event processing/Drools Fusion: problem using "this after" and "@expires"
by diana-mendes
Hello,
I'm implementing a simple event processing application, and I'm getting
unexpected results. I use the time operator "this after" and I declare one
of my events with an "@expires" property.
I want to detect an event with a certain attribute (let's call it "main
event"), and when this event arrives I want to initiate a timer so that I
collect all the events that arrive within the next 10 seconds, regardless of
their attributes. A second timer should never be initiated until the first
one ends.
In order to implement this scenario I used an auxiliary event, named
"Context", that is inserted in the working memory when the "main event" is
detected, and expires after 10 seconds.
So I have two rules: the first one detects the "main event" (when there's no
Context in the working memory) and inserts a Context event. The second rule
fires when there's a Context event, and lists all the other events that
arrive within the next 10 seconds.
The rules are bellow:
rule "Detect Main Event"
activation-group "A"
lock-on-active true
salience 1
when
$event : Notif( specificProblem == "New ONT" || specificProblem == "ONT Is
Inactive" ) && not Context()
then
System.out.println("Context Created by
"+$event.getSpecificProblem()+" "+$event.id);
insert( new Context($event) );
end
rule "Collect Events in a 10 second window"
activation-group "A"
lock-on-active true
salience 2
when
$context : Context()
$list10s : List() from collect ( Notif( this after [0s,10s] $context ))
then
Notif notifContext = $context.getNotif();
System.out.println("context: "+notifContext.getSpecificProblem()+"
"+notifContext.id);
Helper.printList($list10s);
end
The output I get is the following:
/0s: New ONT 1/
Context Created by New ONT 1
/2s: ONT is inactive 1/
context: New ONT 1
-List:
--ONT Is Inactive1
---
/4s: ONT is inactive 2/
context: New ONT 1
-List:
--ONT Is Inactive1
--ONT Is Inactive2
---
/7s: New ONT 2/
context: New ONT 1
-List:
--ONT Is Inactive1
--ONT Is Inactive2
--New ONT2
---
*/22s: New ONT 3/
context: New ONT 1
Empty list
/27s: New ONT 4/
Context Created by New ONT 4*
The lines in italic are the events I receive, and the respective time
instance, in seconds.
The lines in bold are the unexpected results. When I receive event "New ONT
3", the "Context" should have expired by then and it should create a new
one. What could be causing this? It seems to work properly until I receive
that event.
Any help would be greatly appreciated, as I've tried several modifications
and none seem to work.
Thanks in advance,
Diana
--
View this message in context: http://drools.46999.n3.nabble.com/Event-processing-Drools-Fusion-problem-...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 5 months
How to parse "comments" in "drl" file using DrlParser?
by Praveen
Hi,
The system we are building requires "rulenames" and "rule
description(comments)" to be displayed in the UI(built using JQuery).
I am using DrlParser to convert the drl(generated using Guvnor) to XML so
that it could be used to display in the UI.
However, the comments written in drl are not visible in the converted XML.
Please let me know how to parse "comments" using DrlParser so that I can use
it to display as "rule description".
Thanks & Regards,
Praveen.
--
View this message in context: http://drools.46999.n3.nabble.com/How-to-parse-comments-in-drl-file-using...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 5 months
Regarding verstions of Drools-Guvnor...
by Manohar Kokkula
Hi guys ,
I am new to this Drools.
I have one small doubt,
Is it mandatory to have all equal versions While executing Drools-Guvnor
Applications ?
For example:
Binaries and Dependencies of Drools- 5.1.1
Drools_Eclipse Plugins & Features-5.1.1
Drools Guvnor (.war)-5.1.1
Currently I used following version:
Binaries and Dependencies of Drools- 5.0.1
Drools_Eclipse Plugins & Features-5.0.1
Drools Guvnor (.war)-5.2.0
Is this fine? or Shall I install all of these of equal versions.
Please help me.
Thanks and Regards
Manohar Kokkula
Mailto: manohar.kokkula(a)tcs.com
=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain
confidential or privileged information. If you are
not the intended recipient, any dissemination, use,
review, distribution, printing or copying of the
information contained in this e-mail message
and/or attachments to it are strictly prohibited. If
you have received this communication in error,
please notify us by reply e-mail or telephone and
immediately and permanently delete the message
and any attachments. Thank you
14 years, 5 months
guvnor and drl rules file uploading
by gcautiero
Hello,
i'm working with different drools template (.drt) on excel raw data files. I
have an application to generate rules files (.drl) to use it in my
applications. My question is: there is a way in Guvnor to upload a new drl
file? maybe with a restful service? i want upload the file with generating
rules (template +excel data) but the only way to do this right now (version
5.3.0.Final) is to made a new rule and copy all the rules from my generating
process to it.
Regards,
Gianfranco Cautiero
--
View this message in context: http://drools.46999.n3.nabble.com/guvnor-and-drl-rules-file-uploading-tp3...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 5 months
Guvnor Import .drl Issues
by mpinch
I'm running guvnor 5.1 at the moment. I can export my .drl file just fine.
When I try and import it back into guvnor 5.1 (or guvnor 5.3, tried that as
well), it states that the import was successful. However, none of my rules
or data model validates. I've noted that all of my functions in the
original ruleset exist, however they are all now listed in the data model
configuration window of the package. When I open any of the actual
functions, all I see is the first line starting /function ..../
Any idea what the issues are here? I"ve searched and not found a similar
one, but this happens everytime with every ruleset I have. I'm kind of
permanently stuck on 5.1 unless I can solve this.
Thanks
--
View this message in context: http://drools.46999.n3.nabble.com/Guvnor-Import-drl-Issues-tp3475087p3475...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 5 months
Guvnor Into Weblogic
by calcacuervo
Hi Everyone. I have deployed Guvnor 5.2 in Weblogic 10.
I am able to browse it though web ui, create packages. But I have a problem
with eclipse plugin.
When I try to add a process to a package, I get "WebDav Error: Nor Found
(404)
In guvnor logs I see:
ERROR 02-11 09:26:03,257 (WebDavServletBean.java:service:154) Exception:
org.drools.repository.RulesRepositoryException:
javax.jcr.AccessDeniedException: Access denied
at org.drools.repository.PackageItem.addAsset(PackageItem.java:290)
at org.drools.repository.PackageItem.addAsset(PackageItem.java:228)
at
org.drools.guvnor.server.files.WebDAVImpl.createResource(WebDAVImpl.java:140)
at net.sf.webdav.methods.DoPut.execute(DoPut.java:104)
at net.sf.webdav.WebDavServletBean.service(WebDavServletBean.java:128)
at
org.drools.guvnor.server.files.WebdavServlet.service(WebdavServlet.java:76)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at
weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at
weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at
weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
at
weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
at org.jboss.seam.web.ContextFilter$1.process(ContextFilter.java:42)
at
org.jboss.seam.servlet.ContextualHttpServletRequest.run(ContextualHttpServletRequest.java:53)
at org.jboss.seam.web.ContextFilter.doFilter(ContextFilter.java:37)
at
weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
at
weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3496)
at
weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(Unknown Source)
at
weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2180)
at
weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2086)
at
weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1406)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
Caused by: javax.jcr.AccessDeniedException: Access denied
at
org.apache.jackrabbit.core.security.simple.SimpleAccessManager.checkPermission(SimpleAccessManager.java:138)
at org.apache.jackrabbit.core.NodeImpl.addNode(NodeImpl.java:1476)
at org.apache.jackrabbit.core.NodeImpl.addNodeWithUuid(NodeImpl.java:2082)
at org.apache.jackrabbit.core.NodeImpl.addNode(NodeImpl.java:1987)
at org.drools.repository.PackageItem.addAsset(PackageItem.java:248)
... 23 more
I have been debugging it, and found that in WebdavServlet class, this:
String auth = req.getHeader( "Authorization" );
Is returning null, but in my tomcat installed tomcat it returns something
like "Basic .,..".
have everyone had this problem with guvnor in weblogic?
Thanks in advance,
Demian
--
View this message in context: http://drools.46999.n3.nabble.com/Guvnor-Into-Weblogic-tp3473811p3473811....
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 5 months
Bugs in rule templates?
by Bruno Freudensprung
Hi all,
I am writing rules using Drools Templates and I noticed strange problems
(ocurring when I slightly modify a DRT that works well):
1. the template instanciation depends on the declarations order of
the parameters in the template header
2. if the rule template does not contain a package declaration
(default package) the instanciation of the template fails
I am working with Drools 5.1.1 but those problems occur in 5.2.0.Final
and in 5.3.0.Final as well.
Do you think it is worth posting a JIRA?
Anyway let me tell you that Drools Templates are great! Our users like
that feature a lot! They start writing a rule in DRL format and, once it
works, they transform it into a DRT and put data into a tsv file. It is
quite a natural way of working. The general perception here is that it
is easier to "templatize" an existing DRL than to write a decision table
from scratch.
Best regards,
Bruno.
PS:
_DRT that works well_:
template header
*name
message
package templates;
*
import org.drools.bug.Entity;
template "TestTemplate"
rule "Test1 @{row.rowNumber}"
dialect "mvel"
when
Entity( $name : name == "@{name}" )
then
System.out.println("@{message}" + $name);
insert($name);
end
end template
_DRT that does not work_ (first case):
template header
*message
name
package templates;
*
import org.drools.bug.Entity;
template "TestTemplate"
rule "Test1 @{row.rowNumber}"
dialect "mvel"
when
Entity( $name : name == "@{name}" )
then
System.out.println("@{message}" + $name);
insert($name);
end
end template
_DRT that does not work_ (second case):
template header
*name
message
*
import org.drools.bug.Entity;
template "TestTemplate"
rule "Test1 @{row.rowNumber}"
dialect "mvel"
when
Entity( $name : name == "@{name}" )
then
System.out.println("@{message}" + $name);
insert($name);
end
end template
14 years, 5 months
Getting Exceptions for ChangeSet.xml resource...
by Manohar Kokkula
Hi to All,
I am getting following exceptions while executing simple application with
ChangeSet.xml resource.
[2011:11:308 01:11:101:exception]
java.lang.RuntimeException: KnowledgeAgent exception while trying to
deserialize KnowledgeDefinitionsPackage
at
org.drools.agent.impl.KnowledgeAgentImpl.rebuildResources(KnowledgeAgentImpl.java:418)
at
org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:120)
at
org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:109)
at com.code.Bankmain.createKnowledgeBase(Bankmain.java:52)
at com.code.Bankmain.main(Bankmain.java:28)
Caused by: java.io.InvalidClassException: org.drools.rule.Package; local
class incompatible: stream classdesc serialVersionUID = 510, local class
serialVersionUID = 400
at
java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:579)
at
java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1600)
at
java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1513)
at
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1749)
at
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1346)
at
java.io.ObjectInputStream.readObject(ObjectInputStream.java:368)
at
org.drools.util.DroolsStreamUtils.streamIn(DroolsStreamUtils.java:189)
at
org.drools.util.DroolsStreamUtils.streamIn(DroolsStreamUtils.java:158)
at
org.drools.agent.impl.KnowledgeAgentImpl.rebuildResources(KnowledgeAgentImpl.java:408)
... 4 more
[2011:11:308 01:11:103:info] KnowledgeAgent new KnowledgeBase now built
and in use
Balance is 0
Deposit is 0
Please help me.
Thanks and regards
Manohar Kokkula
Mailto: manohar.kokkula(a)tcs.com
=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain
confidential or privileged information. If you are
not the intended recipient, any dissemination, use,
review, distribution, printing or copying of the
information contained in this e-mail message
and/or attachments to it are strictly prohibited. If
you have received this communication in error,
please notify us by reply e-mail or telephone and
immediately and permanently delete the message
and any attachments. Thank you
14 years, 5 months
Drools Planner - planning variable as list
by sirius
I'm new Drools Planner user, so sorry if my question proved to be trivial.
Simplified problem definition:
Facts:
Workorder
Technician
Planning entity:
WorkorderAssignement {
private List<Technician> technicianList;
private Workorder workorder;
}
Workorder depends of his definiiton maybe assigned to variable number of
technicians. So, some of them require only ONE technician, but other
requires TWO technicians.
Is there possible build optimized technician list in this case?
--
View this message in context: http://drools.46999.n3.nabble.com/Drools-Planner-planning-variable-as-lis...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 5 months