Purpose
- This article will demonstrate how to insert time stamps/date stamps into notifications generated by the rules engine.
Required permissions
- DROOLS_CREATION_RULE
- EDIT_RULES
Instructions
1. Insert the following action into any Drool in the component module to insert a time and date stamp into a Notification.
then
java.time.LocalDateTime start = java.time.LocalDateTime.now();
java.time.format.DateTimeFormatter formatter = java.time.format.DateTimeFormatter.ofPattern("MMM-dd HH:mm:ss");
insertLogical(new com.iriusrisk.drools.model.ComponentNotification(NotificationType.ALERT, "<Notification Unique ID>", start.format(formatter) + " <Notification Message>", $component.getComponentReferenceId()));
2. A full example is inserted below. This example inserts this notification if a GCP PostgreSQL component is added to a diagram for a condition.
The resulting output looks like the following:
Comments
0 comments
Article is closed for comments.