congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
DynamicTypeUtils.mapOf
Code IndexAdd Tabnine to your IDE (free)

How to use
mapOf
method
in
org.kie.dmn.core.util.DynamicTypeUtils

Best Java code snippets using org.kie.dmn.core.util.DynamicTypeUtils.mapOf (Showing top 12 results out of 315)

origin: org.kie/kie-dmn-core

@Test
public void testImportTransitiveEvaluate3Layers() {
  final DMNRuntime runtime = DMNRuntimeUtil.createRuntimeWithAdditionalResources("Sayhello1ID1D.dmn",
                                          this.getClass(),
                                          "ModelB.dmn",
                                          "ModelB2.dmn",
                                          "ModelC.dmn");
  final DMNModel dmnModel = getAndAssertModelNoErrors(runtime, "http://www.trisotech.com/dmn/definitions/_10435dcd-8774-4575-a338-49dd554a0928", "Model C");
  final DMNContext context = runtime.newContext();
  context.set("Model B", mapOf(entry("modelA", mapOf(entry("Person name", "B.A.John")))));
  context.set("Model B2", mapOf(entry("modelA", mapOf(entry("Person name", "B2.A.John2")))));
  final DMNResult evaluateAll = runtime.evaluateAll(dmnModel, context);
  LOG.debug("{}", evaluateAll);
  assertThat(DMNRuntimeUtil.formatMessages(evaluateAll.getMessages()), evaluateAll.hasErrors(), is(false));
  assertThat(evaluateAll.getDecisionResultByName("Model C Decision based on Bs").getResult(), is("B: Evaluating Say Hello to: Hello, B.A.John; B2:Evaluating Say Hello to: Hello, B2.A.John2"));
}
origin: org.kie/kie-dmn-core

private void testAllowDMNAPItoEvaluateDirectDependencyImportedDecisions_evaluateResultsAndCheck(final DMNRuntime runtime, final Function<DMNContext, DMNResult> fn) {
  final DMNContext context = runtime.newContext();
  context.set("modelA", mapOf(entry("Person name", "John")));
  final DMNResult evaluateAll = fn.apply(context);
  LOG.debug("{}", evaluateAll);
  LOG.debug("{}", evaluateAll.getDecisionResults());
  assertThat(DMNRuntimeUtil.formatMessages(evaluateAll.getMessages()), evaluateAll.hasErrors(), is(false));
  assertThat(evaluateAll.getDecisionResultByName("Evaluating Say Hello").getResult(), is("Evaluating Say Hello to: Hello, John"));
  assertThat(evaluateAll.getDecisionResultByName("modelA.Greet the Person").getResult(), is("Hello, John"));
}
origin: org.kie/kie-dmn-core

  private static void testDecisionService20180920_testEvaluateDS(final DMNRuntime runtime, final DMNModel dmnModel) {
    final DMNContext context = DMNFactory.newContext();
    context.set("Model A", mapOf(entry("Input 1", "input 1 value")));

    final DMNResult dmnResult = runtime.evaluateDecisionService(dmnModel, context, "Decision B DS");
    LOG.debug("{}", dmnResult);
    dmnResult.getDecisionResults().forEach(x -> LOG.debug("{}", x));
    assertThat(DMNRuntimeUtil.formatMessages(dmnResult.getMessages()), dmnResult.hasErrors(), is(false));

    final DMNContext result = dmnResult.getContext();
    assertThat(result.getAll(), not(hasEntry(is("Invoke Decision B DS"), anything()))); // we invoked only the Decision Service, not this other Decision in the model.
    assertThat(result.get("Decision B"), is("input 1 value"));
  }
}
origin: org.kie/kie-dmn-core

private static void testDecisionService20180920_testEvaluateAll(final DMNRuntime runtime, final DMNModel dmnModel) {
  final DMNContext context = DMNFactory.newContext();
  context.set("Model A", mapOf(entry("Input 1", "input 1 value")));
  final DMNResult dmnResult = runtime.evaluateAll(dmnModel, context);
  LOG.debug("{}", dmnResult);
  dmnResult.getDecisionResults().forEach(x -> LOG.debug("{}", x));
  assertThat(DMNRuntimeUtil.formatMessages(dmnResult.getMessages()), dmnResult.hasErrors(), is(false));
  final DMNContext result = dmnResult.getContext();
  assertThat(result.get("Decision B"), is("input 1 value"));
  assertThat(result.get("Invoke Decision B DS"), is("A value"));
}
origin: org.kie/kie-dmn-core

  private void check_testDMN12typeRefInformationItem(String filename) {
    final DMNRuntime runtime = DMNRuntimeUtil.createRuntime(filename, this.getClass());
    final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_fe2fd9ea-5928-4a35-b218-036de5798776", "Drawing 1");
    assertThat(dmnModel, notNullValue());
    assertThat(DMNRuntimeUtil.formatMessages(dmnModel.getMessages()), dmnModel.hasErrors(), is(false));

    final DMNContext emptyContext = DMNFactory.newContext();

    final DMNResult dmnResult = runtime.evaluateAll(dmnModel, emptyContext);
    LOG.debug("{}", dmnResult);
    assertThat(DMNRuntimeUtil.formatMessages(dmnResult.getMessages()), dmnResult.hasErrors(), is(false));

    final DMNContext result = dmnResult.getContext();
    assertThat(result.get("invoke the a function"), is("Hello World"));
    assertThat(result.get("the list of vowels"), is(Arrays.asList("a", "e", "i", "o", "u")));
    assertThat(result.get("a Person"), is(mapOf(entry("name", "John"),
                          entry("surname", "Doe"),
                          entry("age", BigDecimal.valueOf(47)))));
  }
}
origin: org.kie/kie-dmn-core

@Test
public void testImportingID() {
  // DROOLS-2944 DMN decision logic referencing DMN<import> InputData
  final DMNRuntime runtime = DMNRuntimeUtil.createRuntimeWithAdditionalResources("Sayhello1ID1D.dmn",
                                          this.getClass(),
                                          "Importing_ID.dmn");
  final DMNModel dmnModel = getAndAssertModelNoErrors(runtime, "http://www.trisotech.com/dmn/definitions/_24bac498-2a5a-403d-8b44-d407628784c4", "Importing ID");
  final DMNContext context = runtime.newContext();
  context.set("my import hello", mapOf(entry("Person name", "DROOLS-2944")));
  final DMNResult evaluateAll = runtime.evaluateAll(dmnModel, context);
  LOG.debug("{}", evaluateAll);
  assertThat(DMNRuntimeUtil.formatMessages(evaluateAll.getMessages()), evaluateAll.hasErrors(), is(false));
  assertThat(evaluateAll.getDecisionResultByName("Hello decision using imported InputData").getResult(), is("Hello, DROOLS-2944"));
}
origin: org.kie/kie-dmn-validation

@Ignore
@Test
public void testBaseModel_OK() {
  DMNRuntime runtime = DMNRuntimeUtil.createRuntimeWithAdditionalResources("import/Base-model.dmn", this.getClass(), "import/Import-base-model.dmn");
  DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/dmn/definitions/_b33fa7d9-f501-423b-afa8-15ded7e7f493", "Import base model");
  assertThat(dmnModel, notNullValue());
  assertThat(DMNRuntimeUtil.formatMessages(dmnModel.getMessages()), dmnModel.hasErrors(), is(false));
  DMNContext context = DMNFactory.newContext();
  context.set("Customer", mapOf(entry("full name", "John Doe"), entry("age", 47)));
  DMNResult dmnResult = runtime.evaluateAll(dmnModel, context);
  LOG.debug("{}", dmnResult);
  assertThat(DMNRuntimeUtil.formatMessages(dmnResult.getMessages()), dmnResult.hasErrors(), is(false));
}
origin: org.kie/kie-dmn-core

@Test
public void testImportTransitiveEvaluate2Layers() {
  final DMNRuntime runtime = DMNRuntimeUtil.createRuntimeWithAdditionalResources("Sayhello1ID1D.dmn",
                                          this.getClass(),
                                          "ModelB.dmn",
                                          "ModelB2.dmn",
                                          "ModelC.dmn");
  final DMNModel dmnModel = getAndAssertModelNoErrors(runtime, "http://www.trisotech.com/dmn/definitions/_2a1d771a-a899-4fef-abd6-fc894332337c", "Model B");
  final DMNContext context = runtime.newContext();
  context.set("modelA", mapOf(entry("Person name", "John")));
  final DMNResult evaluateAll = runtime.evaluateAll(dmnModel, context);
  LOG.debug("{}", evaluateAll);
  assertThat(DMNRuntimeUtil.formatMessages(evaluateAll.getMessages()), evaluateAll.hasErrors(), is(false));
  assertThat(evaluateAll.getDecisionResultByName("Evaluating Say Hello").getResult(), is("Evaluating Say Hello to: Hello, John"));
}
origin: org.kie/kie-dmn-core

@Test
public void testImport() {
  final DMNRuntime runtime = DMNRuntimeUtil.createRuntimeWithAdditionalResources("Importing_Model.dmn",
                                          this.getClass(),
                                          "Imported_Model.dmn");
  final DMNModel importedModel = runtime.getModel("http://www.trisotech.com/dmn/definitions/_f27bb64b-6fc7-4e1f-9848-11ba35e0df36",
                          "Imported Model");
  assertThat(importedModel, notNullValue());
  for (final DMNMessage message : importedModel.getMessages()) {
    LOG.debug("{}", message);
  }
  final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/dmn/definitions/_f79aa7a4-f9a3-410a-ac95-bea496edab52",
                        "Importing Model");
  assertThat(dmnModel, notNullValue());
  for (final DMNMessage message : dmnModel.getMessages()) {
    LOG.debug("{}", message);
  }
  final DMNContext context = runtime.newContext();
  context.set("A Person", mapOf(entry("name", "John"), entry("age", 47)));
  final DMNResult evaluateAll = runtime.evaluateAll(dmnModel, context);
  for (final DMNMessage message : evaluateAll.getMessages()) {
    LOG.debug("{}", message);
  }
  LOG.debug("{}", evaluateAll);
  assertThat(evaluateAll.getDecisionResultByName("Greeting").getResult(), is("Hello John!"));
}
origin: org.kie/kie-dmn-core

@Test
public void testDecisionTableInputClauseImportingItemDefinition() {
  // DROOLS-2927 DMN DecisionTable inputClause importing ItemDefinition throws NPE at compilation
  final DMNRuntime runtime = DMNRuntimeUtil.createRuntimeWithAdditionalResources("imports/Imported_Model.dmn",
                                          this.getClass(),
                                          "imports/Importing_Person_DT_with_Person.dmn");
  final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/dmn/definitions/_3d586cb1-3ed0-4bc4-a1a7-070b70ece398", "Importing Person DT with Person");
  assertThat(dmnModel, notNullValue());
  assertThat(DMNRuntimeUtil.formatMessages(dmnModel.getMessages()), dmnModel.hasErrors(), is(false));
  final DMNContext context = DMNFactory.newContext();
  context.set("A Person here", mapOf(entry("age", new BigDecimal(17)),
                    entry("name", "John")));
  final DMNResult dmnResult = runtime.evaluateAll(dmnModel, context);
  LOG.debug("{}", dmnResult);
  assertThat(DMNRuntimeUtil.formatMessages(dmnResult.getMessages()), dmnResult.hasErrors(), is(false));
  final DMNContext result = dmnResult.getContext();
  assertThat(result.get("A Decision Table"), is("NOT Allowed"));
}
origin: org.kie/kie-dmn-core

@Test
public void testImportDependenciesForDTInAContext() {
  final DMNRuntime runtime = DMNRuntimeUtil.createRuntimeWithAdditionalResources("Imported_Model.dmn",
                                          this.getClass(),
                                          "Import_BKM_and_have_a_Decision_Ctx_with_DT.dmn");
  final DMNModel importedModel = runtime.getModel("http://www.trisotech.com/definitions/_f27bb64b-6fc7-4e1f-9848-11ba35e0df36",
                          "Imported Model");
  assertThat(importedModel, notNullValue());
  assertThat(DMNRuntimeUtil.formatMessages(importedModel.getMessages()), importedModel.hasErrors(), is(false));
  final DMNModel dmnModel = runtime.getModel("http://www.trisotech.com/definitions/_c3e08836-7973-4e4d-af2b-d46b23725c13",
                        "Import BKM and have a Decision Ctx with DT");
  assertThat(dmnModel, notNullValue());
  assertThat(DMNRuntimeUtil.formatMessages(dmnModel.getMessages()), dmnModel.hasErrors(), is(false));
  final DMNContext context = runtime.newContext();
  context.set("A Person", mapOf(entry("name", "John"), entry("age", 47)));
  final DMNResult evaluateAll = runtime.evaluateAll(dmnModel, context);
  assertThat(DMNRuntimeUtil.formatMessages(evaluateAll.getMessages()), evaluateAll.hasErrors(), is(false));
  LOG.debug("{}", evaluateAll);
  assertThat(evaluateAll.getDecisionResultByName("A Decision Ctx with DT").getResult(), is("Respectfully, Hello John!"));
}

origin: org.kie/kie-dmn-core

context.set("L2import", mapOf(entry("Person name", "John")));
org.kie.dmn.core.utilDynamicTypeUtilsmapOf

Popular methods of DynamicTypeUtils

  • entry
  • prototype

Popular in Java

  • Running tasks concurrently on multiple threads
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getSupportFragmentManager (FragmentActivity)
  • scheduleAtFixedRate (Timer)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • Kernel (java.awt.image)
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now