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);
}
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;
}
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());
}
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);
}
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);
}
Aggregations