use of org.kie.workbench.common.stunner.bpmn.definition.UserTask in project kie-wb-common by kiegroup.
the class ContextUtilsTest method testIsFormGenerationSupported.
@Test
public void testIsFormGenerationSupported() {
Assert.assertTrue(ContextUtils.isFormGenerationSupported(createNode(new UserTask())));
Assert.assertFalse(ContextUtils.isFormGenerationSupported(createNode(new ScriptTask())));
Assert.assertFalse(ContextUtils.isFormGenerationSupported(createNode(new BusinessRuleTask())));
Assert.assertFalse(ContextUtils.isFormGenerationSupported(createNode(new NoneTask())));
Assert.assertFalse(ContextUtils.isFormGenerationSupported(createNode(new StartNoneEvent())));
Assert.assertFalse(ContextUtils.isFormGenerationSupported(createNode(new EndNoneEvent())));
Assert.assertFalse(ContextUtils.isFormGenerationSupported(createNode(new ParallelGateway())));
}
use of org.kie.workbench.common.stunner.bpmn.definition.UserTask in project kie-wb-common by kiegroup.
the class BPMNDiagramMarshallerTest method testUnmarshallEvaluation.
@Test
@SuppressWarnings("unchecked")
public void testUnmarshallEvaluation() throws Exception {
Diagram<Graph, Metadata> diagram = unmarshall(BPMN_EVALUATION);
assertDiagram(diagram, 8);
assertEquals("Evaluation", diagram.getMetadata().getTitle());
Node<? extends View, ?> task1 = diagram.getGraph().getNode("_88233779-B395-4B8C-A086-9EF43698426C");
Node<? extends View, ?> task2 = diagram.getGraph().getNode("_AE5BF0DC-B720-4FDE-9499-5ED89D41FB1A");
Node<? extends View, ?> task3 = diagram.getGraph().getNode("_6063D302-9D81-4C86-920B-E808A45377C2");
assertTrue(task1.getContent().getDefinition() instanceof UserTask);
assertTrue(task2.getContent().getDefinition() instanceof UserTask);
assertTrue(task3.getContent().getDefinition() instanceof UserTask);
// Assert bounds.
Bounds task1Bounds = task1.getContent().getBounds();
Bounds.Bound task1ULBound = task1Bounds.getUpperLeft();
Bounds.Bound task1LRBound = task1Bounds.getLowerRight();
assertEquals(648d, task1ULBound.getX(), 0);
assertEquals(149d, task1ULBound.getY(), 0);
assertEquals(784d, task1LRBound.getX(), 0);
assertEquals(197d, task1LRBound.getY(), 0);
}
use of org.kie.workbench.common.stunner.bpmn.definition.UserTask in project kie-wb-common by kiegroup.
the class BPMNDiagramMarshallerTest method testUnmarshallUserTaskAssignees.
@Test
@SuppressWarnings("unchecked")
public void testUnmarshallUserTaskAssignees() throws Exception {
Diagram<Graph, Metadata> diagram = unmarshall(BPMN_USERTASKASSIGNEES);
assertDiagram(diagram, 6);
assertEquals("UserGroups", diagram.getMetadata().getTitle());
UserTaskExecutionSet executionSet = null;
Iterator<Element> it = nodesIterator(diagram);
while (it.hasNext()) {
Element element = it.next();
if (element.getContent() instanceof View) {
Object oDefinition = ((View) element.getContent()).getDefinition();
if (oDefinition instanceof UserTask) {
UserTask userTask = (UserTask) oDefinition;
executionSet = userTask.getExecutionSet();
break;
}
}
}
assertEquals("user,user1", executionSet.getActors().getValue());
assertEquals("admin,kiemgmt", executionSet.getGroupid().getValue());
}
use of org.kie.workbench.common.stunner.bpmn.definition.UserTask in project kie-wb-common by kiegroup.
the class UserTaskTest method testUserTaskNameValid.
@Test
public void testUserTaskNameValid() {
UserTask userTask = new UserTask.UserTaskBuilder().build();
userTask.getGeneral().setName(new Name(TASK_NAME_VALID));
Set<ConstraintViolation<UserTask>> violations = this.validator.validate(userTask);
assertTrue(violations.isEmpty());
}
use of org.kie.workbench.common.stunner.bpmn.definition.UserTask in project kie-wb-common by kiegroup.
the class UserTaskTest method testUserTaskNameEmpty.
@Test
public void testUserTaskNameEmpty() {
UserTask userTask = new UserTask.UserTaskBuilder().build();
userTask.getGeneral().setName(new Name(""));
Set<ConstraintViolation<UserTask>> violations = this.validator.validate(userTask);
assertTrue(violations.isEmpty());
}
Aggregations