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);
}
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);
}
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);
}
Aggregations