DSL: Unable to Expand Error - Even things that shouldn't be expanded.
by SrjTx
I've done a couple DSL/RDSLR rules in the past with success. Been trying to
create one today but get "Unable to expand" errors on validation on every
line, even with not substitutions.
What am i missing?
Here is a NON-DSL/RDRL file that works just fine.
5. | rule "AAA"
6. | dialect "mvel"
7. | when
8. | $sep : DroolsSepBean( )
9. | then
10. | System.out.println("HI");
11. | end
Here is a DSL/RDSLR file that generates the errors below (note this is the
same code as above and nothing should substitute) I even took out the $sep
assignment to make it more simple (it gives same errors if it's in there)
5. | rule "dsltest"
6. | dialect "mvel"
7. | when
8. | DroolsSepBean( )
9. | then
10. | System.out.println("HI");
11. | end
18:42:57,396 ERROR [org.drools.compiler.kie.builder.impl.AbstractKieModule]
(http-/127.0.0.1:8080-2) Unable to build KieBaseModel:defaultKieBase
[8] Unable to expand: DroolsSepBean( )
[10] Unable to expand: System.out.println("HI");
--
View this message in context: http://drools.46999.n3.nabble.com/DSL-Unable-to-Expand-Error-Even-things-...
Sent from the Drools: User forum mailing list archive at Nabble.com.
10 years, 8 months
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, 8 months
ArrayIndexOutOfBoundsException under high events load in drools CEP
by ters
Hi, drools users/developers. As mentioned in subject, I often faced
ArrayIndexOutOfBoundsException under high events load in drools during
marshaling.
Conditions: drools CEP (5.4.0.Final), Stream mode, fireUntilHalt mode,
during very active marshaling process (in several threads) I often have such
trace:
java.lang.ArrayIndexOutOfBoundsException: 2773
at
org.drools.marshalling.impl.ProtobufOutputMarshaller.orderFacts(ProtobufOutputMarshaller.java:592)
at
org.drools.marshalling.impl.ProtobufOutputMarshaller.writeFactHandles(ProtobufOutputMarshaller.java:533)
at
org.drools.marshalling.impl.ProtobufOutputMarshaller.serializeSession(ProtobufOutputMarshaller.java:139)
at
org.drools.marshalling.impl.ProtobufOutputMarshaller.writeSession(ProtobufOutputMarshaller.java:100)
at
org.drools.marshalling.impl.ProtobufMarshaller.marshall(ProtobufMarshaller.java:169)
at
org.drools.marshalling.impl.ProtobufMarshaller.marshall(ProtobufMarshaller.java:151)
at
com.blablabla.cep.CEPEventProcessor.marshalWorkingMemory(CEPEventProcessor.java:332)
This exception occurs really often.
I googled fresh tracked bug
https://bugzilla.redhat.com/show_bug.cgi?id=1044577. As I understand, this
bug is fixed in drool 5.3.x branch, but we using drools-core 5.4.0.Final.
So could you please help me what to do with this exeption?
Thanks in advance.
--
View this message in context: http://drools.46999.n3.nabble.com/ArrayIndexOutOfBoundsException-under-hi...
Sent from the Drools: User forum mailing list archive at Nabble.com.
10 years, 8 months
NullPointerException when calling Scan manually
by Brecht De Rooms
Dear Drools users,
I just merged all my code to Drools 6.0.1 and I am happy to see that it is
more stable. Several issues I had with 5.6.x do not present themselves in
6.0.1. I am still stuck on one bug however that occurs randomly. I wrote a
unit test in which I deploy new rules and then call scanNow. Often the
unit test succeeds, but sometimes it throws this nullpointer exception.
java.lang.NullPointerException
at
org.drools.core.rule.Package.getRulesGeneratedFromResource(Package.java:668)
at
org.drools.core.rule.Package.removeRulesGeneratedFromResource(Package.java:658)
at
org.drools.core.reteoo.ReteooRuleBase.removeObjectsGeneratedFromResource(ReteooRuleBase.java:1653)
at
org.drools.compiler.compiler.PackageBuilder.removeObjectsGeneratedFromResource(PackageBuilder.java:4150)
at
org.drools.compiler.kie.builder.impl.KieContainerImpl.updateToVersion(KieContainerImpl.java:149)
at
org.kie.scanner.KieRepositoryScannerImpl.updateKieModule(KieRepositoryScannerImpl.java:214)
at
org.kie.scanner.KieRepositoryScannerImpl.scanNow(KieRepositoryScannerImpl.java:204)
at derooms.be.engine.RuleEngine.scanNow(RuleEngine.java:111)
at
derooms.be.engine.ruleDeployment.RulesPackageWriter.deployRules(RulesPackageWriter.java:104)
at
derooms.be.engine.ruleDeployment.RulesPackageWriter.addRules(RulesPackageWriter.java:84)
at
derooms.be.engine.dynamicRuleWatcher.RuleFileHandler.handleModifiedFile(RuleFileHandler.java:50)
at
derooms.be.engine.dynamicRuleWatcher.RulesWatcherRunnable.run(RulesWatcherRunnable.java:105)
at java.lang.Thread.run(Thread.java:744)
Does anyone have an idea what the problem might be?
Kind Regards,
Brecht
-------------------------------------------------------------
Brecht De Rooms
Phd Student @ WISE
Department of Computer Science
Vrije Universiteit Brussel
Pleinlaan 2, B-1050 Brussels, Belgium
office: 10 G 731f
phone: +32 2 629 37 49
email: bderooms(a)vub.ac.be
-------------------------------------------------------------
---
Dit e-mailbericht bevat geen virussen en malware omdat avast! Antivirus-bescherming actief is.
http://www.avast.com
10 years, 9 months
VCRP - Distance calculation in getMilliDistance
by Marcus Uerlings
Hi
I´ve download Optaplanner a couple of months ago and found it fantastic!!
Congrats to Geoffrey!
I´m not a programmer, but a logistic consultant to a non-governmental
organization (NGO) of recycling products and like to give my "cent of
contribuition" if it applies.
1. Distance Calculation:
I´ve learned from a person that works with georeference that a good
aproximation in calculating distances from latitude and longitude is to
multiply the Euclidean result by "111.1".
This "magic number" will give the approximate distance in kilometers and
then the final soft score will show the minimum distance in "km" and not in
"fuel" (although they are related).
=====
public int getMilliDistance(Location location) {
( ... )
(latitudeDifference * latitudeDifference) +
(longitudeDifference * longitudeDifference));
return (int) (distance * 1000.0 * 111.1);
}
=====
2. Heteregenous vehicles
Many times a fleet is made of different vehicles, different sizes, capacity
and one of the most important, different mileages (in Km/litre or
litres/100 km).
How can I put it in vehicle parameters, together with capacity and took
into account in score calculation?
Doing so, the score would be calculated as minimum(Distance*mileage).
3. Real example
I fed real data into Optaplanner VCRP and plot the results in Googlemaps.
Due to one way streets, the result does not look efficient to the drivers
of the NGO.
Is there a way to use an internet routing service, like Googlemaps in
Optaplanner?
If it is possible, can someone help me coding this? :)
Regards from Brazil
Thank you in advance
Marcus Uerlings
______________________________________________
*Marcus Uerlings+11 9 4178-0544*
10 years, 9 months