ImportType importType = DroolsFactory.eINSTANCE.createImportType(); importType.setName(importParts[0]); if (process.getExtensionValues() == null || process.getExtensionValues().size() < 1) { ExtensionAttributeValue extensionElement = Bpmn2Factory.eINSTANCE.createExtensionAttributeValue(); process.getExtensionValues().add(extensionElement); process.getExtensionValues().get(0).getValue().add(extensionElementEntry); } else { Import imp = Bpmn2Factory.eINSTANCE.createImport(); if (process.getExtensionValues() == null || process.getExtensionValues().size() < 1) { ExtensionAttributeValue extensionElement = Bpmn2Factory.eINSTANCE.createExtensionAttributeValue(); process.getExtensionValues().add(extensionElement); process.getExtensionValues().get(0).getValue().add(extensionElementEntry); globalType.setIdentifier(globalParts[0]); globalType.setType(globalParts[1]); if (process.getExtensionValues() == null || process.getExtensionValues().size() < 1) { ExtensionAttributeValue extensionElement = Bpmn2Factory.eINSTANCE.createExtensionAttributeValue(); process.getExtensionValues().add(extensionElement); process.getExtensionValues().get(0).getValue().add(extensionElementEntry); } else if (globalParts.length == 1) { GlobalType globalType = DroolsFactory.eINSTANCE.createGlobalType(); globalType.setIdentifier(globalParts[0]); globalType.setType("Object"); if (process.getExtensionValues() == null || process.getExtensionValues().size() < 1) { ExtensionAttributeValue extensionElement = Bpmn2Factory.eINSTANCE.createExtensionAttributeValue();
private String getProcessExtensionValue(Process process, String propertyName) { List<ExtensionAttributeValue> extensionValues = process.getExtensionValues(); for (ExtensionAttributeValue extensionValue : extensionValues) { FeatureMap featureMap = extensionValue.getValue(); for (int i = 0; i < featureMap.size(); i++) { EStructuralFeatureImpl.SimpleFeatureMapEntry featureMapEntry = (EStructuralFeatureImpl.SimpleFeatureMapEntry) featureMap.get(i); MetaDataType featureMapValue = (MetaDataType) featureMapEntry.getValue(); if (propertyName.equals(featureMapValue.getName())) { return featureMapValue.getMetaValue(); } } } return ""; }
private String getProcessExtensionValue(Process process, String propertyName) { List<ExtensionAttributeValue> extensionValues = process.getExtensionValues(); for (ExtensionAttributeValue extensionValue : extensionValues) { FeatureMap featureMap = extensionValue.getValue(); for (int i = 0; i < featureMap.size(); i++) { EStructuralFeatureImpl.SimpleFeatureMapEntry featureMapEntry = (EStructuralFeatureImpl.SimpleFeatureMapEntry) featureMap.get(i); MetaDataType featureMapValue = (MetaDataType) featureMapEntry.getValue(); if (propertyName.equals(featureMapValue.getName())) { return featureMapValue.getMetaValue(); } } } return ""; }