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:
- KieServices: allows you to create KieContainers.
- 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
- 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.
- 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.
- 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.