Decision table imported into guvnor fails validation
by Lisa Horton
I have a decision table (xls) that I am able to successfully load into a knowledge base and test in my java code. However, when I import it into guvnor using the Create a File upload for xls type, validation fails with these errors:
[document list decision table] Rule Compilation error The type com.domain.job.AbstractJob is not visible The type org.apache.commons.lang.reflect.MemberUtils is not visible Syntax error on token "enum", Identifier expected The type org.apache.commons.lang.Entities is not visible The type com.abclegal.domain.activity.AbstractActivity is not visible Syntax error on token "enum", Identifier expected Syntax error on token "enum", Identifier expected The type org.apache.commons.lang.IntHashMap is not visible The type org.apache.commons.lang.builder.IDKey is not visible The import org.apache.commons.lang.NumberRange collides with another import statement The import org.apache.commons.lang.math.NumberUtils collides with another import statement
The spreadsheet does include import statement in the rules template section, including an import of com.domain.job.AbstractJob seen above. AbstractJob is in the POJO model.
I am at version 5.1.1
I'd appreciate any suggestions for troubleshooting. Also, is this the recommended way to integrate decision tables with Guvnor rules (i.e. to import into guvnor), or is there a better practice for managing decision tables along with other rule sources?
14 years, 10 months
Is there any work going on for Drools on .net?
by rahultechie
Hi,
I am currently working on Drools on .net. What I found that the latest
version of drool .net is 3.0 which was developed around 2007. After that
there is work no done on Drool .net.
On above investigation following are my some of questions,
1. Whatever information I got is correct?
2. I want to use drools in my .net project. Latest version of Drools is 5.0
in JAVA, in future can we see Drools 5.0 in .net?
3. Is there any work around for now to use Drools 5.0 in .net?
Any link to above question will be useful.
Thanks.
--
View this message in context: http://drools.46999.n3.nabble.com/Is-there-any-work-going-on-for-Drools-o...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 10 months
Smart Templates
by ChrisMu
Hi,
I'm trying to get a template (.drt) to generate 2 rules (.drl) from 2
datasets but by doing a little bit more work than direct substitution.
Data (service,value):
DC, AAA
DC, XYZ
Idea for the template - if value is of type1 then create Type object with
'Type1' as name. If value is of type2, use 'Type2' as name:
rule "DC_(a){row.rowNumber}"
when
Service(name == "DC")
then
Type.setName(eval(Service.getType(@{value})))
Type.setAtt(0,@{value})
end template
eval(Service.getType(@{arg0})) should take 'AAA' or 'XYZ' etc as arg and
return a string Type1/Type2 etc.
This would then generate 2 rules that look like:
rule "DC_0"
when
Service(name == "DC", value == "AAA")
then
RiskType.setName("Type1")
RiskType.setAtt(0,"AAA")
rule "DC_1"
when
Service(name == "DC", value == "XYZ")
then
RiskType.setName("Type2")
RiskType.setAtt(0,"XYZ")
...is this possible at all? I'm trying to avoid the eval step being done in
the actual rule (.drl) .
Thanks
Chris
--
View this message in context: http://drools.46999.n3.nabble.com/Smart-Templates-tp3006479p3006479.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 10 months
Clarification needed in writing DSL function mapping
by Bala
Is there a simplified way of mapping than what i have done???
Java function :
function boolean checkIfVia(Route route, String locationCode)
{
if(route != null)
{
Via[] viaArr = route.getViaArray();
for(int i=1; i < viaArr.length; i++)
{
if(viaArr[i].getLocation().equalsIgnoreCase(locationCode))
return true;
else
return false;
}
}
return false;
}
Dsl Mapping:
[keyword][][Ff][Uu][Nn][Cc]
[Cc][Hh][Ee][Cc][Kk][Ii][Ff][Vv][Ii][Aa]=function boolean checkIfVia(Route
route, String locationCode)\n{checkIfViaBody}
[keyword][]checkIfViaBody=\nif(route != null)\n{checkIfViaIfBlock}\nreturn
false;\n
[keyword][]checkIfViaIfBlock=\nVia[] viaArr = route.getViaArray();\nfor(int
i=1; i < viaArr.length; i++)\n{checkIfViaForBlock}\n
[keyword][]checkIfViaForBlock=\nif(viaArr[i].getLocationCode().equalsIgnoreCase(locationCode))\n
return true; \nelse \nreturn false;\n
-----
Thanks,
Bala
--
View this message in context: http://drools.46999.n3.nabble.com/Clarification-needed-in-writing-DSL-fun...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 10 months
How to convert and use JAVA drools 5.1 in .net
by rahultechie
Hi,
I am trying to access JAVA drools 5.1 in .net. To convert binary files of
JAVA drools 5.1 in .net, I use ikvm-0.46.0.1 tool.
I referred these dlls in my .net application and tried to write JAVA code
(referring to
http://techgrafitti.wordpress.com/2011/02/21/drools-%E2%80%93-getting-sta...
link ) in my .net application.
But not able to refer StatefulSession class from
"org.drools.StatefulSession" namespace. Actually not able to find
"org.drools.StatefulSession" namespace from "drools-core-5.1.1.dll".
While converting jar to dlls I got lots of warning, after Googling I found
that we have to neglect these warnings.
Have any body already wrote such code?
Please share the dlls if you are able to run the rules in .net using latest
drools 5.1.
If possible please share me the code (if your code is not similar to the
code referred in above link).
--
View this message in context: http://drools.46999.n3.nabble.com/How-to-convert-and-use-JAVA-drools-5-1-...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 10 months
field names containing underscore
by Samuli Saarinen
Hello,
Currently it seams that using underscore as part of a field makes it
impossible to use the field in a rule.
eg.
public class Bean {
private boolean my_boolean;
}
rule "Test"
dialect "mvel"
when
b: Bean(my_boolean == true)
....
When compiling the rule this results in "Unable to build constraint as
'my_boolean' is invalid" error using Drools 5.2.0.CR1
and "Unable to create Field Extractor for 'my_boolean' of
'[ClassObjectType class=com.test.Bean]'" using Drools 5.1.1
Is this the expected behavior?
Cheers,
Samuli
--
Remion Oy Etävalvontajärjestelmät liiketoiminnan
Samuli Saarinen tehostamiseen
gsm +358 (0)50 3560075
fax +358 (0)3 2125064 www.remion.com
14 years, 10 months
Reuse of rule
by Küng Sabrina
Hello
How can I write a rule, that can be used in several other packages resp. rulesets without copying the code?
14 years, 10 months