use of org.kie.workbench.common.stunner.bpmn.definition.property.notification.NotificationValue in project kie-wb-common by kiegroup.
the class NotificationWidget method ok.
@Override
public void ok() {
if (callback != null) {
List<NotificationValue> notifications = getValue().stream().map(NotificationRow::toNotificationValue).collect(Collectors.toList());
callback.getData(new NotificationTypeListValue(notifications));
}
view.hide();
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.notification.NotificationValue in project kie-wb-common by kiegroup.
the class NotificationValueTest method testNotificationPartialVerticalBar.
@Test
public void testNotificationPartialVerticalBar() {
NotificationValue test = new NotificationValue("a||||||dssf||sdf|Sdf|sdf|Sdf|SDf^", "1h", "^z|asd|ASd||asd|Asd|asd|", "me", "NotStartedNotify", "me", EMPTY_LIST, EMPTY_LIST, "");
assertEquals("[from:me|tousers:|togroups:|toemails:|replyTo:me|subject:^z|asd|ASd||asd|Asd|asd||body:a||||||dssf||sdf|Sdf|sdf|Sdf|SDf^]@[1h]", test.toCDATAFormat());
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.notification.NotificationValue in project kie-wb-common by kiegroup.
the class BPMNDirectDiagramMarshallerTest method testNotifications.
@Test
public void testNotifications() throws Exception {
Diagram<Graph, Metadata> diagram = unmarshall(BPMN_REASSIGNMENT_NOTIFICATION);
Node<? extends Definition, ?> multipleInstanceSubprocessNode = diagram.getGraph().getNode("_F402A212-CBB8-4F1B-A7FC-EE185C41BBF7");
UserTask userTask = (UserTask) multipleInstanceSubprocessNode.getContent().getDefinition();
NotificationsInfo notificationsInfo = userTask.getExecutionSet().getNotificationsInfo();
assertEquals(1, notificationsInfo.getValue().getValues().size());
NotificationValue notification = notificationsInfo.getValue().getValues().get(0);
assertEquals("[from:director|tousers:alessio,guest,john|togroups:Developer,IT|toemails:|replyTo:guest|subject:test|body:test body]@[11h]", notification.toCDATAFormat());
assertEquals("NotStartedNotify", notification.getType());
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.notification.NotificationValue in project kie-wb-common by kiegroup.
the class NotificationsEditorWidgetTest method testOneNotification.
@Test
public void testOneNotification() {
values.setValues(new ArrayList<>());
values.addValue(new NotificationValue());
Assert.assertEquals(1, values.getValues().size());
Assert.assertFalse(values.isEmpty());
notificationsEditorWidget.setValue(values);
Assert.assertEquals(1, values.getValues().size());
Assert.assertEquals(1, notificationsEditorWidget.getValue().getValues().size());
HTMLInputElement input = getFieldValue(NotificationsEditorWidget.class, notificationsEditorWidget, "notificationTextBox");
Assert.assertEquals("1 notifications", input.value);
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.notification.NotificationValue in project kie-wb-common by kiegroup.
the class NotificationRowTest method testToNotificationValue.
@Test
public void testToNotificationValue() {
// Setup
final NotificationValue expectedResult = new NotificationValue();
expectedResult.setExpiresAt("");
expectedResult.setFrom("");
expectedResult.setBody("");
expectedResult.setSubject("");
expectedResult.setReplyTo("");
expectedResult.setType("NotCompletedNotify");
// Run the test
final NotificationValue result = new NotificationRow().toNotificationValue();
// Verify the results
assertEquals(expectedResult, result);
}
Aggregations