Guvnor data enumeration issue
by GPatel@tsys.com
I am trying to use data enumerations and running into a problem. Following
the Vehicle engineType/fuelType data enumeration example in the Guvnor
manual, I created the following enumeration list and it works:
'Vehicle.engineType' : (new test.VehicleHelper()).getEngineTypes()
'Vehicle.fuelType[engineType]' : '(new
test.VehicleHelper()).getFuelTypes("@{engineType}")'
VehicleHelper:
------------
public class VehicleHelper {
public List<String> getEngineTypes(){
List<String> engineTypes = new ArrayList<String>();
engineTypes.add("Petrol");
engineTypes.add("Diesel");
return engineTypes;
}
public List<String> getFuelTypes(String engineType){
List<String> fuelTypes = new ArrayList<String>();
if("Petrol".equalsIgnoreCase(engineType)){
fuelTypes.add("ULP");
fuelTypes.add("PULP");
}
else if("Diesel".equalsIgnoreCase(engineType)){
fuelTypes.add("BIO");
fuelTypes.add("NORMAL");
}
else{
fuelTypes.add("Default Fuel 1");
fuelTypes.add("Default Fuel 2");
}
return fuelTypes;
}
}
Above works as expected.
Problem:
I want to only have an enumeration on Vehicle.fuelType that depends on the
value of engineType, without specifying an enumeration on engineType. So,
I took out the first line in my enumeration list so that it is now:
'Vehicle.fuelType[engineType]' : '(new
test.VehicleHelper()).getFuelTypes("@{engineType}")'
But that does not work. When I create a rule, VehicleHelper.getFuelTypes
does not get called and the dropdown for fuelType is not a list.
How do I get this working?
Thanks
G. Patel
-----------------------------------------
The information contained in this communication (including any
attachments hereto) is confidential and is intended solely for the
personal and confidential use of the individual or entity to whom
it is addressed. If the reader of this message is not the intended
recipient or an agent responsible for delivering it to the intended
recipient, you are hereby notified that you have received this
communication in error and that any review, dissemination, copying,
or unauthorized use of this information, or the taking of any
action in reliance on the contents of this information is strictly
prohibited. If you have received this communication in error,
please notify us immediately by e-mail, and delete the original
message. Thank you
12 years, 6 months
Some problems with Deploying drools-camel-sever 5.3.x in Weblogic 10.x
by ndipiazza
Hey everyone,
We have been trying to deploy drools-camel-server-5.3.x.Final.war from
droolsjbpm-integration-distribution-5.3.0.Final on WebLogic 10.3.3.
We hit a series of issues, of which I've opened up some issue tickets to
address:
1) strict web application container complains about web.xml (JBRULES-3403 -
https://issues.jboss.org/browse/JBRULES-3403) - web.xml needs to be
re-arranged to get it to work in weblogic 10.x.
2) There seems to be duplicate JPA persistence units
(https://issues.jboss.org/browse/JBRULES-3404)
I also experienced two other issues that I do not feel comfortable putting
on the issue tracker because they may be weblogic-specific:
3) When I tried to run a SOAP UI test on the drools server in Weblogic
10.3.3 I get this:
WARNING: Interceptor for {http://soap.jax.drools.org/}CommandExecutor has
thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: This class does not support SAAJ 1.1
at
org.apache.camel.component.cxf.CxfConsumer$1.checkFailure(CxfConsumer
.java:123)
at
org.apache.camel.component.cxf.CxfConsumer$1.invoke(CxfConsumer.java:
102)
at
org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInv
okerInterceptor.java:58)
at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:44
1)
at
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at
org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecu
tor.java:37)
at
org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(Se
rviceInvokerInterceptor.java:106)
at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseIntercept
orChain.java:263)
at
org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainIniti
ationObserver.java:118)
at
org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(Abstract
HTTPDestination.java:208)
at
org.apache.cxf.transport.servlet.ServletController.invokeDestination(
ServletController.java:223)
at
org.apache.cxf.transport.servlet.ServletController.invoke(ServletCont
roller.java:205)
at
org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpr
ingServlet.java:113)
at
org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(Ab
stractHTTPServlet.java:184)
at
org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractH
TTPServlet.java:107)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at
org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(Abstract
HTTPServlet.java:163)
at
weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run
(StubSecurityHelper.java:227)
at
weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecuri
tyHelper.java:125)
at
weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.jav
a:300)
at
weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.jav
a:183)
at
weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio
n.doIt(WebAppServletContext.java:3686)
at
weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio
n.run(WebAppServletContext.java:3650)
at
weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
dSubject.java:321)
at
weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
121)
at
weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppS
ervletContext.java:2268)
at
weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletC
ontext.java:2174)
at
weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.j
ava:1446)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
Caused by: java.lang.UnsupportedOperationException: This class does not
support
SAAJ 1.1
at
weblogic.webservice.core.soap.SOAPMessageImpl.getSOAPBody(SOAPMessage
Impl.java:631)
at
org.drools.jax.soap.PreCxfTransportSoapProcessor.process(PreCxfTransp
ortSoapProcessor.java:42)
at
org.drools.camel.component.DroolsPolicy$DroolsProcess.process(DroolsP
olicy.java:341)
at
org.apache.camel.impl.converter.AsyncProcessorTypeConverter$Processor
ToAsyncProcessorBridge.process(AsyncProcessorTypeConverter.java:50)
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelp
er.java:70)
at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(Delegat
eAsyncProcessor.java:98)
at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsy
ncProcessor.java:89)
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelp
er.java:70)
at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(Delegat
eAsyncProcessor.java:98)
at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsy
ncProcessor.java:89)
at
org.apache.camel.processor.interceptor.TraceInterceptor.process(Trace
Interceptor.java:99)
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelp
er.java:70)
at
org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler
(RedeliveryErrorHandler.java:290)
at
org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryE
rrorHandler.java:202)
at
org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java
:256)
at
org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProc
essor.java:99)
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelp
er.java:70)
at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(Delegat
eAsyncProcessor.java:98)
at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsy
ncProcessor.java:89)
at
org.apache.camel.management.InstrumentationProcessor.process(Instrume
ntationProcessor.java:68)
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelp
er.java:91)
at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsy
ncProcessor.java:85)
at
org.apache.camel.component.cxf.CxfConsumer$1.invoke(CxfConsumer.java:
97)
... 29 more
Seems to be two possible ways to solve this (have not tested these yet!)
Option One: Use axis.jar instead of saaj-impl.jar
1. add axis.jar file to bea class path
2. in startWebLogic.sh/cmd
set JAVA_OPTIONS=%SAVE_JAVA_OPTIONS%
-Djavax.xml.soap.MessageFactory=org.apache.axis.soap.MessageFactoryImpl
Option Two: Make a code fix to allow the saaj to function
Follow the below steps to resolve "UnsupportedOperationException"
a. Set classpath to latest saaj-impl.jar in startweblogic.cmd
b. Set the below 2 system properties in code.
System.setProperty("javax.xml.soap.MessageFactory","com.sun.xml.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl");
System.setProperty("javax.xml.soap.SOAPConnectionFactory","weblogic.wsee.saaj.SOAPConnectionFactoryImpl");
c. Note that the above 2 classes are available in the saaj-impl.jar which i
have used and set classpath in step1. If you are using different version of
saaj-impl.jar, set the exact "MessageFactory" and "SOAPConnectionFactory"
classes which are avilable in your saaj-impl.jar. (Just extract your
saaj-impl.jar and findout the exact classes).
Obviously we cannot expect Drools team to make any code changes with respect
to WebLogic, so I would imagine trying Step 1 is the best way to go.
4) The drools-camel-server.war’s test.jsp apparently runs an example that
uses a Camel route leading to a REST web service. This does not work for me
either off the bat:
WARNING: Interceptor for {http://soap.jax.drools.org/}CommandExecutor has
thrown
exception, unwinding now
org.apache.cxf.interceptor.Fault: Unable to create message factory for SOAP:
Pro
vider org.apache.axis.soap.MessageFactoryImpl not found
at
org.apache.camel.component.cxf.CxfConsumer$1.checkFailure(CxfConsumer
.java:123)
at
org.apache.camel.component.cxf.CxfConsumer$1.invoke(CxfConsumer.java:
102)
at
org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInv
okerInterceptor.java:58)
at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:44
1)
at
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at
org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecu
tor.java:37)
at
org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(Se
rviceInvokerInterceptor.java:106)
at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseIntercept
orChain.java:263)
at
org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainIniti
ationObserver.java:118)
at
org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(Abstract
HTTPDestination.java:208)
at
org.apache.cxf.transport.servlet.ServletController.invokeDestination(
ServletController.java:223)
at
org.apache.cxf.transport.servlet.ServletController.invoke(ServletCont
roller.java:205)
at
org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpr
ingServlet.java:113)
at
org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(Ab
stractHTTPServlet.java:184)
at
org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractH
TTPServlet.java:107)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at
org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(Abstract
HTTPServlet.java:163)
at
weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run
(StubSecurityHelper.java:227)
at
weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecuri
tyHelper.java:125)
at
weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.jav
a:300)
at
weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.jav
a:183)
at
weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio
n.doIt(WebAppServletContext.java:3686)
at
weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio
n.run(WebAppServletContext.java:3650)
at
weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
dSubject.java:321)
at
weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
121)
at
weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppS
ervletContext.java:2268)
at
weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletC
ontext.java:2174)
at
weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.j
ava:1446)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
Caused by: javax.xml.soap.SOAPException: Unable to create message factory
for SO
AP: Provider org.apache.axis.soap.MessageFactoryImpl not found
at
javax.xml.soap.MessageFactory.newInstance(MessageFactory.java:116)
at
org.drools.jax.soap.PreCxfTransportSoapProcessor.process(PreCxfTransp
ortSoapProcessor.java:40)
at
org.drools.camel.component.DroolsPolicy$DroolsProcess.process(DroolsP
olicy.java:341)
at
org.apache.camel.impl.converter.AsyncProcessorTypeConverter$Processor
ToAsyncProcessorBridge.process(AsyncProcessorTypeConverter.java:50)
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelp
er.java:70)
at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(Delegat
eAsyncProcessor.java:98)
at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsy
ncProcessor.java:89)
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelp
er.java:70)
at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(Delegat
eAsyncProcessor.java:98)
at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsy
ncProcessor.java:89)
at
org.apache.camel.processor.interceptor.TraceInterceptor.process(Trace
Interceptor.java:99)
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelp
er.java:70)
at
org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler
(RedeliveryErrorHandler.java:290)
at
org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryE
rrorHandler.java:202)
at
org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java
:256)
at
org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProc
essor.java:99)
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelp
er.java:70)
at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(Delegat
eAsyncProcessor.java:98)
at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsy
ncProcessor.java:89)
at
org.apache.camel.management.InstrumentationProcessor.process(Instrume
ntationProcessor.java:68)
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelp
er.java:91)
at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsy
ncProcessor.java:85)
at
org.apache.camel.component.cxf.CxfConsumer$1.invoke(CxfConsumer.java:
97)
... 29 more
<Feb 26, 2012 3:58:31 PM CST> <Error> <HTTP> <BEA-101020>
<[ServletContext@12863
942[app:_appsdir_drools-5.3.0A_dir module:drools-5.3.0A path:/drools-5.3.0A
spec
-version:null]] Servlet failed with Exception
org.apache.camel.CamelExecutionException: Exception occurred during
execution on
the exchange: Exchange[Message: <batch-execution lookup="ksession1">
<insert out-identifier="message">
<org.test.Message>
<text>Hello World</text>
</org.test.Message>
</insert>
</batch-execution>
]
at
org.apache.camel.util.ObjectHelper.wrapCamelExecutionException(Object
Helper.java:1142)
at
org.apache.camel.util.ExchangeHelper.extractResultBody(ExchangeHelper
.java:452)
at
org.apache.camel.impl.DefaultProducerTemplate.extractResultBody(Defau
ltProducerTemplate.java:441)
at
org.apache.camel.impl.DefaultProducerTemplate.sendBody(DefaultProduce
rTemplate.java:119)
at
org.apache.camel.impl.DefaultProducerTemplate.sendBody(DefaultProduce
rTemplate.java:135)
Truncated. see log file for complete stacktrace
Caused By: org.apache.camel.CamelExchangeException: No consumers available
on en
dpoint: Endpoint[direct://kservice/rest]. Exchange[Message: <batch-execution
loo
kup="ksession1">
<insert out-identifier="message">
<org.test.Message>
<text>Hello World</text>
</org.test.Message>
</insert>
</batch-execution>
]
at
org.apache.camel.component.direct.DirectProducer.process(DirectProduc
er.java:56)
at
org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProc
essor.java:99)
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelp
er.java:91)
at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsy
ncProcessor.java:85)
at
org.apache.camel.processor.UnitOfWorkProducer.process(UnitOfWorkProdu
cer.java:63)
Truncated. see log file for complete stacktrace
Apparently the camel endpoint did not deploy at all, or something.
I'm wondering what of these issues are totally specific to WebLogic, and
which are just plain 'ole issues. Can anyone share their experiences or
expectations of using the drools camel server WAR within the various app
servers? How much are we expected to make custom changes?
--
View this message in context: http://drools.46999.n3.nabble.com/Some-problems-with-Deploying-drools-cam...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 6 months
make the Guvnor interface into French
by freelance developpement
Hi every one,
For simplicity I must make the interface Guvnor for administration of
business rules, in French and not English under Internet Explorer or
Firefox.
Have you ant idea?
thanx in advance
12 years, 7 months
KnowledgeAgent Changeset problems
by albertorugnone
Hi all,
I have some problem with KnowledgeAgent, maybe you can help me. I will list
these in the following
1) during change set loading I have the following error
(null: 1, 207): schema_reference.4: Failed to read schema document
'drools-change-set-5.0.xsd', because 1) could not find the document; 2) the
document could not be read; 3) the root element of the document is not
<xsd:schema>.
(null: 1, 207): cvc-elt.1: Cannot find the declaration of element
'change-set'.
(null: 1, 216): schema_reference.4: Failed to read schema document
'drools-change-set-5.0.xsd', because 1) could not find the document; 2) the
document could not be read; 3) the root element of the document is not
<xsd:schema>.
(null: 1, 311): schema_reference.4: Failed to read schema document
'drools-change-set-5.0.xsd', because 1) could not find the document; 2) the
document could not be read; 3) the root element of the document is not
<xsd:schema>
I suppose this is because change-set.xml can be reached. What is a correct
setting for xs:schemaLocation.
2) I would like scan also a directories in order to add knowledge to my rule
set if I add a new file. How I can do that?
3) KnowledgeAgentConfiguration aconf =
KnowledgeAgentFactory.newKnowledgeAgentConfiguration();
aconf.setProperty("drools.agent.newInstance", "true") <== what is the
meaning of this property? Where I can find documentation about those
properties
4) why when I would set a global variable I receive
Exception in thread "main" java.lang.RuntimeException: Unexpected global
[service]
at
org.drools.common.AbstractWorkingMemory.setGlobal(AbstractWorkingMemory.java:615)
at
org.drools.impl.StatefulKnowledgeSessionImpl.setGlobal(StatefulKnowledgeSessionImpl.java:332)
at
com.sample.DroolsKnowledgeAgentTest.main(DroolsKnowledgeAgentTest.java:90)
I the following an example about my question
@SuppressWarnings("restriction") public class DroolsKnowledgeAgentTest {
public static class Service {
}
DroolsKnowledgeAgentTest() {
KnowledgeBase newKnowledgeBase = KnowledgeBaseFactory.newKnowledgeBase();
ResourceFactory.getResourceChangeNotifierService()
.start();
ResourceFactory.getResourceChangeScannerService()
.start();
final ResourceChangeScannerConfiguration sconf =
ResourceFactory.getResourceChangeScannerService()
.newResourceChangeScannerConfiguration();
sconf.setProperty("drools.resource.scanner.interval", "2");
ResourceFactory.getResourceChangeScannerService()
.configure(sconf);
final KnowledgeAgentConfiguration aconf =
KnowledgeAgentFactory.newKnowledgeAgentConfiguration();
aconf.setProperty("drools.agent.scanDirectories", "true");
aconf.setProperty("drools.agent.scanResources", "true");
aconf.setProperty("drools.agent.newInstance", "true");
final KnowledgeAgent agent =
KnowledgeAgentFactory.newKnowledgeAgent("pch.sel.knowledge.agent",
newKnowledgeBase, aconf);
// if (_l.isDebugEnabled()) {
/* we need some log every time */
agent.setSystemEventListener(new PrintStreamSystemEventListener());
// }
}
public static void main(String[] args) throws IOException {
ResourceFactory.getResourceChangeNotifierService()
.start();
ResourceFactory.getResourceChangeScannerService()
.start();
String xml = "";
xml += "<change-set xmlns='http://drools.org/drools-5.0/change-set'";
xml += "
xmlns:xs='http://www.w3.org/2001/XMLSchema-instance'";
xml += "
xs:schemaLocation='http://drools.org/drools-5.0/change-set
drools-change-set-5.0.xsd' >";
xml += " <add> ";
xml += " <resource
source='Z:/WSP/drools-test/src/main/java/com/sample/rule1.drl' type='DRL'
/>";
xml += " </add> ";
xml += "</change-set>";
FileManager fileManager = new FileManager();
File fxml = fileManager.newFile("changeset.xml");
BufferedWriter output = new BufferedWriter(new FileWriter(fxml));
output.write(xml);
output.close();
KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
ResourceChangeScannerConfiguration sconf =
ResourceFactory.getResourceChangeScannerService()
.newResourceChangeScannerConfiguration();
sconf.setProperty("drools.resource.scanner.interval", "2");
ResourceFactory.getResourceChangeScannerService()
.configure(sconf);
KnowledgeAgentConfiguration aconf =
KnowledgeAgentFactory.newKnowledgeAgentConfiguration();
aconf.setProperty("drools.agent.scanDirectories", "true");
aconf.setProperty("drools.agent.scanResources", "true");
aconf.setProperty("drools.agent.newInstance", "true");
KnowledgeAgent kagent = KnowledgeAgentFactory.newKnowledgeAgent("test
agent", kbase, aconf);
kagent.applyChangeSet(ResourceFactory.newUrlResource(fxml.toURI()
.toURL()));
StatefulKnowledgeSession ksession = kagent.getKnowledgeBase()
.newStatefulKnowledgeSession();
ksession.setGlobal("service", new Service());
}
}
and rule named rule1.drl
#created on: 29-Feb-2012
package com.sample
#list any import classes here.
#declare any global variables here
global DroolsKnowledgeAgentTest.Service service;
rule "Your First Rule"
when
#conditions
then
#actions
end
Thank you very much for your answers and kind regards
Alberto
--
View this message in context: http://drools.46999.n3.nabble.com/KnowledgeAgent-Changeset-problems-tp378...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 7 months
Using Character typed properties in Drool 5.3
by Welsh, Armand
Community,
In drools 5.2 I had the following LHS"
when
BloombergColumn (columnName == "CRNCY", $cur : stringValue != null)
Country (currency == $cur, emergingMkt == 'Y' || countryCode in ("BH","HR","CZ","EE","HK","HU","IL","KR","KW","MO","OM","QA","SA","SG","SK","SI","TT"))
I am switching to Drool 5.3, and Drools Guvnor reports the following error upon validate (or compile):
[bum_code_value.currency 01] Unable to Analyse Expression emergingMkt == 'Y' || countryCode == "BH" || countryCode == "HR" || countryCode == "CZ" || countryCode == "EE" || countryCode == "HK" || countryCode == "HU" || countryCode == "IL" || countryCode == "KR" || countryCode == "KW" || countryCode == "MO" || countryCode == "OM" || countryCode == "QA" || countryCode == "SA" || countryCode == "SG" || countryCode == "SK" || countryCode == "SI" || countryCode == "TT": [Error: Comparison operation requires compatible types. Found class java.lang.Character and class java.lang.String] [Near : {... == "SK" || countryCode == "SI" || countryCode == "TT" ....}] ^ [Line: 7, Column: 28]
Looking at the emergingMkt in my data model, I see that it is defined as a Character. If I change my LHS to:
BloombergColumn (columnName == "CRNCY", $cur : stringValue != null)
Country (currency == $cur, emergingMkt == Character.valueOf('Y') || countryCode in ("BH","HR","CZ","EE","HK","HU","IL","KR","KW","MO","OM","QA","SA","SG","SK","SI","TT"))
Then the validate passes.
Was this change in behavior intentional? I don't see a reference to this change in the Drools 5.3 documentation, and this makes for a harder to read rule for our Drools analysts.
Thanks in advance,
Armand
12 years, 8 months
[Drools Planner] Hard constraint appears to be ignored
by Reinis
Hello, it appears that hard constraint I have defined is being ignored
in some rare cases. Here's an example:
This is what my application logs after getting best solution after
solver has returned from solve():
2012-02-23 21:28:54,595 [main] INFO Project Project1 assignment
563:[2012-02-27T13:00:00.000/2012-02-27T17:00:00.000] was assigned to John
2012-02-23 21:28:54,597 [main] INFO Project Project2 assignment
508:[2012-02-27T13:00:00.000/2012-02-27T17:00:00.000] was assigned to John
(The log says that John was assigned twice in same time period to two
different assignments (assignment 563 and assignment 508)
Here short explanation of the relevant domain data
assignment.id = 563
assignment.interval = 2012-02-27T13:00:00.000/2012-02-27T17:00:00.000
assignment.project = Project1
assignment.resource = John
And this is rule that, to my opinion should've prohibited that two
assignments get assigned to the same resource:
rule "only one assignment within interval for the same resource"
when
$leftAssignment : Assignment($leftId : id, $interval :
interval, resource != null, $resource : resource)
$rightAssignment : Assignment(interval == $interval, resource
== $resource, id != $leftId)
then
insertLogical(new IntConstraintOccurrence("only one assignment
within interval for the same resource", ConstraintType.NEGATIVE_HARD, 1,
$leftAssignment, $rightAssignment));
end
The score looks like this:
2012-02-23 21:28:54,594 [main] DEBUG The hard score is: 0 and the soft
score is: -532
So no hard constraints are broken according to planner.
My question is not what is wrong with this particular example (unless it
is obvious for you), but if you can think of any anti-pattern that would
cause this behavior?
What I already checked is:
- this happens really sporadically (most of the time the result is
CORRECT but in 1 from 5 runs I get this kind of error);
- I checked, re-checked and re-re-checked all the hashCode, compareTo,
solutionHashCode, solutionCompare, clone, ... methods - they appear to
be correct;
- moves are simple and I tried to keep them consistent with the way
moves in drools-planner examples are constructed;
Would be great if you could give me a hint to what direction I should
look next.
br
Reinis
12 years, 8 months
Drools & jBPM Event : London 8th March 2012
by Mark Proctor
http://blog.athico.com/2012/02/drools-jbpm-event-london-8th-march-2012.html
-----
Register now to join us for the free Drools & jBPM London 2012 event,
hurry limited spaces :)
http://redhat-mail.com/t/XRU-OE4J-824IMOYW1D/cr.aspx
When Thursday 8th March
Where Stationers Hall, London
Agenda trans
trans trans trans
trans
trans
09:00 trans Registration, tea and coffee
trans
09:30 trans Introduction/ Welcome
trans
09:45 trans Rules, Events & Processes: the Open Source way
Mark Proctor - Worldwide Technical Lead for BRMS & BPMS, Red Hat
trans
10:45 trans Decision Tables
Michael Anstis, JBoss Core Developer, Red Hat
trans
11:15 trans Tea/Coffee Break
trans
11:30 trans BPMN2 and jBPM5
Kris Verlaenen, JBoss Core Developer, Red Hat
trans
12:15 trans Solving Planning Problems
Geoffrey de Smet, JBoss Core Developer, Red Hat
trans
12:45 trans Case Studies
trans
13:00 trans Lunch and Networking
trans
12 years, 8 months
5.4.0.Beta2 parse error in consequence /* in string
by Benjamin Bennett
Just passing on I am using the drools 5.4.0Beta2
The following doesn't compile using the mvel dialect .
rule "some rule"
when
fact: Fact()
then
BasicFact fault= new BasicFact( "/*");
end
but
rule "some rule"
when
fact: Fact()
then
BasicFact fault= new BasicFact( "/ *");
end
does compile some how /* is being parsed as an expression I think and not a
string literal.
Thanks,
Ben
12 years, 8 months
limits on number of rules in Guvnor in a package, loaded in knowledge base
by vadlam
are there are any benchmarks around number of rules that can be created in a
package in Guvnor?
we run Guvnor 5.3.0.final in Guvnor on a windows server that has 1.4 GB heap
and we are seeing memory issues when the package has reached around 900
rules or so.
by memory issues, I mean that after the package is built successfully,
memory is not being released back. this behaviour is more obvious at such
high number of rules in package than when we had just around 600 rules or
so.
also, when we try to load the package generated (around 6.4 MB) into the
knowledgesession, it crashes the system .
are there any recommendations on
1. whether we can split up a package into two separate packages, and load
the 2 of them separately one after the other into the session ?
2. amount of memory that guvnor needs to build such high number of rules ?
3. ways to shrink the number of rules as per some best practices while
still meeting requirements ?
--
View this message in context: http://drools.46999.n3.nabble.com/limits-on-number-of-rules-in-Guvnor-in-...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 8 months