Skip to content

Instantly share code, notes, and snippets.

@adrielparedes
Last active February 19, 2021 18:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adrielparedes/9e9b8be5a740ed5820d5b0f2aefbcb81 to your computer and use it in GitHub Desktop.
Save adrielparedes/9e9b8be5a740ed5820d5b0f2aefbcb81 to your computer and use it in GitHub Desktop.
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