Is there any other remote interface like EJB or WS to call the BRMS RepositoryService (ServiceImplementation)
by Wesley Akio Imamura
Hi,
I was present at Edson Tirelli presentation at Just Java 2007 in Brazil
and got impressed about drools and brms.
I'm implementing a mission critical application using drools+brms and
have some doubts that didn't find answers in the manuals or searching
the mailist archive.
We need the cluster servers both running drools and specially getting
updates 24x7. I chose to use the RulesAgents and BRMS in order to have
dedicated servers to build the rules packages. I think that's the best
solution instead of implementing the administration and synchronization
from scratch, right ?
Configured JCR to use a oracle database for the rules repository. Can I
have a administration cluster with two or more servers running BRMS
(drools-jbrms.war) pointing to the same database ?
Is it cluster aware ? It would be necessary to configure the rule agent
to point to 2 url's snapshots for the same package. I think it's a
problem... If not, what would be the behavior ?
Another solution for clustering the brms I thought was to have a http
server or hardware pointing to a primary brms server. In case of failure
it switches to the stand by brms server. But I think the updates on the
primary brms would not be reflected on the stand by server, right ?
Is it possible to have the rule agent dynamically configured to point
the a new snapshot url instead of statically configuring the urls on the
properties file used by the rule agent ?
The brms manual says that it possíble to replace the GWT interface,
connecting directly to the RepositoryService (ServiceImplementation). I
saw that the ajax communicates with the GWTRemoteServiceServlet on the
server side. We don't need to replace the interface, but need a remote
interface in order to have one external system make calls to the
RepositoryService. Is there any other remote interface like web service
or remote ejb ? If not, what is the fastest solution to make remote calls ?
Thanks in advance,
Wesley.
--
Wesley Akio Imamura
17 years, 10 months
regular expresions
by Brian Trezise
For the following line of code in the LHS of a rule, is it possible to save
the matched string, and/or the starting and ending index of said match?
sd : SmartDescription(description matches "<some regular expression>",
description : description)
___________________________________________________
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
compare string and int in LHS
by brenner
Hi,
I have a class, wich contains a string value. This value is in some use
cases an integer.
For this use case I want to convert (parse) the string typ to an integer
because I want that the following rule matches:
rule
when
t : Test(value <= 1)
then
System.out.println(t)
end
class Test {
String value;
getValue();
setValue();
}
Have anyone a solution or some help for me?
Is that possible what I want to do?
Thanks
Daniel
--
View this message in context: http://www.nabble.com/compare-string-and-int-in-LHS-tp15337728p15337728.html
Sent from the drools - user mailing list archive at Nabble.com.
17 years, 10 months
Re: rules-users Digest, Vol 15, Issue 16
by siddhartha banik
Hi,
Sorry, the Problem statement did not come with the attchment.
The problem is:
I am serializing working memory(WM). But after deserializing that, if I try
to modify the corresponding RuleBase that is not getting reflected.
I mean, after loading the serialized WM even I add a package to the
corresponding RuleBase, new Rules are not getting fired for newly added
facts. Or I remove a package from the corresponding RuleBase, even removed
Rules are getting fired for newly added facts.
So, Once WM is deserialized any chage to the corresponding RuleBase is
failing.
I have attached the test program & test rules.
Thanks
Siddhartha
>
> Message: 3
> Date: Wed, 6 Feb 2008 10:12:40 +0530
> From: "siddhartha banik" <siddhartha.banik(a)gmail.com>
> Subject: [rules-users] Facing Problem with Working Memory
> Serialization/DeSerialization
> To: rules-users(a)lists.jboss.org
> Message-ID:
> <c3d0203e0802052042t65e14fe0h107028b0d37ff723(a)mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Skipped content of type multipart/alternative-------------- next part
> --------------
> A non-text attachment was scrubbed...
> Name: attach.zip
> Type: application/zip
> Size: 6367 bytes
> Desc: not available
> Url :
> http://lists.jboss.org/pipermail/rules-users/attachments/20080206/406aee5...
>
>
17 years, 10 months
java.lang.ClassCastException comparing BigDecimals (compareTo)
by José Arrarte
Hello,
First of all, I'd like to thank all the people involved in making this tool
such a great one (this includes whoever writes the reference manual as
well).
I've been having some problems when comparing BigDecimals (using the
compareTo method). I didn't find this issue in any previous post or in
Drools' JIRA. However, I've been using Drools for a short time, so I hope
you people can help me.
The problem:
Firing this (simple) rule:
rule "Test Rule"
when
$dec : java.math.BigDecimal() from java.math.BigDecimal.TEN;
eval( $dec.compareTo(java.math.BigDecimal.ONE) > 0 )
then
System.out.println("OK!");
end
Fires this exception:
org.drools.RuntimeDroolsException: java.lang.ClassCastException:
java.lang.Integer cannot be cast to java.math.BigDecimal
at org.drools.rule.EvalCondition.isAllowed(EvalCondition.java:76)
at org.drools.reteoo.EvalConditionNode.assertTuple(EvalConditionNode.java:145)
at org.drools.reteoo.SingleTupleSinkAdapter.propagateAssertTuple(
SingleTupleSinkAdapter.java:20)
at org.drools.reteoo.FromNode.assertTuple(FromNode.java:90)
at org.drools.reteoo.SingleTupleSinkAdapter.createAndPropagateAssertTuple(
SingleTupleSinkAdapter.java:55)
at org.drools.reteoo.LeftInputAdapterNode.assertObject(
LeftInputAdapterNode.java:116)
at org.drools.reteoo.SingleObjectSinkAdapter.propagateAssertObject(
SingleObjectSinkAdapter.java:22)
at org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:153)
at org.drools.reteoo.Rete.assertObject(Rete.java:175)
at org.drools.reteoo.ReteooRuleBase.assertObject(ReteooRuleBase.java:192)
at
org.drools.reteoo.ReteooWorkingMemory$WorkingMemoryReteAssertAction.execute(
ReteooWorkingMemory.java:179)
at org.drools.common.AbstractWorkingMemory.executeQueuedActions(
AbstractWorkingMemory.java:1315)
at org.drools.common.AbstractWorkingMemory.fireAllRules(
AbstractWorkingMemory.java:462)
at org.drools.common.AbstractWorkingMemory.fireAllRules(
AbstractWorkingMemory.java:433)
at com.sample.DroolsTest.main(DroolsTest.java:33)
Caused by: java.lang.ClassCastException: java.lang.Integer cannot be cast to
java.math.BigDecimal
at com.sample.Rule_Test_Rule_0Eval0Invoker.evaluate(Rule_Test_Rule_0Eval0Invoker.java:12)
at org.drools.rule.EvalCondition.isAllowed(EvalCondition.java:72)
... 14 more
I've reported the issue in JIRA (
http://jira.jboss.com/jira/browse/JBRULES-1433)
Best regards,
José
17 years, 10 months
Grouping rules
by Jai Vasanth
Hi,
I am building a system where I would need to fire different sets of rules
based on some attribute in the fact object.
Here are someways which I thought of, I was wondering if there was something
better than that.
1) I could do this by creating different sessions based on the data attrbute
(different sessions would have different rule packages based on the
attribute)
or
2) Have all the rules fire (all the different sets of rules) irrespective of
the attribute and have them insert fact new objects into the working memory.
In the second round of rules, collect the (newly made) fact objects based
on the attribute and take that action.
Thanks
Jai
17 years, 10 months
boolean == String?
by Carlsen, Len
Hi,
I have an expression where I am comparing a Boolean to a String which I
would expect to fail but the expression always returns true. Is this
expected behaviour?
I modified the Drools HelloWorldExample and changed the status from an
int to a boolean.
import org.drools.examples.HelloWorldExample.Message;
rule "Hello World"
when
m : Message( status == "hello", message : message )
then
System.out.println( message );
end
public static class Message {
public static final boolean HELLO = false;
public static final boolean GOODBYE = true;
private String message;
private Boolean status;
public Message() {}
public String getMessage() { return this.message; }
public void setMessage(final String message) { this.message =
message; }
public boolean getStatus() { return this.status; }
public void setStatus(final boolean status) { this.status =
status; }
}
final Message message = new Message();
message.setMessage( "Hello World" );
message.setStatus( Message.HELLO );
final StatefulSession session = ruleBase.newStatefulSession();
session.insert( message );
session.fireAllRules();
Thanks very much,
Len
17 years, 10 months
having a little problem when using LHS variable in RHS
by nemesis29@free.fr
Hello All,
Well i'm trying to create a rule witch need to get some infos in the RHS that
are available in variables declared in the LHS part of the rule.
To make it clear (as my english is not on top ;-) here is an exemple:
the rule file :
rule "NODSLVIP"
dialect "java"
when
$rt : RuleTargetContainer()
$travellers : TravellerListType() from $rt.metaDossier.travellers
$traveller : TravellerType() from $travellers.traveller
$user : UserType() from $traveller.user
$personalInfo : PersonalInfoType(isVIP == true) from $user.personalInfo
then
System.out.println("VIP");
System.out.println($user.getName());
end
When i use it in my code i have the following exception trhown :
org.mvel.CompileException: problem encountered at node [11] 5{172,191}: unable
to resolve token: declr.identifier
If i remove the line printing the user name all goes well (ie : i have VIP in my
trace when user is vip ^^ ).
What am i missing here? I have seen in the documentation that using LHS variable
is possible bu can't make it work for my case :-( .
Thant in advance for any help you can supply.
N Beucler.
17 years, 10 months