@Override protected Node<View<BPMNDefinition>, Edge> doBuild(final BuilderContext context) { final Node<View<BPMNDefinition>, Edge> node = super.doBuild(context); final ServiceTask serviceTask = (ServiceTask) node.getContent().getDefinition(); // Oryx handles the taskName property, use it for populating the service task. final String taskName = serviceTask.getExecutionSet().getTaskName().getValue(); final WorkItemDefinition workItemDefinition = workItemDefinitionRegistry.get().get(taskName); ServiceTaskFactory.ServiceTaskBuilder.setProperties(workItemDefinition, serviceTask); return node; } }
assertEquals("TaskTest", executionSet.getTaskName().getValue()); assertEquals("TaskTest", executionSet.getSubject().getValue()); assertEquals("TaskTest", executionSet.getActors().getValue());
userTaskExecutionSet.getTaskName().getValue()); assertEquals("true", userTaskExecutionSet.getIsAsync().getValue().toString());
userTaskExecutionSet.getTaskName().getValue()); assertEquals("true", userTaskExecutionSet.getIsAsync().getValue().toString());
private PropertyWriter serviceTask(Node<View<ServiceTask>, ?> n) { org.eclipse.bpmn2.Task task = bpmn2.createTask(); task.setId(n.getUUID()); ServiceTask definition = n.getContent().getDefinition(); ServiceTaskPropertyWriter p = propertyWriterFactory.of(task); p.setServiceTaskName(definition.getName()); TaskGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); p.setAssignmentsInfo( definition.getDataIOSet().getAssignmentsinfo()); ServiceTaskExecutionSet executionSet = definition.getExecutionSet(); p.setTaskName(executionSet.getTaskName().getValue()); p.setAsync(executionSet.getIsAsync().getValue()); p.setOnEntryAction(executionSet.getOnEntryAction()); p.setOnExitAction(executionSet.getOnExitAction()); p.setAdHocAutostart(executionSet.getAdHocAutostart().getValue()); p.setSimulationSet(definition.getSimulationSet()); p.setBounds(n.getContent().getBounds()); return p; }
@Test public void testBuild() { final ServiceTask serviceTask = tested.build(getWorkItemDefinitionName()); assertEquals(WID_NAME, serviceTask.getName()); assertEquals(WID_NAME, serviceTask.getTaskType().getRawType()); assertEquals(WID_NAME, serviceTask.getExecutionSet().getTaskName().getValue()); assertEquals(WID_CAT, serviceTask.getCategory()); assertEquals(WID_HANDLER, serviceTask.getDefaultHandler()); assertEquals(WID_DISP_NAME, serviceTask.getGeneral().getName().getValue()); assertEquals(WID_DOC, serviceTask.getGeneral().getDocumentation().getValue()); assertEquals(WID_DESC, serviceTask.getDescription()); assertEquals(WID_PARAMS + WID_RESULTS, serviceTask.getDataIOSet().getAssignmentsinfo().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(taskName, executionSet.getTaskName().getValue()); assertEquals(subject, executionSet.getSubject().getValue()); assertEquals(actors, executionSet.getActors().getValue());