Rules with C++
by Sumeet Karawal
Hi All,
I have my application written in C++. How can I use Drools to make rules
that work on C++ facts. Also How to use BRMS in this case?
It would be very helpful if somebody could guide me on this.
Thanks and Regards,
Sumeet Karawal
Mailto: sumeet.karawal(a)tcs.com
=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain
confidential or privileged information. If you are
not the intended recipient, any dissemination, use,
review, distribution, printing or copying of the
information contained in this e-mail message
and/or attachments to it are strictly prohibited. If
you have received this communication in error,
please notify us by reply e-mail or telephone and
immediately and permanently delete the message
and any attachments. Thank you
13 years, 8 months
help! rule"rule_key" failed to predicate
by 赵慧
hi,thank you very much for helping me with the problem.nevertheless,I have got another error. I compile the program and get the errors as follows:
[4,0]: [ERR 103] Line 4:0 rule 'rule_key' failed predicate: {(validateIdentifierKey(DroolsSoftKeywords.RULE))}? in rule
[4,9]: [ERR 101] Line 4:9 no viable alternative at input 'com' in rule package
I don't know how it happened, looking forward to your reply! thank you !!!
> Try adding 'dialect "mvel"' (no single quotes) after the rule name to the top of each of the rules. I have seen this error before and doing this resolved the issue.
>
> >hello,everyone!I wrote a rule with Drools,but the error told me that the field Server.Message is not visible, I can't find how it happens. Please
> >help me, I am almost exhausted with it. thank you.
> >the rules are as follows:
> >
> >package com.sample
> >import com.sample.Server;
> >
> >rule "system will execute 'tc' command"
> > when
> > eval(Server.Message>8388608)
> > then
> > System.out.println("The network is so crowd that it needs repairing.");
> > Runtime.getRuntime().exec("tc");#execute the "tc" command end
> >
> >rule "caution"
> > when
> > eval(Server.Message==8388608)
> > then
> > System.out.println("caution!The network maybe will get blocked very soon."); end
> >
> >rule "fluent network"
> > when
> > eval(Server.Message<8388608)#conditions
> > then
> > System.out.println("the current network is very good");
> > #actions
> >end
>
>
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
13 years, 8 months
Calling a method with varargs
by janders
Hey all, I've got a rule in a DRL file that I'm trying to call an object
method that contains a varargs parameter.
The method signature looks like so:
public void addMessage(int displayPriority, String messageFormat, Object...
messageArgs) {
The rule looks like so:
rule "Notice Quantity"
no-loop
when
$notice : Notice(quantity > 0);
then
$explanation.addMessage(1, "%s Quantity = %,d", $notice.dispositionCode,
$notice.quantity);
end
When I run this rule base, I get this runtime error from the Drools engine:
Caused by: [Error: unable to resolve method:
com.package.TriggerExplanation.addMessage(java.lang.Integer,
java.lang.String, java.lang.String, java.lang.Integer) [arglength=4]]
[Near : {... Unknown ....}]
This feels very much like either the MVEL engine or Drools can't resolve a
method with varargs. I found nothing in any of the documentation and the
only thread on these forums that references varargs was a few years old.
Can anyone tell me if Drools does/does not support method calls with
varargs? Doing this without varargs is going to be a galactic pain in the
butt.
Thanks!
Jason
--
View this message in context: http://drools.46999.n3.nabble.com/Calling-a-method-with-varargs-tp2812191...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 8 months
Support for Probabilistic reasoning & FOL
by Arjun Dhar
Hi,
though it is clear Rule Engine (lke Drools) supports Declarative
programming and First order Logic or FOL (with existential quantifiers and
works) .... am also looking for Probabilistic Reasoning.
Example:
Fact: A U B => C; this fact exists with a probability of 0.9.
Principles namely being: Locality, Detachment, Truth functionality (i.e.
when predicates in facts are not mutually exclusive then probabilistic
calculations are not as simple as Boolean operations) etc.
Has such theory been worked into Drools yet or are there any plans for the
future?
I'd assume the same concepts can be used on Fuzzy rules and fuzzy sets.
Am sure these are practical issues that at some point the Drools team would
have thought about. Whats the direction on this?
thanks
--
View this message in context: http://drools.46999.n3.nabble.com/Support-for-Probabilistic-reasoning-FOL...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 8 months
completing persisted workItem doesn't complete a process
by gs76pl
hi,
i've a very simple process with only 4 work items that run async. For steps
WI1 & WI2 i complete each step but when the process reaches WI3 step i
manually kill the whole process and then load it from a database
i.e.
ksession.loadStatefullSess..
Now after i complete WI3 step i can see that the last step i.e. WI4 gets
executed and marked as completed but when i'm checking my process status its
status is still ACTIVE instead of COMPLETED ?
ksession = JPAKnowledgeService.loadStatefulKnowledgeSession(
mySessionId, getKnowledgeBase(), null, getEnvironment());
ProcessInstance processInstance = ksession.getProcessInstance(myProcessId);
//after below line i can see that WI3 & WI4 get completed
ksession.getWorkItemManager().completeWorkItem(workItemIdForWI3, null);
//here the process still remains as ACTIVE ie.1
processInstance.getState() == ProcessInstance.STATE_ACTIVE
what i've seen in the tables is that all tables (i.e. processinstanceinfo,
variableinstanceinfo,workiteminfo) excepts sessionInfo gets cleared after
completing WI3. Why despite completing all work items the process remains
ACTIVE when in fact it should be COMPLETED
--
View this message in context: http://drools.46999.n3.nabble.com/completing-persisted-workItem-doesn-t-c...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 8 months
Re: [rules-users] help! the field *** is not visible
by John Peterson
Try adding 'dialect "mvel"' (no single quotes) after the rule name to the top of each of the rules. I have seen this error before and doing this resolved the issue.
>hello,everyone!I wrote a rule with Drools,but the error told me that the field Server.Message is not visible, I can't find how it happens. Please
>help me, I am almost exhausted with it. thank you.
>the rules are as follows:
>
>package com.sample
>import com.sample.Server;
>
>rule "system will execute 'tc' command"
> when
> eval(Server.Message>8388608)
> then
> System.out.println("The network is so crowd that it needs repairing.");
> Runtime.getRuntime().exec("tc");#execute the "tc" command end
>
>rule "caution"
> when
> eval(Server.Message==8388608)
> then
> System.out.println("caution!The network maybe will get blocked very soon."); end
>
>rule "fluent network"
> when
> eval(Server.Message<8388608)#conditions
> then
> System.out.println("the current network is very good");
> #actions
>end
13 years, 8 months
Insert an object containing a HashMap
by hbunny
Hello,
I have searched the forum for information on this case, but I haven't find,
at least yet.
I am trying to insert an object containing a HashMap, but when I call
ksession.insert( fact ) method I get this error:
java.lang.ClassCastException: java.util.HashMap cannot be cast to
java.lang.Comparable
I have searched the net for this kind of error, but it's not clear why I'm
getting it, especially that I am inserting with success a global HashMap.
Can you help me please, it is rather urgent. Thank you in advance.
--
View this message in context: http://drools.46999.n3.nabble.com/Insert-an-object-containing-a-HashMap-t...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 8 months
help! the field *** is not visible
by 赵慧
hello,everyone!I wrote a rule with Drools,but the error told me that the field Server.Message is not visible, I can't find how it happens. Please help me, I am almost exhausted with it. thank you.
the rules are as follows:
package com.sample
import com.sample.Server;
rule "system will execute 'tc' command"
when
eval(Server.Message>8388608)
then
System.out.println("The network is so crowd that it needs repairing.");
Runtime.getRuntime().exec("tc");#execute the "tc" command
end
rule "caution"
when
eval(Server.Message==8388608)
then
System.out.println("caution!The network maybe will get blocked very soon.");
end
rule "fluent network"
when
eval(Server.Message<8388608)#conditions
then
System.out.println("the current network is very good");#actions
end
13 years, 8 months
Getting a Drools Fusion - CEP Example to work
by s.Daniel
Hello
I have built my first few test rules and now I'm working on moving on to
more complex questions. Since I need to monitor data over time I would like
to lern from the example provided here:
http://javabeans.asia/articles/drools_5_case_study_2_complex_event_proces...
Unfortunately I can't get the tutorial to work properly. In eclipse I have
the error marker
----------------------
Description Resource Path Location Type
Error: java.lang.NullPointerException account.drl /SlidingWindowCEP/etc
Unknown Drools Error
----------------------
and upon build and get following error:
----------------------
[81,20]: [ERR 101] Line 81:20 no viable alternative at input '90d' in rule
"NinetyDaysPeriod"
java.lang.IllegalArgumentException: Could not parse knowledge.
at
net.javabeansdotasia.casestudy.test.Tester.prepareKnowledgeBase(Tester.java:85)
at net.javabeansdotasia.casestudy.test.Tester.setUp(Tester.java:54)
at net.javabeansdotasia.casestudy.test.Tester.main(Tester.java:118)
java.lang.NullPointerException
at
net.javabeansdotasia.casestudy.test.Tester.prepareAccountInfo(Tester.java:98)
at net.javabeansdotasia.casestudy.test.Tester.setUp(Tester.java:55)
at net.javabeansdotasia.casestudy.test.Tester.main(Tester.java:118)
Exception in thread "main" java.lang.NullPointerException
at
net.javabeansdotasia.casestudy.test.Tester.prepareStatefulKnowledgeSession(Tester.java:70)
at net.javabeansdotasia.casestudy.test.Tester.setUp(Tester.java:56)
at net.javabeansdotasia.casestudy.test.Tester.main(Tester.java:118)
----------------------
Now if I change 90d to 90m the Nullpointer Error goes away but then two new
markers appear at rule "NinetyDaysPeriod" and rule "FiveLastClaims":
----------------------
Description Resource Path Location Type
BuildError: Unable to build expression for 'consequence': [Error: Failed to
compile: 1 compilation error(s):
- (4,31) unable to resolve method using strict-mode:
java.lang.Object.setEligibleForBonusClaims(java.lang.Boolean)]
[Near : {... Unknown ....}]
^
[Line: 1, Column: 0] ' modify($accountInfo) {
setAveOfLastClaims($aveOfLastClaims);
setEligibleForBonusClaims(true);
};
' account.drl /SlidingWindowCEP/etc line 21 Drools Error
----------------------
Description Resource Path Location Type
BuildError: Unable to build expression for 'consequence': [Error: Failed to
compile: 1 compilation error(s):
- (4,33) unable to resolve method using strict-mode:
java.lang.Object.setEligibleForPeriodicBonus(java.lang.Boolean)]
[Near : {... Unknown ....}]
^
[Line: 1, Column: 0] ' modify($accountInfo) {
setAveForPeriod($aveForPeriod);
setEligibleForPeriodicBonus(true);
};
' account.drl /SlidingWindowCEP/etc line 65 Drools Error
----------------------
I'm using Drools 5.1 and JDK 1.6 the tutorial is based upon 5.0 and JDK 1.5
could that be the root of my problem? I'm stuck here and still in the
process of learning Java so any hint is appreciated.
--
View this message in context: http://drools.46999.n3.nabble.com/Getting-a-Drools-Fusion-CEP-Example-to-...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 8 months