Search in sources :

Example 11 with ReassignmentValue

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

the class ReassignmentsEditorWidgetTest method testOneReassignment.

@Test
public void testOneReassignment() {
    values.setValues(new ArrayList<>());
    values.addValue(new ReassignmentValue());
    Assert.assertEquals(1, values.getValues().size());
    Assert.assertFalse(values.isEmpty());
    reassignmentsEditorWidget.setValue(values);
    Assert.assertEquals(1, values.getValues().size());
    Assert.assertEquals(1, reassignmentsEditorWidget.getValue().getValues().size());
    HTMLInputElement input = getFieldValue(ReassignmentsEditorWidget.class, reassignmentsEditorWidget, "reassignmentsTextBox");
    Assert.assertEquals("1 reassignments", input.value);
}
Also used : HTMLInputElement(elemental2.dom.HTMLInputElement) ReassignmentValue(org.kie.workbench.common.stunner.bpmn.definition.property.reassignment.ReassignmentValue) Test(org.junit.Test) ReflectionUtilsTest(org.kie.workbench.common.stunner.bpmn.client.forms.util.ReflectionUtilsTest)

Example 12 with ReassignmentValue

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

the class ReassignmentRow method toReassignmentValue.

public ReassignmentValue toReassignmentValue() {
    ReassignmentValue value = new ReassignmentValue();
    value.setType(getType().getAlias());
    value.setDuration(getDuration());
    value.setGroups(getGroups());
    value.setUsers(getUsers());
    return value;
}
Also used : ReassignmentValue(org.kie.workbench.common.stunner.bpmn.definition.property.reassignment.ReassignmentValue)

Example 13 with ReassignmentValue

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

the class BPMNDirectDiagramMarshallerTest method testReassignments.

@Test
public void testReassignments() 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();
    ReassignmentsInfo reassignmentsInfo = userTask.getExecutionSet().getReassignmentsInfo();
    assertEquals(2, reassignmentsInfo.getValue().getValues().size());
    ReassignmentValue reassignment = reassignmentsInfo.getValue().getValues().get(0);
    assertEquals("[users:Reviewer|groups:kirill]@[1111w]", reassignment.toCDATAFormat());
    assertEquals("NotStartedReassign", reassignment.getType());
    reassignment = reassignmentsInfo.getValue().getValues().get(1);
    assertEquals("[users:Forms,HR|groups:director,guest]@[22h]", reassignment.toCDATAFormat());
    assertEquals("NotCompletedReassign", reassignment.getType());
}
Also used : Graph(org.kie.workbench.common.stunner.core.graph.Graph) ReassignmentsInfo(org.kie.workbench.common.stunner.bpmn.definition.property.reassignment.ReassignmentsInfo) Metadata(org.kie.workbench.common.stunner.core.diagram.Metadata) UserTask(org.kie.workbench.common.stunner.bpmn.definition.UserTask) ReassignmentValue(org.kie.workbench.common.stunner.bpmn.definition.property.reassignment.ReassignmentValue) Test(org.junit.Test)

Example 14 with ReassignmentValue

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

the class ParsedReassignmentsInfosTest method testReassignment.

@Test
public void testReassignment() {
    String body = "[users:Forms,Reviewer,manager|groups:director,john]@[33y]";
    ReassignmentValue actual = ParsedReassignmentsInfos.of(AssociationType.NOT_COMPLETED_REASSIGN.getName(), body);
    ReassignmentValue expected = new ReassignmentValue();
    expected.setType(AssociationType.NOT_COMPLETED_REASSIGN.getName());
    expected.setDuration("33y");
    expected.setGroups(new ArrayList<>(Arrays.asList("director", "john")));
    expected.setUsers(new ArrayList<>(Arrays.asList("Forms", "Reviewer", "manager")));
    assertEquals(expected, actual);
}
Also used : ReassignmentValue(org.kie.workbench.common.stunner.bpmn.definition.property.reassignment.ReassignmentValue) Test(org.junit.Test)

Example 15 with ReassignmentValue

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

the class ParsedReassignmentsInfosTest method testReassignmentPartial.

@Test
public void testReassignmentPartial() {
    String body = "[users:|groups:]@[33h]";
    ReassignmentValue actual = ParsedReassignmentsInfos.of(AssociationType.NOT_COMPLETED_REASSIGN.getName(), body);
    ReassignmentValue expected = new ReassignmentValue();
    expected.setType(AssociationType.NOT_COMPLETED_REASSIGN.getName());
    expected.setDuration("33h");
    assertEquals(expected.toString(), actual.toString());
    assertEquals(expected.toCDATAFormat(), actual.toCDATAFormat());
    assertEquals(expected, actual);
}
Also used : ReassignmentValue(org.kie.workbench.common.stunner.bpmn.definition.property.reassignment.ReassignmentValue) Test(org.junit.Test)

Aggregations

ReassignmentValue (org.kie.workbench.common.stunner.bpmn.definition.property.reassignment.ReassignmentValue)22 Test (org.junit.Test)17 ArrayList (java.util.ArrayList)4 ValueChangeEvent (com.google.gwt.event.logical.shared.ValueChangeEvent)1 ValueChangeHandler (com.google.gwt.event.logical.shared.ValueChangeHandler)1 GwtEvent (com.google.gwt.event.shared.GwtEvent)1 HandlerRegistration (com.google.gwt.event.shared.HandlerRegistration)1 IsWidget (com.google.gwt.user.client.ui.IsWidget)1 Widget (com.google.gwt.user.client.ui.Widget)1 HTMLInputElement (elemental2.dom.HTMLInputElement)1 List (java.util.List)1 Collectors (java.util.stream.Collectors)1 Dependent (javax.enterprise.context.Dependent)1 Inject (javax.inject.Inject)1 StunnerBPMNConstants (org.kie.workbench.common.stunner.bpmn.client.forms.fields.i18n.StunnerBPMNConstants)1 ReassignmentRow (org.kie.workbench.common.stunner.bpmn.client.forms.fields.model.ReassignmentRow)1 ReassignmentsEditorWidget (org.kie.workbench.common.stunner.bpmn.client.forms.fields.reassignmentsEditor.ReassignmentsEditorWidget)1 ReflectionUtilsTest (org.kie.workbench.common.stunner.bpmn.client.forms.util.ReflectionUtilsTest)1 UserTask (org.kie.workbench.common.stunner.bpmn.definition.UserTask)1 ReassignmentTypeListValue (org.kie.workbench.common.stunner.bpmn.definition.property.reassignment.ReassignmentTypeListValue)1