Last active
February 19, 2021 18:39
-
-
Save adrielparedes/9e9b8be5a740ed5820d5b0f2aefbcb81 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.appformer.kogito.bridge.client.notifications.NotificationsApi; | |
public class MyEditor{ | |
private NotificationsApi notificationsApi; | |
@Inject | |
public MyEditor(NotificationsApi notificationsApi){ | |
this.notificationsApi = notificationsApi; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String path = "src/main/resources/diagram.dmn"; | |
this.notificationsApi.setNotifications(path,notifications); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export interface Notification { | |
path: string; | |
severity: NotificationSeverity; | |
message: string; | |
type: NotificationType; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export interface NotificationsApi { | |
createNotification(notification: Notification): void; | |
setNotifications(path: string, notifications: Notification[]): void; | |
removeNotifications(path: string): void; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export type NotificationSeverity = "INFO" | "WARNING" | "ERROR" | "SUCCESS" | "HINT"; | |
export type NotificationType = "PROBLEM" | "ALERT"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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