Re: [rules-users] rules not wrking
by John Peterson
If you really wanted to see your text string there, you might be able to
invoke a method that takes that text string and prints it and then
returns "true" in all cases. You'd most likely need to put it in an
Eval as suggested below.
>You can't directly use java code inside the LHS of a rule. You can
though
>use eval to call a java method inside your LHS. Also remember that you
don't
>have to use ; in the patterns.
>
>2010/4/30 Puneet duggal <duggalpunit(a)gmail.com>
>
>> frnds i have a rule
>>
>> and its not working and i for checking i have put a Sop in my when
but
>> it not prints the
>> Inside Area_SqFt_1_10-01-09_12-31-14
>> so how can we put SOP inside when clause.
>>
>> rule "Area_SqFt_1_10-01-09_12-31-14"
>>
>> date-effective "01-Oct-2009" date-expires "31-Dec-2014" salience 6
>>
>> no-loop true
>>
>> when
>>
>> System.out.println("Inside Area_SqFt_1_10-01-09_12-31-14");
>>
>> objectP2483 : Para_2483( (fid2335=="Block") && (fid2336==16) );
>>
>> then
>>
>> System.out.println("Area_SqFt_1_10-01-09_12-31-14");
>>
>> objectP2483.setFid31003(new Double(497)); end
>>
15 years, 11 months
Missing space when using DSL and Guvnor
by Doyel,Jeff
I am setting up a very simple example using a DSL and Guvnor. My DSL is as follows:
[when]Age is less than {age} years old=AgeFact(ageInYears < {age})
When I attempt to create a new Business Rule using the Guvnor I can select the above expression just fine and the sentence displays as expected. I then fill in the years with a numeric value (4) and validate. Upon validation I receive the following error.
[Age Test Rule] [ERR 101] Line 4:2 no viable alternative at input 'Age' in rule "Age Test Rule"
I then view the source and it looks like this.
rule "Age Test Rule"
dialect "mvel"
when
Age is less than 4years old
then
end
I noticed that there is no space between the '4' and the word 'years'. However, in my DSL sentence there is a space between {age} and years. Another interesting thing, if I enter the number 4 followed by a space in the Guvnor form then the rule validates correctly. Is this a bug or is it something I am doing wrong in my DSL?
Thanks,
Jeff
----------------------------------------------------------------------
CONFIDENTIALITY NOTICE This message and any included attachments are from Cerner Corporation and are intended only for the addressee. The information contained in this message is confidential and may constitute inside or non-public information under international, federal, or state securities laws. Unauthorized forwarding, printing, copying, distribution, or use of such information is strictly prohibited and may be unlawful. If you are not the addressee, please promptly delete this message and notify the sender of the delivery error by e-mail or you may call Cerner's corporate offices in Kansas City, Missouri, U.S.A at (+1) (816)221-1024.
15 years, 11 months
Error when trying to serialize session
by dmiller44
I'm getting the following stack when trying to serialize a session containing
one running process:
java.io.NotSerializableException:
org.drools.workflow.instance.impl.NodeInstanceFactoryRegistry
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1156)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
at
org.drools.RuleBaseConfiguration.writeExternal(RuleBaseConfiguration.java:191)
at
java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1421)
at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1390)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
at
org.drools.common.AbstractRuleBase.writeExternal(AbstractRuleBase.java:204)
at org.drools.reteoo.ReteooRuleBase.writeExternal(ReteooRuleBase.java:185)
at
org.drools.impl.KnowledgeBaseImpl.writeExternal(KnowledgeBaseImpl.java:81)
at
java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1421)
at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1390)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
The call is thrown from this line of code:
droolsOut.writeObject(session.getKnowledgeBase());
Is this a legitimate bug in Drools? Or is this because something in my
knowledge base is not serializable? The
"org.drools.workflow.instance.impl.NodeInstanceFactoryRegistry" is what is
confusing me if this is my issue or a Drools issue.
Thanks!
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Error-when-trying-to-...
Sent from the Drools - User mailing list archive at Nabble.com.
15 years, 11 months
rules problem
by Puneet duggal
hi all,
I am new to drool business rules ,
i have a web application in which i have 100 rules
so i want to know which rules are going to be
executed based on the facts i suppilied .
my drl files is loaded at run time from database.
thanks
15 years, 11 months
Using Drools Flow To Build A Web Application
by Stephen L
Can Drools Flow be used to build the structure of a web application similar
to how Spring page flow or Seam jBPM works?
I'm looking to build a Spring MVC web application that does estimation based
on a list of questions and business rules. The web application will have
one (or more) questions per page. Each page will have its own html and
javascript to facilitate the visual representation of the question being
asked so I need each node to be a separate page or at least specify unique
view information.
I understand how Drools Expert could be used to specify the business rules.
I even see how it might be possible to build the entire system with rules,
however, I feel I want to define the page order and business logic/rule as
the estimation proceeds.
What I'm not seeing is how to use Flow to specify the structure and flow of
the system in the context of a web application.
How would I start a process from a controller or servlet and then have the
workflow provide the response model and view once the first "page" (workitem
or other node) is hit?
What is the best way to continue the flow with each additional page
submission? Would I pull the users ksession from their http session, insert
or update facts and then allow the flow to run and respond again with
another "page"?
Thanks for the help,
Stephen
15 years, 11 months
Drools Solver - Multiple Entries <ScoreDrl>
by Antonio Neto
Hi all,
In the Drools Solver documentation there is a point that say we can add
multiples entries <ScoreDrl>. But when I try do that, Drools Solver uses
just one entry to calculate the score, and I need put 2 files in the input.
Anybody could help me, please?
Thank you
15 years, 11 months
Drooles Expert - Chapt 2- Quick Start
by Kurt Guenther
As a learning exercise, I've been putting the examples described into
Drooles, and I've found numerous mistakes. The Account example appears
to go into an infinite loop.
Where do I report problems?
--Kurt
15 years, 11 months
template 101
by Stefan Marconi
Hi,
just starting using drools and need to use templates but having error
messages (described in comments in the code below).
I checked the meaning of the error messages but still can't figure it out.
I modified an simple rule according to the template section of the drools
manual: btw I use the eclipse with the drools-core plugin.
Thanks for your help. Stefan
template header
symbol
package com.test.processor; # [ERR 102] Line 4:26 mismatched input ';'
expecting 'identifier' in template header
template "test"
rule "A stand alone rule @{symbol}"
dialect "mvel"
when
eval(@{symbol} == "AAA")
then
System.out.println("this symbol is" + @{symbol})
end
end template # Multiple markers at this line
# - [ERR 103] Line 13:0 rule 'rule_key' failed predicate:
{(validateIdentifierKey(DroolsSoftKeywords.RULE))}? in rule
# - [ERR 101] Line 13:4 no viable alternative at input 'template' in rule
end
15 years, 11 months
Drools Execution Server Executing Twice
by jgautier
Hi All,
I have created a rule in guvnor that acts on one model. When the rule is
executed there is a value added to a global ArrayList object. I can verify
that this rule is executing once when running a test scenario in guvnor. I
have also created a java application to test the execution which also
verifies it is running once. However when running the package through the
drools execution server VIA xml the response I get shows two values in my
global arraylist even though there is only one object and one rule. I have
also added a println to the rule and when executing via the test scenario in
guvnor i see one line printed to the console. when executing it as the
webservice i see 2 lines printed to the console. Does anyone else have a
similar issue to this? I have found this issue on the issue tracker
https://jira.jboss.org/jira/browse/GUVNOR-354 but it looks like this person
resovled the issue by ignoring duplicates in their return response which
seems like an unacceptable solution. Thanks for your response!
jgautier
--
View this message in context: http://n3.nabble.com/Drools-Execution-Server-Executing-Twice-tp729952p729...
Sent from the Drools - User mailing list archive at Nabble.com.
15 years, 11 months