Trouble using java.util.List.size in constraints in 5.4.0.Final
by Alexis Brouard
Hi everyone,
I've tried to go from Drools 5.3.0.Final to 5.4.0.Final and some strange
errors appeared on constraints using the size of a list.
For instance, given the following object:
public class MyObject {
private List<String> param = new ArrayList<String>();
public MyObject() {
super();
}
public List<String> getParam() {
return param;
}
public void setParam(List<String> param) {
this.param = param;
}
}
This rule:
rule "Sample rule"
when
MyObject( param.size > 0 )
then
System.out.println( "Sample rule activated" );
end
Provokes the following error:
Unable to Analyse Expression param.size > 0:
[Error: Comparison operation requires compatible types. Found class
java.lang.String and class java.lang.Integer]
[Near : {... param.size > 0 ....}]
^ : [Rule name='Sample rule']
This worked very well in Drools 5.3.0.Final.
Is there some configuration specific to Drools 5.4.0.Final that I've missed
in the release notes?
Thanks in advance for your help.
Best,
Alexis
12 years, 5 months
Programatically filled Enum not getting loaded
by Sandjaja, Dominik
I use Guvnor 5.4.0 with the following Assets:
Enum:
'Enums.Modules' : (new de.itm.util.DroolsEnumHelper()).loadModules()
DSL:
[when]Testmodule {module:ENUM:Enums.Modules} is just for testing={module} : Cylinder()
DroolsEnumHelper-Class:
public List<String> loadModules() {
List<String> values = new ArrayList<String>();
for (Module module : Module.values()) {
values.add(module.getModuleName() + "=" + module.getDisplayName());
}
return values;
}
When running the "Source->Validate" in the Enum-Editor, I see the method getting called (being connected to the JBoss for Debugging). But if I use the DSL rule in the guided editor, I can select the rule but the dropdown field stays grayed out. The loadModules() method isn't even called, no getting stuck in my breakpoint!
Anyone an idea why and how this happens? Am I doing something totally wrong?
Thanks
Dominik
...........................................................................
mit freundlichen Grüßen / kind regards
Dominik Sandjaja
Fon: +49 (0) 203 60878 183
Mobil +49 (0) 162 2624490
Fax: +49 (0) 203 60878 22
e-mail: dominik.sandjaja(a)it-motive.de
it-motive AG
Zum Walkmüller 10-12
47269 Duisburg
info(a)it-motive.de
http://www.it-motive.de <http://www.it-motive.de/>
..............................................................................
Vorsitzender des Aufsichtsrats: Dipl.-Ing. Klaus Straub
Vorstand: Horst-Dieter Deelmann (Vors.), Matthias Heming, Christoph Tim Klose
HRB 9207, Amtsgericht Duisburg
12 years, 5 months
Implementing complex operators in Decsion Table
by pratibhapandey
I need some help in implementing complex rules in decision table..
Following are the two queries that I need to implement in decision table.
1 ----------- ((UPPER(PRODUCT_TYPE_CODE) IN ('REO', 'TRM')) OR
(UPPER(INVESTMENT_GROUP_TYPE) = 'EQUITY' AND deal_ltv_nbi_ext_Debt <= .6))
AND UPPER(PRIMARY_COLLATERAL_TYPE) = 'HOTEL'
2 --------------(UPPER(INVESTMENT_GROUP_TYPE) = 'EQUITY' OR
UPPER(PRODUCT_TYPE_CODE) = 'LES') AND ((UPPER(NNN_LEASE) = 'Y' AND
DECODE(ENHANCED_ITV, NULL, DEAL_ITV_NBI_SPP_CURR_MKT_VAL, ENHANCED_ITV) >=
.95 AND Core_Property_Type_YN = 'Y') OR (UPPER(NNN_LEASE) = 'Y' AND
DECODE(ENHANCED_ITV, NULL, DEAL_ITV_NBI_SPP_CURR_MKT_VAL, ENHANCED_ITV) >=
.85 AND Core_Property_Type_YN = 'N'))
I need to use decision tables only. so how do I implement them. I have also
attached a decsion table in which I have to implement these queries.
http://drools.46999.n3.nabble.com/file/n4017943/LeverageRuleSheet1.xls
LeverageRuleSheet1.xls
--
View this message in context: http://drools.46999.n3.nabble.com/Implementing-complex-operators-in-Decsi...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 5 months
Implementing complex operators in Decision table
by pratibhapandey
I need some help in implementing complex rules in decision table..
Following are the two queries that I need to implement in decision table.
1 ----------- ((UPPER(PRODUCT_TYPE_CODE) IN ('REO', 'TRM')) OR
(UPPER(INVESTMENT_GROUP_TYPE) = 'EQUITY' AND
deal_ltv_nbi_ext_Debt <= .6)) AND
UPPER(PRIMARY_COLLATERAL_TYPE) = 'HOTEL'
2 --------------(UPPER(INVESTMENT_GROUP_TYPE) = 'EQUITY' OR
UPPER(PRODUCT_TYPE_CODE) = 'LES') AND
((UPPER(NNN_LEASE) = 'Y' AND
DECODE(ENHANCED_ITV,
NULL,
DEAL_ITV_NBI_SPP_CURR_MKT_VAL,
ENHANCED_ITV) >= .95 AND Core_Property_Type_YN = 'Y') OR
(UPPER(NNN_LEASE) = 'Y' AND
DECODE(ENHANCED_ITV,
NULL,
DEAL_ITV_NBI_SPP_CURR_MKT_VAL,
ENHANCED_ITV) >= .85 AND Core_Property_Type_YN = 'N'))
I need to use decision tables only. so do I implement them. I have attached
a decsion table in which I have to implement.
http://drools.46999.n3.nabble.com/file/n4017941/LeverageRuleSheet1.xls
LeverageRuleSheet1.xls
--
View this message in context: http://drools.46999.n3.nabble.com/Implementing-complex-operators-in-Decis...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 5 months
Declarative model does not replicate
by devan.vanreenen@gmail.com
Hi there,
I am using Guvnor 5.0.0
I have a Guvnor running in a cluster, Guvnor uses Oracle DB for the repo.
When I add rules, functions or upload a POJO model jar, the different guvnor
instances are in synch, however this is not the case for my declarative
model which is not in synch.
My apologies if this should be posted in the JackRabbit forum rather than
this one but if you have any suggestions it would be appreciated. I will
post there as well.
Many thanks
Devan
--
View this message in context: http://drools.46999.n3.nabble.com/Declarative-model-does-not-replicate-tp...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 5 months