Yes, the use case is supported, but it is important to understand that Drools 6 introduces the concept of versioned deployable artifacts (the mavenized kjars). In other words, once you create a kjar with version X, it is supposed to be immutable. If you want to add/remove rules to the kbases defined in kjar, you should create another kjar version X+1. This kjar can be created either physically in the disk as a real jar or in memory.
Also important to understand the concept that the kjar is the immutable source artifact and the kcontainer is the container that instantiates the kjar and allows the use of its kbases and ksessions.
If that is understood, then all you need to do is instantiate the container for version X, and when you want to change the kbase, call the container updateToVersion(...) method to update it to the new version. KBases and KSessions are incrementally updated and preserved like they were in Drools 5.
Unit test here: https://github.com/droolsjbpm/drools/blob/master/drools-compiler/src/test/java/org/drools/compiler/integrationtests/IncrementalCompilationTest.java#L158
Code snippet:
// work with version 1.0.0
ReleaseId releaseId1 = ks.newReleaseId("org.kie", "test-upgrade", "1.0.0");
...
// Create a session and fire rules
KieContainer kc = ks.newKieContainer( releaseId1 );
KieSession ksession = kc.newKieSession();
ksession.insert(new Message("Hello World"));
...
// upgrade to version 1.1.0
ReleaseId releaseId2 = ks.newReleaseId("org.kie", "test-upgrade", "1.1.0");
kc.updateToVersion(releaseId2);
// continue working with the session
ksession.insert(new Message("Hello World"));
...
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…