Search in sources :

Example 16 with FactIdentifier

use of org.drools.scenariosimulation.api.model.FactIdentifier in project drools by kiegroup.

the class AbstractRunnerHelperTest method fillResult.

@Test
public void fillResult() {
    FactIdentifier factIdentifier = FactIdentifier.create("MyInstance", String.class.getCanonicalName());
    ExpressionIdentifier expressionIdentifier = ExpressionIdentifier.create("MyProperty", FactMappingType.GIVEN);
    FactMappingValue expectedResultSpy = spy(new FactMappingValue(factIdentifier, expressionIdentifier, VALUE));
    AtomicReference<ValueWrapper> resultWrapperAtomicReference = new AtomicReference<>();
    Supplier<ValueWrapper<?>> resultWrapperSupplier = resultWrapperAtomicReference::get;
    ExpressionEvaluator expressionEvaluator = new BaseExpressionEvaluator(AbstractRunnerHelper.class.getClassLoader());
    // Success
    resultWrapperAtomicReference.set(ValueWrapper.of(VALUE));
    assertTrue(abstractRunnerHelper.fillResult(expectedResultSpy, resultWrapperSupplier, expressionEvaluator).getResult());
    verify(expectedResultSpy, times(1)).resetStatus();
    reset(expectedResultSpy);
    // Fail with expected value
    resultWrapperAtomicReference.set(ValueWrapper.errorWithValidValue(VALUE, "value1"));
    assertFalse(abstractRunnerHelper.fillResult(expectedResultSpy, resultWrapperSupplier, expressionEvaluator).getResult());
    verify(expectedResultSpy, times(1)).setErrorValue(VALUE);
    reset(expectedResultSpy);
    // Fail with exception while reverting actual value
    resultWrapperAtomicReference.set(ValueWrapper.errorWithValidValue(VALUE, "value1"));
    ExpressionEvaluator expressionEvaluatorMock = mock(ExpressionEvaluator.class);
    when(expressionEvaluatorMock.fromObjectToExpression(any())).thenThrow(new IllegalArgumentException("Error"));
    assertFalse(abstractRunnerHelper.fillResult(expectedResultSpy, resultWrapperSupplier, expressionEvaluatorMock).getResult());
    verify(expectedResultSpy, times(1)).setExceptionMessage("Error");
    reset(expectedResultSpy);
    // Fail in collection case
    List<String> pathToValue = Arrays.asList("field1", "fields2");
    resultWrapperAtomicReference.set(ValueWrapper.errorWithCollectionPathToValue(VALUE, pathToValue));
    assertFalse(abstractRunnerHelper.fillResult(expectedResultSpy, resultWrapperSupplier, expressionEvaluator).getResult());
    verify(expectedResultSpy, times(1)).setCollectionPathToValue(pathToValue);
    verify(expectedResultSpy, times(1)).setErrorValue(VALUE);
    // Fail with exception
    resultWrapperAtomicReference.set(ValueWrapper.errorWithMessage("detailedError"));
    assertFalse(abstractRunnerHelper.fillResult(expectedResultSpy, resultWrapperSupplier, expressionEvaluator).getResult());
    verify(expectedResultSpy, times(1)).setExceptionMessage("detailedError");
}
Also used : ValueWrapper(org.drools.scenariosimulation.backend.runner.model.ValueWrapper) FactMappingValue(org.drools.scenariosimulation.api.model.FactMappingValue) AtomicReference(java.util.concurrent.atomic.AtomicReference) FactIdentifier(org.drools.scenariosimulation.api.model.FactIdentifier) BaseExpressionEvaluator(org.drools.scenariosimulation.backend.expression.BaseExpressionEvaluator) ExpressionEvaluator(org.drools.scenariosimulation.backend.expression.ExpressionEvaluator) ExpressionIdentifier(org.drools.scenariosimulation.api.model.ExpressionIdentifier) BaseExpressionEvaluator(org.drools.scenariosimulation.backend.expression.BaseExpressionEvaluator) Test(org.junit.Test)

Example 17 with FactIdentifier

use of org.drools.scenariosimulation.api.model.FactIdentifier in project drools by kiegroup.

the class AbstractRunnerHelperTest method isFactMappingValueToSkip.

@Test
public void isFactMappingValueToSkip() {
    FactIdentifier factIdentifier = FactIdentifier.create("MyInstance", String.class.getCanonicalName());
    ExpressionIdentifier expressionIdentifier = ExpressionIdentifier.create("MyProperty", FactMappingType.GIVEN);
    FactMappingValue factMappingValueWithValidValue = new FactMappingValue(factIdentifier, expressionIdentifier, VALUE);
    assertFalse(abstractRunnerHelper.isFactMappingValueToSkip(factMappingValueWithValidValue));
    FactMappingValue factMappingValueWithoutValue = new FactMappingValue(factIdentifier, expressionIdentifier, null);
    assertTrue(abstractRunnerHelper.isFactMappingValueToSkip(factMappingValueWithoutValue));
}
Also used : ExpressionIdentifier(org.drools.scenariosimulation.api.model.ExpressionIdentifier) FactMappingValue(org.drools.scenariosimulation.api.model.FactMappingValue) FactIdentifier(org.drools.scenariosimulation.api.model.FactIdentifier) Test(org.junit.Test)

Example 18 with FactIdentifier

use of org.drools.scenariosimulation.api.model.FactIdentifier in project drools by kiegroup.

the class DMNScenarioRunnerHelperTest method executeScenario.

@Test
public void executeScenario() {
    ArgumentCaptor<Object> setValueCaptor = ArgumentCaptor.forClass(Object.class);
    ArgumentCaptor<String> setKeyCaptor = ArgumentCaptor.forClass(String.class);
    FactIdentifier bookFactIdentifier = FactIdentifier.create("Book", "Book");
    FactIdentifier importedPersonFactIdentifier = FactIdentifier.create(IMPORTED_PREFIX + ".Person", IMPORTED_PREFIX + ".Person", IMPORTED_PREFIX);
    FactIdentifier importedDisputeFactIdentifier = FactIdentifier.create(IMPORTED_PREFIX + ".Dispute", IMPORTED_PREFIX + ".Dispute", IMPORTED_PREFIX);
    FactIdentifier importedBookFactIdentifier = FactIdentifier.create(IMPORTED_PREFIX + ".Book", IMPORTED_PREFIX + ".Book", IMPORTED_PREFIX);
    FactIdentifier importedWrBookFactIdentifier = FactIdentifier.create(IMPORTED_PREFIX + ".wr.Book", IMPORTED_PREFIX + ".wr.Book", IMPORTED_PREFIX);
    AbstractMap.SimpleEntry<String, Object> backgroundDisputeFactData = new AbstractMap.SimpleEntry<>("description", "Nice");
    AbstractMap.SimpleEntry<String, Object> backgroundPersonFactData = new AbstractMap.SimpleEntry<>("name", "Carl");
    AbstractMap.SimpleEntry<String, Object> backgroundPersonFactData2 = new AbstractMap.SimpleEntry<>("age", 2);
    AbstractMap.SimpleEntry<String, Object> backgroundImportedDisputeFactData = new AbstractMap.SimpleEntry<>("description", "Bad");
    AbstractMap.SimpleEntry<String, Object> backgroundImportedPersonFactData = new AbstractMap.SimpleEntry<>("name", "Max");
    AbstractMap.SimpleEntry<String, Object> backgroundImportedPersonFactData2 = new AbstractMap.SimpleEntry<>("age", 34);
    AbstractMap.SimpleEntry<String, Object> givenPersonFactData = new AbstractMap.SimpleEntry<>("surname", "Brown");
    AbstractMap.SimpleEntry<String, Object> givenPersonFactData2 = new AbstractMap.SimpleEntry<>("age", 23);
    AbstractMap.SimpleEntry<String, Object> givenBookFactData = new AbstractMap.SimpleEntry<>("Author", "Resey Rema");
    AbstractMap.SimpleEntry<String, Object> givenBookFactData2 = new AbstractMap.SimpleEntry<>("Name", "The mighty Test Scenario!");
    AbstractMap.SimpleEntry<String, Object> givenImportedBookFactData = new AbstractMap.SimpleEntry<>("Author", "Mr Y");
    AbstractMap.SimpleEntry<String, Object> givenImportedBookFactData2 = new AbstractMap.SimpleEntry<>("Title", "The awesome Test Scenario!");
    AbstractMap.SimpleEntry<String, Object> givenImportedPersonFactData = new AbstractMap.SimpleEntry<>("surname", "White");
    AbstractMap.SimpleEntry<String, Object> givenImportedPersonFactData2 = new AbstractMap.SimpleEntry<>("age", 67);
    AbstractMap.SimpleEntry<String, Object> givenImportedWrBookFactData = new AbstractMap.SimpleEntry<>("Title", "I hate name with multi dots");
    ScenarioRunnerData scenarioRunnerData = new ScenarioRunnerData();
    scenarioRunnerData.addBackground(new InstanceGiven(disputeFactIdentifier, instantiateMap(backgroundDisputeFactData)));
    scenarioRunnerData.addBackground(new InstanceGiven(personFactIdentifier, instantiateMap(backgroundPersonFactData, backgroundPersonFactData2)));
    scenarioRunnerData.addBackground(new InstanceGiven(importedPersonFactIdentifier, instantiateMap(backgroundImportedPersonFactData, backgroundImportedPersonFactData2)));
    scenarioRunnerData.addBackground(new InstanceGiven(importedDisputeFactIdentifier, instantiateMap(backgroundImportedDisputeFactData)));
    scenarioRunnerData.addGiven(new InstanceGiven(personFactIdentifier, instantiateMap(givenPersonFactData, givenPersonFactData2)));
    scenarioRunnerData.addGiven(new InstanceGiven(importedPersonFactIdentifier, instantiateMap(givenImportedPersonFactData, givenImportedPersonFactData2)));
    scenarioRunnerData.addGiven(new InstanceGiven(bookFactIdentifier, instantiateMap(givenBookFactData, givenBookFactData2)));
    scenarioRunnerData.addGiven(new InstanceGiven(importedBookFactIdentifier, instantiateMap(givenImportedBookFactData, givenImportedBookFactData2)));
    scenarioRunnerData.addGiven(new InstanceGiven(importedWrBookFactIdentifier, instantiateMap(givenImportedWrBookFactData)));
    FactMappingValue factMappingValue = new FactMappingValue(personFactIdentifier, firstNameExpectedExpressionIdentifier, NAME);
    scenarioRunnerData.addExpect(new ScenarioExpect(personFactIdentifier, singletonList(factMappingValue), false));
    scenarioRunnerData.addExpect(new ScenarioExpect(personFactIdentifier, singletonList(factMappingValue), true));
    List<String> expectedInputDataToLoad = asList(personFactIdentifier.getName(), disputeFactIdentifier.getName(), bookFactIdentifier.getName(), IMPORTED_PREFIX);
    int inputObjects = expectedInputDataToLoad.size();
    runnerHelper.executeScenario(kieContainerMock, scenarioRunnerData, expressionEvaluatorFactory, simulation.getScesimModelDescriptor(), settings);
    verify(dmnScenarioExecutableBuilderMock, times(1)).setActiveModel(DMN_FILE_PATH);
    verify(dmnScenarioExecutableBuilderMock, times(inputObjects)).setValue(setKeyCaptor.capture(), setValueCaptor.capture());
    assertTrue(setKeyCaptor.getAllValues().containsAll(expectedInputDataToLoad));
    for (int i = 0; i < inputObjects; i++) {
        String key = setKeyCaptor.getAllValues().get(i);
        Map<String, Object> value = (Map<String, Object>) setValueCaptor.getAllValues().get(i);
        if (personFactIdentifier.getName().equals(key)) {
            assertEquals(backgroundPersonFactData.getValue(), value.get(backgroundPersonFactData.getKey()));
            assertNotEquals(backgroundPersonFactData2.getValue(), value.get(backgroundPersonFactData2.getKey()));
            assertEquals(givenPersonFactData.getValue(), value.get(givenPersonFactData.getKey()));
            assertEquals(givenPersonFactData2.getValue(), value.get(givenPersonFactData2.getKey()));
            assertEquals(3, value.size());
        } else if (disputeFactIdentifier.getName().equals(key)) {
            assertEquals(backgroundDisputeFactData.getValue(), value.get(backgroundDisputeFactData.getKey()));
            assertEquals(1, value.size());
        } else if (bookFactIdentifier.getName().equals(key)) {
            assertEquals(givenBookFactData.getValue(), value.get(givenBookFactData.getKey()));
            assertEquals(givenBookFactData2.getValue(), value.get(givenBookFactData2.getKey()));
            assertEquals(2, value.size());
        } else if (IMPORTED_PREFIX.equals(key)) {
            Map<String, Object> subValueDispute = (Map<String, Object>) value.get("Dispute");
            assertEquals(backgroundImportedDisputeFactData.getValue(), subValueDispute.get(backgroundImportedDisputeFactData.getKey()));
            assertEquals(1, subValueDispute.size());
            Map<String, Object> subValueBook = (Map<String, Object>) value.get("Book");
            assertEquals(givenImportedBookFactData.getValue(), subValueBook.get(givenImportedBookFactData.getKey()));
            assertEquals(givenImportedBookFactData2.getValue(), subValueBook.get(givenImportedBookFactData2.getKey()));
            assertEquals(2, subValueBook.size());
            Map<String, Object> subValuePerson = (Map<String, Object>) value.get("Person");
            assertEquals(backgroundImportedPersonFactData.getValue(), subValuePerson.get(backgroundImportedPersonFactData.getKey()));
            assertNotEquals(backgroundImportedPersonFactData2.getValue(), subValuePerson.get(backgroundImportedPersonFactData2.getKey()));
            assertEquals(givenImportedPersonFactData.getValue(), subValuePerson.get(givenImportedPersonFactData.getKey()));
            assertEquals(givenImportedPersonFactData2.getValue(), subValuePerson.get(givenImportedPersonFactData2.getKey()));
            assertEquals(3, subValuePerson.size());
            Map<String, Object> subValueWrBook = (Map<String, Object>) value.get("wr.Book");
            assertEquals(givenImportedWrBookFactData.getValue(), subValueWrBook.get(givenImportedWrBookFactData.getKey()));
            assertEquals(1, subValueWrBook.size());
            assertEquals(4, value.size());
        } else {
            fail("Unexpected key: " + key);
        }
    }
    verify(dmnScenarioExecutableBuilderMock, times(1)).run();
    // test not rule error
    settings.setType(ScenarioSimulationModel.Type.RULE);
    assertThatThrownBy(() -> runnerHelper.executeScenario(kieContainerMock, scenarioRunnerData, expressionEvaluatorFactory, simulation.getScesimModelDescriptor(), settings)).isInstanceOf(ScenarioException.class).hasMessageStartingWith("Impossible to run");
}
Also used : FactMappingValue(org.drools.scenariosimulation.api.model.FactMappingValue) InstanceGiven(org.drools.scenariosimulation.backend.runner.model.InstanceGiven) Mockito.anyString(org.mockito.Mockito.anyString) FactIdentifier(org.drools.scenariosimulation.api.model.FactIdentifier) AbstractMap(java.util.AbstractMap) ScenarioExpect(org.drools.scenariosimulation.backend.runner.model.ScenarioExpect) ScenarioRunnerData(org.drools.scenariosimulation.backend.runner.model.ScenarioRunnerData) Map(java.util.Map) HashMap(java.util.HashMap) AbstractMap(java.util.AbstractMap) Test(org.junit.Test)

Example 19 with FactIdentifier

use of org.drools.scenariosimulation.api.model.FactIdentifier in project drools by kiegroup.

the class AbstractRunnerHelper method groupByFactIdentifierAndFilter.

protected Map<FactIdentifier, List<FactMappingValue>> groupByFactIdentifierAndFilter(List<FactMappingValue> factMappingValues, FactMappingType type) {
    Map<FactIdentifier, List<FactMappingValue>> groupByFactIdentifier = new HashMap<>();
    for (FactMappingValue factMappingValue : factMappingValues) {
        FactIdentifier factIdentifier = factMappingValue.getFactIdentifier();
        if (isFactMappingValueToSkip(factMappingValue)) {
            continue;
        }
        ExpressionIdentifier expressionIdentifier = factMappingValue.getExpressionIdentifier();
        if (expressionIdentifier == null) {
            throw new IllegalArgumentException("ExpressionIdentifier malformed");
        }
        if (!Objects.equals(expressionIdentifier.getType(), type)) {
            continue;
        }
        groupByFactIdentifier.computeIfAbsent(factIdentifier, key -> new ArrayList<>()).add(factMappingValue);
    }
    return groupByFactIdentifier;
}
Also used : FactMappingValueStatus(org.drools.scenariosimulation.api.model.FactMappingValueStatus) ScenarioResultMetadata(org.drools.scenariosimulation.backend.runner.model.ScenarioResultMetadata) LoggerFactory(org.slf4j.LoggerFactory) FactIdentifier(org.drools.scenariosimulation.api.model.FactIdentifier) HashMap(java.util.HashMap) ValueWrapper.errorWithValidValue(org.drools.scenariosimulation.backend.runner.model.ValueWrapper.errorWithValidValue) Supplier(java.util.function.Supplier) ArrayList(java.util.ArrayList) ExpressionElement(org.drools.scenariosimulation.api.model.ExpressionElement) ExpressionIdentifier(org.drools.scenariosimulation.api.model.ExpressionIdentifier) Scenario(org.drools.scenariosimulation.api.model.Scenario) ValueWrapper(org.drools.scenariosimulation.backend.runner.model.ValueWrapper) Map(java.util.Map) ValueWrapper.errorWithMessage(org.drools.scenariosimulation.backend.runner.model.ValueWrapper.errorWithMessage) ScenarioResult(org.drools.scenariosimulation.backend.runner.model.ScenarioResult) ScesimModelDescriptor(org.drools.scenariosimulation.api.model.ScesimModelDescriptor) ScenarioWithIndex(org.drools.scenariosimulation.api.model.ScenarioWithIndex) ScenarioSimulationServerMessages(org.drools.scenariosimulation.backend.util.ScenarioSimulationServerMessages) Logger(org.slf4j.Logger) BackgroundData(org.drools.scenariosimulation.api.model.BackgroundData) Settings(org.drools.scenariosimulation.api.model.Settings) ScenarioExpect(org.drools.scenariosimulation.backend.runner.model.ScenarioExpect) ScenarioRunnerData(org.drools.scenariosimulation.backend.runner.model.ScenarioRunnerData) Background(org.drools.scenariosimulation.api.model.Background) FactMappingValue(org.drools.scenariosimulation.api.model.FactMappingValue) Set(java.util.Set) KieContainer(org.kie.api.runtime.KieContainer) ValueWrapper.of(org.drools.scenariosimulation.backend.runner.model.ValueWrapper.of) FactMappingType(org.drools.scenariosimulation.api.model.FactMappingType) ValueWrapper.errorWithCollectionPathToValue(org.drools.scenariosimulation.backend.runner.model.ValueWrapper.errorWithCollectionPathToValue) Collectors(java.util.stream.Collectors) Objects(java.util.Objects) ExpressionEvaluatorFactory(org.drools.scenariosimulation.backend.expression.ExpressionEvaluatorFactory) List(java.util.List) ExpressionEvaluator(org.drools.scenariosimulation.backend.expression.ExpressionEvaluator) Collectors.toList(java.util.stream.Collectors.toList) FactMapping(org.drools.scenariosimulation.api.model.FactMapping) ExpressionEvaluatorResult(org.drools.scenariosimulation.backend.expression.ExpressionEvaluatorResult) ScenarioSimulationSharedUtils.isCollectionOrMap(org.drools.scenariosimulation.api.utils.ScenarioSimulationSharedUtils.isCollectionOrMap) InstanceGiven(org.drools.scenariosimulation.backend.runner.model.InstanceGiven) HashMap(java.util.HashMap) FactMappingValue(org.drools.scenariosimulation.api.model.FactMappingValue) ExpressionIdentifier(org.drools.scenariosimulation.api.model.ExpressionIdentifier) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List) Collectors.toList(java.util.stream.Collectors.toList) FactIdentifier(org.drools.scenariosimulation.api.model.FactIdentifier)

Example 20 with FactIdentifier

use of org.drools.scenariosimulation.api.model.FactIdentifier in project drools by kiegroup.

the class AbstractRunnerHelper method extractExpectedValues.

protected List<ScenarioExpect> extractExpectedValues(List<FactMappingValue> factMappingValues) {
    List<ScenarioExpect> scenarioExpect = new ArrayList<>();
    Map<FactIdentifier, List<FactMappingValue>> groupByFactIdentifier = groupByFactIdentifierAndFilter(factMappingValues, FactMappingType.EXPECT);
    Set<FactIdentifier> inputFacts = factMappingValues.stream().filter(elem -> FactMappingType.GIVEN.equals(elem.getExpressionIdentifier().getType())).filter(elem -> !isFactMappingValueToSkip(elem)).map(FactMappingValue::getFactIdentifier).collect(Collectors.toSet());
    for (Map.Entry<FactIdentifier, List<FactMappingValue>> entry : groupByFactIdentifier.entrySet()) {
        FactIdentifier factIdentifier = entry.getKey();
        scenarioExpect.add(new ScenarioExpect(factIdentifier, entry.getValue(), !inputFacts.contains(factIdentifier)));
    }
    return scenarioExpect;
}
Also used : ScenarioExpect(org.drools.scenariosimulation.backend.runner.model.ScenarioExpect) FactMappingValueStatus(org.drools.scenariosimulation.api.model.FactMappingValueStatus) ScenarioResultMetadata(org.drools.scenariosimulation.backend.runner.model.ScenarioResultMetadata) LoggerFactory(org.slf4j.LoggerFactory) FactIdentifier(org.drools.scenariosimulation.api.model.FactIdentifier) HashMap(java.util.HashMap) ValueWrapper.errorWithValidValue(org.drools.scenariosimulation.backend.runner.model.ValueWrapper.errorWithValidValue) Supplier(java.util.function.Supplier) ArrayList(java.util.ArrayList) ExpressionElement(org.drools.scenariosimulation.api.model.ExpressionElement) ExpressionIdentifier(org.drools.scenariosimulation.api.model.ExpressionIdentifier) Scenario(org.drools.scenariosimulation.api.model.Scenario) ValueWrapper(org.drools.scenariosimulation.backend.runner.model.ValueWrapper) Map(java.util.Map) ValueWrapper.errorWithMessage(org.drools.scenariosimulation.backend.runner.model.ValueWrapper.errorWithMessage) ScenarioResult(org.drools.scenariosimulation.backend.runner.model.ScenarioResult) ScesimModelDescriptor(org.drools.scenariosimulation.api.model.ScesimModelDescriptor) ScenarioWithIndex(org.drools.scenariosimulation.api.model.ScenarioWithIndex) ScenarioSimulationServerMessages(org.drools.scenariosimulation.backend.util.ScenarioSimulationServerMessages) Logger(org.slf4j.Logger) BackgroundData(org.drools.scenariosimulation.api.model.BackgroundData) Settings(org.drools.scenariosimulation.api.model.Settings) ScenarioExpect(org.drools.scenariosimulation.backend.runner.model.ScenarioExpect) ScenarioRunnerData(org.drools.scenariosimulation.backend.runner.model.ScenarioRunnerData) Background(org.drools.scenariosimulation.api.model.Background) FactMappingValue(org.drools.scenariosimulation.api.model.FactMappingValue) Set(java.util.Set) KieContainer(org.kie.api.runtime.KieContainer) ValueWrapper.of(org.drools.scenariosimulation.backend.runner.model.ValueWrapper.of) FactMappingType(org.drools.scenariosimulation.api.model.FactMappingType) ValueWrapper.errorWithCollectionPathToValue(org.drools.scenariosimulation.backend.runner.model.ValueWrapper.errorWithCollectionPathToValue) Collectors(java.util.stream.Collectors) Objects(java.util.Objects) ExpressionEvaluatorFactory(org.drools.scenariosimulation.backend.expression.ExpressionEvaluatorFactory) List(java.util.List) ExpressionEvaluator(org.drools.scenariosimulation.backend.expression.ExpressionEvaluator) Collectors.toList(java.util.stream.Collectors.toList) FactMapping(org.drools.scenariosimulation.api.model.FactMapping) ExpressionEvaluatorResult(org.drools.scenariosimulation.backend.expression.ExpressionEvaluatorResult) ScenarioSimulationSharedUtils.isCollectionOrMap(org.drools.scenariosimulation.api.utils.ScenarioSimulationSharedUtils.isCollectionOrMap) InstanceGiven(org.drools.scenariosimulation.backend.runner.model.InstanceGiven) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List) Collectors.toList(java.util.stream.Collectors.toList) FactIdentifier(org.drools.scenariosimulation.api.model.FactIdentifier) HashMap(java.util.HashMap) Map(java.util.Map) ScenarioSimulationSharedUtils.isCollectionOrMap(org.drools.scenariosimulation.api.utils.ScenarioSimulationSharedUtils.isCollectionOrMap)

Aggregations

FactIdentifier (org.drools.scenariosimulation.api.model.FactIdentifier)28 FactMapping (org.drools.scenariosimulation.api.model.FactMapping)15 ExpressionIdentifier (org.drools.scenariosimulation.api.model.ExpressionIdentifier)12 List (java.util.List)10 ArrayList (java.util.ArrayList)9 FactMappingValue (org.drools.scenariosimulation.api.model.FactMappingValue)9 Test (org.junit.Test)9 Map (java.util.Map)8 ScesimModelDescriptor (org.drools.scenariosimulation.api.model.ScesimModelDescriptor)8 Set (java.util.Set)6 Objects (java.util.Objects)5 Collectors.toList (java.util.stream.Collectors.toList)5 ExpressionElement (org.drools.scenariosimulation.api.model.ExpressionElement)5 FactMappingType (org.drools.scenariosimulation.api.model.FactMappingType)5 ExpressionEvaluator (org.drools.scenariosimulation.backend.expression.ExpressionEvaluator)5 InstanceGiven (org.drools.scenariosimulation.backend.runner.model.InstanceGiven)5 ScenarioExpect (org.drools.scenariosimulation.backend.runner.model.ScenarioExpect)5 Supplier (java.util.function.Supplier)4 Collectors (java.util.stream.Collectors)4 FactMappingValueStatus (org.drools.scenariosimulation.api.model.FactMappingValueStatus)4