use of org.kie.workbench.common.stunner.bpmn.definition.property.reassignment.ReassignmentsInfo in project kie-wb-common by kiegroup.
the class ReassignmentPropertyWriterTest method addTwoNotCompletedReassignmentValue.
@Test
public void addTwoNotCompletedReassignmentValue() {
UserTaskPropertyWriter userTaskPropertyWriter = new UserTaskPropertyWriter(bpmn2.createUserTask(), variableScope, new HashSet<>());
ReassignmentsInfo reassignmentsInfo = new ReassignmentsInfo();
reassignmentsInfo.getValue().addValue(getReassignmentValue(AssociationType.NOT_COMPLETED_REASSIGN.getName()));
reassignmentsInfo.getValue().addValue(getReassignmentValue(AssociationType.NOT_COMPLETED_REASSIGN.getName()));
userTaskPropertyWriter.setReassignments(reassignmentsInfo);
String cdata = getReassignmentValue(AssociationType.NOT_COMPLETED_REASSIGN.getName()).toCDATAFormat();
CustomInput<String> notStartedNotify = getFieldValue(UserTaskPropertyWriter.class, userTaskPropertyWriter, "notCompletedReassign");
Assert.assertEquals(asCDATA(cdata + "^" + cdata), notStartedNotify.get());
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.reassignment.ReassignmentsInfo in project kie-wb-common by kiegroup.
the class TaskConverterPriorityTest method setPriorityMvel.
@Test
public void setPriorityMvel() {
propertyWriterFactory = new PropertyWriterFactory();
taskConverter = spy(new TaskConverter(propertyWriterFactory));
when(n.getContent()).thenReturn(view);
when(view.getBounds()).thenReturn(Bounds.create(0, 0, 10, 10));
when(view.getDefinition()).thenReturn(definition);
when(general.getName()).thenReturn(new Name("Name"));
when(general.getDocumentation()).thenReturn(new Documentation());
when(definition.getGeneral()).thenReturn(general);
when(definition.getSimulationSet()).thenReturn(new SimulationSet());
when(definition.getExecutionSet()).thenReturn(baseUserTaskExecutionSet);
when(baseUserTaskExecutionSet.getTaskName()).thenReturn(new TaskName("taskName"));
when(baseUserTaskExecutionSet.getActors()).thenReturn(new Actors());
when(baseUserTaskExecutionSet.getAssignmentsinfo()).thenReturn(new AssignmentsInfo());
when(baseUserTaskExecutionSet.getReassignmentsInfo()).thenReturn(new ReassignmentsInfo());
when(baseUserTaskExecutionSet.getNotificationsInfo()).thenReturn(new NotificationsInfo());
when(baseUserTaskExecutionSet.getSkippable()).thenReturn(new Skippable(true));
when(baseUserTaskExecutionSet.getGroupid()).thenReturn(new Groupid("groupId"));
when(baseUserTaskExecutionSet.getSubject()).thenReturn(new Subject());
when(baseUserTaskExecutionSet.getDescription()).thenReturn(new Description());
when(baseUserTaskExecutionSet.getPriority()).thenReturn(new TaskPriority("#{varOne}"));
when(baseUserTaskExecutionSet.getIsAsync()).thenReturn(new IsAsync(true));
when(baseUserTaskExecutionSet.getCreatedBy()).thenReturn(new CreatedBy());
when(baseUserTaskExecutionSet.getAdHocAutostart()).thenReturn(new AdHocAutostart());
when(baseUserTaskExecutionSet.getIsMultipleInstance()).thenReturn(new IsMultipleInstance(false));
when(baseUserTaskExecutionSet.getOnEntryAction()).thenReturn(new OnEntryAction(new ScriptTypeListValue().addValue(new ScriptTypeValue("java", ""))));
when(baseUserTaskExecutionSet.getOnExitAction()).thenReturn(new OnExitAction(new ScriptTypeListValue().addValue(new ScriptTypeValue("java", ""))));
when(baseUserTaskExecutionSet.getContent()).thenReturn(new Content());
when(baseUserTaskExecutionSet.getSlaDueDate()).thenReturn(new SLADueDate());
when(definition.getAdvancedData()).thenReturn(new AdvancedData(new MetaDataAttributes()));
doCallRealMethod().when(taskConverter).userTask(any());
final UserTaskPropertyWriter propertyWriter = (UserTaskPropertyWriter) taskConverter.userTask(n);
assertTrue(propertyWriter.getPriority().equals("<![CDATA[#{varOne}]]>"));
System.out.println("Priority: " + propertyWriter.getPriority());
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.reassignment.ReassignmentsInfo 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.ReassignmentsInfo in project kie-wb-common by kiegroup.
the class ReassignmentPropertyWriterTest method addOneNotStartedReassignmentValue.
@Test
public void addOneNotStartedReassignmentValue() {
UserTaskPropertyWriter userTaskPropertyWriter = new UserTaskPropertyWriter(bpmn2.createUserTask(), variableScope, new HashSet<>());
ReassignmentsInfo reassignmentsInfo = new ReassignmentsInfo();
reassignmentsInfo.getValue().addValue(getReassignmentValue(AssociationType.NOT_STARTED_REASSIGN.getName()));
userTaskPropertyWriter.setReassignments(reassignmentsInfo);
CustomInput<String> notStartedNotify = getFieldValue(UserTaskPropertyWriter.class, userTaskPropertyWriter, "notStartedReassign");
Assert.assertEquals(asCDATA(getReassignmentValue(AssociationType.NOT_STARTED_REASSIGN.getName()).toCDATAFormat()), notStartedNotify.get());
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.reassignment.ReassignmentsInfo in project kie-wb-common by kiegroup.
the class ReassignmentPropertyWriterTest method addTwoNotStartedReassignmentValue.
@Test
public void addTwoNotStartedReassignmentValue() {
UserTaskPropertyWriter userTaskPropertyWriter = new UserTaskPropertyWriter(bpmn2.createUserTask(), variableScope, new HashSet<>());
ReassignmentsInfo reassignmentsInfo = new ReassignmentsInfo();
reassignmentsInfo.getValue().addValue(getReassignmentValue(AssociationType.NOT_COMPLETED_REASSIGN.getName()));
reassignmentsInfo.getValue().addValue(getReassignmentValue(AssociationType.NOT_COMPLETED_REASSIGN.getName()));
userTaskPropertyWriter.setReassignments(reassignmentsInfo);
String cdata = getReassignmentValue(AssociationType.NOT_COMPLETED_REASSIGN.getName()).toCDATAFormat();
CustomInput<String> notStartedNotify = getFieldValue(UserTaskPropertyWriter.class, userTaskPropertyWriter, "notCompletedReassign");
Assert.assertEquals(asCDATA(cdata + "^" + cdata), notStartedNotify.get());
}
Aggregations