[rules-users] BaseDescr and addOrMerge method

2007-12-17 Thread Raffaele Viola
Hi all,

I'm searching for a description about the way to use the addOrMerge method
in the BaseDescr interface,
but in the Drools 4.0.3 API there are nothing? Can someone help me?

Thanks in advance
Raffo
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] create XML rules with XML parser

2007-11-14 Thread Raffaele Viola
Hi all,

I want to create automatically the xml containing the rules using a parser
like castor, which .xsd I have to use to generate the appropriate java
class?
Can someone give me some indications?

Thanks
Raffo
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Fwd: assertion of object

2007-09-24 Thread Raffaele Viola
Thanks,

what do you suggest to clone the object in the first line of the
consequence?

Regards
Raffo



2007/9/24, Mark Proctor <[EMAIL PROTECTED]>:
>
>  Have you thought of inserting your data, rather than setting it as a
> global? It looks like statoNodo should be inserted and not a global.
>
> Also each rule will still use the same instance, if you need another
> instance why not clone the object in the first line of the consequence?
>
> Mark
> Raffaele Viola wrote:
>
> when a condition match call statoNodo.variabiliInOR() that add in to
> the list the first arg
>
> the action function add the list in the azioe with the method
> azione.setAzione("pio",lista);
>
> My list result is :
> Pisa
> Cagliari
> Pisa
> Cagliari
>
> 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;
> import java.util.ArrayList;
>
> global StatoNodo statoNodo;
> global Azione azione;
> global ArrayList lista;
>
> #From row number: 13
> rule "Pricing bracket_13"
>
> salience 1
> when
> eval(statoNodo.variabiliInOR("Pisa",lista,1))
> then
> azione.setAzione("ciao",lista);
> end
>
> #From row number: 14
> rule "Pricing bracket_14"
>
> salience 3
> when
> eval(statoNodo.variabiliInOR("Cagliari,Pisa",lista,1))
> then
> azione.setAzione("pio",lista);
> end
>
> --
>
> ___
> rules-users mailing list
> [EMAIL PROTECTED]://lists.jboss.org/mailman/listinfo/rules-users
>
>
>
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] drools cannot be resolved

2007-09-22 Thread Raffaele Viola
In the statoNodo.variabiliInOR(drools.getRule().getName(),$param) called in
the condition part of the rule creates a list using $param that I add in the
consequences part to another object called Azione.

At the end Azione must contains the list created using the $param of is own
row.

But so far I have no solution
Thanks
Raffo

2007/9/22, Edson Tirelli <[EMAIL PROTECTED]>:
>
>
> Because the "drools" variable is only available in consequences. What
> are you trying to do?
>
>     []s
>     Edson
>
> 2007/9/22, Raffaele Viola < [EMAIL PROTECTED]>:
> >
> > Hi all,
> >
> > why if I set in the condition
> >
> > eval(statoNodo.variabiliInOR(drools.getRule().getName()))
> > I get the error
> > drools cannot be resolved??
> >
> > Thanks
> > Raffo
> >
> > ___
> > rules-users mailing list
> > rules-users@lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/rules-users
> >
> >
>
>
> --
>   Edson Tirelli
>   Software Engineer - JBoss Rules Core Developer
>   Office: +55 11 3529-6000
>   Mobile: +55 11 9287-5646
>   JBoss, a division of Red Hat @ www.jboss.com
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] drools cannot be resolved

2007-09-22 Thread Raffaele Viola
Hi all,

why if I set in the condition

eval(statoNodo.variabiliInOR(drools.getRule().getName()))
I get the error
drools cannot be resolved??

Thanks
Raffo
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Fwd: assertion of object

2007-09-21 Thread Raffaele Viola
when a condition match call statoNodo.variabiliInOR() that add in to the
list the first arg

the action function add the list in the azioe with the method
azione.setAzione("pio",lista);

My list result is :
Pisa
Cagliari
Pisa
Cagliari

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;
import java.util.ArrayList;

global StatoNodo statoNodo;
global Azione azione;
global ArrayList lista;

#From row number: 13
rule "Pricing bracket_13"

salience 1
when
eval(statoNodo.variabiliInOR("Pisa",lista,1))
then
azione.setAzione("ciao",lista);
end

#From row number: 14
rule "Pricing bracket_14"

salience 3
when
eval(statoNodo.variabiliInOR("Cagliari,Pisa",lista,1))
then
azione.setAzione("pio",lista);
end
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Fwd: [rules-users] assertion of object

2007-09-21 Thread Raffaele Viola
How can I declare a variable not global but local to every rules

Thanks
Raffo

-- Forwarded message --
From: Raffaele Viola <[EMAIL PROTECTED]>
Date: 21-set-2007 19.51
Subject: Re: [rules-users] assertion of object
To: Rules Users List 

No,

the problem is that if I assert an object ArrayList lista and in the
Condition i add a string using $param

at the end of iteration I have an array with every params in the column but
I want only the param in the row of my action

Thanks
Raffo

2007/9/21, Scott Reed <[EMAIL PROTECTED]>:
>
> maybe: insert( new MyObject( x,y,z ) );
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] assertion of object

2007-09-21 Thread Raffaele Viola
No,

the problem is that if I assert an object ArrayList lista and in the
Condition i add a string using $param

at the end of iteration I have an array with every params in the column but
I want only the param in the row of my action

Thanks
Raffo

2007/9/21, Scott Reed <[EMAIL PROTECTED]>:
>
> maybe: insert( new MyObject( x,y,z ) );
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] RIGHT_PAREN

2007-09-21 Thread Raffaele Viola
ok thanks ... i solved my problem using
eval(statoNodo.variabiliInOR("$param"));
the function variabiliInOR returns a boolean variable

Regards
Raffo

2007/9/21, Scott Reed <[EMAIL PROTECTED]>:
>
> Ok, my apologies for not reading carefully. Now I see you are working from
> a decision table.
> My advice is to try your rules using DRL first to be sure you understand
> the syntax and the
> limitations and then work out the decision table version.
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] assertion of object

2007-09-21 Thread Raffaele Viola
Hi all,

how can I assert an object to the rules engine and be sure that for each
rule fired it use s a new istance of my object??

Thanks
Raffo
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] RIGHT_PAREN

2007-09-21 Thread 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:
[EMAIL PROTECTED],476:479='"18"',<20>,13:12]; expecting type RIGHT_PAREN


Thanks,
Raffo
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] mismatched token

2007-09-20 Thread 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 '[EMAIL PROTECTED],392:392='.',<8>,9:50]' 
expecting
set null[9,51]: unknown:9:51 mismatched token '[EMAIL 
PROTECTED],393:393='.',<8>,9:51]'
expecting set null[9,57]: unknown:9:57 mismatched token
'[EMAIL PROTECTED],399:399=')',<12>,9:57]' expecting set null[32,16]: 
unknown:32:16
mismatched token: [EMAIL PROTECTED],787:787='2',<25>,32:16]; expecting type
RIGHT_PAREN[42,16]: unknown:42:16 mismatched token:
[EMAIL PROTECTED],1043:1043='1',<25>,42:16]; expecting type RIGHT_PAREN[52,16]:
unknown:52:16 mismatched token: [EMAIL PROTECTED],1308:1308='1',<25>,52:16]; 
expecting
type RIGHT_PAREN[53,16]: unknown:53:16 mismatched token:
[EMAIL PROTECTED],1443:1443='1',<25>,53:16]; expecting type RIGHT_PAREN[63,16]:
unknown:63:16 mismatched token: [EMAIL PROTECTED],1682:1682='1',<25>,63:16]; 
expecting
type RIGHT_PAREN[64,16]: unknown:64:16 mismatched token:
[EMAIL PROTECTED],1825:1825='1',<25>,64:16]; expecting type RIGHT_PAREN[74,16]:
unknown:74:16 mismatched token: [EMAIL PROTECTED],2066:2066='1',<25>,74:16]; 
expecting
type RIGHT_PAREN[75,16]: unknown:75:16 mismatched token:
[EMAIL PROTECTED],2201:2201='1',<25>,75:16]; expecting type RIGHT_PAREN[76,16]:
unknown:76:16 mismatched token: [EMAIL PROTECTED],2278:2278='1',<25>,76:16]; 
expecting
type RIGHT_PAREN[86,16]: unknown:86:16 mismatched token:
[EMAIL PROTECTED],2517:2517='1',<25>,86:16]; expecting type RIGHT_PAREN[87,16]:
unknown:87:16 mismatched token: [EMAIL PROTECTED],2660:2660='1',<25>,87:16]; 
expecting
type RIGHT_PAREN[88,16]: unknown:88:16 mismatched token:
[EMAIL PROTECTED],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 

Re: [rules-users] column in OR

2007-09-12 Thread Raffaele Viola
yes, but in a decision table

regards
Raffo

2007/9/12, Edson Tirelli <[EMAIL PROTECTED]>:
>
>What do you mean?
>
> rule XXX
> when
> A() or B()
> then
>// do something
> end
>
>    ?
>
>Edson
>
> 2007/9/12, Raffaele Viola < [EMAIL PROTECTED]>:
> >
> > Hi all,
> >
> > how can I put two columns in OR
> >
> > Thanks
> > Raffo
> >
> > ___
> > rules-users mailing list
> > rules-users@lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/rules-users
> >
> >
>
>
> --
>   Edson Tirelli
>   Software Engineer - JBoss Rules Core Developer
>   Office: +55 11 3529-6000
>   Mobile: +55 11 9287-5646
>   JBoss, a division of Red Hat @ www.jboss.com
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] column in OR

2007-09-12 Thread Raffaele Viola
Hi all,

how can I put two columns in OR

Thanks
Raffo
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] rules name

2007-09-12 Thread Raffaele Viola
Hi all,

can I set using the decision table the name of each rules?

thanks
Raffo
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] problem with threads

2007-08-30 Thread Raffaele Viola
Hi all,

I have a HashTable dawned by a thread T1, another thread T2 take this
HashTable and give it to the working memory as assertion.

what happens if T2 and JRools try to access to the HashTable?
Can I consider the working memory as a thread and use a method
synchronization to solve the concurrent access problem?

Thanks
Raffo
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] RuntimeDroolsException

2007-08-16 Thread Raffaele Viola
Hi,

I'm starting to use eclipse plug.in for JRules. I created the example JRules
project in eclipse and I tried to start it as Java Application but I got
this exception

org.drools.RuntimeDroolsException: Unable to load dialect '
org.drools.rule.builder.dialect.java.JavaDialect:java'
at org.drools.compiler.PackageBuilderConfiguration.buildDialectRegistry(
PackageBuilderConfiguration.java:156)
at org.drools.compiler.PackageBuilder.(PackageBuilder.java:131)
at org.drools.compiler.PackageBuilder.(PackageBuilder.java:84)
at com.sample.DroolsTest.readRule(DroolsTest.java:50)
at com.sample.DroolsTest.main(DroolsTest.java:21)

Can someone help me?
Thanks
Raffo
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users