business guided rule editor
by neha.gupta19@wipro.com
Hi,
Business guided rule editor is not working in drools.i am not able to open the rule defined in business guided rule editor
The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments.
WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.
www.wipro.com
11 years, 10 months
DSRL rule access in web editor
by riri
Hello everyone,
I need to provide a way to allow non technical users to modify and possibly
create rules by using a web based editor. I thought about using Guvnor
because it already has validation functionality for the dsrl rule files and
I wouldn't have to implement that from scratch. The problem is that the
interface seems very complex and I have to provide something very simple, in
the style of "drag and drop".
Would there be a way to achieve this without having to dig through the whole
Guvnor source code? Is there a way to recover rule objects from rule
packages and modify the conditions parameters? The idea is not to modify the
.dsrl file directly but having a tool to display the information in a way
that the user can interact with the rule in a safe way.
Thank you very much for any help you can give me.
--
View this message in context: http://drools.46999.n3.nabble.com/DSRL-rule-access-in-web-editor-tp402179...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 10 months
Guvnor problems...
by des4900
I am working with Guvnor/Drools 5.5.0, jBPM 5.4.0 on Win7 64 bit, JBoss 7.1.1
First Problem:
1. I have a rule in the global area, e.g., Rule1
2. I create a new rule in a package by importing Rule1 from the global area
3. I realize that I imported the wrong rule.
4. How do I remove Rule1 from the package? If I archive it from the
package, it also archives it from global, which I don't want to do since it
has been imported into many other packages. If I archive it from the
package anyway and then restore it, it reappears in the global area, and
also in all of the other packages that it was a part of. The only thing I
have found that works is to copy the rule, archive it, delete it, and then
import the copied rule into all the packages where the original rule
actually belongs.
Second Problem (which I got into by trying to deal with the first one
above):
1. I have a rule in the global area, e.g., Rule2
2. I rename Rule2 to Rule3
3. I also have a different rule in a package named Rule2
4. I archive and delete Rule 2 from the package, and it no longer appears
in the archives, nor in the package. I save the package, close it, stop and
restart JBoss, and check again, and it is not in the archives nor in the
package.
5. I try to copy Rule3 from the global area to this package giving it the
name Rule2 (the same name as the rule I archived and deleted) and somehow
Guvnor thinks Rule2 is still there.
6. I get an error (apparently Guvnor thinks the rule is still there):
Error
500 The call failed on the server; see server log for details
The server log shows this:
14:22:39,840 ERROR
[org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/drools-guvnor]]
(http--0.0.0.0-8080-22) Exception while dispatching incoming RPC call:
com.google.gwt.user.server.rpc.UnexpectedException: Service method 'public
abstract java.lang.String
org.drools.guvnor.client.rpc.AssetService.copyAsset(java.lang.String,java.lang.String,java.lang.String)'
threw an unexpected exception:
org.drools.repository.RulesRepositoryException:
javax.jcr.ItemExistsException: cannot add child node
'InitClinicalStatementConcepts' to
/drools:repository/drools:package_area/edu.utah.AHRQ_PSI_04_v4_3/assets:
colliding with same-named existing node
at
com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure(RPC.java:385)
[gwt-servlet-2.4.0.jar:]
at
com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:588)
[gwt-servlet-2.4.0.jar:]
at
com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:208)
[gwt-servlet-2.4.0.jar:]
at
com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:248)
[gwt-servlet-2.4.0.jar:]
at
com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62)
[gwt-servlet-2.4.0.jar:]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:754)
[jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
[jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329)
[jbossweb-7.0.13.Final.jar:]
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
[jbossweb-7.0.13.Final.jar:]
at
org.jboss.weld.servlet.ConversationPropagationFilter.doFilter(ConversationPropagationFilter.java:62)
[weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280)
[jbossweb-7.0.13.Final.jar:]
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
[jbossweb-7.0.13.Final.jar:]
at
org.jboss.solder.servlet.exception.CatchExceptionFilter.doFilter(CatchExceptionFilter.java:65)
[solder-impl-3.1.1.Final.jar:3.1.1.Final]
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280)
[jbossweb-7.0.13.Final.jar:]
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
[jbossweb-7.0.13.Final.jar:]
at
org.jboss.solder.servlet.event.ServletEventBridgeFilter.doFilter(ServletEventBridgeFilter.java:74)
[solder-impl-3.1.1.Final.jar:3.1.1.Final]
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280)
[jbossweb-7.0.13.Final.jar:]
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
[jbossweb-7.0.13.Final.jar:]
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)
[jbossweb-7.0.13.Final.jar:]
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)
[jbossweb-7.0.13.Final.jar:]
at
org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153)
[jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155)
[jbossweb-7.0.13.Final.jar:]
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
[jbossweb-7.0.13.Final.jar:]
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
[jbossweb-7.0.13.Final.jar:]
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368)
[jbossweb-7.0.13.Final.jar:]
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)
[jbossweb-7.0.13.Final.jar:]
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671)
[jbossweb-7.0.13.Final.jar:]
at
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930)
[jbossweb-7.0.13.Final.jar:]
at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_25]
Caused by: org.drools.repository.RulesRepositoryException:
javax.jcr.ItemExistsException: cannot add child node
'InitClinicalStatementConcepts' to
/drools:repository/drools:package_area/edu.utah.AHRQ_PSI_04_v4_3/assets:
colliding with same-named existing node
at
org.drools.repository.RulesRepository.copyAsset(RulesRepository.java:421)
[guvnor-repository-5.5.0.Final.jar:5.5.0.Final]
at
org.drools.repository.RulesRepository$Proxy$_$$_WeldClientProxy.copyAsset(RulesRepository$Proxy$_$$_WeldClientProxy.java)
[guvnor-repository-5.5.0.Final.jar:5.5.0.Final]
at
org.drools.guvnor.server.RepositoryAssetService.copyAsset(RepositoryAssetService.java:264)
[guvnor-webapp-core-5.5.0.Final.jar:5.5.0.Final]
at
org.drools.guvnor.server.RepositoryAssetService$Proxy$_$$_WeldClientProxy.copyAsset(RepositoryAssetService$Proxy$_$$_WeldClientProxy.java)
[guvnor-webapp-core-5.5.0.Final.jar:5.5.0.Final]
at
org.drools.guvnor.server.AssetServiceServlet.copyAsset(AssetServiceServlet.java:166)
[guvnor-webapp-core-5.5.0.Final.jar:5.5.0.Final]
at sun.reflect.GeneratedMethodAccessor218.invoke(Unknown Source)
[:1.6.0_25]
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[rt.jar:1.6.0_25]
at java.lang.reflect.Method.invoke(Method.java:597)
[rt.jar:1.6.0_25]
at
com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:569)
[gwt-servlet-2.4.0.jar:]
... 27 more
Caused by: javax.jcr.ItemExistsException: cannot add child node
'InitClinicalStatementConcepts' to
/drools:repository/drools:package_area/edu.utah.AHRQ_PSI_04_v4_3/assets:
colliding with same-named existing node
at
org.apache.jackrabbit.core.BatchedItemOperations.checkAddNode(BatchedItemOperations.java:746)
[jackrabbit-core-2.2.8.jar:2.2.8]
at
org.apache.jackrabbit.core.BatchedItemOperations.copy(BatchedItemOperations.java:401)
[jackrabbit-core-2.2.8.jar:2.2.8]
at
org.apache.jackrabbit.core.WorkspaceImpl.internalCopy(WorkspaceImpl.java:420)
[jackrabbit-core-2.2.8.jar:2.2.8]
at
org.apache.jackrabbit.core.WorkspaceImpl.copy(WorkspaceImpl.java:646)
[jackrabbit-core-2.2.8.jar:2.2.8]
at
org.drools.repository.RulesRepository.copyAsset(RulesRepository.java:404)
[guvnor-repository-5.5.0.Final.jar:5.5.0.Final]
... 35 more
--
View this message in context: http://drools.46999.n3.nabble.com/Guvnor-problems-tp4021809.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 10 months
Drools as a Webservice
by abhinavgupta
Hi,
I am new to the Drools , i wanted to expose rules as a webservice using
Axis2.
what i have done is that
1. I have created a drools Project (working fine on eclispe) export all
files in jar
2. Placed the jar file in C:\Program Files\Apache Software Foundation\Tomcat
7.0\webapps\axis2\WEB-INF\lib directory
3. Created a new Dynamic java project with axis2 facet.created a class with
**
package in.abhi.ws;
import java.math.BigDecimal;
import org.drools.KnowledgeBase;
import org.drools.KnowledgeBaseFactory;
import org.drools.builder.KnowledgeBuilder;
import org.drools.builder.KnowledgeBuilderError;
import org.drools.builder.KnowledgeBuilderErrors;
import org.drools.builder.KnowledgeBuilderFactory;
import org.drools.builder.ResourceType;
import org.drools.io.ResourceFactory;
import org.drools.runtime.StatefulKnowledgeSession;
import com.sample.SaleItem;
public class Test {
private static KnowledgeBase readKnowledgeBase() throws Exception {
KnowledgeBuilder kbuilder = KnowledgeBuilderFactory
.newKnowledgeBuilder();
kbuilder.add(ResourceFactory.newClassPathResource("KanasSalesTax.drl"),
ResourceType.DRL);
KnowledgeBuilderErrors errors = kbuilder.getErrors();
if (errors.size() > 0) {
for (KnowledgeBuilderError error : errors) {
System.err.println(error);
}
throw new IllegalArgumentException("Could not parse knowledge.");
}
KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
kbase.addKnowledgePackages(kbuilder.getKnowledgePackages());
return kbase;
}
public BigDecimal salesTax(String taxState, String typeItem) {
BigDecimal taxCal = null;
try {
// load up the knowledge base
KnowledgeBase kbase = readKnowledgeBase();
StatefulKnowledgeSession ksession = kbase
.newStatefulKnowledgeSession();
// Non-prescription item
// Expect $1.89 for the tax
SaleItem item1 = new SaleItem();
item1.setPurchaseState(taxState);
item1.setItemType(typeItem);
item1.setSalesPrice(new BigDecimal(29.95));
ksession.insert(item1);
ksession.fireAllRules();
taxCal = item1.getSalesTax();
System.out.println(item1.getPurchaseState().toString() + " "
+ item1.getItemType().toString() + ": "
+ item1.getSalesTax().toString());
} catch (Throwable t) {
t.printStackTrace();
}
return taxCal;
}
}
**
4. Then created a bottom up java bean webservice of it using the same above
class.
5. Wsdl is generated
i am getting the error response on eclispe console while testing by soap-ui
**********
java.lang.NullPointerException
at
org.drools.util.CompositeClassLoader.getResourceAsStream(CompositeClassLoader.java:122)
at
org.drools.commons.jci.compilers.EclipseJavaCompiler$2.findType(EclipseJavaCompiler.java:234)
at
org.drools.commons.jci.compilers.EclipseJavaCompiler$2.findType(EclipseJavaCompiler.java:215)
at
org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.createPackage(LookupEnvironment.java:748)
at
org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.buildTypeBindings(CompilationUnitScope.java:87)
at
org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.buildTypeBindings(LookupEnvironment.java:167)
at
org.eclipse.jdt.internal.compiler.Compiler.internalBeginToCompile(Compiler.java:721)
at
org.eclipse.jdt.internal.compiler.Compiler.beginToCompile(Compiler.java:381)
at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:426)
at
org.drools.commons.jci.compilers.EclipseJavaCompiler.compile(EclipseJavaCompiler.java:358)
at
org.drools.commons.jci.compilers.AbstractJavaCompiler.compile(AbstractJavaCompiler.java:49)
at
org.drools.rule.builder.dialect.java.JavaDialect.compileAll(JavaDialect.java:369)
at
org.drools.compiler.DialectCompiletimeRegistry.compileAll(DialectCompiletimeRegistry.java:53)
at org.drools.compiler.PackageRegistry.compileAll(PackageRegistry.java:71)
at org.drools.compiler.PackageBuilder.compileAll(PackageBuilder.java:869)
at org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:826)
at
org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:404)
at
org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:586)
at
org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:37)
at in.abhi.ws.Test.readKnowledgeBase(Test.java:31)
at in.abhi.ws.Test.salesTax(Test.java:55)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at
org.apache.axis2.rpc.receivers.RPCUtil.invokeServiceClass(RPCUtil.java:212)
at
org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(RPCMessageReceiver.java:117)
at
org.apache.axis2.receivers.AbstractInOutMessageReceiver.invokeBusinessLogic(AbstractInOutMessageReceiver.java:40)
at
org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:110)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:181)
at
org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:172)
at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:146)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
at
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579)
at
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:307)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
java.lang.NullPointerException
at
org.drools.util.CompositeClassLoader.getResourceAsStream(CompositeClassLoader.java:122)
at
org.drools.commons.jci.compilers.EclipseJavaCompiler$2.findType(EclipseJavaCompiler.java:234)
at
org.drools.commons.jci.compilers.EclipseJavaCompiler$2.findType(EclipseJavaCompiler.java:215)
at
org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.createPackage(LookupEnvironment.java:748)
at
org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.buildTypeBindings(CompilationUnitScope.java:87)
at
org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.buildTypeBindings(LookupEnvironment.java:167)
at
org.eclipse.jdt.internal.compiler.Compiler.internalBeginToCompile(Compiler.java:721)
at
org.eclipse.jdt.internal.compiler.Compiler.beginToCompile(Compiler.java:381)
at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:426)
at
org.drools.commons.jci.compilers.EclipseJavaCompiler.compile(EclipseJavaCompiler.java:358)
at
org.drools.commons.jci.compilers.AbstractJavaCompiler.compile(AbstractJavaCompiler.java:49)
at
org.drools.rule.builder.dialect.java.JavaDialect.compileAll(JavaDialect.java:369)
at
org.drools.compiler.DialectCompiletimeRegistry.compileAll(DialectCompiletimeRegistry.java:53)
at org.drools.compiler.PackageRegistry.compileAll(PackageRegistry.java:71)
at org.drools.compiler.PackageBuilder.compileAll(PackageBuilder.java:869)
at org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:826)
at
org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:404)
at
org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:586)
at
org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:37)
at in.abhi.ws.Test.readKnowledgeBase(Test.java:31)
at in.abhi.ws.Test.salesTax(Test.java:55)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at
org.apache.axis2.rpc.receivers.RPCUtil.invokeServiceClass(RPCUtil.java:212)
at
org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(RPCMessageReceiver.java:117)
at
org.apache.axis2.receivers.AbstractInOutMessageReceiver.invokeBusinessLogic(AbstractInOutMessageReceiver.java:40)
at
org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:110)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:181)
at
org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:172)
at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:146)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
at
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579)
at
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:307)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
****************
Please let me know how to make it work
--
View this message in context: http://drools.46999.n3.nabble.com/Drools-as-a-Webservice-tp3950198.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 10 months
ClassCastException using memberOf operator
by Marco Malziotti
Hello
I am a beginner in Drools 5.1.1 and try to use 'memberOf' operator.
Simply I want check whether a short field 'f' (belonging to Item class)
is a member of an array 'a': retrieved by a function 'makeA'.
In my .drl file I try with :
function Short[] makeA() {
return (new Short[] {1, 2, 3} );
}
rule "chek"
when
a: Short[]() from makeA()
i: Item ( f memberOf a )
then
... 'f' is member of array 'a' !
end
I have following stack trace:
java.lang.ClassCastException: Can't check if an attribute is member of
an object of class class java.lang.Short
at
org.drools.base.evaluators.SetEvaluatorsDefinition$BaseMemberOfEvaluator.evaluateCachedRight(SetEvaluatorsDefinition.java:532)
at
org.drools.rule.VariableRestriction.isAllowedCachedRight(VariableRestriction.java:117)
at
org.drools.rule.VariableConstraint.isAllowedCachedRight(VariableConstraint.java:121)
at
org.drools.common.SingleBetaConstraints.isAllowedCachedRight(SingleBetaConstraints.java:151)
at org.drools.reteoo.JoinNode.assertObject(JoinNode.java:125)
at
org.drools.reteoo.SingleObjectSinkAdapter.propagateAssertObject(SingleObjectSinkAdapter.java:59)
at
org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:190)
at
org.drools.reteoo.EntryPointNode.assertObject(EntryPointNode.java:145)
at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:1174)
at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:1123)
at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:917)
at
org.drools.impl.StatefulKnowledgeSessionImpl.insert(StatefulKnowledgeSessionImpl.java:251)
In :
http://lists.jboss.org/pipermail/rules-users/2008-October/006746.html
and
http://lists.jboss.org/pipermail/rules-users/2007-September/003010.html
I haven't found the solution to my problem.
I don't know if it is already open a related issue.
Thanks for your attention.
Regards.
Marco Malziotti
Tecnologie nelle Reti e nei Sistemi T.R.S. S.p.A.
Integration Test Engineer
Tel. + 39 06.87281.407
Fax. + 39 06.87281.550
E-mail: marco.malziotti(a)trs.it
Tecnologie nelle Reti e nei Sistemi T.R.S. SpA
Via della Bufalotta, 378 - 00139 Roma
Tel +39.06.87.28.1.1 - Fax +39.06.87.28.1.550
-------------------------------------------------------
Ai sensi del D.Lgs. 196/2003 si precisa che le informazioni contenute in questo messaggio
sono riservate ed a uso esclusivo del destinatario. Qualora il messaggio in parola Le
fosse pervenuto per errore, la preghiamo di eliminarlo senza copiarlo e di non inoltrarlo
a terzi, dandocene gentilmente comunicazione. Grazie.
This message, for the law 196/2003, may contain confidential and/or privileged information.
If you are not the addressee or authorized to receive this for the addressee, you must not
use, copy, disclose or take any action based on this message or any information herein.
If you have received this message in error, please advise the sender immediately by reply
e-mail and delete this message. Thank you for your cooperation.
-------------------------------------------------------
This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.
11 years, 10 months