User Experience with multiple users in Guvnor
by John Peterson
I have a question for users out there working with Guvnor. Do you have
more than one user working on rules within the same package at the same
time? How are you handling versioning and testing, especially if the
changes are not going out at the same time?
We've been experimenting with Guvnor (5.0.1) and multiple users and
we're finding that if user A gets something that parses with an error,
it carries over to all the other users when they attempt to validate
their rules. This has been confusing because the error is not with
their code but with something else completely (like a Function with an
error, and they're working on a rule). It seems to us that multiple
users working on the same package in Guvnor would require a lot of
coordination.
Anyone have some wisdom or lessons learned you'd be willing to share?
15 years, 7 months
accumulate vs collect
by rouvas@di.uoa.gr
Hi List,
I'm trying to count the number of objects I have in the Working Memory
using accumulate, but I'm having a ClassCastException thrown at me.
Using a variant with collect, everything work OK.
Can someone shed some light on this issue?
Is it related to https://jira.jboss.org/browse/JBRULES-2202 ?
I'm using Drools.5.0.1 and the fact is a declared one, as follows:
declare t_1
regRowId : String
versionId : String
c_7 : String
c_1 : String
c_2 : String
c_3 : String
c_4 : String
c_5 : String
c_6 : Double
end
trying with :
v945 : Number ( doubleValue >= 1 ) from accumulate ( p : t_1 ( c_6 >=
20100511 && c_7 == "5" ) , count(p) )
I'm getting a ClassCastException:t_1, while using :
v945 : ArrayList ( size >= 1 ) from collect ( t_1 ( c_6 >= 20100511 &&
c_7 == "5" ) )
works OK.
The reason I'm preferring accumulate over collect, is that I'm not really
interested in constructing an ArrayList of the matched facts (worries
about memory consumption), all I want is how many of them are there.
The actual rule I'm using (although I don't think it matters) for the
accumulate variant, is:
rule "r95944.6"
dialect "mvel"
when
gnId : GoodNumbers()
LogicalValue : Trader( gnId.goodNo==goodNo )
v945 : Number ( doubleValue >= 1 ) from accumulate ( p : t_1 ( c_6
>= 20100511 && c_7 == "5" ) , count(p) )
then
RaResultCode rrc = new RaResultCode();
rrc.setResultRuleId("95944");
rrc.setResultRuleVersionId("6");
rrc.setResultColor("R");
rrc.setResultRuleCode("01");
rrc.setResultAction("1");
rrc.setResultGoodNo(gnId.goodNo);
insertLogical(rrc);
end
Thank you for your time.
-Stathis
15 years, 7 months
Rules Flow Eclipse editor
by Prafull Kumar
Hi All,
I would like to know how we can modify the Rules flow eclipse editor look and
feel and functionality. e.g. If we have a Embedded Sub-Process in the flow and
reduce the size of it, the arrows are still displayed in the main canvas.
How we can fix it? also if we want to open the Embedded Sub-Process in a new
window for easy maintainability/readability of the very complex processes, how
we can achieve it?
Please see the attached snapshot for reference.
Going forward we are also looking to create the custom editor for the nodes.
Please guide us if its possible and there is any document for this.
Regards, Prafull
15 years, 7 months
Removing facts from statefulknowledgeSession's memory
by Ayush
Hi,
In my drools implementation I'm inserting all my facts into working memory
and for every fact received I'm also inserting events into notification
stream.
Now the StatefulKnowledgeSession I'm using is static and it is neither
initialized nor disposed after being initialized for first time. My
application will run for months without restarting and so the same session
will be used without being reinitialized or disposed.
Do I have to retract events explicitly or will it handled by drools
internally? If not then how can I retract them say after 5 minutes?
Also I'm using sliding window and I've not explicitly declared expiry time,
for events, in my drl file. Should I define it or will drools remove them
after the maximum sliding window time defined in rules?
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Removing-facts-from-s...
Sent from the Drools - User mailing list archive at Nabble.com.
15 years, 7 months
Loading StatefulKnowledgeSession and Session-ID-Concept
by O.S.
Hi,
I have a question concerning the id-concept of StatefullKnowledgeSessions:
int sessionId = ksession.getId();
While looking up the KnowledgeStoreService-Interface I was a little bit
confused about the loadStatefulKnowledgeSession(...) Method:
|*loadStatefulKnowledgeSession*(int id, KnowledgeBase kbase,
KnowledgeSessionConfiguration configuration, Environment environment)|
I think the first parameter is the session id (see above). But why does
he needs the kbase, config and environment too? Is the session id not
global? Is she bound to one or more of the Classes/Instances
(|kbase|,|configuration,||environment)|?
||
|If the id| is bound, it will implicitly mean that there can be more
than one ksessions with the same id?
Kind regards,
O.S.
||
15 years, 7 months
Updating interval events
by anais
Hello.
I'm using Drools in a system of alarms. I have a drl file with rules in
wich I have defined events that are java classes. I have defined timed
events and interval events. My idea is that an external timer inserts some
interval events time to time. Well, the thing is that I need update an
interval event if another event appears.
I have read somewhere in documentation that updating an event is equal to
remove it and insert a new event with the changes made. If I update an
interval event, will its timestamp change? That is, if I update an interval
event, the moment that this event finishes will be delayed? The problem will
be solved if I assign its timestamp to one property of the event?
Thanks in advance.
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Updating-interval-eve...
Sent from the Drools - User mailing list archive at Nabble.com.
15 years, 7 months
NullPointerException when using Drools rule template
by Roger Smith
All -
I tried out Drools rule template with a with a proptotype app. Drools is
throwing NullPointerException as below. I would much appreciate if someone
on this list can help.
java.lang.NullPointerException
at
org.drools.template.parser.DefaultTemplateColumn.createCellCondition(DefaultTemplateColumn.java:68)
at
org.drools.template.parser.DefaultTemplateColumn.addCondition(DefaultTemplateColumn.java:91)
at
org.drools.template.parser.DefaultTemplateRuleBase.createColumnConditions(DefaultTemplateRuleBase.java:105)
at
org.drools.template.parser.DefaultTemplateRuleBase.createTemplateRule(DefaultTemplateRuleBase.java:98)
at
org.drools.template.parser.DefaultTemplateRuleBase.getDTRules(DefaultTemplateRuleBase.java:85)
at
org.drools.template.parser.DefaultTemplateRuleBase.<init>(DefaultTemplateRuleBase.java:64)
at
org.drools.template.parser.TemplateDataListener.<init>(TemplateDataListener.java:76)
at
org.drools.template.parser.TemplateDataListener.<init>(TemplateDataListener.java:52)
at
org.drools.template.ObjectDataCompiler.compile(ObjectDataCompiler.java:44)
Here is my code
KnowledgeBuilder kBuilder =
KnowledgeBuilderFactory.newKnowledgeBuilder();
ObjectDataCompiler converter = new ObjectDataCompiler();
InputStream dis = new FileInputStream( new File(
"/home/pranab/Projects/gridx/ct11_1.drl" ) );
if (null == dis){
System.out.println("null rule template stream");
return;
}
Collection<Map<String,Object>> paramMaps = new
ArrayList<Map<String,Object>>();
Map<String,Object> params = new HashMap<String,Object>();
params.put("summerOnPeakPrimaryRate", new Integer(299));
params.put("summerOnPeakSecondaryRate", new Integer(524));
params.put("summerSemiPeakPrimaryRate", new Integer(176));
params.put("summerSemiPeakSecondaryRate", new Integer(305));
params.put("summerOffPeakPrimaryRate", new Integer(139));
params.put("summerOffPeakSecondaryRate", new Integer(243));
params.put("winterOnPeakPrimaryRate", new Integer(249));
params.put("winterOnPeakSecondaryRate", new Integer(438));
params.put("winterSemiPeakPrimaryRate", new Integer(176));
params.put("winterSemiPeakSecondaryRate", new Integer(305));
params.put("winterOffPeakPrimaryRate", new Integer(139));
params.put("winterOffPeakSecondaryRate", new Integer(243));
paramMaps.add(params);
String drl = converter.compile(paramMaps, dis);
Reader rdr = new StringReader( drl );
kBuilder.add( ResourceFactory.newReaderResource(rdr),
ResourceType.DRL);
The line in blue is throwing the exception. This code is very similar to the
example code in Drools Expert guide.
Best,
Roger
15 years, 7 months
Doubt regardging Drools-RETE
by Harshit Bapna
Hello everyone,
1. If there are not many common facts i.e all rules are operating on
distinct facts / data. Does this mean the algorithm will not bring in much
benefit ?
2. Also if the facts are same but the LHS of a rule is quite different from
others then will RETE have its benefits.
I have gone through the RETE algorithm documentation and RETE node diagram
chart but still finding difficulty to understand it.
Can somebody please provide a layman language link to understand RETE.
15 years, 7 months
Unable to use StatefulKnowledgeSession inside a webservice
by sumatheja
Hi All,
I'm trying to expose a class as a web service using jax ws.
The class has methods using StatefulKnowledgeSession . Everything goes
on well if i omit those fields. Any idea on this??
--
cheers
Sumatheja Dasararaju
15 years, 7 months