Search in sources :

Example 1 with NotificationValue

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();
}
Also used : NotificationTypeListValue(org.kie.workbench.common.stunner.bpmn.definition.property.notification.NotificationTypeListValue) NotificationValue(org.kie.workbench.common.stunner.bpmn.definition.property.notification.NotificationValue)

Example 2 with NotificationValue

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:&#94;z&#124;asd&#124;ASd&#124;&#124;asd&#124;Asd&#124;asd&#124;|body:a&#124;&#124;&#124;&#124;&#124;&#124;dssf&#124;&#124;sdf&#124;Sdf&#124;sdf&#124;Sdf&#124;SDf&#94;]@[1h]", test.toCDATAFormat());
}
Also used : NotificationValue(org.kie.workbench.common.stunner.bpmn.definition.property.notification.NotificationValue) Test(org.junit.Test)

Example 3 with NotificationValue

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());
}
Also used : Graph(org.kie.workbench.common.stunner.core.graph.Graph) Metadata(org.kie.workbench.common.stunner.core.diagram.Metadata) UserTask(org.kie.workbench.common.stunner.bpmn.definition.UserTask) NotificationValue(org.kie.workbench.common.stunner.bpmn.definition.property.notification.NotificationValue) NotificationsInfo(org.kie.workbench.common.stunner.bpmn.definition.property.notification.NotificationsInfo) Test(org.junit.Test)

Example 4 with NotificationValue

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);
}
Also used : HTMLInputElement(elemental2.dom.HTMLInputElement) NotificationValue(org.kie.workbench.common.stunner.bpmn.definition.property.notification.NotificationValue) Test(org.junit.Test) ReflectionUtilsTest(org.kie.workbench.common.stunner.bpmn.client.forms.util.ReflectionUtilsTest)

Example 5 with NotificationValue

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);
}
Also used : NotificationValue(org.kie.workbench.common.stunner.bpmn.definition.property.notification.NotificationValue) Test(org.junit.Test)

Aggregations

NotificationValue (org.kie.workbench.common.stunner.bpmn.definition.property.notification.NotificationValue)16 Test (org.junit.Test)10 ArrayList (java.util.ArrayList)3 HTMLInputElement (elemental2.dom.HTMLInputElement)1 ValidNotificationValue (org.kie.workbench.common.stunner.bpmn.client.forms.fields.notificationsEditor.validation.ValidNotificationValue)1 ReflectionUtilsTest (org.kie.workbench.common.stunner.bpmn.client.forms.util.ReflectionUtilsTest)1 UserTask (org.kie.workbench.common.stunner.bpmn.definition.UserTask)1 NotificationTypeListValue (org.kie.workbench.common.stunner.bpmn.definition.property.notification.NotificationTypeListValue)1 NotificationsInfo (org.kie.workbench.common.stunner.bpmn.definition.property.notification.NotificationsInfo)1 Metadata (org.kie.workbench.common.stunner.core.diagram.Metadata)1 Graph (org.kie.workbench.common.stunner.core.graph.Graph)1