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

How to use
setContext
method
in
org.kie.dmn.core.impl.DMNResultImpl

Best Java code snippets using org.kie.dmn.core.impl.DMNResultImpl.setContext (Showing top 4 results out of 315)

origin: kiegroup/droolsjbpm-integration

@Test
public void testDMNContextContainingListAndSublist() {
  // DROOLS-2713 DMN evaluation response containing list and sublist fail on server
  DMNContext ctx = new DMNContextImpl();
  List<?> list = IntStream.range(1, 11).boxed().collect(Collectors.toList());
  List<?> sublist = list.subList(1, 3);
  ctx.set("list", list);
  ctx.set("sublist", sublist);
  DMNResultImpl dmnResults = new DMNResultImpl(null);
  dmnResults.setContext(ctx);
  dmnResults.addDecisionResult(new DMNDecisionResultImpl("list", "list", DecisionEvaluationStatus.SUCCEEDED, list, Collections.emptyList()));
  dmnResults.addDecisionResult(new DMNDecisionResultImpl("sublist", "sublist", DecisionEvaluationStatus.SUCCEEDED, sublist, Collections.emptyList()));
  DMNResultKS results = new DMNResultKS(dmnResults);
  Assertions.assertThat(results.getContext().get("list")).isEqualTo(list);
  Assertions.assertThat(results.getContext().get("sublist")).isEqualTo(sublist);
  Assertions.assertThat(results.getDecisionResultByName("list").getResult()).isEqualTo(list);
  Assertions.assertThat(results.getDecisionResultByName("sublist").getResult()).isEqualTo(sublist);
}

origin: org.kie/kie-dmn-core

  @Test
  public void execute() {
    RegistryContext registryContext = new ContextImpl();
    GetDMNDecisionResultsCommand getDMNDecisionResultsCommand = new GetDMNDecisionResultsCommand();

    assertThatThrownBy(() -> getDMNDecisionResultsCommand.execute(registryContext))
        .isInstanceOf(IllegalStateException.class)
        .hasMessage("There is no DMNResult available");

    DMNResultImpl dmnResult = new DMNResultImpl(null);
    dmnResult.setContext(new DMNContextImpl());

    registryContext.register(DMNResult.class, dmnResult);

    List<DMNDecisionResult> result = getDMNDecisionResultsCommand.execute(registryContext);
    assertEquals(0, result.size());
  }
}
origin: org.kie/kie-dmn-core

  @Test
  public void execute() {
    RegistryContext registryContext = new ContextImpl();
    GetAllDMNContextCommand getAllDMNContextCommand = new GetAllDMNContextCommand();

    assertThatThrownBy(() -> getAllDMNContextCommand.execute(registryContext))
        .isInstanceOf(IllegalStateException.class)
        .hasMessage("There is not DMNResult available");

    DMNResultImpl dmnResult = new DMNResultImpl(null);
    dmnResult.setContext(new DMNContextImpl());

    registryContext.register(DMNResult.class, dmnResult);

    Map<String, Object> result = getAllDMNContextCommand.execute(registryContext);
    assertEquals(0, result.size());
  }
}
origin: org.kie/kie-dmn-core

  @Test
  public void execute() {
    RegistryContext registryContext = new ContextImpl();
    GetDMNMessagesCommand getDMNMessagesCommand = new GetDMNMessagesCommand();

    assertThatThrownBy(() -> getDMNMessagesCommand.execute(registryContext))
        .isInstanceOf(IllegalStateException.class)
        .hasMessage("There is no DMNResult available");

    DMNResultImpl dmnResult = new DMNResultImpl(null);
    dmnResult.setContext(new DMNContextImpl());

    registryContext.register(DMNResult.class, dmnResult);

    List<DMNMessage> result = getDMNMessagesCommand.execute(registryContext);
    assertEquals(0, result.size());
  }
}
org.kie.dmn.core.implDMNResultImplsetContext

Popular methods of DMNResultImpl

  • <init>
  • addDecisionResult

Popular in Java

  • Start an intent from android
  • addToBackStack (FragmentTransaction)
  • runOnUiThread (Activity)
  • compareTo (BigDecimal)
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • ImageIO (javax.imageio)
  • JComboBox (javax.swing)
  • JPanel (javax.swing)
  • LogFactory (org.apache.commons.logging)
    Factory for creating Log instances, with discovery and configuration features similar to that employ
  • Best IntelliJ plugins
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