Java5 Enum - Reference on usage in constraints.
by Krishna Satya
Greetings.
I am trying to find the correct approach to defining and using Java5 Enum's
in Drools constraints.
*Psudo code:*
Class RuleRequest {
... other attributes ...
// RequestType is an enum type.
RequestType type ;
public RequestType getRequestType() {
return type;
}
}
public enum RequestType {
INTERNAL("internal"), EXTERNAL("external");
}
*Drools Rule:*
# 1st Constraint - I could have listed the type in the constraint for
RuleRequest but say I want that to be in a separate constraint
# 2nd Constraint - on the nested RequestType enum
*req: RuleRequest(..some match not based on the RequestType but other
attributes of RuleRequest...)
type: RequestType( ??? == RequestType.INTERNAL ) from req.requestType
*
What should be plugged in ??? to be able to match the requestType.
Interestingly, if I say
*type: RequestType( this == RequestType.INTERNAL ) from req.requestType *when
the ruleRequest has an RequestType of INTERNAL, the matching works. But I
do not see any examples/reference in the Drools documentation on the usage
of "this" in constraints. I saw a posting from Edson T. using this which is
why I tried it in the first place.
*Question
*- What is the expectation for the Enum. Should it have methods (getters)
that return the Enum type itself or methods that return the strigified value
of the Enum?
- What is syntax and usage practices for the usage of the "this" keyword
- What really happens when the Drools engine does the == comparison on
Enum's. Does it convert to the string value of the enum and then compare
that or is there something else in play.
I hope I have asked valid questions as I see many questions relating to Enum
but maybe a definitive/suggested approach and explanation from the drools
dream team may serve as a good reference on this subject.
Thanks.
- Krishna
16 years, 10 months
Invalid MagicNumber when validating package.
by Darko Ivancan
Product: JBoss DRools
Version: 4.0.3
JDK: 1.5.0_12
OS: Windows XP SP2
AS: JBoss 4.2.2GA
Hi,
Sorry haven't been on the list for a while, busy with a project, which keeps me now really busy.
We have here an exception which does not seem to make any sense and we're a bit lost in the why and where this happens.
Any help will be appreciated.
Thanks,
Darko IVANCAN
----------------------------------
Steps to reproduce:
1. Log in to jBRMS
2. Created Package as “com.xyz.abcservice.rules”
3. Imported two jars (“rulescore.jar”,” sampleDomain.jar”) into Model.
4. Created New Rule with the following content
package com.xyz.abcservice.rules;
import domain.Accommodation1;
import java.util.List;
import com.xyz.common.rules.api.GenericRuleViolation;
global java.util.List errList;
rule "Conflict Rule 1"
when
accommodation1:Accommodation1(name == "Car")
accommodation2:Accommodation1(name == "Caravan")
then
errList.add(new
GenericRuleViolation(accommodation1,"Invalid cabin combination."));
end
4. Validate it…
------------Output------------------
An error occurred executing the action.
Details
<!-- AppServer Exceptions moved below this exception for readability--!>
Caused by: java.lang.ClassFormatError: Incompatible magic value 1885430635 in class file domain/Accommodation1
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at org.drools.rule.MapBackedClassLoader.fastFindClass(MapBackedClassLoader.java:60)
at org.drools.rule.MapBackedClassLoader.loadClass(MapBackedClassLoader.java:79)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at org.drools.rule.PackageCompilationData$PackageClassLoader.loadClass(PackageCompilationData.java:358)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at org.drools.base.ClassTypeResolver.resolveType(ClassTypeResolver.java:146)
at org.drools.rule.builder.dialect.mvel.MVELDialect.addImport(MVELDialect.java:254)
at org.drools.compiler.DialectRegistry.addImport(DialectRegistry.java:98)
at org.drools.compiler.PackageBuilder.mergePackage(PackageBuilder.java:377)
at org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:264)
at org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:167)
at org.drools.brms.server.contenthandler.DecisionTableXLSHandler.compile(DecisionTableXLSHandler.java:63)
at org.drools.brms.server.builder.ContentPackageAssembler.buildAsset(ContentPackageAssembler.java:139)
at org.drools.brms.server.builder.ContentPackageAssembler.<init>(ContentPackageAssembler.java:103)
at org.drools.brms.server.ServiceImplementation.buildAsset(ServiceImplementation.java:867)
... 51 more
<!-- AppServer Exceptions: --!>
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:31)
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:46)
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:42)
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
at org.jboss.seam.security.SecurityInterceptor.aroundInvoke(SecurityInterceptor.java:40)
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:106)
at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:155)
at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:91)
at org.drools.brms.server.ServiceImplementation_$$_javassist_3.buildAsset(ServiceImplementation_$$_javassist_3.java)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.seam.remoting.gwt.GWTToSeamAdapter.callWebRemoteMethod(GWTToSeamAdapter.java:74)
at org.jboss.seam.remoting.gwt.GWTRemoteServiceServlet.processCall(GWTRemoteServiceServlet.java:290)
at org.jboss.seam.remoting.gwt.GWTRemoteServiceServlet.doPost(GWTRemoteServiceServlet.java:172)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.seam.web.ContextFilter$1.process(ContextFilter.java:42)
at org.jboss.seam.servlet.ContextualHttpServletRequest.run(ContextualHttpServletRequest.java:46)
at org.jboss.seam.web.ContextFilter.doFilter(ContextFilter.java:37)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
at java.lang.Thread.run(Thread.java:595)
--
GMX FreeMail: 1 GB Postfach, 5 E-Mail-Adressen, 10 Free SMS.
Alle Infos und kostenlose Anmeldung: http://www.gmx.net/de/go/freemail
16 years, 11 months
Stopping Rule-Execution after first match
by Mescher,Mark
Hello,
we have realized a project using drools with Decision Tables. We are working in sequential mode.
Now we have the request for a mechanism to stop the rule execution after the first rule matches (so no more rules are executed). Is there a native way to do this with decision tables?
Thx
Mark
16 years, 11 months
OutOfMemory with BRMS 4.0.3
by sophie.ramel@tudor.lu
Hello,
I am using Drools BRMS 4.0.3 with tomcat 5.5.25, and I get OutOfMemory
exceptions in tomcat regularly.
I recently changed the java option of tomcat to add "-Xmx512m", but it
only resulted in taking a little more time before crashing (3 days,
instead of 1 before).
The server has nearly no access - it's a development server which is not a
lot used at the moment - and there are only a few rules, for tests, so I
really don't understand this error. I'm using java 1.5.0 on a linux
server.
The BRMS is accessed by web, to create and deploy the rules, and queried
from another tool (on the same machine but in another server: in JBoss),
to insert data in a workingMemory and execute the rules from the deployed
package URL. I call the dispose() method on the StatefulSession at the end
of the query (but this shouldn't be linked to this error, since this is in
JBoss and the OutOfMemory occurs in tomcat...).
Any idea?
Thanks,
Sophie
16 years, 11 months
Writing rules against derived facts.
by Faron Dutton
Hi,
I am having trouble understanding why the following does not work in 4.0.4.
rule "A"
when
foo : Foo( bar == true )
then
insertLogical( new DerivedFact( "relationName", foo, Boolean.TRUE ) );
end
rule "B"
when
tuple : DerivedFact( name == "relationName" )
then
// < do something with tuple >
end
Rule A fires and adds a new DerivedFact to the working memory as a
shadow fact. Rule B then fires but name is always null in the shadow
object even though name is set in the delegate.
My main goal is to reason about an existing model that I cannot change
and without adding a lot of new elements as some sort of shadow model.
I wanted to add additional properties to the model so I tried using
Java dynamic proxies to add a new interface, which did not work as I
got ClassCastExceptions during consequence execution. I then tried
using fact templates but I get compilation errors when the compiler
cannot find the DerivedFact class. I finally just added DerivedFact as
a normal class, which is where I am now. I would really like to get
back to the original goal of adding properties to the model so that
the rules are easier to understand. For example, the above code would
then be:
rule "A"
when
foo : Foo( bar == true )
then
foo.relationName = true; // or foo.setRelationName(true);
end
rule "B"
when
foo : Foo( relationName == true )
then
// < do something with foo >
end
Any insight would be greatly appreciated.
Faron.
16 years, 11 months
Drools BRMS for Different UI Framework
by Carlsen, Len
Hello,
I have been looking at the Drools brms package (org.drools.brms) and
have noticed that it is built specifically for GWT. Are there any plans
to move GWT to a layer further up so the brms can be used by different
UI toolkits/frameworks instead of using the drools repository
(org.drools.repository)?
Also, is there a way to add my own meta data properties (maybe as a
java.util.Map?) to the org.drools.brms.client.rpc.MetaData class?
Thanks,
Len
16 years, 11 months
VORTE 2007 Follow-up: Journal special issue
by nicolae oana
Call for Papers
Journal: Information Systems
Special Issue on "Vocabularies, Ontologies and Rules for Enterprise and Business Process Modeling and Management"
Vocabularies, ontologies, and business rules are key components of a model-driven approach to enterprise computing in a networked economy. Enterprise vocabularies, ontologies, and business rules do not exist in isolation but serve to support business processes. While many have recognized the importance of vocabularies, ontologies, and business rules in business process modeling and management, there are many open research challenges to be addressed. These challenges can be approached from different perspectives. Fundamental research explores ontological foundations and languages and methods for enterprise and business process modeling. It also covers ontological evaluation of enterprise systems and their interoperability, and ontological analysis of business process modeling. Applied research looks into enhancing business rule engines and business process management systems by ontologies. Business process modeling research aims to define how process modeling
and execution languages, such as Business Process Modeling Notation and Business Process Execution Language, relate to business ontologies and rules. Enterprise integration and collaboration research addresses ontology-based service description technologies for inter-enterprise collaboration. This special issue solicits papers focussed on the described research areas. The topics to be covered by submissions include but are not limited to the following:
o Conceptual modeling
o Ontological foundations for enterprise and business process modeling
o Languages and methods for business vocabularies, terminologies, and taxonomies
o Modeling of enterprise information integration and interoperability o Languages for conceptual modeling (for example, OWL and UML) o Agent-oriented conceptual modeling
o Business rule and business process modeling
o Analysis of and experiences with OMG's Semantics of Business Vocabularies and Rules (SBVR)
o Rule modeling and rule markup
o Rule-based approaches to Web service policies and choreographies
o Agent-based business rule and process management
o Integrating business rules with business process modeling and execution languages (for example, BPMN and BPML)
o Ontologies for enterprise systems
o Ontological approaches to content and knowledge management
o Ontologies for e-business registries/repositories
o Web service ontologies
o Ontological evaluation of enterprise systems
o Ontology-based enterprise architectures
o Ontology-based software engineering for enterprise solutions
o Model-driven engineering approaches in enterprise systems
o Modeling and architecture frameworks
o Domain engineering
o Domain-specific business information and system engineering
o Model transformations in enterprise and business process modeling
Important Dates
Submission Deadline May 1st, 2008
Reviews Completed: September 1st, 2008
Major Revisions Due: October 15th, 2008
Re-reviews Completed: December 1st, 2008
Final recommendations: January 1st, 2009
Final Manuscripts Due: February 1st, 2009
Publication Date: TBD (2009)
Guest editors
Dragan Gasevic, Athabasca University, Canada
Giancarlo Guizzardi, Federal University of EspÃrito Santo (UFES), Brazil
Kuldar Taveter, University of Melbourne, Australia
Gerd Wagner, Brandenburg University of Technology at Cottbus, Germany
Submission Guidelines
All manuscripts should be compliant with the submission guidelines and policies of the Information Systems journal (http://www.elsevier.com/locate/infosys). All manuscripts will be subject to the high standards of peer review. All the papers must be submitted via the online submission system at http://ees.elsevier.com/is (by selecting "SI Business Proc. Modelling" during the submission process).
---------------------------------
Looking for last minute shopping deals? Find them fast with Yahoo! Search.
16 years, 11 months
2nd East European Workshop on Rule-Based Applications - RuleApps'2008
by nicolae oana
[We apologize in advance if you receive multiple copies of this CFP]
2nd East European Workshop on Rule-Based Applications - RuleApps'2008
---------------------------------------------------------------------
July 21-22, 2008, Patras, Greece
http://oxygen.informatik.tu-cottbus.de/RuleApp2008/
Workshop within the ECAI 2008 conference
http://www.ece.upatras.gr/ecai2008/
Paper submission:
http://www.easychair.org/conferences/?conf=ruleapp2008
Topics
---------------
Rules are becoming increasingly important in business modeling and requirements engineering, and as a high level programming paradigm especially in the engineering of e-business applications and of the Semantic Web applications. Rules are used in applications to model and manage specific parts of the application business logic. They are best used in applications with a dynamic business logic i.e. applications where changes in the business logic are frequently and they need to be immediately reflected in the application behavior. This workshop seeks contributions that address theoretic foundations, practical techniques, empirical studies, experience, and lessons learned related, but not limited, to the following topics: - Artificial Intelligence Rules and Rule Systems
- Web Rules and Semantic Web Rules
- Best Practices in Business Rules
- Rules Modeling (including Production Rules and ECA Rules)
- Combining rules and ontologies
- Languages for rule interchange
- Rule base Visualization, Verbalization, Validation, Verification and Exception Handling.
- Rule Engines Architectures
- Rules in Web 2.0 Applications
- Rule-based modeling of mechanisms, policies, strategies and contracts.
- Rules and Web Services Integration
- Implemented tools and systems
Important dates
---------------
Papers submission: April 10, 2008
Notification of acceptance: May 10, 2008
Final submission: May 26, 2008
Workshop date: July 21-22, 2008
Submission Requirements
-----------------------
RuleApps2008 looks for three categories of submissions: regular papers, poster submissions and applications.
- The submission web site is http://www.easychair.org/conferences/?conf=ruleapp2008.
- Authors have to use the ECAI'2008 style to prepare their submissions. A description of the style is available
- Regular papers submissions must not exceed 5 pages. The same style has to be used for poster submissions which cannot exceed 2 pages.
- Applications have to be described in a 2 pages short paper (part of the proceedings too). They must be available for demo either in a download or online form during the review process.
Publication
-----------
- Each workshop participant will receive a hardcopy of the proceedings of the workshop (s)he participates, as well as a CD with the proceedings of all ECAI'08 workshops. The workshops CD will be produced by ECAI2008 and will be separate from the CD with the proceedings of the main conference.
- Workshop authors will have to sign a permission allowing the local organizers to include their paper in the workshop's proceedings.
- Additionally the accepted papers will be published as
CEUR-WS( http://ftp.informatik.rwth-aachen.de/Publications/CEUR-WS/ )
The copyright for the individual items (subsuming any type of computer-represented files containing articles, software demos, videos, etc.) within a proceedings volume is owned by default by their respective authors. Copying of items, in particular papers, and proceedings volumes is permitted only for private and academic purposes. Copying or use for commercial purposes is forbidden unless an explicit permission is acquired from the copyright owners (i.e. authors).
- Extended versions of the best technical papers of the workshop will be invited to
Handbook of Research on Emerging Rule-Based Languages and Technologies ( http://oxygen.informatik.tu-cottbus.de/handbook/ )
Workshop Co-Chairs
------------------
Anastasia Analyti, Foundation for Research and Technology - Hellas, Greece
Adrian Giurca, Brandenburg University of Technology, Germany
Gerd Wagner, Brandenburg University of Technology, Germany
Program Committee
-----------------
Anastasia Analyti, FORTH, Greece
Grigoris Antoniou, FORTH, Greece
Costin Badica, University of Craiova, Romania
Nick Bassiliades, Aristotle University of Thessaloniki, Greece
Phillipe Bonnard, ILOG, France
Carlos Viegas Damasio, Universidade de Nova Lisboa, Portugal
Vladan Devedzic, University of Belgrade, Serbia
Jens Dietrich, Massey University, New Zealand
Dragan Gasevic, Athabasca University, Canada
Adrian Giurca, Brandenburg University of Technology, Germany
Antoni Ligeza, AGH University of Science and Technology, Poland
Grzegorz J. Nalepa, AGH University of Science and Technology, Poland
Viorel Negru, West University of Timisoara, Romania
Paula Lavinia Patranjan, Ludwig-Maximilians University, Muenchen, Germany
Mark Proctor, JBoss Rules, Redhat
Dave Reynolds, Hewlett-Packard Semantic Web Research, England
Silvie Spreeuwenberg, LibRT, Amsterdam, Netherlands
Kuldar Taveter, University of Melbourne, Australia
Laurentiu Alexandru Vasiliu, DERI Galway, Ireland
Sanja Vranes, Mihailo Pupin Institute, Belgrade, Serbia
Gerd Wagner, Brandenburg University of Technology, Germany
---------------------------------
Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.
16 years, 11 months
Count matching facts
by cfili
I am having a hard time finding an example of what I am trying to do, so
maybe someone here could help me. What I am trying to do is determine how
many facts fall into the same category.
My facts are 'processes' and one of their attributes is a 'name'. My goal
is to determine how many processes with the same name are running. The
problem is I do not know ahead of time the process names available, I want
to determine that set at runtime. Also, once I determine the count for a
given name, I do not want to run it again for the other processes that fall
in that name category.
I think "from collect" is probably what I want to use here, but I am not
sure how to grab the names in my Pattern from the fact I am currently
iterating on.
Thanks.
--
View this message in context: http://www.nabble.com/Count-matching-facts-tp15160392p15160392.html
Sent from the drools - user mailing list archive at Nabble.com.
16 years, 11 months