Search in sources :

Example 1 with KieRuntimeLogger

use of org.kie.api.logger.KieRuntimeLogger in project opennms by OpenNMS.

the class CorrelationExample method main.

/**
     * <p>main</p>
     *
     * @param args an array of {@link java.lang.String} objects.
     * @throws java.lang.Exception if any.
     */
public static void main(final String[] args) throws Exception {
    final KieSession session = new KieHelper().addResource(new ClassPathResource("CorrelationExample.drl")).build().newKieSession();
    KieRuntimeLogger logger = KieServices.Factory.get().getLoggers().newFileLogger(session, "log/correlation");
    try (InputStream in = CorrelationExample.class.getResourceAsStream("simulation")) {
        final Simulation simulation = new Simulation();
        System.out.println("Loading Simulation");
        simulation.load(in);
        System.out.println("Executing Simulation");
        simulation.simulate(session);
    }
    logger.close();
}
Also used : KieRuntimeLogger(org.kie.api.logger.KieRuntimeLogger) InputStream(java.io.InputStream) KieHelper(org.kie.internal.utils.KieHelper) KieSession(org.kie.api.runtime.KieSession) ClassPathResource(org.drools.core.io.impl.ClassPathResource)

Aggregations

InputStream (java.io.InputStream)1 ClassPathResource (org.drools.core.io.impl.ClassPathResource)1 KieRuntimeLogger (org.kie.api.logger.KieRuntimeLogger)1 KieSession (org.kie.api.runtime.KieSession)1 KieHelper (org.kie.internal.utils.KieHelper)1