如何将Drools集成到jersey rest Web服务中 [英] How to integrate drools in jersey rest web service

查看:103
本文介绍了如何将Drools集成到jersey rest Web服务中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经开发了jersey est网络服务API.现在,我想在此REST服务中集成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

本质上,您创建了一个singleton bean,该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.

这篇关于如何将Drools集成到jersey rest Web服务中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆