protected String getResource() {
return "dataobjectmodel.bpmn";
}
private void validateModel(BpmnModel model) {
FlowElement flowElement = model.getMainProcess().getFlowElement("start1");
assertNotNull(flowElement);
assertTrue(flowElement instanceof StartEvent);
assertEquals("start1", flowElement.getId());
// verify the main process data objects
List<ValuedDataObject> dataObjects = model.getMainProcess().getDataObjects();
assertEquals(7, dataObjects.size());
Map<String, ValuedDataObject> objectMap = new HashMap<String, ValuedDataObject>();
for (ValuedDataObject valueObj : dataObjects) {
objectMap.put(valueObj.getId(), valueObj);
}
ValuedDataObject dataObj = objectMap.get("dObj1");
assertEquals("dObj1", dataObj.getId());
assertEquals("StringTest", dataObj.getName());
assertEquals("xsd:string", dataObj.getItemSubjectRef().getStructureRef());
dataObj = objectMap.get("dObj2");
assertEquals("BooleanTest", dataObj.getName());
assertEquals("xsd:boolean", dataObj.getItemSubjectRef().getStructureRef());
dataObj = objectMap.get("dObj3");
assertEquals("DateTest", dataObj.getName());
assertEquals("xsd:datetime", dataObj.getItemSubjectRef().getStructureRef());
dataObj = objectMap.get("dObj4");
assertEquals("DoubleTest", dataObj.getName());
assertEquals("xsd:double", dataObj.getItemSubjectRef().getStructureRef());
dataObj = objectMap.get("dObj5");
assertEquals("IntegerTest", dataObj.getName());
assertEquals("xsd:int", dataObj.getItemSubjectRef().getStructureRef());
dataObj = objectMap.get("dObj6");
assertEquals("LongTest", dataObj.getName());
assertEquals("xsd:long", dataObj.getItemSubjectRef().getStructureRef());
dataObj = objectMap.get("dObjWithoutType");
assertEquals("UnknownTypeTest", dataObj.getName());
assertEquals("xsd:string", dataObj.getItemSubjectRef().getStructureRef());
flowElement = model.getMainProcess().getFlowElement("userTask1");
assertNotNull(flowElement);
assertTrue(flowElement instanceof UserTask);
assertEquals("userTask1", flowElement.getId());
UserTask userTask = (UserTask) flowElement;
assertEquals("kermit", userTask.getAssignee());
flowElement = model.getMainProcess().getFlowElement("subprocess1");
assertNotNull(flowElement);
assertTrue(flowElement instanceof SubProcess);
assertEquals("subprocess1", flowElement.getId());
SubProcess subProcess = (SubProcess) flowElement;
assertEquals(11, subProcess.getFlowElements().size());
// verify the sub process data objects
dataObjects = subProcess.getDataObjects();