Search in sources :

Example 6 with NotificationTypeListValue

use of org.kie.workbench.common.stunner.bpmn.definition.property.notification.NotificationTypeListValue in project kie-wb-common by kiegroup.

the class NotificationsInfos method of.

public static NotificationsInfo of(List<DataInputAssociation> dataInputAssociations) {
    NotificationTypeListValue notifications = new NotificationTypeListValue();
    dataInputAssociations.forEach(din -> {
        DataInput targetRef = (DataInput) (din.getTargetRef());
        if (isReservedIdentifier(targetRef.getName())) {
            if (!din.getAssignment().isEmpty()) {
                Assignment assignment = din.getAssignment().get(0);
                if (assignment != null) {
                    String body = ((FormalExpression) assignment.getFrom()).getBody();
                    if (body != null) {
                        Arrays.stream(body.split("\\^")).forEach(b -> {
                            notifications.addValue(ParsedNotificationsInfos.of(targetRef.getName(), b));
                        });
                    }
                }
            }
        }
    });
    return new NotificationsInfo(notifications);
}
Also used : DataInput(org.eclipse.bpmn2.DataInput) Assignment(org.eclipse.bpmn2.Assignment) NotificationTypeListValue(org.kie.workbench.common.stunner.bpmn.definition.property.notification.NotificationTypeListValue) FormalExpression(org.eclipse.bpmn2.FormalExpression) NotificationsInfo(org.kie.workbench.common.stunner.bpmn.definition.property.notification.NotificationsInfo)

Aggregations

NotificationTypeListValue (org.kie.workbench.common.stunner.bpmn.definition.property.notification.NotificationTypeListValue)6 LienzoMockitoTestRunner (com.ait.lienzo.test.LienzoMockitoTestRunner)3 HasData (com.google.gwt.view.client.HasData)3 ListDataProvider (com.google.gwt.view.client.ListDataProvider)3 GwtMock (com.google.gwtmockito.GwtMock)3 GwtMockito (com.google.gwtmockito.GwtMockito)3 ArrayList (java.util.ArrayList)3 Collections (java.util.Collections)3 List (java.util.List)3 Assert (org.junit.Assert)3 Before (org.junit.Before)3 Test (org.junit.Test)3 RunWith (org.junit.runner.RunWith)3 NotificationRow (org.kie.workbench.common.stunner.bpmn.client.forms.fields.model.NotificationRow)3 NotificationsEditorWidget (org.kie.workbench.common.stunner.bpmn.client.forms.fields.notificationsEditor.NotificationsEditorWidget)3 NotificationEvent (org.kie.workbench.common.stunner.bpmn.client.forms.fields.notificationsEditor.event.NotificationEvent)3 ReflectionUtilsTest (org.kie.workbench.common.stunner.bpmn.client.forms.util.ReflectionUtilsTest)3 ArgumentMatchers.any (org.mockito.ArgumentMatchers.any)3 ArgumentMatchers.anyList (org.mockito.ArgumentMatchers.anyList)3 Mockito.doCallRealMethod (org.mockito.Mockito.doCallRealMethod)3