Do exported BRMS repositories maintain version history?
by Shahad Ahmed
I've come across an issue with exporting and importing a BRMS repository
backups, which I'm not sure is a feature or a bug.
I have a package that contains a bunch of rules I've developed. I've
modified and saved rules, so that most of the rules have a fairly long
history when you select the Version History in the rule view.
If I export the repository in the Admin/Manage Backups section and then
import the repository into a clean BRMS installation, all the version
history of the rules seems to be lost. The rules still have the correct
version attribute (e.g. version: 8 etc), but when you click on the View
History link it just says No History. Its not clear to me whether this is
the expected behaviour, although I would have thought that the repository
backup would save the history as well.
If you actually export and then re-import the rules into the same BRMS
installation, then the history is maintained – however, I suspect that is
purely by chance as the underlying repository is not being cleaned up by the
import option?
Regards,
Shahad
17 years, 3 months
Another problem
by Natraj Gudla
Hi, I am using Drools 3.0.6, and facing a peculiar problem.
My rule:
*
rule* "Calculate Business profit,1"*
**salience* 1000
*when
**EMIAgainstProperty ( BP1 : refBP1 )
*emi : EMIAgainstProperty ( businessProfit2 > BP1 )
*then* *
*System.out.println(" BP "+(emi.getBusinessProfit1
()+emi.getBusinessProfit2())/2);*
*emi.setBusinessProfit((emi.getBusinessProfit1
()+emi.getBusinessProfit2())/2);*
**end*
**
The above line in bold inside the condition part seem to create problem for
rule evaluation. WHen i have this, the rule does not show up in the Agenda
view, hence i dont see the console print in the action part. As soon as i
remove this line and replace BP1 with 1.5 in the second line, i see the rule
being fired.
As far as i understand, I am doing a declaration to set refBP1 an object
attribute to BP1, which i later use.What is that i am missing here? My fact
has proper getter and setters for refBP1 attribute.
Thanks
Natraj
17 years, 3 months
Drools - is dynamic change possible ?
by pns77
Have been able to execute/run a sample Drools file
import com.sample.Message;
rule "Hello World"
when
m : Message( status == Message.HELLO, message : message,
testStringExternal : testStringExternal )
then
System.out.println( message );
m.setMessage( "Goodbye cruel world" );
System.out.println( testStringExternal + "Message.HELLO" );
m.setStatus( Message.GOODBYE );
update( m );
end
Now, is it possible to change the logic dynamically at runtime ? Or is the
drl file used only to externalize the business logic? I tried changing the
message in drl file and it didnt get reflected
Environment - RAD 6.0/jdk 1.4
Used the following set of jar files
C:\Drools\libraries\drools-core.jar;
C:\Drools\libraries\drools-compiler.jar;
C:\Drools\libraries\mvel14.jar;
C:\Drools\libraries\antlr-runtime.jar;
C:\Drools\libraries\xstream.jar;
C:\Drools\lib\core-3.2.3.v_686_R32x.jar;
--
View this message in context: http://www.nabble.com/Drools---is-dynamic-change-possible---tf4277622.htm...
Sent from the drools - user mailing list archive at Nabble.com.
17 years, 3 months
Re: [rules-users] Odd static inner class behavior
by Edson Tirelli
Eric,
Thanks, I understand now.
What happens is that if both DRL files declare the same package name,
all their contents will be merged. It means that you would end up with both
imports in the same namespace:
import com.company.DataClass.AlternativeKey;
import com.company.AnotherClass.AlternativeKey;
And so the engine will raise an error saying that it does not know
which one you are refering to when you write simply:
AlternativeKey
I think the engine behavior is correct, since the idea of loading two
different files with the same name space into the same package builder is to
merge them, or even replace (update) that eventually have the same name.
What do you think?
Edson
2007/7/26, Eric Miles <eric.miles(a)kronos.com>:
>
> Edson,
>
> I have since changed my schema but here was my issue:
>
> rule1.drl:
> import com.company.DataClass.AlternativeKey;
> import com.company.DataClass;
>
> rule "Some rule"
> when
> DataClass.AlternativeKey(someParm == true)
> then
> ...
> end
>
> Different drlf file:
> rule2.drl
> import com.company.AnotherClass.AlternativeKey;
> import com.company.AnotherClass;
>
> rule "Another rule"
> when
> AnotherClass.AlternativeKey(diffParm == 1)
> then
> ...
> end
>
>
> This was the gist of what I was doing. The outer classes' names were
> different, it was the INNER class of each of these classes that had the same
> name. I was actually getting compile errors on the import statements. Like
> I said, these rules worked fine if loaded separately, but once I tried to
> put them all int he same rule base, I was getting the import collision
> error. Later on this evening (when I'm not at work), I'll try to put
> together a small test case and upload it. In the meantime, you can look
> skim over this and let me know if something jumps out at you.
>
> Thanks,
> Eric
>
> On Thu, 2007-07-26 at 10:32 -0300, Edson Tirelli wrote:
>
> Eric,
>
> Not sure if I understood your problem, but if you have multiple
> classes with the same name, and the only difference is that they are inner
> classes of different classes, I guess what you need to do is to fully
> qualify your class names in your rules...
>
> rule xxx
> when
> my.package.MyClass.MyInnerClass( ... )
> ...
> end
>
> If this is not your problem, can you please show us an example so we
> understand it better?
>
> Edson
>
>
> 2007/7/25, Eric Miles <eric.miles(a)kronos.com>:
>
> Due to how JAXB treats anonymous inner complex types, I ended up with a
> public static inner classes named AlternativeKey in several of my data
> classes I have several rules written to deal with each data class
> individually that all work ok. However, when I attempt to put them all in
> the same rule base (all belong to the same package), I get an import
> collision exception on the AlternativeKey inner class. Depending on where
> in the builder I add the resource depends on which AlternativeKey the
> compiler bitches about (validity). I'm not familiar with the source at all,
> so I'm unsure as to where to look for this. However, this sounds like a bug
> to me? There is an easy workaround for this as I I just don't use anonymous
> types and define them in my schema explicitly. Just thought I'd identify
> this as a possible issue.
>
> Thanks,
> Eric
>
>
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
>
>
> --
> Edson Tirelli
> Software Engineer - JBoss Rules Core Developer
> Office: +55 11 3529-6000
> Mobile: +55 11 9287-5646
> JBoss, a division of Red Hat @ www.jboss.com
>
>
--
Edson Tirelli
Software Engineer - JBoss Rules Core Developer
Office: +55 11 3529-6000
Mobile: +55 11 9287-5646
JBoss, a division of Red Hat @ www.jboss.com
17 years, 3 months
Logic Problems & drools
by MarkA
I am a big fan of the logic problem puzzles (the ones with the grids) and
would like to play with drools to solve a few - just for a laugh and to see
if it can be done.
I found a pretty simple one:
----------------------------
Mrs. Robinson's 4th grade class took a field trip to the local zoo. The day
was sunny and warm - a perfect day to spend at the zoo. The kids had a great
time and the monkeys were voted the class favorite animal. The zoo had four
monkeys - two males and two females. It was lunchtime for the monkeys and as
the kids watched, each one ate a different fruit in their favorite resting
place. Can you determine the name of each monkey, what kind of fruit each
monkey ate, and where their favorite resting place was?
1. Sam, who doesn't like bananas, likes sitting on the grass.
2. The monkey who sat on the rock ate the apple. The monkey who ate the
pear didn't sit on the tree branch.
3. Anna sat by the stream but she didn't eat the pear.
4. Harriet didn't sit on the tree branch. Mike doesn't like oranges.
---------------------
But I can't get the logic working, has anyone done any other examples for
drools (or maybe converted the monkey & banana or cannibal ones from CLIPS)?
I have looked at the golf one in the examples but it's a bit simple. In that
one it uses variables for each bit $bobsColour etc. and then uses those in
later rules. I tried it with the one above but I kept needing to refer to a
variable that I hadn't yet defined and I couldn't define it as it needed to
refer to another one and so on...
Many thanks,
Mark.
--
View this message in context: http://www.nabble.com/Logic-Problems---drools-tf4278900.html#a12179098
Sent from the drools - user mailing list archive at Nabble.com.
17 years, 3 months
Drools Puzzle, Round 2 is open!
by Dr. Gernot Starke
Hi JBoss-Drools-folks,
round 2 of our (not-already) famous (enough) puzzle contest just
opened. Until September 14th you
can send your solutions to droolspuzzle(a)gmail.com
The riddle itself has been posted in the JBoss-Drools-Blog
http://blog.athico.com/2007/08/drools-puzzle-round-2-familiy-puzzle.html
For you non-bloggers:
=====================================
Difficulty level: Settler
* Three men, Abel, Locker and Snyder are married to Edith, Doris
and Luisa, but not necessarily in this order.
* Each couple has one son.
* The sons are called Albert, Henry and Victor.
* Snyder is nor married to Luisa, neither is he Henry's father.
* Edit is not married to Locker and not Albert's mother.
* If Alberts father is either Locker or Snyder, then Luisa is
Victor's mother.
* If Luisa is married to Locker, then Doris is not Albert's mother.
Who is married to whom and what are their sons called?
Taken from the German book "Denken als Spiel" by Willy Hochkeppel,
1973 (Thinking as a Game).
=====================================
Rules of the Contest:
http://blog.athico.com/2007/08/drools-puzzles.html
We're looking forward to your contributions -
let the rules rule...
greetings from Cologne,
Gernot
Dr. Gernot Starke
Doing IT Right
---
Willi-Lauf Allee 43, D-50858 Köln
gs(a)gernotstarke.de,
+49 (0) 177 - 728 2570
http://www.gernotstarke.de
Blog: http://it-and-more.blogspot.com
17 years, 3 months
Eclipse plugin not compiling
by Scott Reed
I am not getting notified of compiler errors in the Rule Editor, only when I execute the rule
engine. I am running Eclipse 3.2 and Drools plugin 4.0.0. Any ideas what might be wrong or is this
how it works now?
17 years, 3 months
programmatic manipulation of 4.0 salience?
by Scott Reed
My 3.1 app has a mechanism that allowed the user to change the salience of some rules before running
them, before loading up WorkingMemory. This was quite simple, rule.getSalience() returned a rule's
int salience value and rule.setSalience(int) set it. Now in 4.0 I see salience is no longer just an
int, but a Salience object with a simple constructor and complicated getValue(Tuple,WorkingMemory)
method to access the int value.
It appears to be still easy to set the salience of a rule: rule.setSalience( new
SalienceInteger(int)) but getting the int salience from a Salience object seems to have been removed
from joe-blow coder's reach.
I would be very grateful if someone would provide me with an example that gets the int salience
associated with a rule. I have no idea where or why I need to get the Tuple and WorkingMemory. Can I
just pass nulls in for those two arguments?
Thanks,
Scott
17 years, 3 months
Drools 4.0 problem: insert (drl) not reflected StatefulSession.
by Michael Waluk
I just upgraded to Drools 4.0 and changed my assertObject calls to insert.
I also switched from WorkingMemory to StatefulSession. The rules seem to be
fine, but I am not able to retrieve any inserted objects from the working
memory for some reason. Here is what I'm doing. I'd appreciate any
suggestions...
StatefulSession *workingMemory* = getActiveWorkingMemories(id);
*workingMemory*.fireAllRules();
// Here is the rule that fires:
*
rule* "RecognizeBenefitsProgramEvent" *
** when* $edit: BenefitsProgramModelEdit()
* then*
* insert* (*new* *BenefitsProgramEvent*("BenefitsProgramEvent",
$edit.getValidFrom(), "AnnualEnrollmentEvent")); *
** System*.out.println("Rule RecognizeBenefitsProgramEvent fired "); *
**end*
I see the print statement in the console but the inserted object is not
actually in the working memory. I look using this:
Iterator events = *workingMemory*.iterateObjects(new ClassObjectFilter(
BenefitsProgramEvent.class));
This iterator is empty. I also debug and look at the assetMap inside
workingMemory and it never changes.
Thanks,
Michael
17 years, 3 months