RE: RCP and DRools project: Unable to create view: org/drools/Wor kingMemory
by Huang, XiaoDong David
In addition:
1. "Add required plug-in" in configuration can not add the DRools libraries,
is it correct?
2. Export operation ended with error: "Error occurred during the operation.
A zip file containing the build logs has been generated and placed at
"D:\Eclipse Deploy" (zip file attached also). In the zip file, "The import
org.drools cannot be resolved",..., seems like that DRools libraries missed.
How to solve this issue?
Any comment is welcome.
Thanks,
David
_____
From: Huang, XiaoDong David
Sent: Thursday, February 14, 2008 2:55 PM
To: 'Rules Users List'
Subject: RE: RCP and DRools project: Unable to create view:
org/drools/WorkingMemory
Hi,
I am trying to use RCP to develop a BRMS. But I am a newcomer of both RCP
and DRools. The problem in my program is:
A view can not be displayed properly while the DRools program is added in my
RCP project. But if I disable below statement, the view can be displayed:
workingMemory = ruleBase.newStatefulSession();
Error message and a view RCP codes in which rule is fired are attached.
My steps of constructing the RCP+DRools project:
1. Create Plug-in project with RCP
2. Add customized view and add some buttons
3. Run as Eclipse Application, everything is fine
4. "Convert to DRools project" using the pop-up menu, some DRools libraries
were added.
5. Add button event and fire rules in a view - "EditView"
6. Run as Eclipse Application, EditView can not be displayed properly and
throw out error message.
7. if "workingMemory = ruleBase.newStatefulSession();" is disabled, the view
can be display correctly again.
Is my DRools calling method in RCP correct?
Please comment.
Thanks,
David
17 years, 10 months
RE: RCP and DRools project: Unable to create view: org/drools/Wor kingMemory
by Huang, XiaoDong David
Hi,
I am trying to use RCP to develop a BRMS. But I am a newcomer of both RCP
and DRools. The problem in my program is:
A view can not be displayed properly while the DRools program is added in my
RCP project. But if I disable below statement, the view can be displayed:
workingMemory = ruleBase.newStatefulSession();
Error message and a view RCP codes in which rule is fired are attached.
My steps of constructing the RCP+DRools project:
1. Create Plug-in project with RCP
2. Add customized view and add some buttons
3. Run as Eclipse Application, everything is fine
4. "Convert to DRools project" using the pop-up menu, some DRools libraries
were added.
5. Add button event and fire rules in a view - "EditView"
6. Run as Eclipse Application, EditView can not be displayed properly and
throw out error message.
7. if "workingMemory = ruleBase.newStatefulSession();" is disabled, the view
can be display correctly again.
Is my DRools calling method in RCP correct?
Please comment.
Thanks,
David
17 years, 10 months
issues with parser when using MVEL dialect
by Godmar Back
Hi,
I've recently upgraded to Drools 4.0.4 with mvel14-1.2.21.jar, and I'm
having severe issues with its parser.
For instance, this simple .drl file:
--
package test;
rule "Rule #1"
dialect "mvel"
when
then
/* a single-line comment */
System.out.println("hello world");
end
--
results in:
org.mvel.PropertyAccessException: unable to resolve property: ;
at org.mvel.optimizers.impl.refl.ReflectiveAccessorOptimizer.compileGetChain(ReflectiveAccessorOptimizer.java:285)
at org.mvel.optimizers.impl.refl.ReflectiveAccessorOptimizer.optimizeAccessor(ReflectiveAccessorOptimizer.java:107)
at org.mvel.ASTNode.getReducedValueAccelerated(ASTNode.java:185)
at org.mvel.MVELRuntime.execute(MVELRuntime.java:88)
at org.mvel.CompiledExpression.getValue(CompiledExpression.java:107)
at org.mvel.MVEL.executeExpression(MVEL.java:223)
at org.drools.base.mvel.MVELConsequence.evaluate(MVELConsequence.java:47)
at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:550)
at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:514)
at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:471)
at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:433)
--
Switching to dialect "java," or removing the /* single-line comment
*/, helps. So does replacing the comment with a // style comment.
There are many more weirdnesses I'm encountering (I've filed a number
of bugs already), but I'm wondering if something else isn't amiss
here. I also tried mvel16-1.2.22.jar, same effect. On the other hand,
running just the RHS in mvelsh works just fine.
In this context, I'd like to voice the wish that Drools include a
command-line driver that can load and execute .drl files for testing.
- Godmar
17 years, 10 months
BRMS
by Markus Helbig
Hi,
i tryed to deploy the BRMS on a WebSphere Server, but i get
incompatibility errors. It seems BRMS can not be used with JRE 1.4.x,
right? Why? JRE 1.4.x is still very common and often used in
enterprises ...
Cheers
Markus
Stacktrace is:
Could not be defined due to: (org/jboss/seam/servlet/SeamListener) bad
major version at offset=6
This is often caused by having a class defined at multiple
locations within the classloader hierarchy. Other potential causes
include compiling against an older or newer version of the class
that has an incompatible method signature.
Dumping the current context classloader hierarchy:
==> indicates defining classloader
17 years, 10 months
BRMS
by Carlsen, Len
Hi,
I am looking at the Drools BRMS to see how I can reuse the
org.drools.brms.server.ServiceImplementation for other UI toolkits and
also be able to create my own meta-data. So, I created a plain
BRMSServiceImplementation and removed Seam and GWT from several other
classes and re-wrote the org.drools.brms.server.ServiceImplementation to
use BRMSServiceImplementation so the BRMS still works but I am having
problems with Seam org.jboss.seam.annotations.In annotation since my
BRMSServiceImplementation class uses the ServiceImplementation's
RulesRepository.
I don't know much about Seam and am wondering if anyone knows if the @In
annotation can be replaced (with another annotation???) and set to the
constructor instead of a class member variable?
@Name("org.drools.brms.client.rpc.RepositoryService")
@AutoCreate
public class ServiceImplementation
implements
RepositoryService {
@In
public RulesRepository repository;
Replace with public ServiceImplementation( RulesRepository repository )
If I can get this to work, I'd be happy to submit it to Drools.
Thanks in advance for any help,
Len
17 years, 10 months
Match workingmemory elements based on declared type (interface)
by Andreas Langegger
Dear list members,
is it possible to match elements in the working memory based on their
declared type which means based on the Java "interface"?
Consider several interfaces like this one:
interface A {
public String getX();
public void setX(String x);
}
and different implementation of the corresponding interfaces as AImpl,
BImpl, etc. Is it possible to write a rule such that:
rule "let me match based on declared not the actual impl type"
when
A( ... )
then ...
end
?
Another question: I have troubles with eclipse to get the Working
Memory View running. I remember it was necessary to focus a
WorkingMemory object in the Variables view, but now I followed the
docs here http://downloads.jboss.com/drools/docs/4.0.4.17825.GA/html/ch05.html#d0e2524
and it does not work either.
I'm running Eclipse 3.3.1.1 Build id: M20071023-1652 on Mac OS X 10.5
Thanks a lot!
Andy
----------------------------------------------------------------------
Dipl.-Ing.(FH) Andreas Langegger
Institute for Applied Knowledge Processing
Johannes Kepler University Linz
A-4040 Linz, Altenberger Straße 69
http://www.langegger.at
17 years, 10 months
Can "From" reason over primitive arrays?
by Henry Canterburry
I am trying to pattern match on a primitive array such as String[] or
SomeObject[]. The documentation only mentions collections in the section
about From.
Would a pattern match syntax such as...
rule "My rule"
when
$source : SourceObject()
$myObject : MyObject() from $source.returnsAnArrayProperty
then
....
..be correct? If not, how can capture and loop over every object in an
array (not Collection)?
I have tried the above and I get a ClassCastException.
HC
17 years, 10 months
Partial match (best rule to fire)
by Houssam Haitof
Hi, I need to know if a there is a possibility to have a partial match for a rule. For instance, let's concider rule 1:
rule "rule 1"
when
o : MyObject(field1=="A" && field2=="B" && field3=="C")
then
//
end
I have a MyObject with values ("A", "B", "X") that would normally not match the rule.
Is there a way to have a partial match? Something like "rule 1 matches at 66%" ?
My aim is to find the best rule to fire, the one that has the highest partial matches.
Thank you in advance.
Houssam
P.S: I can't break rule 1 into multiple rules because I have a large number of "fieldsN".
____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
17 years, 10 months
Re[rules-users] te Tree view ... tutorial?
by Noc2
hello all,
as newbie to drools, i was working with rule files when i accidentally found
the " Rete Tree View". Curious as i am, i went searching on the net on how
to read this thing. I have found some information on what it is, but
unfortenatly, when i try to link the information to the real life situation,
i realized that some things didnt match.
So i am still looking for a nice tutorial or explanation of the Rete Tree
view. Anybody that could help me? All suggestions are welcome.
Thanks in advance,
Noc2
--
View this message in context: http://www.nabble.com/Rete-Tree-view-...-tutorial--tp15413110p15413110.html
Sent from the drools - user mailing list archive at Nabble.com.
17 years, 10 months
Three questions
by Brian Trezise
I have three questions, re: the following line of code in Drools (LHS).
sd : SmartDescription(description matches "MAR(K|KE|KED)? ",
pFamilies.containsKey(SchemaConstants.CERAMIC_CHIP_CAPACITORS) ||
pFamilies.containsKey(SchemaConstants.CERAMIC_NETWORKS), description :
description, pFamilies : possibleFamilies);
To put it in plain English, I want to match against the regex, but only if
the rule can provide useful information (ie the two constant family id keys
are still present in the family maps). When I put in
SchemaConstants.familyKey, it tells me I've got an unexpected token. How
can I accomplish this?
Is there a way to store the regex in a local rule variable? Ie,
String pattern = "MAR(K|KE|KED)? ";
Description matches pattern, .
?
Finally, this is a rather long line, is there a way to split apart the
testing of the map condition from the match condition into a separate part,
to let it match the .containsKey on a separate line?
Thanks,
___________________________________________________
Brian Trezise
Staff Software Engineer
IntelliData, Inc
3173 s. uravan way
aurora, colorado 80013
T: 720.524.4864
brian.trezise(a)intellidata.net
17 years, 10 months