Skip to content

Instantly share code, notes, and snippets.

@adrielparedes

adrielparedes/Example.java

Last active Feb 19, 2021
Embed
What would you like to do?
Notification notification = new Notification();
notification.setPath("src/main/resources/diagram.dmn");
notification.setMessage("The message I want to inform");
notifications.setType(NotificationType.PROBLEM);
notification.setSeverity(NotificationSeverity.ERROR);
this.notificationsApi.createNotification(notification);
import org.appformer.kogito.bridge.client.notifications.NotificationsApi;
public class MyEditor{
private NotificationsApi notificationsApi;
@Inject
public MyEditor(NotificationsApi notificationsApi){
this.notificationsApi = notificationsApi;
}
}
String path = "src/main/resources/diagram.dmn";
this.notificationsApi.setNotifications(path,notifications);
export interface Notification {
path: string;
severity: NotificationSeverity;
message: string;
type: NotificationType;
}
export interface NotificationsApi {
createNotification(notification: Notification): void;
setNotifications(path: string, notifications: Notification[]): void;
removeNotifications(path: string): void;
}
export type NotificationSeverity = "INFO" | "WARNING" | "ERROR" | "SUCCESS" | "HINT";
export type NotificationType = "PROBLEM" | "ALERT";
import org.uberfire.lifecycle.Validate;
...
@Validate
public Promise validate() { return Promise.resolve(listOfNotifications) }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment