diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2021-01-03 22:20:15 +0100 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2021-01-03 22:20:15 +0100 |
commit | 09ba202f73a519355f86b845b210b5126ea1dacf (patch) | |
tree | 73f6901ec956c5985b3f62c4dba86c010860f92c /src/main/java/io/trygvis/rules/engine | |
parent | 1911481101e15463c8aecbdc03a6ce5b63b0d68f (diff) | |
download | rules-sandbox-09ba202f73a519355f86b845b210b5126ea1dacf.tar.gz rules-sandbox-09ba202f73a519355f86b845b210b5126ea1dacf.tar.bz2 rules-sandbox-09ba202f73a519355f86b845b210b5126ea1dacf.tar.xz rules-sandbox-09ba202f73a519355f86b845b210b5126ea1dacf.zip |
VPN work.
Diffstat (limited to 'src/main/java/io/trygvis/rules/engine')
-rw-r--r-- | src/main/java/io/trygvis/rules/engine/Main.java | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/main/java/io/trygvis/rules/engine/Main.java b/src/main/java/io/trygvis/rules/engine/Main.java index d469f3a..a3b0259 100644 --- a/src/main/java/io/trygvis/rules/engine/Main.java +++ b/src/main/java/io/trygvis/rules/engine/Main.java @@ -1,6 +1,8 @@ package io.trygvis.rules.engine; import io.trygvis.rules.acme.AcmeIo; +import io.trygvis.rules.dns.DnsEntry; +import io.trygvis.rules.machine.Machine; import org.drools.core.audit.WorkingMemoryConsoleLogger; import org.kie.api.KieServices; import org.kie.api.event.rule.AgendaEventListener; @@ -10,12 +12,13 @@ import java.io.IOException; public class Main { public static void main(String[] args) throws IOException { - var io = new AcmeIo(); + var services = KieServices.Factory.get(); + var container = services.getKieClasspathContainer(); + var kieBase = container.getKieBase(); + var io = new AcmeIo(kieBase); var objects = io.load("acme.yaml"); - var services = KieServices.Factory.get(); - var container = services.getKieClasspathContainer(); var session = container.newKieSession(); session.setGlobal("te", new TemplateEngine()); @@ -35,6 +38,10 @@ public class Main { io.dump("phase-1", session.getFactHandles()); + io.dump("vs0", session.getFactHandles(), (Object o) -> { + return o.getClass().getName().contains("Wg") || o instanceof Machine || o instanceof DnsEntry; + }); + session.dispose(); } } |