guvnor converting descision tables
by captainrhino
<http://drools.46999.n3.nabble.com/file/n4025559/table2.gif>
Trying to convert the following xls spreadsheet to descision table using
guvnor. The spreadsheet above works loaded normally through drools runtime
but it would be real nice if the users could update data rows through the
guvnor interface.
I recieve the following error
com.google.gwt.user.server.rpc.UnexpectedException: Service method 'public
abstract org.drools.guvnor.client.rpc.ConversionResult
org.drools.guvnor.client.rpc.AssetService.convertAsset(java.lang.String,java.lang.String)
throws com.google.gwt.user.client.rpc.SerializationException' threw an
unexpected exception:
org.drools.template.parser.DecisionTableParseException: Unexpected content
"eval( true )" in cell B15, leave this cell blank
Is there anything obviously wrong with what I am trying to do? I have
removed cell b15 but that starts a catalogue of other errors...
Any suggestions most welcome....
regards&thanks in advance
Graeme
--
View this message in context: http://drools.46999.n3.nabble.com/guvnor-converting-descision-tables-tp40...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 3 months
AgendaListener, Mockito not capturing arguments
by droolster
Hello,
Please can the community help me.
I am mocking an AgendaListener on my working memory session using Mockito.
However, Mockito's ArgumentCaptor is not picking up the event. Please can
you tell me where I am going wrong (code below):
Code:
// Set up knowledge base and sessions etc ....
AgendaEventListener ael = mock(AgendaEventListener.class);
ksession.addEventListener(ael);
// push data into session ....
ArgumentCaptor<AfterActivationFiredEvent> af =
ArgumentCaptor.forClass(AfterActivationFiredEvent.class);
verify(ael).afterActivationFired(af.capture()); *// This fails*
List<AfterActivationFiredEvent> events = aafe.getAllValues();
AfterActivationFiredEvent first = events.get(0);
assertThat(first.getActivation().getRule().getName(), is("My rule"));
If I add the listener as follows, I can see that the afterActivationFired()
method is being called:
ksession.addEventListener(new AgendaEventListener() {
@Override
public void beforeRuleFlowGroupDeactivated(
RuleFlowGroupDeactivatedEvent event) {
// TODO Auto-generated method stub
}
@Override
public void beforeRuleFlowGroupActivated(RuleFlowGroupActivatedEvent
event) {
// TODO Auto-generated method stub
}
@Override
public void beforeActivationFired(BeforeActivationFiredEvent event) {
// TODO Auto-generated method stub
}
@Override
public void agendaGroupPushed(AgendaGroupPushedEvent event) {
// TODO Auto-generated method stub
}
@Override
public void agendaGroupPopped(AgendaGroupPoppedEvent event) {
// TODO Auto-generated method stub
}
@Override
public void afterRuleFlowGroupDeactivated(
RuleFlowGroupDeactivatedEvent event) {
// TODO Auto-generated method stub
}
@Override
public void afterRuleFlowGroupActivated(RuleFlowGroupActivatedEvent
event) {
// TODO Auto-generated method stub
}
@Override
public void afterActivationFired(AfterActivationFiredEvent event) {
// TODO Auto-generated method stub
System.out.println(event.getActivation().getRule().getName());
}
@Override
public void activationCreated(ActivationCreatedEvent event) {
// TODO Auto-generated method stub
}
@Override
public void activationCancelled(ActivationCancelledEvent event) {
// TODO Auto-generated method stub
}
});
Thanks for your help in advance.
Regards,
--
View this message in context: http://drools.46999.n3.nabble.com/AgendaListener-Mockito-not-capturing-ar...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 3 months
Descision Tables loop around params $1, $2, $3 add to list
by captainrhino
With the pseudo class below as an example I am looking to dynamically loop
around the list of params (there could be n number of strings) in a
descision table and load some values into a list. I could do this in
separate columns but I am looking to do it in one column so as that there
can be an infinite number of strings.
public MyClass{
private List<String> list;
private List<String> getList(){
return list;
}
}
Pesudo desciion table
Action
forAll ($) myclass.list.add($)
ListOFStrings
first,second,third,fourth
basicaly list gets populated with the $1,$2,$3,$n etc values by some king of
loop construct.
Is this even possible or can someone suggest an alternative?
regards and thx in advance
GRaeme
--
View this message in context: http://drools.46999.n3.nabble.com/Descision-Tables-loop-around-params-1-2...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 3 months
Using Drools Fusion to compute overlaps of many intervals
by Raphael Jolivet
Hi Drools guys.
I just asked the following question on
StackOverlow<http://stackoverflow.com/questions/18219841/using-drools-fusion-to-comput...>
.
Could you please help :
I am already using Drools to do some *preprocessing of an allocation problem
* (resources vs operations). The operations are already time *intervals* but
I did not need to leverage the Drools Fusion features yet.
There is a new requirement for having some *attributes of my resources
changing over time*.
I am willing to model this (the change of values over time) as *"events" in
Drools* and take advantage of Drools Fusion, in *Cloud* mode.
Hence I will have to match those "dynamic" attributes events against my
operations (again declared as events in Drools fusion). This will require
Drools to *compute a great amount of intervals overlaps*.
I have several questions :
- I have found the *overlap* operator to be kind of counter-intuitive,
and to not actually process*overlap* as we usually describe it. I would
expect [a;b] and [c;d] to overlap if *(b > c) and (a < c)*. Is there a
time operator for that ? Or should I use a composition of several time
operators ?
- Does Drools Fusion uses any kind of internal optimization for this
kind of problem ? Naively matching N intervals against M intervals would
require *0(N x M)* operations. I have found a way to go down to *(M x
log(M) + N x log(N))*, by sorting the intervals beforehand : Should I
prepare the pair of overlaps for Drools in advance ?
- Related to the previous question : Is there any benefit in this case
(in term of performances), of using *Drools Fusion* instead of *regular
Drools* together with conditions over timestamps and duration ?
Thanks for your advice
Brgds,
-- Raphael
11 years, 3 months
Drools 5.5 + JavaEE on ARM: a simple benchmark. How to proper benchmark Drools 6 ?
by Matteo Mortari
Hey Ciao, I want to share my findings while experimenting with Drools
5.5.0.Final and JavaEE 6 on an ARM (embedded) platform: Raspberry Pi and
Odroid-U2; and their performances.
I'm going to provide a link below with more details, but to avoid this post
being flagged as "shameless plug" :P I make a small summary right here.
I've readapted the waltz benchmark as a JavaEE application / webservice.
I'm aware on the debate concerning Expert systems benchmarks, but in this
case will be used for a relative comparison of performances. I load-tested
the webservice on the Raspberry Pi and the Odroid-U2, comparing the
response time to a baseline computer with a 1.8 GHz Intel Core i7. The
baseline responds in 132ms. The Raspberry Pi responds in 17219ms (~130x
slower) showing it's suffering a lot in this case and possibly is not
really a fair use case scenario for the Raspberry Pi, given the intensive
computation Vs limits of the JVM on this platform. The Odroid-U2 responds
in 566ms (~4x slower) which is a very impressive figures if you consider
its specs and cheap cost.
Conclusion I take, in my perspective, there is plenty of potential in using
JavaEE on these inexpensive ARM platforms, and I'm looking forward to hear
how would be a proper way to benchmark / performance-test of upcoming
Drools 6. The reason I'm asking, is because of the following statement on
the announcement of Drools 6 on blog.athico.com: "The algorithm addresses
the greedy and wasteful nature of Rete. This will make it suitable for more
constrained environments, such as mobile devices" - which I do believe is a
very similar scenario to the one I've presented above. I'll be happy to
clock its performance on the ARM platforms I own, but in this case I prefer
be guided what would be a sensible benchmark to highlight the gain given by
the new algorithm.
Besides, I hope I provided with this post an informative report to this
community :)
Ciao
MM
see also link:
http://tarilabs.wordpress.com/2013/08/14/expert-systems-and-javaee-on-arm...
11 years, 3 months
Drools 5.5 Percentage rules
by gboro54
I am trying to craft rules which deal with percentage of 2 numbers(some
percentages are like .1%). A rule like the following I can't get to fire
for bigger numbers. Any thoughts on this would be great!
rule 'Added through MPID < 0.1% TCV'
when
billableItem:BillableItem(code in ("A","7","8"),
isPriceUnderDollar==false)
$a:AccountVolumeAccumulation(accountId==$billableItem.accountNumber,accumulationType=="Add-All",
((volume * 100.0f)/$consolidatedVolume.volume) <.1)
then
$billableItem.setPrice(t);
end
please note that $consolidatedVolume is a global variable(this is static
data)
--
View this message in context: http://drools.46999.n3.nabble.com/Drools-5-5-Percentage-rules-tp4025545.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 3 months
Dublin : JBoss BRMS (Drools) event Wed 28th August
by Mark Proctor
http://blog.athico.com/2013/08/dublin-jboss-brms-drools-event-wed-28th.html
---
Dublin : JBoss BRMS (Drools) event Wed 28th August
Posted by Mark Proctor
Making an updated post. Thanks to Sabeo and IrishDev I'll be doing two presentations now, one in the morning, and one in the evening. Both events are free, but you must register, and spaces are limited. So please help spread the word.
Both events are sponsored by Sabeo, and the evening event is hosted by IrishDev
Morning Event
Date : 28 August
Start: 09:30
Location: The Westin Dublin Hotel, College Green, Westmorland Street, Dublin 2
URL: http://tinyurl.com/mfralbu
Evening Event
Date : 28 August
Start: 18:30
Location TCube, Pheonix House, Castle St, Dunblin 2
URL: http://irishdev.com/Home/Events/896-Dublin-Java-User-Group-.html
11 years, 3 months
Is my use case suuported in Drools?
by Elran Dvir
Hi all,
I am new to drools and I'm trying to understand whether the following use case is supported - any help on the following will be greatly appreciated:
I would like to create a new event based on multiple events (all of the same type meeting a set of conditions) occurring over a given period of time T1.
For each combination of values for fieldA and fieldB, a new group of event candidates should be opened (fieldA and fieldB are group by fields. Each combination of values of these fields, should be treated separately).
The event should be created when at least X events occurred over the period. Count the events based on unique values of fieldC and fieldD (for a given combination of fieldA and fieldB, if you notice an event with already existing values of the combination of fieldC and fieldD, it should not be counted).
If all conditions described above are met, create the desired new event. The new event will stay open for duration of T2, and update will be sent for it every T3.
Aside from the above, I need an aggregation function (besides count) of "collect" : in the new event the value of fieldE will be the collection of (preferably distinct) values of fieldE in originating events.
Example:
Port scan event - the basic event is connection. For each combination of source_ip and destination_ip (group by fields), detect a port scan event if over a minute (T1) there more than 20 (X) events with different ports (unique field).
The event will stay open for 10 minutes (T2) and an update will be sent every 1 minute (T3). Every update will contain the count of events, source_ip, destination_ip and collection of services.
Thanks a lot.
11 years, 3 months
Multiple user on same rule server
by Chaturvedi Dewashish
Hi,
I have a set up of rule server as
1. Drools-guvnor is being hosted on jBoss-as-7.1.1
2. Rule checker uses this location for rule and validates accordingly.
Now I want to use the same rule server for different user with different
rule checker as rule server set up is heavy. So I want some sort of context
between rules or packages. One rule/package can only be used for one user.
If rule repository is separate for different user it will be great.
Thanks and regards,
Chaturvedi Dewashish
11 years, 3 months
Drools decision tables — calling functions inside value cells
by Atul Bhatia
I am looking to use drools decision tables for a project. I want to add a
condition where I verify that the value of a passed in object is less than
a specified number. I want the decision table to look something like:
http://imgur.com/gf1Twb4
If you look at the third condition where I am checking the max size of the
loan, I am calling a function: $t.getStandardLimit($n).
Unfortunately, I am unable to call the function inside the value cells with
that syntax (drools reads it as a string and returns a syntax error). Is
there a way to do this?
11 years, 3 months