Search in sources :

Example 1 with XLSConversionResultMessage

use of org.drools.workbench.screens.guided.dtable.shared.XLSConversionResultMessage in project drools-wb by kiegroup.

the class GuidedDecisionTableEditorViewImpl method showConversionSuccess.

@Override
public void showConversionSuccess(final Set<XLSConversionResultMessage> infoMessages) {
    popupListWidget.clear();
    popupListWidget.setTitle(GuidedDecisionTableConstants.INSTANCE.TableConvertedSuccessfully());
    popupListWidget.addListMessage(MessageType.INFO, GuidedDecisionTableConstants.INSTANCE.TableConvertedSuccessfully());
    for (XLSConversionResultMessage infoMessage : infoMessages) {
        popupListWidget.addListMessage(MessageType.INFO, ConversionInfoMessageTranslator.translate(infoMessage));
    }
    popupListWidget.show();
}
Also used : XLSConversionResultMessage(org.drools.workbench.screens.guided.dtable.shared.XLSConversionResultMessage)

Example 2 with XLSConversionResultMessage

use of org.drools.workbench.screens.guided.dtable.shared.XLSConversionResultMessage in project drools-wb by kiegroup.

the class XLSBuilder method build.

public BuildResult build() {
    try {
        checkHitPolicy();
        makeRuleSet();
        makeImports();
        makeDeclare();
        makeTable();
    } catch (final UnsupportedOperationException e) {
        return new BuildResult(workbook, new XLSConversionResult(e.getMessage()));
    } catch (final Exception e) {
        return new BuildResult(workbook, new XLSConversionResult(e.toString() + " : " + e.getMessage()));
    }
    final XLSConversionResult conversionResult = new XLSConversionResult();
    for (final XLSConversionResultMessage notification : notifications) {
        conversionResult.addInfoMessage(notification);
    }
    return new BuildResult(workbook, conversionResult);
}
Also used : XLSConversionResult(org.drools.workbench.screens.guided.dtable.shared.XLSConversionResult) XLSConversionResultMessage(org.drools.workbench.screens.guided.dtable.shared.XLSConversionResultMessage)

Example 3 with XLSConversionResultMessage

use of org.drools.workbench.screens.guided.dtable.shared.XLSConversionResultMessage in project drools-wb by kiegroup.

the class XLSBuilderTypesTableTest method setUp.

@BeforeClass
public static void setUp() throws Exception {
    final String xml = loadResource(XLSBuilderAttributesNegateTest.class.getResourceAsStream("TypesTable.gdst"));
    final GuidedDecisionTable52 dtable = GuidedDTXMLPersistence.getInstance().unmarshal(xml);
    final XLSBuilder.BuildResult buildResult = new XLSBuilder(dtable, makeDMO()).build();
    final Workbook workbook = buildResult.getWorkbook();
    final Set<XLSConversionResultMessage> infoMessages = buildResult.getConversionResult().getInfoMessages();
    assertEquals(2, infoMessages.size());
    Assertions.assertThat(infoMessages).hasSize(2).containsOnlyOnce(new XLSConversionResultMessage(XLSConversionResultMessageType.DIALECT_NOT_CONVERTED, "Dialect is not a supported column type in XLS Decision tables. Conversion ignored this column.")).containsOnlyOnce(new XLSConversionResultMessage(XLSConversionResultMessageType.RULE_NAME_NOT_CONVERTED, "Rule Name column conversion is not supported yet. Conversion ignored this column."));
    assertEquals(1, workbook.getNumberOfSheets());
    sheet = workbook.iterator().next();
}
Also used : GuidedDecisionTable52(org.drools.workbench.models.guided.dtable.shared.model.GuidedDecisionTable52) XLSConversionResultMessage(org.drools.workbench.screens.guided.dtable.shared.XLSConversionResultMessage) Workbook(org.apache.poi.ss.usermodel.Workbook) BeforeClass(org.junit.BeforeClass)

Aggregations

XLSConversionResultMessage (org.drools.workbench.screens.guided.dtable.shared.XLSConversionResultMessage)3 Workbook (org.apache.poi.ss.usermodel.Workbook)1 GuidedDecisionTable52 (org.drools.workbench.models.guided.dtable.shared.model.GuidedDecisionTable52)1 XLSConversionResult (org.drools.workbench.screens.guided.dtable.shared.XLSConversionResult)1 BeforeClass (org.junit.BeforeClass)1