Problem with Collection
by mohanm
Hi,
I am using Drools 5.5.0 Final Expert to do Alarm Co-relation. I was trying
to collect the facts in to the ArrayList collection. My drl file will look
like below. From the Rule I calling an Java method to access the collected
facts.
/rule "Rule [Alarm Collection]"
no-loop
when
$alarmColl : ArrayList() from collect(Alarm
(
JustInserted == true;
))
then
// act on $alarmColl
end/
while in my Java code I am loop through the collection to set an attribute
of the Alarm Object. But while I am trying to set this attribute in the
collection, the collection is getting updated and indexes are changed. Due
to which all the objects are not updated. Even I tried using the iterator to
access the ArrayList collection. Still the same issue.
/
while(index < alarmColl.size()){
Alarm alarmObj=alarmColl.get(index)
if(alarmObj.isJustInserted()) {
alarmObj.setJustInserted(false);
theScenario.getSession().update(alarmObj);
}
index++;
}/
How can I update the objects in collection without changing the index or any
other way to achieve this.
--
View this message in context: http://drools.46999.n3.nabble.com/Problem-with-Collection-tp4029219.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 11 months
Guvnor - Importing Drl FIle and its associated model
by mattmadhavan
Hello,
In have a working Drools project. I would like to import existing DRL files
and associated Model file.
I have a custom operator as well. I have packaged the Model and necessary
operators and util global functions into a jar with their dependencies.
How do I import my DRL and the model jar so that, the DRL's imports 'see'
the referenced operators and functions and the Model (FACT) classes.
Can some one please let me have the sequence of steps?
Thanks
Matt
--
View this message in context: http://drools.46999.n3.nabble.com/Guvnor-Importing-Drl-FIle-and-its-assoc...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 11 months
If I have a rule that has a lot of permutation, which is the best approach to set it up? (Currently using decision table)
by SSWA
Attached is a sample rule decision table that I have set up.
As you can see, I have designed my conditions very nicely in the picture.
But if I were to add a new check, I will actually have to slowly key in the
values.
I'm wondering if there is any way that when I slot a condition into row 4,
it will auto populate the other fields that are "grouped" together. This
way, I wouldn't have to re-write those condition's information.
So example if I have a new module coming in for P1 called MODULE-A, and I
want to create a condition for it to say if the nationality is FR and
Eligibility is Y, it is 500 dollar. I will probably click the + button at
row 5 or even row 6. Then the fields, "P1", "Nationality", "Eligibility",
"Fee Code" will all be populated since they are grouped, and I will just key
in the Module Code.
Is there any way to do this?
--
View this message in context: http://drools.46999.n3.nabble.com/If-I-have-a-rule-that-has-a-lot-of-perm...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 11 months
Best practices to hand over from dev to business
by djb
Hi,
So I've worked with Drools v5 on a few projects, and made the move to v6
yesterday.
My programs typically have a model of pojos, plus some service utilities
that do the stuff that's easier in Java than in Drools.
I have implemented the system with DRLs and agenda groups, and one of the
next steps is to hand over to business. My comments will allow a junior
developer to maintain the program, but you'd be surprised how non-technical
the business users can be. They won't touch code.
So I'm hoping that Workbench will be what I need to facilitate the
transition. With Drools 6, I've separated my web app from the DRL files,
which now reside in their own mavenized Jar.
Deployment is also very manual at the moment. Run mvn install, ftp war to
server, drop in Jboss.
So step 1 is probably to load the model and drl files into WB. Should a
kiesession jar have pojos too? Only the parts you want to manage in WB?
Then I presume that the main goal of WB is to provide a graphical ui to
maintain rules, with business users messing around in their sandbox, making
new snapshot versions of the rules jar?
Then i change the web app's dependency to the new snapshot, rebuild and
redeploy?
What is the best scenario, to allow business users a UI and myself a simple
deployment mechanism when business users want to test their changes, that i
can hope to achieve with Drools and it's Uberfire parts?
--
View this message in context: http://drools.46999.n3.nabble.com/Best-practices-to-hand-over-from-dev-to...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 11 months
Drools 6 Unable to load pom.properties
by djb
Hi guys,
Drools 5 was so nice. I am struggling with 6. (6.0.1-Final)
So I've made a Maven project, ctCharges-0.1-SNAPSHOT, to contain my rules,
and it's basically the same as the named-kiesession example, without any
java files in it. Same kmodule.xml, just my own parentless maven group
instead of org.drools.
I add the dependency to my main project, but when I try this:
KieServices kServices = KieServices.Factory.get();
KieContainer kContainer = kServices.getKieClasspathContainer();
KieSession ksession = kContainer.newKieSession("ksession1");
it gets this:
Found kmodule:
vfs:/C:/jboss-eap/standalone/deployments/iconRules6.war/WEB-INF/lib/ctCharges-0.1-SNAPSHOT.jar/META-INF/kmodule.xml
Virtual file physical path =
C:\jboss-eap\standalone\tmp\vfs\deployment\deployment59bc0232401e9992\ctCharges-0.1-SNAPSHOT.jar-2808edf3c95bef92\ctCharges-0.1-SNAPSHOT.jar
*Unable to load pom.properties*
from\jboss-eap\standalone\tmp\vfs\deployment\deployment59bc0232401e9992\ctCharges-0.1-SNAPSHOT.jar-2808edf3c95bef92\ctCharges-0.1-SNAPSHOT.jar
null
(And then repeats this error couple of times)
If I look in the jar, I see:
META-INF/maven/com.mycompany/myArtifactName/pom.xml and pom.properties
What is going on?
--
View this message in context: http://drools.46999.n3.nabble.com/Drools-6-Unable-to-load-pom-properties-...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 11 months
External Jar/Pojo in Drools Workbench.
by Leonard93
Hello everyone, I have a small question/problem.
I have created a class (POJO) in Eclipse and I want to be able to write
rules over this class in the Drools Workbench, thus I exported the class and
the classes it depends on (1 other class) to a Jar and imported it in the
Drools workbench.
Now what I did next is I added the jar dependency to my workbench project,
created a new datamodel and set its super class to the external class from
the jar and left the rest empty.
When I then try to use this datamodel in a guided rule or anything I can
access the variables defined in the external class fine when using the rule
editor. But when I save I get various compiler errors.
Currently I tried to make a rule template and I got these errors (I am using
the standard example project to test it out):
Unable to create Field Extractor for *'Destination'Field/method
'destination'* not found for class '*org.mortgages.Test' *
Unable to Analyse Expression *Destination ==
GenericDataObject$Country.Germany*: [Error: unable to resolve method using
strict-mode: *org.mortgages.Test.GenericDataObject$Country()]* [Near : {...*
Destination == GenericDataObject$Country.Germ ....}]* ^ [Line: 9, Column: 2]
The class from the jar looks like this:
public class GenericDataObject {
public enum Country
{
Egypt,
Germany,
Turkey,
France,
Unknown
}
public GenericDataObject()
{
result = new Result();
}
public Result result;
public Country Destination;
public void setDiscount(int amount)
{
result.discount = amount;
}
}
public class Result
{
public int discount;
public Result()
{
discount = 0;
}
}
--
View this message in context: http://drools.46999.n3.nabble.com/External-Jar-Pojo-in-Drools-Workbench-t...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 11 months
kie-wb 6.0.2 Deployment error on WAS 8.5.5
by Shrinath Managuli
Hi,
Deployment on WAS 8.5.5 gives the following error:
com.ibm.ws.exception.RuntimeWarning: Error while processing references for
EJB-in-WAR: com.ibm.ejs.container.EJBConfigurationException: The
KieSessionRequesMessageBean message-driven bean (MDB) class does not define a
message listener interface.
Thanks,
Shrinath
[Aspire Systems]
This e-mail message and any attachments are for the sole use of the intended recipient(s) and may contain proprietary, confidential, trade secret or privileged information. Any unauthorized review, use, disclosure or distribution is prohibited and may be a violation of law. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message.
11 years, 11 months