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.
15 years, 9 months
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 *
15 years, 9 months
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.
15 years, 9 months
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
15 years, 9 months
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.
15 years, 9 months
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.
15 years, 9 months
error running test scenarios
by Fnu Mahalakshmi
________________________________
From: Fnu Mahalakshmi
Sent: Friday, May 28, 2010 3:43 PM
To: 'rules-users-request(a)lists.jboss.org'
Subject: error running test scenarios
Hi,
I am working on a drools application and I am getting the following error:
I import java files to my application and then create the rules + test scenarios to run them.
Attaching a jar file of the java classes.
My Test Case:
Run scenario
[cid:image001.gif@01CAFE7B.7BEA36E0]
GIVEN
insert [Ovo]
[TestOvoUseType]
ipAddress:
[cid:image002.gif@01CAFE7B.7BEA36E0]
useType:
[cid:image002.gif@01CAFE7B.7BEA36E0]
[cid:image002.gif@01CAFE7B.7BEA36E0]
[cid:image001.gif@01CAFE7B.7BEA36E0]
EXPECT
[cid:image002.gif@01CAFE7B.7BEA36E0]
[cid:image003.gif@01CAFE7B.7BEA36E0]
Use real date and time
Use a simulated date and time
Expect rules
Production Ips:
fired at least once
did not fire
fired this many times:
Choose...
[cid:image002.gif@01CAFE7B.7BEA36E0]
More...
(configuration)
Allow these rules to fire:
Prevent these rules from firing:
All rules may fire
[cid:image001.gif@01CAFE7B.7BEA36E0]
[cid:image004.gif@01CAFE7B.7BEA36E0]
[cid:image001.gif@01CAFE7B.7BEA36E0]
(globals)
Test for checking Production Ips
Title: [ProdIp Test]
[show more info...]
Rules case:
WHEN
[cid:image001.gif@01CAFE7B.7BEA36E0]
Ovo
useType
--- please choose ---
is equal to
is not equal to
matches
sounds like
[cid:image005.gif@01CAFE7B.7BEA36E0]
[cid:image002.gif@01CAFE7B.7BEA36E0]
[cid:image002.gif@01CAFE7B.7BEA36E0]
THEN
[cid:image001.gif@01CAFE7B.7BEA36E0]
Insert Ip
type
[cid:image002.gif@01CAFE7B.7BEA36E0]
[cid:image002.gif@01CAFE7B.7BEA36E0]
(options)
[cid:image001.gif@01CAFE7B.7BEA36E0]
View source
Validate
Ips in Ovo are Production Ips
Title: [Production Ips]
[show more info...]
Error stack:
15:36:25,517 INFO [STDOUT] ERROR 28-05 15:36:25,507 (ServiceImplementation.java:runScenario:1942) [Error: unable to find constructor for: org.servers.Ovo] [Near : {... new org.servers.Ovo( ....}] ^ [Line: 1, Column: 0]
I have defined the constructor in the Ovo class and Ip class respectively.
Please let me know if you can throw some light on this.
Thanks,
Jillika
</pre>
<P><hr size=1></P>
<P><STRONG><font color=green>Please consider the environment before printing this email.</font></STRONG></P>
<P><STRONG>Visit our website at <a href="http://www.nyse.com">http://www.nyse.com</a> <br>
*****************************************************************************
<br>
Note: The information contained in this message and any attachment to it is privileged, confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify the sender immediately by replying to the message, and please delete it from your system. Thank you. NYSE Euronext.
</STRONG></P><pre>
15 years, 9 months