简体   繁体   English

如何从 Business Central Drools 获取规则数据

[英]How to get Rule Data from Business Central Drools

I am using business central and Drools 7.49.我正在使用 business central 和 Drools 7.49。 I have configured my rules through Business Central and I am able to fire the rules and get the result successfully.我已经通过 Business Central 配置了我的规则,我能够触发规则并成功获得结果。 Now what I need is an API preferably returning a JSON containing all the rules description as I want to show the rules set in Business Central my space, project and package.现在我需要的是一个 API,最好返回一个 JSON,其中包含所有规则描述,因为我想显示 Business Central 我的空间、项目和 package 中设置的规则。

Is there a way I could get the rules details that I have configured.有什么方法可以获取我配置的规则详细信息。

Do let me know if any additional information is required.如果需要任何其他信息,请告诉我。 Here is my project details.这是我的项目详细信息。 Space: iot-platform-space Project: iot-temperature-service Container: IOTTreeContainer空间:iot-platform-space 项目:iot-temperature-service 容器:IOTTreeContainer

Below is the code I am having to connect to Business Central下面是我必须连接到 Business Central 的代码

URL = http://x.x.x.x:8080/kie-server/services/rest/server

KieServicesConfiguration conf = KieServicesFactory.newRestConfiguration(URL, USER, PASSWORD);

KieServicesClient kieServicesClient = KieServicesFactory.newKieServicesClient(conf);

I want an object of KieContainer from this to get all the rules.我想要一个 object 的 KieContainer 从这里获取所有规则。

Here is the code to get the rules.这是获取规则的代码。

KieBase kieBase = kieContainer.getKieBase();
        Collection<KiePackage> kiePackages = kieBase.getKiePackages();
List<Rule> ruleList = kiePackages.stream().flatMap(kiePackage -> kiePackage.getRules().stream()).collect(Collectors.toList());

How to get KieContainer object from kieServiceClient or any other way to get it.如何从 kieServiceClient 或任何其他方式获取 KieContainer object。

The Business Central REST API is what you are looking for. 商务中心 REST API就是您要找的。

With this API you can get your projects and the git URL of each of them.使用此 API,您可以获得您的项目以及每个项目的 git URL。 If you want, you can then use a git client to access the project assets.如果需要,您可以使用 git 客户端访问项目资产。

Another possibility is to use the KIE Server REST APIs , but I never used them before.另一种可能性是使用KIE Server REST APIs ,但我以前从未使用过它们。 The documentation mentions a Swagger endpoint that you can use to see what information is available through these endpoints.该文档提到了一个 Swagger 端点,您可以使用它来查看通过这些端点提供的信息。

facing the same issue.面临同样的问题。 " How to get KieContainer object from kieServiceClient or any other way to get it." “如何从 kieServiceClient 或任何其他方式获取 KieContainer object。”

any solutions you have found?您找到了任何解决方案? Pls share请分享

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM