KieContainer可以加载多个软件包吗? KieContainer和KieBase之间是什么关系 [英] Can KieContainer load multiple packages? and what's the relationship between KieContainer and KieBase

查看:487
本文介绍了KieContainer可以加载多个软件包吗? KieContainer和KieBase之间是什么关系的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是流口水的新手。
该项目有几个由Kie工作台构建的Kjars。在我们的程序中,我们希望将所有这些Kjars放入一个KieContainer中。
但是我从文档中看到的是创建KieContainer时,它需要一个releaseId作为参数。参数是Kjar的GroupId / ArtifactId / version,这意味着KieContainer仅与1个Kjar相关。



那么如何将这些Jars只能加载到一个KieContainer中?还是不可能将多个Kjars装入一个容器中?



另一个困惑是KieContainer和KieBase之间的确切关系是什么?



非常感谢您提前回答我的问题。

解决方案

首先,我知道您只询问过KieContainer和KieBase,但我认为了解全部5个KieConcepts以获得完整图片很重要:


  1. KieServices :允许您创建 KieContainer

  2. KieContainer :具有对所有规则,函数等的引用。 KieContainer 可以加载 KieModule 及其依赖项。一个 KieContainer 可以具有1个或多个 KieBases

  3. KieModule :定义多个 KieBases KieSessions KieModules 可以包含其他 KieModules 。这意味着您可以拥有一个包含不同域资产的顶级 KieModule 。这是 KieModule 的模式,显示您可以拥有的所有选项。

  4. KieBase :代表一组资产的编译版本。例如,您可以使用相同的规则进行无状态会话和有状态会话。另一种选择是为一组软件包使用一个 KieBase ,对于另一组软件包使用另一个 KieBase

  5. KieSession :表示规则引擎的实例,该实例包含 KieBase 中的规则。每个 KieBase 可以具有一个或多个 KieSessions

据我所知不可能将几个不同的Kjar加载到一个KieContainer中。



所以我的建议是



A)找到一种将所有内容组合到一个Kjar中的方法,以便您可以使用所有资产创建
KieContainer。此文档可以帮助您了解这是否对您的用例有效。 / p>

B)为
所需的每种资产版本创建一个新的KieContainer,并根据输入进行相应的路由。这会占用更大的内存,但是如果您不能使用单个Kjar,这可能是最好的选择。


I'm new to drools. The project has several Kjars which are built from Kie workbench. And in our program, we want to put all these Kjars into one KieContainer. But I can see from the document is when creating KieContainer, it need a releaseId as parameter. The parameter is GroupId/ArtifactId/version of the Kjar, meaning, the KieContainer is related to only 1 Kjar.

So how can I load these Jars to only one KieContainer? or it is impossbile to load several Kjars into one container?

Another confusion is what's the exact relationship between KieContainer and KieBase?

Really appreciate in advance to answer my problem.

解决方案

First, I know you only asked about KieContainer and KieBase, but I think it's important to know about all 5 KieConcepts to get a full picture:

  1. KieServices: allows you to create KieContainers.
  2. KieContainer: has references to all rules, functions, etc. A KieContainer can load a KieModule and its dependencies. A KieContainer can have 1 or more KieBases
  3. KieModule: Defines multiple KieBases and KieSessions. KieModules can include other KieModules. This means you can have a top level KieModule that contains assets from different domains. Here is a link to the schema for KieModule, showing all the options you can have.
  4. KieBase: represents a compiled version of a set of assets. You can have a Stateless and Stateful session with the same rules for example. Another option is to have one KieBase for one set of packages, and another KieBase for another set of packages.
  5. KieSession: represents an instance of the rule engine containing the rules in a KieBase. Each KieBase can have one or more KieSessions

To my knowledge it is not possible to load several different Kjars into one KieContainer.

So my recommendation would be to either

A) Find a way to combine everything in one Kjar so you can create a KieContainer with all of your assets. This documentation may help you understand if this is a valid option for you given your use case.

B) Create a new KieContainer for each version of the assets that you need and route accordingly based on input. This has a bigger memory footprint, but this may be the best option if you can't use a single Kjar.

这篇关于KieContainer可以加载多个软件包吗? KieContainer和KieBase之间是什么关系的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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