RIGHT_PAREN
by Raffaele Viola
Hi all,
can some one help me????? I don't understand why this drl
package org.drools.examples.decisiontable;
#generated from Decision Table
import com.RuleEngine.ControlloreNodo.*;
import com.RuleEngine.ControlloreNodo.OggettiControllo.Azione;
import com.RuleEngine.ControlloreNodo.OggettiStato.StatoNodo;
global StatoNodo statoNodo;
global Azione azione;
function controllo(String a)
{
return statoNodovariabiliInOR(a);
}
#From row number: 13
rule "Pricing bracket_13"
when
controllo("18")
then
azione.setNomeAzione("ciao");
end
Gives me this type of error: [13,12]: unknown:13:12 mismatched token:
[@102,476:479='"18"',<20>,13:12]; expecting type RIGHT_PAREN
Thanks,
Raffo
17 years, 3 months
RE: [rules-users] Adding constraints to facts in DSL
by DELBART Vincent
Hello Stephane,
I think it's difficult to do that. Could you try this :
There is a Cheese with
- age is less than 42 or age is more than 60
- type is 'stilton'
with in your DSL
[condition][]There is a Cheese with=Cheese()
[condition][]- age is less than {low} or age is more than {high}=age < {low} || age > {high}
[condition][]- type is '{type}'=type == "{type}"
I don't see other solution...
vdelbart
________________________________
De : rules-users-bounces(a)lists.jboss.org [mailto:rules-users-bounces@lists.jboss.org] De la part de stephane.remillieux(a)agysoft.fr
Envoyé : mardi 11 septembre 2007 10:16
À : rules-users(a)lists.jboss.org
Objet : [rules-users] Adding constraints to facts in DSL
Hello,
I'm using JBossDrools in my company and I have some problems with DSL.
Actually, I would like to write something like this :
There is a Cheese with
( - age is less
than 42
or
- age is more than 60 )
- type is
'stilton'
Unfortunately, It's the drools parser which manage "-" char.
Also this previous synthax don't work in the LHS.
Anyone could help me to do an equivalent condition in my DSL ? If possible with "-" sugar char.
Stephane.
PS : Sorry, for my very bad english.
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
17 years, 3 months
Re: [rules-users] Drools-Example.zip - Newbie
by ekke
hi malika,
I downloaded drools 4.0.1 examples from:
http://download.jboss.org/drools/release/4.0.1.14754GA/drools-4.0.1-examp...
then unzip
and inside eclipse
Import ... General ... Existing projects into workspace
select root directory
navigate to the drools-examples folder
Choose - select all
copy into workspace
all works well in my environment:
Eclipse 3.3 Drools 4.0.1 JDK 5 OSX 10.4.10
ekke
Malika wrote:
>
> Hello,
>
> I am a complete novice in Drools. I would like to see some working
> examples. But my issue here is that I don't really know how to try the
> examples provided at this link:
> http://anonsvn.labs.jboss.com/labs/jbossrules/trunk/drools-examples/
>
> I used SVn Chekout option to download the examples on my pc. I have
> Eclipse 3.2 installed. I am not sure how to proceed further to import the
> project in Eclipse and run it. Could anyone please describe in details
> what exactly needs to be done to try an example. What tools do I need
> other than Eclipse & SVN to see the result.
>
> I hope all the experts can understand the pain I am going thru:) and share
> some experience.
>
> Thanks!!
> Malika
>
>
>
>
>
--
View this message in context: http://www.nabble.com/Drools-Example.zip---Newbie-tf4490167.html#a12806016
Sent from the drools - user mailing list archive at Nabble.com.
17 years, 3 months
ruleflow-group
by ekke
..just working thru the ruleflows (documentation and editor)
think I'll use RuleFlows and found one problem:
inside the .drl's I define the ruleflow-group, where the drl belongs to
inside the RuleFlow editor I have to enter the RuleFlowGroup below
the name in the properties view
but I have no informations about all the RuleFlowGroups used inside
the .drl's.
are there any plans to have a RulesGroupView like the RulesView, but showing
the RuleFlowGroups instead of packages ?
or are there plans for context-assist ?
thx for infos
ekke
--
View this message in context: http://www.nabble.com/ruleflow-group-tf4486773.html#a12794772
Sent from the drools - user mailing list archive at Nabble.com.
17 years, 3 months
Creating a RuleFlow in eclipse
by kissro@lidp.com
Could someone tell me how to use the RuleFlow editor in Eclipse?
I've created a .rf file and I have a Start node. Next I add a Split node
followed by 2 RuleFlow nodes. I select the 'connection' tool, click the
Split node and draw a line to my 1st RuleFlow node. I go back to the
Split node and try to draw a connection line to my 2nd RuleFlow node but
it won't let me. When I click the Split node it gives me a circle with a
line thru it (which I'm interpreting as meaning "not allowed"). I can't
make a connection between my Start node and my Split node either.
What am I doing wrong? Why can't I draw more than 1 connection line?
Also, the connection line that I can draw does not have the arrow,
indicating direction, at the end of the line like all the examples I've
seen do. Is that a problem? Any help would be appreciated.
Thanks,
Rod
17 years, 3 months
Date for 2 years ago
by Brian Enderle
I need to code a rule which checks that the begin date for an object is at
least two years ago (from todays date). Is there an easy way to code this
within Drools rule, something like:
when
Reference(fromDate > (todaysDate - 2 years))
then
<Output error>
end
Thanks in advance,
Brian Enderle
17 years, 3 months
unknown .... mismatched token
by Raffaele Viola
Hi all,
I suppose I'm not clear in the last email and now I try to simplify my
problem.
My decision table generates this drl stream
but builder.getErrors().toString() returns
[29,16]: unknown:29:16 mismatched token: [@180,713:715='"2"',<20>,29:16];
expecting type RIGHT_PAREN
Thanks
Raffo
package TabellaDecisionale;
#generated from Decision Table
import com.RuleEngine.ControlloreNodo.OggettiControllo.Azione;
import com.RuleEngine.ControlloreNodo.OggettiStato.StatoNodo ;
import java.util.*;
import java.lang.Integer;
global Azione azione;
global StatoNodo stato;
function boolean variabiliInOR (string a,string args)
{
boolean risultato=false;
int sev=Integer.parseInt (a);
if(sev==stato.getSeverityIndicatore(args))
{
azione.setIndicatore(indName);
risultato=true;
}
return risultato;
}
function void setAzione(string a)
{
azione.setNomeAzione (a);
}
#From row number: 13
rule "Controllo Stato_13"
salience 9
when
variabiliInOR("2","Throughput");
then
setAzione("SD");
end
17 years, 3 months
mismatched token
by Raffaele Viola
Hi all,
I generate this drl from using these lines of code.
String drl = compiler.compile(getSpreadsheetStream(), InputType.XLS);
builder.addPackageFromDrl(new StringReader(drl));
Package pkg = builder.getPackage();
RuleBase ruleBase = RuleBaseFactory.newRuleBase();
when I try to execute ruleBase.addPackage(pkg); I get this error:
[9,50]: unknown:9:50 mismatched token '[@93,392:392='.',<8>,9:50]' expecting
set null[9,51]: unknown:9:51 mismatched token '[@94,393:393='.',<8>,9:51]'
expecting set null[9,57]: unknown:9:57 mismatched token
'[@97,399:399=')',<12>,9:57]' expecting set null[32,16]: unknown:32:16
mismatched token: [@207,787:787='2',<25>,32:16]; expecting type
RIGHT_PAREN[42,16]: unknown:42:16 mismatched token:
[@274,1043:1043='1',<25>,42:16]; expecting type RIGHT_PAREN[52,16]:
unknown:52:16 mismatched token: [@341,1308:1308='1',<25>,52:16]; expecting
type RIGHT_PAREN[53,16]: unknown:53:16 mismatched token:
[@378,1443:1443='1',<25>,53:16]; expecting type RIGHT_PAREN[63,16]:
unknown:63:16 mismatched token: [@453,1682:1682='1',<25>,63:16]; expecting
type RIGHT_PAREN[64,16]: unknown:64:16 mismatched token:
[@490,1825:1825='1',<25>,64:16]; expecting type RIGHT_PAREN[74,16]:
unknown:74:16 mismatched token: [@565,2066:2066='1',<25>,74:16]; expecting
type RIGHT_PAREN[75,16]: unknown:75:16 mismatched token:
[@602,2201:2201='1',<25>,75:16]; expecting type RIGHT_PAREN[76,16]:
unknown:76:16 mismatched token: [@627,2278:2278='1',<25>,76:16]; expecting
type RIGHT_PAREN[86,16]: unknown:86:16 mismatched token:
[@702,2517:2517='1',<25>,86:16]; expecting type RIGHT_PAREN[87,16]:
unknown:87:16 mismatched token: [@739,2660:2660='1',<25>,87:16]; expecting
type RIGHT_PAREN[88,16]: unknown:88:16 mismatched token:
[@760,2740:2740='1',<25>,88:16]; expecting type RIGHT_PAREN
What is my fault???
Thanks
Raffo
package com.RuleEngine.ControlloreNodo;
#generated from Decision Table
import com.RuleEngine.ControlloreNodo.OggettiControllo.Azione;
import com.RuleEngine.ControlloreNodo.OggettiStato.StatoNodo;
import java.util.*;
import java.lang.Integer;
global Azione azione;
global StatoNodo stato;
function boolean variabiliInOR (String a,String ... args)
{
boolean risultato=false;
int sev=Integer.parseInt(a);
for(String indName : args)
{
if(sev==stato.getSeverityIndicatore(indName))
{
azione.setIndicatore(indName);
risultato=true;
}
}
return risultato;
}
function void setAzione(String a)
{
azione.setNomeAzione(a);
}
#From row number: 13
rule "Controllo Stato_13"
salience 9
when
variabiliInOR(2,Throughput ass INVITE Pisa,Throughput der INVITE
Pisa,Throughput ass INVITE Cagliari,Throughput der INVITE Cagliari)
then
setAzione(taglio INVITE da lista di SD)
end
#From row number: 14
rule "Controllo Stato_14"
salience 10
when
variabiliInOR(1,Throughput ass REGISTER Pisa,Throughput der REGISTER
Pisa,Throughput ass REGISTER Cagliari,Throughput der REGISTER Cagliari)
then
setAzione(taglio REGISTER da lista di SD)
end
#From row number: 15
rule "Controllo Stato_15"
salience 5
when
variabiliInOR(1,Throughput ass INVITE Pisa,Throughput der INVITE
Pisa,Throughput ass INVITE Cagliari,Throughput der INVITE Cagliari)
variabiliInOR(1,CPU RS1,CPU RS2,CPU RS3,CPU RS4,CPU RS5,memoria
RS1,memoria RS2,memoria RS3,memoria RS4,memoria RS5)
then
setAzione(taglio INVITE da lista di SD)
end
#From row number: 16
rule "Controllo Stato_16"
salience 6
when
variabiliInOR(1,Throughput ass REGISTER Pisa,Throughput der REGISTER
Pisa,Throughput ass REGISTER Cagliari,Throughput der REGISTER Cagliari)
variabiliInOR(1,CPU RS1,CPU RS2,CPU RS3,CPU RS4,CPU RS5,memoria
RS1,memoria RS2,memoria RS3,memoria RS4,memoria RS5)
then
setAzione(taglio REGISTER da lista di SD)
end
#From row number: 17
rule "Controllo Stato_17"
salience 7
when
variabiliInOR(1,Throughput ass INVITE Pisa,Throughput der INVITE
Pisa,Throughput ass INVITE Cagliari,Throughput der INVITE Cagliari)
variabiliInOR(1,Tempi Risp ass INVITE Pisa,Tempi Risp ass INVITE
Cagliari)
variabiliInOR(1,CPU RS1,CPU RS2,CPU RS3,CPU RS4,CPU RS5,memoria
RS1,memoria RS2,memoria RS3,memoria RS4,memoria RS5)
then
setAzione(taglio INVITE da lista di SD)
end
#From row number: 18
rule "Controllo Stato_18"
salience 8
when
variabiliInOR(1,Throughput ass REGISTER Pisa,Throughput der REGISTER
Pisa,Throughput ass REGISTER Cagliari,Throughput der REGISTER Cagliari)
variabiliInOR(1,THRIn-THROut REGISTER Pisa,THRIn-THROut REGISTER
Cagliari)
variabiliInOR(1,CPU RS1,CPU RS2,CPU RS3,CPU RS4,CPU RS5,memoria
RS1,memoria RS2,memoria RS3,memoria RS4,memoria RS5)
then
setAzione(taglio REGISTER da lista di SD)
end
17 years, 3 months
place for import statments
by ekke
hi,
I installed Drools 4.0.1 and examples.
I have seen that there's a file rule.package
(//This is a package configuration file
//Add imports, globals etc here which will be used by all the rule assets in
thise folder.)
I've tested something and noticed, that .drl and .brl "see" these imports.
because I didn't found something about rule.package files in the docs,
I want to ask whats the recommended place for imports etc:
inside the .drl or inside the rule.package file ?
thanks for info
ekke
--
View this message in context: http://www.nabble.com/place-for-import-statments-tf4486306.html#a12793585
Sent from the drools - user mailing list archive at Nabble.com.
17 years, 3 months