How to integrate drools in jersey rest web service(如何在 jersey rest web 服务中集成 drools)
问题描述
我开发了一个 jersey est 网络服务 API.现在我想在这个休息服务中集成 DROOLS 规则.在其余服务中,在确定所有必需条件后,我想将其发送到 drools 规则引擎并触发规则.这个怎么做.请帮我一步一步指导.
I have developed a jersey est web service API. Now I would like to integrate DROOLS rules in this rest service. IN the rest service, after ascertaining all required conditions, i would like to send it to the drools rule engine and the fire the rule. How to do this. Please help me step by step guidance.
推荐答案
这不是 Jersey,但这里是一个 REST Web 服务的示例,它使用 Drools 评估请求:https://github.com/gratiartis/sctrcd-payment-validation-web
It's not Jersey, but here is an example of a REST web service, which evaluates requests using Drools: https://github.com/gratiartis/sctrcd-payment-validation-web
实际上,您创建了一个封装知识库的单例 bean.当验证请求到达时,您可以创建知识会话、插入事实并执行规则.
Essentially you create a singleton bean, which wraps the knowledge base. When validation requests arrive, you can create knowledge sessions, insert your facts and execute the rules.
它是使用 Spring 构建的,因此如果不使用 Spring,您需要进行的主要更改是确保知识库只创建一次.
It's built with Spring, so the main change you would need to make if not using Spring would be to ensure that the knowledge base is only created once.
这篇关于如何在 jersey rest web 服务中集成 drools的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何在 jersey rest web 服务中集成 drools
基础教程推荐
- 使用堆栈算法进行括号/括号匹配 2022-01-01
- RabbitMQ:消息保持“未确认"; 2022-01-01
- 无法复制:“比较方法违反了它的一般约定!" 2022-01-01
- Spring AOP错误无法懒惰地为此建议构建thisJoinPoin 2022-09-13
- 如何对 Java Hashmap 中的值求和 2022-01-01
- 修改 void 函数的输入参数,然后读取 2022-01-01
- Struts2 URL 无法访问 2022-01-01
- REST Web 服务返回 415 - 不支持的媒体类型 2022-01-01
- 问题http://apache.org/xml/features/xinclude测试日志4j 2 2022-01-01
- 存储 20 位数字的数据类型 2022-01-01
