void assertGeneralSet(TaskGeneralSet generalSet, String nodeName, String documentation) { assertNotNull(generalSet); assertNotNull(generalSet.getName()); assertNotNull(generalSet.getDocumentation()); assertEquals(nodeName, generalSet.getName().getValue()); assertEquals(documentation, generalSet.getDocumentation().getValue()); } }
private PropertyWriter noneTask(Node<View<NoneTask>, ?> n) { Task task = bpmn2.createTask(); task.setId(n.getUUID()); NoneTask definition = n.getContent().getDefinition(); ActivityPropertyWriter p = propertyWriterFactory.of(task); TaskGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); p.setBounds(n.getContent().getBounds()); p.setSimulationSet(definition.getSimulationSet()); return p; } }
@Override public ServiceTask build() { final ServiceTask serviceTask = newInstance(); final String name = workItemDefinition.getName(); setProperties(workItemDefinition, serviceTask); serviceTask.getExecutionSet().getTaskName().setValue(name); serviceTask.getGeneral().getName().setValue(workItemDefinition.getDisplayName()); serviceTask.getGeneral().getDocumentation().setValue(workItemDefinition.getDocumentation()); serviceTask.setDescription(workItemDefinition.getDescription()); serviceTask.getDataIOSet() .getAssignmentsinfo() .setValue(workItemDefinition.getParameters() + workItemDefinition.getResults()); return serviceTask; }
@Test public void testBasicUnmarshall() throws Exception { Diagram<Graph, Metadata> d = unmarshall(newMarshaller, BPMN_SERVICE_TASK_PROPERTIES_FILE_PATH); Node<View<ServiceTask>, ?> node = d.getGraph().getNode(SERVICE_TASK_ID); ServiceTask definition = node.getContent().getDefinition(); assertEquals("Custom Email", definition.getGeneral().getName().getValue()); assertEquals("This is an email task", definition.getGeneral().getDocumentation().getValue()); }
private PropertyWriter scriptTask(Node<View<ScriptTask>, ?> n) { org.eclipse.bpmn2.ScriptTask task = bpmn2.createScriptTask(); task.setId(n.getUUID()); ScriptTask definition = n.getContent().getDefinition(); ScriptTaskPropertyWriter p = propertyWriterFactory.of(task); TaskGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); ScriptTaskExecutionSet executionSet = definition.getExecutionSet(); p.setScript(executionSet.getScript().getValue()); p.setAsync(executionSet.getIsAsync().getValue()); p.setSimulationSet(definition.getSimulationSet()); p.setBounds(n.getContent().getBounds()); return p; }
private PropertyWriter businessRuleTask(Node<View<BusinessRuleTask>, ?> n) { org.eclipse.bpmn2.BusinessRuleTask task = bpmn2.createBusinessRuleTask(); task.setId(n.getUUID()); BusinessRuleTask definition = n.getContent().getDefinition(); BusinessRuleTaskPropertyWriter p = propertyWriterFactory.of(task); TaskGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); BusinessRuleTaskExecutionSet executionSet = definition.getExecutionSet(); p.setAsync(executionSet.getIsAsync().getValue()); p.setOnEntryAction(executionSet.getOnEntryAction()); p.setOnExitAction(executionSet.getOnExitAction()); p.setAdHocAutostart(executionSet.getAdHocAutostart().getValue()); RuleLanguage ruleLanguage = executionSet.getRuleLanguage(); p.setImplementation(ruleLanguage); if (ruleLanguage.getValue().equals(RuleLanguage.DRL)) { p.setRuleFlowGroup(executionSet.getRuleFlowGroup()); } else if (ruleLanguage.getValue().equals(RuleLanguage.DMN)) { p.setNamespace(executionSet.getNamespace()); p.setDecisionName(executionSet.getDecisionName()); p.setDmnModelName(executionSet.getDmnModelName()); } p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo()); p.setSimulationSet(definition.getSimulationSet()); p.setBounds(n.getContent().getBounds()); return p; }
assertEquals("TaskTest", taskGeneral.getDocumentation().getValue());
@Test public void testBasicBidi() throws Exception { Diagram<Graph, Metadata> d = unmarshall(newMarshaller, BPMN_SERVICE_TASK_PROPERTIES_FILE_PATH); String marshall = newMarshaller.marshall(d); Diagram<Graph, Metadata> d2 = Unmarshalling.unmarshall(newMarshaller, new StringInputStream(marshall)); Node<View<ServiceTask>, ?> node = d2.getGraph().getNode(SERVICE_TASK_ID); ServiceTask definition = node.getContent().getDefinition(); assertEquals("Custom Email", definition.getGeneral().getName().getValue()); assertEquals("This is an email task", definition.getGeneral().getDocumentation().getValue()); } }
userTask1.getGeneral().getName().getValue()); assertEquals("Task1Documentation", userTask1.getGeneral().getDocumentation().getValue()); assertEquals(userTask1Node, GraphUtils.getDockParent(catchingEventNode).orElse(null)); userTask2.getGeneral().getName().getValue()); assertEquals("Task2Documentation", userTask2.getGeneral().getDocumentation().getValue());
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; }
email.getGeneral().getName().getValue()); assertEquals(WorkItemDefinitionMockRegistry.EMAIL.getDocumentation(), email.getGeneral().getDocumentation().getValue()); log.getGeneral().getName().getValue()); assertEquals(WorkItemDefinitionMockRegistry.LOG.getDocumentation(), log.getGeneral().getDocumentation().getValue());
email.getGeneral().getName().getValue()); assertEquals(WorkItemDefinitionMockRegistry.EMAIL.getDocumentation(), email.getGeneral().getDocumentation().getValue()); log.getGeneral().getName().getValue()); assertEquals(WorkItemDefinitionMockRegistry.LOG.getDocumentation(), log.getGeneral().getDocumentation().getValue());