sliding window question
by lin.lin
Hi,
I tried to create a rule that gives an alert when a machine reading is high
for 30 seconds. I modeled the machine reading input as events. The
following is the rule:
rule "rule1"
dialect "mvel"
when
$rd1 : mReading( reading >90 ) from entry-point ReadingStream
not ($rd2 : mReading (reading<=90 , this before [0s, 30s] $rd1 )
from entry-point ReadingStream )
then
System.out.print ("alert: Reading high for 30 seconds \n");
end
This does not detect detect the bad reading. However, If I changed the rule
to be following (change second condition from "not" to "exists"), it detects
all readings that are good.
rule "rule1"
dialect "mvel"
when
$rd1 : mReading( reading >90 ) from entry-point ReadingStream
exists ($rd2 : mReading (reading<=90 , this before [0s, 30s] $rd1 )
from entry-point ReadingStream )
then
System.out.print ("alert: Reading high for 30 seconds \n");
End
Is this an issue in CEP or did I do something wrong?
Thanks a lot!
Lily
--
View this message in context: http://drools.46999.n3.nabble.com/sliding-window-question-tp4028367.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
10 years, 9 months
KieRepositoryScannerImpl missing in 6.0.0
by Wolfgang Laun
kieScanner = kieServices.newKieScanner(kieContainer);
results in
Caused by: java.lang.ClassNotFoundException:
org.kie.scanner.KieRepositoryScannerImpl
A scan of all the jars shows that the class is missing.
Any comments I can pass on?
-W
10 years, 9 months
OptaPlanner - best strategy for variable number of planning entities?
by Nadim
Hi, I'm new to OptaPlanner, and reading through the planning examples in the
documentation left me with a question. One problem I'm trying to model
involves a variable number of planning entities, which I didn't really see
addressed by any of the examples; they all seemed to me more focused on
varying the states of planning variables for a fixed / known number of
entities.
To throw out some specifics...let's say I'm trying to optimize my attendance
schedule for some convention. I have a set of problem facts, the various
events going on at the convention, with each having a time (when the event
happens), and a worth (how much I'd like to be there for that event).
And I have a set of planning entities, the various times that I'm present at
the convention. So, I'm trying to model the case where my key constraint is
the total amount of time I spend at the convention...let's treat that as
fixed. I don't care how many separate times I go there, though I will have
to model constraints like a minimum length per visit (very inefficient to go
for 10 minutes at a time), and a minimum separation between visits (annoying
/ inefficient to leave, then turn right around and go back, unless I get an
hour break).
Again, I didn't see a good way to just say "have any number of planning
entities in the planning entity collection, so long as they meet the
constraints". So instead, I modeled the problem as a set of visits,
calculated as the max possible visits (total conference length / minimum
visit duration). Then I defined each visit to have three planning
variables: start time, duration, and whether that visit is "active". I'm
looking forward to 6.1, where it seems there's better support for numeric
ranges, but for now, just modeled start time as the set of integers
representing the time range of the convention in minutes. Finally, I
constructed a hard score based on the constraints above, and a soft score
that represents the sum of the worth of the events that occur during the
visit.
However, I'm not seeing it work out too well...the engine seems to spend a
lot of time messing around with one visit, and very little time trying out
multiple visits with different starts and durations to capture event-rich
times. I can certainly play around with parameters and engine
configuration, but I thought I should first ask if I was fundamentally going
about modeling the problem the wrong way, as I am very new to the
OptaPlanner engine.
Thanks in advance for any thoughts or suggestions!
--
View this message in context: http://drools.46999.n3.nabble.com/OptaPlanner-best-strategy-for-variable-...
Sent from the Drools: User forum mailing list archive at Nabble.com.
10 years, 9 months
dynamic rules creation/updation
by Kulbhushan Azad
hi All
i am new to Drools , was trying to explore drools for one of my project
requirements.
am looking if drools business rules can be stored ,retrieved and applied
from a relational database like oracle.
requirement is to provide end user capability to create/modify rules
dynamically without a need of code change.
appreciate if anyone can guide me to some information on this.
--
Thanks
Kulbhusan
10 years, 9 months
Drools Guvnor : Rule validation fails - Not finding any of the fields from the Fact
by mattmadhavan
Hello,
I have imported bunch of rules (.drl file) into the Guvnor. Then I imported
the Jar file containing the Facts and my Custom Operator and also the static
methods into the same "Guvnor
package of the rules.
When I try to validate the rules, I am getting errors saying that it is not
able to fund the given field in the Fact. None of the rules validate. They
always complain that what ever filed that is referenced in the Fact by the
rule, it doesn't exist.
Any ideas please?
Also how do I veiew/verify that my jar file was loaded OK . ( Can I
check/verify the model classes to see if they were loaded Okay?)
Also how do I delete unwanted/old model category or for that matter any
assets?
Thanks in advance
Matt'M
--
View this message in context: http://drools.46999.n3.nabble.com/Drools-Guvnor-Rule-validation-fails-Not...
Sent from the Drools: User forum mailing list archive at Nabble.com.
10 years, 9 months
not in -Not working
by Gopu Shrestha
Here is the code snipet.
rule "Validation"
when
$claim: Claim($cos: claimIdentificationInfo.categoryOfService !=null);
$claimId: ClaimIdentification($cos not in ("01","03","04"), $cos.length >0);
then
log.info("Executing Rule: Validation .............");
end
Above code works if
- $cos in ("01","03","04")
-$cos.length
But when I put not in front of in ("not in"), it throws exception like this...
Unable to build constraint as '$cos' is invalid : [Rule name='Validation']
10 years, 9 months
High availability with a drools cluster
by Chakravarthi Muppalla
Hello All,
We are planning to user drools for our event driven business rules
execution. I’m designing this around the features available in Expert
engine, Fusion, Guvnor.
An overview of the system will look like this.
1.) 1.) We will have N application nodes with an embedded drools engine.
These nodes will be subscribed to the JMS(mostly ActiveMQ) and a clustered
cache.
2.) 2.) All the customer activities will be pushed onto the JMS. One of
these N nodes will get the customer activity event. This node will update
the cache (customer related data cache) with this activity.
3.) 3.) As all the nodes are connected to the cache, each one of them
will get a call back about the cache entry.
4.) 4.) If this is the first activity of the customer, One of the nodes
will act as a master to pick up this and insert this into the stateful
session’s working memory.
5.) 5.) Any further cache call backs related to this user will be sent
to this node.
In case one of the nodes go down, I want one of the other nodes to resume
the execution of the affected customers.
To translate this into drools, I want one of the nodes to pick up the
session of the failed node. As this is not available out of the box, I’m
looking for possible approaches.
I’m thinking of writing the working memory contents to a middle tier
cache(possibly radis) backed by persistence(mysql). This cache will write
the data to the persistence either at certain intervals or on certain
events.
I’m certain that other nodes can be notified, if one of the nodes go down.
So the question is, about the possibility to write/read the session to/from
a cache, pick up with session and seamlessly resume the execution. Are
there any practical approaches to store the working memory in a cache
instead of just the VM memory?
--
Cheers!
10 years, 9 months
Facing Problem with this exception
by Mallikarjun Kohalli (mkohalli)
Hi All,
We are getting the following exceptions when drools is executing some rules.
Exception:
Caused by: java.lang.NullPointerException
at org.drools.core.util.LeftTupleIndexHashTable.remove(LeftTupleIndexHashTable.java:251)
at org.drools.reteoo.NotNode.retractLeftTuple(NotNode.java:226)
at org.drools.reteoo.SingleLeftTupleSinkAdapter.doPropagateRetractLeftTuple(SingleLeftTupleSinkAdapter.java:217)
at org.drools.reteoo.SingleLeftTupleSinkAdapter.propagateRetractRightTuple(SingleLeftTupleSinkAdapter.java:124)
at org.drools.reteoo.JoinNode.retractRightTuple(JoinNode.java:151)
at org.drools.reteoo.ObjectTypeNode.retractObject(ObjectTypeNode.java:232)
at org.drools.reteoo.ReteooWorkingMemory$WorkingMemoryReteExpireAction.execute(ReteooWorkingMemory.java:412)
at org.drools.common.AbstractWorkingMemory.executeQueuedActions(AbstractWorkingMemory.java:1471)
... 51 more
Regards,
Mallikarjun K
10 years, 9 months