Search in sources :

Example 1 with FactPopulatorFactory

use of org.drools.workbench.models.testscenarios.backend.populators.FactPopulatorFactory in project drools by kiegroup.

the class ScenarioRunner method run.

public void run(final Scenario scenario) throws ClassNotFoundException, IllegalAccessException, InstantiationException, InvocationTargetException, NoSuchMethodException, InvalidClockTypeException {
    final Map<String, Object> populatedData = new HashMap<String, Object>();
    final Map<String, Object> globalData = new HashMap<String, Object>();
    // This looks safe!
    final KieBase kieBase = ksession.getKieBase();
    final ClassLoader classloader2 = ((InternalKnowledgeBase) kieBase).getRootClassLoader();
    final ClassTypeResolver resolver = new ClassTypeResolver(getImports(scenario), classloader2);
    this.workingMemoryWrapper = new TestScenarioKSessionWrapper(ksession, resolver, populatedData, globalData, scenarioUsesTimeWalk(scenario));
    this.factPopulatorFactory = new FactPopulatorFactory(populatedData, globalData, resolver);
    this.factPopulator = new FactPopulator(ksession, populatedData);
    MVEL.COMPILER_OPT_ALLOW_NAKED_METH_CALL = true;
    scenario.setLastRunResult(new Date());
    populateGlobals(scenario.getGlobals());
    applyFixtures(scenario.getFixtures(), createScenarioSettings(scenario));
}
Also used : FactPopulatorFactory(org.drools.workbench.models.testscenarios.backend.populators.FactPopulatorFactory) FactPopulator(org.drools.workbench.models.testscenarios.backend.populators.FactPopulator) HashMap(java.util.HashMap) KieBase(org.kie.api.KieBase) ClassTypeResolver(org.kie.soup.project.datamodel.commons.types.ClassTypeResolver) InternalKnowledgeBase(org.drools.core.impl.InternalKnowledgeBase) Date(java.util.Date)

Aggregations

Date (java.util.Date)1 HashMap (java.util.HashMap)1 InternalKnowledgeBase (org.drools.core.impl.InternalKnowledgeBase)1 FactPopulator (org.drools.workbench.models.testscenarios.backend.populators.FactPopulator)1 FactPopulatorFactory (org.drools.workbench.models.testscenarios.backend.populators.FactPopulatorFactory)1 KieBase (org.kie.api.KieBase)1 ClassTypeResolver (org.kie.soup.project.datamodel.commons.types.ClassTypeResolver)1