Using pipelines
by Swindells, Thomas
I've been trying to learn how to use pipelines to execute some rules.
I've had a look at the JaxbSimpleJmsMessengerTest as that seemed a good place to start and copy the code from (using drools 5.0.1).
However running the test doesn't seem to actually run any of the rules - I've tried adding println's but they don't appear, nor do the globals appear to get populated.
What am I missing?
Thomas
________________________________
**************************************************************************************
This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the postmaster(a)nds.com and delete it from your system as well as any copies. The content of e-mails as well as traffic data may be monitored by NDS for employment and security purposes. To protect the environment please do not print this e-mail unless necessary.
NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, United Kingdom. A company registered in England and Wales. Registered no. 3080780. VAT no. GB 603 8808 40-00
**************************************************************************************
16 years
Keeping Flows in Guvnor
by tolitius
Need to host all the flows ( process definitions ) in Guvnor as pre-built
knowledge packages.
I heard that it works out of the box, but other people say it is a "desired"
functionality, and it does not really yet implemented to work.
So what is it in reality? I guess this is a question more to Esteban, but
jump in if you are sure.
Thank you,
/Anatoly
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Keeping-Flows-in-Guvn...
Sent from the Drools - User mailing list archive at Nabble.com.
16 years
Unable to create Field Extractor
by Djerir Smail
Hello everybody,
*I need help please **I am new in drools, to start I am trying to
write some simple examples with drools fusion . I wrote a rule which
print a message when an alarm is received multiple times during 20
minutes but i get this error
*
[java] Unable to create Field Extractor for 'BtsNumber' of
'[ClassObjectType event=com.mfe.casestudy.pojo.AlarmFailureEvent]' in
rule 'MaxBtsAlarmrule' : [Rule name='MaxBtsAlarmrule']
[java] java.lang.IllegalArgumentException: Could not parse knowledge.
[java] at
com.mfe.casestudy.test.Tester.prepareKnowledgeBase(Tester.java:73)
[java] at com.mfe.casestudy.test.Tester.setUp(Tester.java:43)
[java] at com.mfe.casestudy.test.Tester.main(Tester.java:87)
[java] Exception in thread "main" java.lang.NullPointerException
[java] at
com.mfe.casestudy.test.Tester.prepareStatefulKnowledgeSession(Tester.java:58)
[java] at com.mfe.casestudy.test.Tester.setUp(Tester.java:44)
[java] at com.mfe.casestudy.test.Tester.main(Tester.java:87)
[java] Java Result: 1
main:
*This is my rule it calculates the number of alarms received from one
BTS and if this number exceeds the threshold it prints a warning message *
rule "MaxBtsAlarmrule"
dialect "mvel"
no-loop true
salience 100
when
$BTS : BTS()
# check if the number of alarms of last 20 minutes exceeds
# the BTS threshold
$numOfAlarms : Number( intValue > $BTS.threshold )
from accumulate(
AlarmFailureEvent(
BtsNumber == $BTS.number,
$ID : ID
)
over window:time(3) from
entry-point BTSAlarmStream,
count($ID)
)
then
System.out.println("BTS should be restarted...");
end
Finally this is the alarm event class
public class AlarmFailureEvent implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
public String BtsNumber = "";
private int code = 0;
private int ID=0;
public AlarmFailureEvent(String BtsNumber, int code ,int ID) {
this.BtsNumber = BtsNumber;
this.ID=ID;
this.code=code;
}
public void setID(int iD) {
this.ID = iD;
}
public int getID() {
return this.ID;
}
public void setCode(int code) {
this.code = code;
}
public int getCode() {
return this.code;
}
public void setBtsNumber(String btsNumber) {
this.BtsNumber = btsNumber;
}
public String getBtsNumber() {
return BtsNumber;
}
}
*Thank you *
16 years
Working on Selectors - getting 'The Selector named onlyNonDraftRules is not available'
by John Peterson
I'm working off of Jarosław Kijanowski's blog post from 7/8/2009 on using Selectors:
http://www.kijanowski.eu/index.php?site=articles&article=guvnor_selectors...
I've followed the instructions for a DRL selector, including adding a line to the selector.properties file as follows:
onlyNonDraftRules=/NonDraft.drl
Both the NonDraft.drl file and selector.properties file are here:
<parent directory>\jboss-4.2.3.GA\server\default\deploy\drools-guvnor.war\WEB-INF\classes
My NonDraft.drl is as follows:
package org.drools.guvnor.server.selector
import org.drools.repository.AssetItem
import org.drools.guvnor.server.selector.Allow
rule 'non draft rules'
dialect 'mvel'
when
AssetItem(stateDescription != "Draft")
then
insert(new Allow());
end
When I try to do a "Build Package" in Guvnor, I get the following error: "Name: com.sample, Format: package, Message: The Selector named onlyNonDraftRules is not available"
My package in Guvnor has a few rules, only one of which is not in Draft status. Everything is built in Guvnor (including Facts - no code is written in Eclipse).
Has anyone seen this error before and know how to correct it? I'm using 5.0.1.
16 years
Introspect Rules When condition
by Kinjal Khandhar
Hello All,
I am working on Drools Rules and need help on the below problem:
In my .drl file say:
*rule*
*when*
* Object1(......)*
* Object2(......)*
*then*
* *
*end;*
Is there a way(Drools API or any method) in which I can scan through my
rules files and get the objects...say Object1 and Object2.
In a way I want to introspect the *when condition* objects.
If anyone has any idea,please let me know.
Thanks,
Kinjal
16 years
Problem in adding jar files to Drools library in Eclipse
by Prabhat
Hello Everyone,
I am new to Drools and a beginner, and have to work on Drools Rules.
Using Eclipse IDE:
Main Eclipse page on my PC does not show custom classpath container "Drools
Library" and I am not able to add required jar files(already downloaded)
into Drools Library on Buildpath editor where "Drools Library" is available.
Please let me know how to add jar files to Drools library in Eclipse so that
I can see Drools library in package explorer pane in Eclipse window.
Thanks,
Prabhat
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Problem-in-adding-jar...
Sent from the Drools - User mailing list archive at Nabble.com.
16 years
Local repository location of Guvnor and accessing the data out of it
by Vignesh
Hi,
I am new to Guvnor and I am aware that Guvnor will store the data in its
local repository using Derby database, Below is what i am trying to do,
I have imported a JAR file which will access and provide the data that I am
going to run against my rule,
This new rule will do some validation and depending upon the result i need
to log the defect in Guvnor's repository,
Using this persisted data in the defect table I would do my further
processing in another Drools application
I have the below questions,
What is the default location of Guvnor's repository ? (I am using Tomcat for
my deployment)
If we can store the defect data like the way i have mentioned above, how can
we access the data from the repository, is there any spl way to access it?
Thanks,
Viki
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Local-repository-loca...
Sent from the Drools - User mailing list archive at Nabble.com.
16 years