Guvnor Integration with BPEL
by Rabindra Kumar Srivastava
Hi,
I am using guvnor 5.2.0Final version to create rules and integrating
with ActiveVOS.
I am successfully done with one rule in a package using the url
url=http://localhost:8080/guvnor/org.drools.guvnor.Guvnor/package/final/
LATEST.
Now I have created two more rules in the same package final but not able
to access the other rules.
Please suggest the possible solution.
Rabindra Kumar Srivastava | ATT04 | Tech Mahindra
Hinjewadi, Pune 411 057, INDIA
( Office: +91 20 42250000 | Mobile: +91 9892232699| Ext: 253918
Email: rs0090916(a)techmahindra.com
www.techmahindra.com <http://www.techmahindra.com/>
============================================================================================================================Disclaimer: This message and the information contained herein is proprietary and confidential and subject to the Tech Mahindra policy statement, you may review the policy at <a href="http://www.techmahindra.com/Disclaimer.html">http://www.techmahindra.com/Disclaimer.html</a> externally and <a href="http://tim.techmahindra.com/Disclaimer.html">http://tim.techmahindra.com/Disclaimer.html</a> internally within Tech Mahindra.============================================================================================================================
14 years, 10 months
prevent rule evaluation for certain rules while event insertion
by Neel
Hi,I'm using Drools 5.3.0. I've a proprietary key-value based data store, where all the events are stored. As soon as an event is received, it is inserted in the session and the rules (example below) is fired:
rule "registration count"no-loopdialect "mvel"when $e : Event(type == "registration", $s: student)then $s.registerCount += 1; update($s);end
All the 'registration' events which has occurred in the past (stored in data store) also are inserted in session so that any rule with temporal operator (relates among the events) can work fine. If I insert previous events then the rule "registration count" is evaluated again for each previous events and fired. Please let me know, if there is a way to prevent rule evaluation for certain rules while event insertion. The events are too many, so I don't keep all in working memory for long period, instead I store previous events in data store and insert all previous events also in session when I get a new event.Please help me regarding the issue.
Thanks,Neel
14 years, 10 months
Client code using RuleAgent API - Guvnor 5.1.1 - getting 401 error
by Achyutha, Venkata
Hi,
This error would be basic one but it's very frustrating to me to debug this, few days ago it use to work.
I deployed guvnor 5.1.1 war into web logic 10.3, created package with 4 rules, build and deploy, got package url.
Started using package url in properties file and passing file to RuleAgent api, suddenly it started giving HTTP response code: 401 for URL.
Any thoughts on this issue would be greatly appreciated.
Below is the content of properties file and Client code.
{url=http://10.117.39.51:7001/Guvnor5.1.1/org.drools.guvnor.Guvnor/package/com.tmobile.pos.rules/LATEST , name=myrules, username=weblogic, poll=30, newInstance=true, localCacheDir=C:\Installed\workspaces\drools\POC\bin, workspacepath=C://bea/user_projects/domains/posdomain, password=weblogic123, enableBasicAuthentication=true}
Error:
RuleAgent(myrules) INFO (Fri Nov 26 15:19:00 IST 2010): Configuring with newInstance=true, secondsToRefresh=30
RuleAgent(myrules) INFO (Fri Nov 26 15:19:00 IST 2010): Configuring package provider : URLScanner monitoring URLs: http://10.117.39.51:7001/Guvnor5.1.1/org.drools.guvnor.Guvnor/package/com... with local cache dir of C:\Installed\workspaces\drools\POC\bin
RuleAgent(myrules) EXCEPTION (Fri Nov 26 15:19:01 IST 2010): Server returned HTTP response code: 401 for URL: http://10.117.39.51:7001/Guvnor5.1.1/org.drools.guvnor.Guvnor/package/com.... Stack trace should follow.
java.io.IOException: Server returned HTTP response code: 401 for URL: http://10.117.39.51:7001/Guvnor5.1.1/org.drools.guvnor.Guvnor/package/com...
Client Code: (getting error at 3rd line)
File file = new File("C:\\guvnor.properties");
properties.load(new FileInputStream(file));
RuleAgent agent = RuleAgent.newRuleAgent(properties);
RuleBase ruleBase = agent.getRuleBase();
WorkingMemory workingMemory = ruleBase.newStatefulSession();
Thanks
Kumar
14 years, 10 months
order of execution between BPM events and rules
by Jordi Alvarez
Hello, I am involved in a set of projects for an insurance company in which
we have been combining Drools Expert and Drools Flow for its 5.1.1 version.
We are making extensive use of events / wait states in our processes.
We have experienced that, in case of conflict between wait state constraints
and rules (that is, there is a wait state constraint that is true and also a
rule activation that is true), always the constraints associated to our
processes execute before the rule.
We have searched in the documentation but found nothing regarding this
point. Can anybody confirm whether our empirical assumption is really true?
There is some way to configure this behaviour?
Many thanks in advance!
Jordi Alvarez
14 years, 10 months
How to get a Facts handle in Custom Evaluator
by kashif10
Lets say we have 100s or 1000s of Fact objects of Observation.
In rule we need to compare it with some data lets say
Observation( this checkObs "SomeData")
Where checkObs is our customeEvaluator
Now we have to make the RHS dynamic...
That If we have some data in database depending upon the caller... we need
to replcae that with "SomeData" in our evaluator, but how can I get/passes
user info in our custom evaluator.
Is there a way to read some global variable, or some other facts object in
our evalutor, which changed per firing of rule sets??
--
View this message in context: http://drools.46999.n3.nabble.com/How-to-get-a-Facts-handle-in-Custom-Eva...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 10 months
Unable to get WebDav Access, unless modify JackRabbit Config
by john@oa
Relates to webdav management of rules under: guvnor-5.2.0.Final-tomcat-6.0
Hi
For rapid development, I wish to directly manage the repository through
WebDav.
I can successfully navigate the repository using BitKinex 3.2.3 or Windows 7
web folders. However, I cannot create or edit .drl files. When I do this I
receive an ERROR in the Tomcat console (see error below this post).
I have tried to authenticate with:
-no authentication details
- with the 'guest' user
- the 'anonymous' user
- and the 'admin' user.
I have managed to enable WebDav editing of the repository .drl file's by
updating the JackRabbit configuration of the Tomcat server and changing the
anonymous user to have an id of 'guest' (in Tomcat's repository.xml file -
see below).
*However*, when I do this Drools Guvnor can no longer edit or view Rules.
Any help much appreciated!
ERROR received on edit:
*****************
at java.lang.Thread.run(Thread.java:662)
ERROR 07-09 18:41:29,280 (WebDavServletBean.java:service:154) Exception:
org.
drools.repository.RulesRepositoryException: javax.jcr.AccessDeniedException:
Acc
ess denied
at
org.drools.repository.VersionableItem.checkout(VersionableItem.java:5
61)
at
org.drools.repository.VersionableItem.checkout(VersionableItem.java:5
31)
at
org.drools.repository.AssetItem.updateBinaryContentAttachment(AssetIt
em.java:405)
at
org.drools.guvnor.server.files.WebDAVImpl.setResourceContent(WebDAVIm
pl.java:712)
at net.sf.webdav.methods.DoPut.execute(DoPut.java:152)
at
net.sf.webdav.WebDavServletBean.service(WebDavServletBean.java:128)
at
org.drools.guvnor.server.files.WebdavServlet.service(WebdavServlet.ja
va:76)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:290)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:206)
at org.jboss.seam.web.ContextFilter$1.process(ContextFilter.java:42)
at
org.jboss.seam.servlet.ContextualHttpServletRequest.run(ContextualHtt
pServletRequest.java:53)
at org.jboss.seam.web.ContextFilter.doFilter(ContextFilter.java:37)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:206)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:233)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:191)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:127)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
------------------------
JackRabbit configuration with guest user:
*******************************
<LoginModule
class="org.apache.jackrabbit.core.security.simple.SimpleLoginModule">
</LoginModule>
------------------
--
View this message in context: http://drools.46999.n3.nabble.com/Unable-to-get-WebDav-Access-unless-modi...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 10 months
Function and return value
by snehils
I have made a function in drl file. This function is calling another function
from java file. This java file function returns an object, that I am not
able to get.
function SomeObject testFinction(SomeObject obj1) {
String str;
// Some calculations
// ...
str = "something after calculation";
// this function will return SomeObject based on str value
SomeObject obj2 = Util.getSomeObject(str); // problem is here. obj2 is
updated with same value of obj1. Expected value is diffrent from obj1.
Checked getSomeObject(). It is working fine.
// Some other calculations...
// ...
return anotherSomeObject;
}
rule "Check SomeObject"
when
//eval(tlvID == "57")
someObj:SomeObject(id == "123")
then
testFinction(someObj);
end
I am using drool version 5.1.0.
--
View this message in context: http://drools.46999.n3.nabble.com/Function-and-return-value-tp3317132p331...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 10 months
knowledge agent unable to update rule/flow upon changes
by James
Hi all,
I follow the last reply in
"http://drools.46999.n3.nabble.com/KnowledgeAgent-not-reloading-KnowledgeB..."
and use the static method in following class to obtain knowledge base:
public class DroolsCore {
private static KnowledgeAgent kagent = null;
private static KnowledgeBase knowledgeBase = null;
public static KnowledgeBase createKnowledgeBase() {
if(kagent == null && knowledgeBase == null) {
ResourceChangeScannerConfiguration sconf =
ResourceFactory.getResourceChangeScannerService().newResourceChangeScannerConfiguration();
sconf.setProperty("drools.resource.scanner.interval", "10");
ResourceFactory.getResourceChangeScannerService().configure(sconf);
ResourceFactory.getResourceChangeScannerService().start();
ResourceFactory.getResourceChangeNotifierService().start();
kagent = KnowledgeAgentFactory.newKnowledgeAgent("myagent");
kagent.applyChangeSet(ResourceFactory.newClassPathResource("resource/changeSet.xml"));
knowledgeBase = kagent.getKnowledgeBase();
}
return knowledgeBase;
}
}
I have the my changeSet.xml as follows:
<?xml version="1.0" encoding="UTF-8"?>
<change-set xmlns='http://drools.org/drools-5.0/change-set'
xmlns:xs='http://www.w3.org/2001/XMLSchema-instance'
xs:schemaLocation='http://drools.org/drools-5.0/change-set
http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-api/src/...'>
<add>
<resource source='classpath:resource/rules/' type='DRL' />
<resource source='classpath:resource/flows/' type='DRF' />
</add>
</change-set>
After deploying the application as webapp, I can run the flow + rule all
right.
However, when I switch the execution order in my flow file on the fly and
run the app again (by cliking a link), I get the same result as the flow has
never been changed.
Moreover, I get the following error message when I uninstall the webapp from
my application server (WASCE/geronimo 2.1):
Exception in thread "Thread-44" java.lang.RuntimeException: This Resource
cannot
be listed, or is not a directory
at
org.drools.io.impl.ClassPathResource.listResources(ClassPathResource.
java:191)
at
org.drools.io.impl.ResourceChangeScannerImpl.scan(ResourceChangeScann
erImpl.java:130)
at
org.drools.io.impl.ResourceChangeScannerImpl$ProcessChangeSet.run(Res
ourceChangeScannerImpl.java:311)
at java.lang.Thread.run(Thread.java:735)
Any help is appreciated.
--
View this message in context: http://drools.46999.n3.nabble.com/knowledge-agent-unable-to-update-rule-f...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 10 months