Skip to content

Instantly share code, notes, and snippets.

View manstis's full-sized avatar

Michael Anstis manstis

  • Red Hat
  • England
View GitHub Profile
@manstis
manstis / EditablePopupHeaderMetaDataTest
Created November 14, 2018 11:30
DROOLS-2932: Revised EditablePopupHeaderMetaDataTest
/*
* Copyright 2018 Red Hat, Inc. and/or its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<dmn11:definitions xmlns="http://www.trisotech.com/definitions/_b4c63b32-2306-4e38-8196-252503e431e4" xmlns:feel="http://www.omg.org/spec/FEEL/20140401" xmlns:tc="http://www.omg.org/spec/DMN/20160719/testcase" xmlns:triso="http://www.trisotech.com/2015/triso/modeling" xmlns:trisofeed="http://trisotech.com/feed" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" exporter="DMN Modeler" exporterVersion="6.1.12.1" id="_b4c63b32-2306-4e38-8196-252503e431e4" name="CE-LEs" namespace="http://www.trisotech.com/definitions/_b4c63b32-2306-4e38-8196-252503e431e4" triso:logoChoice="Default" xmlns:dmn11="http://www.omg.org/spec/DMN/20151101/dmn.xsd">
<dmn11:extensionElements/>
<dmn11:decision id="_880451e9-c29b-4bb9-ab3f-1b8d28c8c99f" name="CE-No-Expression">
<dmn11:variable id="_b691916f-fe35-49e6-9932-e0a350704d2b" name="CE-No-Expression"/>
<dmn11:context id="_28e9b7c0-3f2d-40d5-914b-63b1b0443426">
<dm

DMN Preview

The Workbench 7.13.0.Final was released in the last Tuesday, October 16th, and this version brings a lot of interesting features and important fixes. One of them is the brand new DMN Editor Preview which is disabled by the default, but you already can try it and take advantage of all power of this new tool.

In this article you'll learn how to enable the DMN Editor Preview, create a simple DMN model and execute it by calling a REST API.

Let's get started :-)

1) Enabling the Preview editor

@Test
--> @SuppressWarnings("unchecked")
public void testIndexDrlInvalidRuleName() throws IOException, InterruptedException, ExecutionException {
//Setup logging
final Logger root = (Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME);
final Appender<ILoggingEvent> mockAppender = mock(Appender.class);
when(mockAppender.getName()).thenReturn("MOCK");
root.addAppender(mockAppender);
//Add test files
interface Command {
void execute();
}
interface DrawLineCommand extends Command { }
interface DrawBoxCommand extends Command { }
Command drawALine() {
return ()->doLineDrawing();
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running org.kie.workbench.common.services.backend.compiler.nio.DefaultMavenCompilerTest
2018-01-10 13:55:42,671 [main] INFO Using 8 threads
2018-01-10 13:55:43,019 [main] INFO Key MAVEN_PLUGINS not present in the Environment, skip to the next ConfigurationStrategy.
Tests run: 4, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 8.807 sec <<< FAILURE! - in org.kie.workbench.common.services.backend.compiler.nio.DefaultMavenCompilerTest
buildWithAllDecoratorsTest(org.kie.workbench.common.services.backend.compiler.nio.DefaultMavenCompilerTest) Time elapsed: 3.631 sec <<< FAILURE!
java.lang.AssertionError: null
final Rectangle r = new Rectangle(10, 10);
r.setY(10.0).setX(x).setFillColor(ColorName.AQUAMARINE).setEventPropagationMode(EventPropagationMode.NO_ANCESTORS);
final PrimitiveTextTooltip tooltip = (PrimitiveTextTooltip) TooltipFactory.INSTANCE.forItem(definition.getName()).forComputedBoundingBox(r::getBoundingBox);
r.addNodeMouseEnterHandler((event) -> {
tooltip.show();
GWT.log("show tooltip");
});
r.addNodeMouseExitHandler((event) -> {
tooltip.hide();
//Instantiate UiModel overriding cell selection to inform MenuItems about changes to selected cells.
GuidedDecisionTableUiModel makeUiModel() {
return new GuidedDecisionTableUiModel(synchronizer) {
@Override
public Range selectCell(final int rowIndex,
final int columnIndex) {
final Range rows = super.selectCell(rowIndex,
columnIndex);
decisionTableSelectionsChangedEvent.fire(new DecisionTableSelectionsChangedEvent(GuidedDecisionTablePresenter.this));
return rows;
<jhrcek> manstis: I'm not sure if they'll help me with this particular issue. In 7.0 we've been seeing this kind of client-side-only error quite often and it's often hard to debug https://issues.jboss.org/secure/attachment/12419498/Error.png
<jhrcek> manstis: this kind of errors is very hard to debug if there's no associated backend message.
<manstis> jhrcek, do yuo see it *everywhere* or just the security screens?
<manstis> jhrcek, that type of error is easily debugged in dev mode.. but in the compiled webapp the Javascript is obfusicated
<manstis> obfusicacted/optimised/munged
<jhrcek> manstis: I mean in general - modal with error like "Type error <some obfuscated variable>: null"
<manstis> jhrcek, well.. afaik there's no reason it should be a generic issue; but I suspect a number of similar problems
<manstis> however I know tsurdilo had a recent problem on designer where some old (reliable) code stopped working recently
<manstis> which could suggest, if you're seeing similar, that something in possible err
<!-- Product Home Page -->
<profile>
<id>productizedProfile</id>
<activation>
<property>
<name>productized</name>
</property>
</activation>
<dependencies>