@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()); }
@Test @SuppressWarnings("unchecked") public void testUnmarshallUserTaskAssignees() throws Exception { Diagram<Graph, Metadata> diagram = unmarshall(BPMN_USERTASKASSIGNEES); assertDiagram(diagram, 6); assertEquals("UserGroups", diagram.getMetadata().getTitle()); UserTask userTask = findContent(diagram, UserTask.class); UserTaskExecutionSet executionSet = userTask.getExecutionSet(); assertEquals("user,user1", executionSet.getActors().getValue()); assertEquals("admin,kiemgmt", executionSet.getGroupid().getValue()); }
assertEquals("TaskTest", executionSet.getSubject().getValue()); assertEquals("TaskTest", executionSet.getActors().getValue()); assertEquals("TaskTest", executionSet.getGroupid().getValue()); assertEquals("5", executionSet.getPriority().getValue()); assertEquals("TaskTest", executionSet.getDescription().getValue());
private PropertyWriter userTask(Node<View<UserTask>, ?> n) { org.eclipse.bpmn2.UserTask task = bpmn2.createUserTask(); task.setId(n.getUUID()); UserTask definition = n.getContent().getDefinition(); UserTaskPropertyWriter p = propertyWriterFactory.of(task); TaskGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); p.setSimulationSet(definition.getSimulationSet()); UserTaskExecutionSet executionSet = definition.getExecutionSet(); p.setTaskName(executionSet.getTaskName().getValue()); p.setActors(executionSet.getActors()); p.setAssignmentsInfo(executionSet.getAssignmentsinfo()); p.setSkippable(executionSet.getSkippable().getValue()); p.setGroupId(executionSet.getGroupid().getValue()); p.setSubject(executionSet.getSubject().getValue()); p.setDescription(executionSet.getDescription().getValue()); p.setPriority(executionSet.getPriority().getValue()); p.setAsync(executionSet.getIsAsync().getValue()); p.setCreatedBy(executionSet.getCreatedBy().getValue()); p.setAdHocAutostart(executionSet.getAdHocAutostart().getValue()); p.setOnEntryAction(executionSet.getOnEntryAction()); p.setOnExitAction(executionSet.getOnExitAction()); p.setContent(executionSet.getContent().getValue()); p.setSLADueDate(executionSet.getSlaDueDate().getValue()); p.setBounds(n.getContent().getBounds()); return p; }
assertEquals(subject, executionSet.getSubject().getValue()); assertEquals(actors, executionSet.getActors().getValue()); assertEquals(groupId, executionSet.getGroupid().getValue()); assertEquals(isAsync, executionSet.getIsAsync().getValue()); assertEquals(skippable, executionSet.getSkippable().getValue());