Search in sources :

Example 6 with PublishBatchMessagesEvent

use of org.guvnor.messageconsole.events.PublishBatchMessagesEvent in project kie-wb-common by kiegroup.

the class TestRunnerReportingPanel method onViewAlerts.

@Override
public void onViewAlerts() {
    PublishBatchMessagesEvent messagesEvent = new PublishBatchMessagesEvent();
    messagesEvent.setCleanExisting(true);
    messagesEvent.setMessagesToPublish(systemMessages);
    publishBatchMessagesEvent.fire(messagesEvent);
}
Also used : PublishBatchMessagesEvent(org.guvnor.messageconsole.events.PublishBatchMessagesEvent)

Example 7 with PublishBatchMessagesEvent

use of org.guvnor.messageconsole.events.PublishBatchMessagesEvent in project kie-wb-common by kiegroup.

the class DataModelerServiceImpl method processErrors.

private void processErrors(KieModule module, ModelDriverResult result) {
    PublishBatchMessagesEvent publishEvent = new PublishBatchMessagesEvent();
    publishEvent.setCleanExisting(true);
    publishEvent.setUserId(identity != null ? identity.getIdentifier() : null);
    publishEvent.setMessageType("DataModeler");
    SystemMessage systemMessage;
    for (DriverError error : result.getErrors()) {
        systemMessage = new SystemMessage();
        systemMessage.setMessageType("DataModeler");
        systemMessage.setLevel(Level.ERROR);
        systemMessage.setId(error.getId());
        systemMessage.setText(error.getMessage());
        systemMessage.setColumn(error.getColumn());
        systemMessage.setLine(error.getLine());
        systemMessage.setPath(error.getFile());
        publishEvent.getMessagesToPublish().add(systemMessage);
    }
    publishBatchMessagesEvent.fire(publishEvent);
}
Also used : SystemMessage(org.guvnor.messageconsole.events.SystemMessage) PublishBatchMessagesEvent(org.guvnor.messageconsole.events.PublishBatchMessagesEvent) DriverError(org.kie.workbench.common.services.datamodeller.driver.model.DriverError)

Example 8 with PublishBatchMessagesEvent

use of org.guvnor.messageconsole.events.PublishBatchMessagesEvent in project kie-wb-common by kiegroup.

the class DataModelerScreenPresenter method publishSystemMessages.

private void publishSystemMessages(String messageType, boolean cleanExisting, List<DataModelerError> errors) {
    PublishBatchMessagesEvent publishMessage = new PublishBatchMessagesEvent();
    publishMessage.setCleanExisting(cleanExisting);
    publishMessage.setMessageType(messageType);
    publishMessage.setUserId((sessionInfo != null && sessionInfo.getIdentity() != null) ? sessionInfo.getIdentity().getIdentifier() : null);
    publishMessage.setPlace(PublishBaseEvent.Place.TOP);
    SystemMessage systemMessage;
    for (DataModelerError error : errors) {
        systemMessage = new SystemMessage();
        systemMessage.setMessageType(messageType);
        systemMessage.setId(error.getId());
        systemMessage.setText(error.getMessage());
        systemMessage.setPath(error.getFile());
        systemMessage.setLevel(error.getLevel());
        systemMessage.setLine(error.getLine());
        systemMessage.setColumn(error.getColumn());
        publishMessage.getMessagesToPublish().add(systemMessage);
    }
    if (workbenchContext.getActiveModule().isPresent()) {
        publishMessage.setRootPath(workbenchContext.getActiveModule().get().getRootPath().toURI());
    }
    publishBatchMessagesEvent.fire(publishMessage);
}
Also used : SystemMessage(org.guvnor.messageconsole.events.SystemMessage) DataModelerError(org.kie.workbench.common.screens.datamodeller.model.DataModelerError) PublishBatchMessagesEvent(org.guvnor.messageconsole.events.PublishBatchMessagesEvent)

Aggregations

PublishBatchMessagesEvent (org.guvnor.messageconsole.events.PublishBatchMessagesEvent)8 Test (org.junit.Test)4 SystemMessage (org.guvnor.messageconsole.events.SystemMessage)3 UnpublishMessagesEvent (org.guvnor.messageconsole.events.UnpublishMessagesEvent)1 DataModelerWorkbenchFocusEvent (org.kie.workbench.common.screens.datamodeller.client.context.DataModelerWorkbenchFocusEvent)1 DataModelerError (org.kie.workbench.common.screens.datamodeller.model.DataModelerError)1 EditorModelContent (org.kie.workbench.common.screens.datamodeller.model.EditorModelContent)1 DriverError (org.kie.workbench.common.services.datamodeller.driver.model.DriverError)1 Path (org.uberfire.backend.vfs.Path)1