Rule Compilation error 问题

db66239192 db66239192 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
请问下我这个问题该怎么解决?。实在看不出来时哪问题了。。问题描述:org.drools.rule.InvalidRulePackage: Rule Compilation error : [Rule name=lady, agendaGroup=MAIN, salience=0, no-loop=false]
dataRules/java/Rule_lady_0.java (7:332) : String literal is not properly closed by a double-quote
dataRules.java.RulesEngine.<init>(RulesEngine.java:42)
dataRules.java.RulesEngineBo.getRulesEngineBo(RulesEngineBo.java:36)
com.gomai.action.DbanalyseresultAction.addDbanalyseresult(DbanalyseresultAction.java:80)
对应的代码:1。#created on: 2009-12-18
package dataRules.java

import dataRules.java.RulesResult;

#判断性别的正确性
rule "lady"

when
s : RulesResult( sex > 1 || sex < 0, sex : sex )
then
System.out.println( "这是一个错误的性别表示,超出表示范围!" );
//System.out.println( "Name: "+s.getName() );
System.out.println( "Sex: "+s.getSex() );
s.setExplain("超出了取值范围");
s.setResult(0);
s.setVerifyTpye(1);
s.setSex( 1 );

end
2.private RulesEngine rulesEngine;

@SuppressWarnings("unchecked")
public RulesResult getRulesEngineBo(Map map) {

final RulesResult rulesResult = new RulesResult();

// Student student = new Student();

String rulesFile = (String) map.get("rulesFile");

System.out.println("rulesFile = " + rulesFile);
// map.get(sex);
// int sex = Integer.parseInt(map.get("sex").toString());
int sex = (Integer) map.get("sex");
System.out.println("sex....=="+sex);
rulesResult.setSex(sex);

System.out.println("explain = " + rulesResult.getExplain());
System.out.println("sex = " + rulesResult.getSex());

// RulesEngine rulesEngine = new RulesEngine();
//上边的System.out.println都能打印出来值,下面的就运行部下去了!!!!!!!!!!!!!!!!!!
rulesEngine = new RulesEngine(rulesFile);
System.out.println("rulesEngine2222==="+rulesEngine);
rulesEngine.executeRules(new WorkingEnvironmentCallback() {
public void initEnvironment(WorkingMemory workingMemory) {
workingMemory.insert(rulesResult);
};
});
3.public RulesEngine(String rulesFile) throws RulesEngineException{
//super();
try {
System.out.println("rulesFile111111111111 = " + rulesFile);
// Read in the rules source file
Reader source = new InputStreamReader(RulesEngine.class.
getResourceAsStream("/dataRules/rules/" + rulesFile));

System.out.println("rulesFile333333333333 = " + rulesFile);
System.out.println("rulesFile333333333333 = " + source);

PackageBuilder builder = new PackageBuilder();
System.out.println("rulesFile44444444444444444 = " + rulesFile);

// This will parse and compile in one step
builder.addPackageFromDrl(source);

// Get the compiled package
Package pkg = builder.getPackage();
System.out.println("pkg==="+pkg);
System.out.println("rulesFile = " + rulesFile);
// Add the package to a rulebase (deploy the rule package).
rules = RuleBaseFactory.newRuleBase();
System.out.println("55555555555555555555555555"+pkg);
rules.addPackage(pkg);//上边的代码也都能打印出来,但在本行就程序运行不下去;不知道为什么?
} catch (Exception e) {
throw new RulesEngineException(
"Could not load/compile rules file: " + rulesFile, e);
}
求教高手,谢谢!
...全文

相关推荐

Fuzzy Sets Engineering

Foreword Dedication Chapter 1—Fuzzy set-based modelling and simulation environment 1.1 Introduction: a rationale 1.2 System modelling with fuzzy sets 1.2.1 The paradigm 1.2.2 The general architecture of fuzzy models and the methodology of their development 1.3 References Chapter 2—Development of input interfaces 2.1 The frame of cognition 2.1.1 Definition 2.1.2 Properties 2.2 Uncertainty representation in the frame of cognition 2.2.1 Possibility and necessity measures 2.2.2 Taxonomy of uncertainty: conflict and ignorance 2.2.3 Uncertainty representation — activation planes 2.3 Reconstruction criterion 2.4 The criterion of entropy equalization 2.5 References Chapter 3—Fuzzy neural networks: models and learning 3.1 From neural networks and fuzzy sets to fuzzy neurocomputations 3.2 Logic-based neurons 3.2.1 Aggregative OR and AND logic neurons 3.2.2 OR/AND neurons 3.2.3 Logic neurons and an OWA aggregation operator 3.2.4 Computational enhancements of fuzzy neurons 3.2.5 Logic neurons with feedback 3.2.6 Referential logic-based neurons 3.2.7 Fuzzy threshold neuron 3.3 Classes of fuzzy neural networks 3.3.1 Approximation of logical relationships — development of the logic processor 3.3.2 Referential processor 3.4 Learning 3.4.1 Learning a single neuron 3.4.2 General policies for the parametric learning — reductions and expansions 3.5 Genetic Algorithms in structural learning of fuzzy neural networks 3.5.1 Prerequisites — Genetic Algorithms as a tool for global optimization 3.5.2 Hybridization: Gradient-based and genetic-oriented schemes in learning fuzzy neural networks 3.5.3 The stratified GA learning in fuzzy neural networks 3.6 Selected aspects of knowledge representation in fuzzy neural networks 3.6.1 Representing and processing uncertainty 3.6.2 Induced Boolean and core neural networks 3.7 Conclusions 3.8 References Chapter 4—Fuzzy neurocomputations 4.1 Decomposition problem 4.2 Implementation of the Tchebyschev and Hausdorff distances 4.3 Optimal vector quantization 4.4 Neural models of fuzzy decision-making 4.5 Rule induction 4.6 Fuzzy Computational Memories (FCM) 4.6.1 The architecture and its functional modules 4.6.2 Learning 4.7 Implicitly-supervised fuzzy pattern recognition 4.7.1 Problem formulation 4.7.2 The General Architecture 4.7.3 The Design of the Classifier 4.8 Neural network realization of a pseudomedian filter 4.9 Ranking fuzzy sets defined in R 4.10 Conclusions 4.11 References Chapter 5—Development of output interfaces 5.1 Linguistic to numerical mapping 5.1.1 Reconstruction criterion 5.1.2 Triangular fuzzy sets in 5.2 Transformation of nonnumerical inputs 5.3 Fuzzy set reconstruction 5.4 Linguistic interpretation 5.5 Optimization of fuzzy models 5.5.1 Validation of fuzzy models 5.5.2 Hierarchy of memories in fuzzy models and learning policies 5.6 Concluding comments 5.7 References Chapter 6—Fuzzy controller 6.1 The basic architecture 6.2 Fuzzy Hebbian learning 6.3 Compilation and interpretation of fuzzy controllers 6.4 Input and output interfaces of the fuzzy controller 6.4.1 Realization of the output interface 6.4.2 Robustness of the fuzzy controller 6.4.3 Nonnumerical input information 6.5 Validation of the fuzzy controller 6.5.1 Static validation 6.5.1.1 Completeness and structural fault-tolerance 6.5.1.2 Conflict 6.5.2 Dynamic modifications 6.5.2.1 Modifications of the input interface of the controller 6.5.2.2 Rule modification 6.6 Extensions of the fuzzy controller 6.6.1 Fuzzy relational equations as a development framework of fuzzy controllers 6.6.2 Fuzzy logic controller 6.7 Hybrid control structures 6.7.1 Switching between fuzzy controller and PID controller 6.7.2 Supervisory control 6.8 Concluding comments 6.9 References Chapter 7—Software development tools in designing fuzzy systems 7.1 The general development framework of fuzzy inference schemes 7.2 Classes of software resources 7.3 Hardware versus software implementation 7.3.1 High-speed fuzzy controllers: a genuine need or (in)expensive extravagance? 7.4 Selected software development tools 7.4.1 MANIFOLD EDITOR and MANIFOLD GRAPHICS EDITOR 7.4.2 FUZZY LOGIC DESIGNER ver. 1.0 7.4.3 FuzzyTECH 3.0 Explorer Edition 7.4.4 Linguistic Fuzzy Logic Controller for Education LFLC-edu ver. 1.0 7.4.5 Fuzzy Logic Development Kit (FULDEK) 7.4.6 MATRIXx/SystemBuild 7.4.7 A Fuzzy Logic Knowledge base generator for the MC68HC11 and MCH68HC05 Inference Engines 7.4.8 Fuzz-C, a preprocessor for fuzzy logic, ver 1.00 7.4.9 FuziCalc ver. 1.00 for Microsoft Windows 7.5 Designing fuzzy controllers with the use of simulation packages 7.6 Conclusions Chapter 8—Fuzzy Control 8.1 Defining notions of fuzzy control 8.1.1 Notions of a single step and multistep constraint-free control 8.2 Stability 8.3 Controllability with constraint requirements 8.4 Fuzzy controller as a knowledge-based control paradigm 8.4.1 Trial-and-error design policies 8.4.2 The architecture of the fuzzy controller 8.5 Control in fuzzy models 8.5.1 Problem formulation 8.5.2 The architecture 8.5.3 Defining objectives of fuzzy control 8.6 Control determination 8.6.1 On-line computations 8.6.2 Off-line control 8.7 Conclusions 8.8 References Chapter 9—Fuzzy flip-flops in information processing 9.1 From JK flip-flops to fuzzy flip-flops 9.1.1 Two-valued JK flip-flop 9.1.2 Design 9.1.3 Generalized fuzzy flip-flop 9.1.4 Fuzzy flip-flop 9.2 Fuzzy flip-flop and its neural network realization 9.3 System design through learning 9.4 Boolean and core structures of fuzzy flip-flops 9.5 Information processing with fuzzy flip-flops 9.5.1 Distributed modelling and its flip-flop realization 9.5.2 Realization of fuzzy algorithmic state machines 9.5.3 Memory-enhanced fuzzy controller 9.5.4 Dynamical pattern classifier 9.6 Conclusions 9.7 References Chapter 10—Fuzzy petri nets 10.1 Introduction 10.2 Petri nets and their fuzzy set-based extensions 10.3 Fuzzy Petri nets 10.3.1 Models of transitions and places 10.3.2 Boolean analysis of the net 10.4 The neural network model of the fuzzy Petri net and its enhancements 10.4.1 Inhibition mechanism in fuzzy Petri nets and its representation 10.4.2 Modelling input and output places — more detailed neural models 10.5 Examples 10.6 Representing rules in fuzzy Petri nets 10.7 Fuzzy controller realized as a fuzzy Petri net 10.8 Learning 10.9 Inverse problem in fuzzy Petri net 10.10 Conclusion 10.11 References Appendix A Appendix B Appendix C Index

giliwala

高校技术转移办公室人员如何利用平台提升技术成果的市场转化率?.docx

科易网基于AI模型+行业大数据,在技术转移、成果转化、技术经纪、知识产权、产业创新、科技招商等垂直领域的多样化应用场景,推出科技创新领域的AI+工具与数智化解决方案,推动科技创新与产业创新智能化发展。

BIZKEEN

人工智能基于Spring AI的流程编排技术:Java开发者实现RAG、工具调用与多Agent协作的系统化方法论

「AI大模型」Spring-AI-流程编排主流做法-保姆级教程 内容概要:本文是一份关于 Spring AI 1.0 GA 版本中流程编排的系统性教程,重点讲解如何利用 Spring AI 的核心机制实现 AI 应用中的标准化、可复用的流程控制。文章从环境搭建入手,深入介绍 ChatClient 作为编排入口的使用方式,并详细阐述 Advisors 拦截链在实现安全过滤、记忆管理、检索增强生成(RAG)、工具调用等功能中的核心作用。进一步覆盖结构化输出、跨进程通信协议 MCP 及基于状态图的复杂工作流引擎 Spring AI Alibaba Graph 等高级编排能力,最后通过一个集成 RAG、工具调用与对话记忆的生产级 Agent 实战案例,展示了全流程自动化的能力。整套体系借鉴了 Servlet Filter 和 LangGraph 思想,强调“约定优于配置”的工程化设计。; 适合人群:具备 Spring Boot 基础,希望系统掌握 AI 应用流程编排的 Java 开发者,尤其是从事企业级 AI 功能开发、Agent 构建及相关平台建设的技术人员。; 使用场景及目标:① 构建具备记忆、RAG、工具调用等复合能力的智能助手;② 实现可插拔、高复用、易测试的 AI 流程组件;③ 设计支持循环、分支和并行的复杂 Agent 工作流;④ 推动跨服务、跨语言的 AI 工具标准化集成(通过 MCP)。; 阅读建议:此资源以 Spring 官方及 Alibaba 生态权威资料为基础,内容紧跟 1.0 GA 最新演进,建议结合官方文档同步实践代码,特别注意版本迁移要点(如 artifactId 更名、Advisor 替换等),并在实际项目中遵循最佳实践规避常见陷阱。

资源创作小能手

产业园区如何精准识别并引进符合本地产业特色的优质科技成果转化项目?.docx

科易网基于AI模型+行业大数据,在技术转移、成果转化、技术经纪、知识产权、产业创新、科技招商等垂直领域的多样化应用场景,推出科技创新领域的AI+工具与数智化解决方案,推动科技创新与产业创新智能化发展。

BIZKEEN

阿里云云原生架构白皮书文档

阿里云云原生架构白皮书,由阿里云内部技术团队合著,对整个阿里云云原生产品和架构理念进行了全面深入介绍

元界MetaLite
评论 6
收藏 已收藏
分享
返回顶部
db66239192
Java EE 67,535 成员 225,843 内容