1229386 Export fails with error “Unable to normalize unique ID due to activity diagram element
Added try-catch block for exception and added log messge in .logs
diff --git a/org.eclipse.epf.diagram.core/src/org/eclipse/epf/diagram/core/bridge/BridgeHelper.java b/org.eclipse.epf.diagram.core/src/org/eclipse/epf/diagram/core/bridge/BridgeHelper.java
index 3c7201d..ab285c4 100644
--- a/org.eclipse.epf.diagram.core/src/org/eclipse/epf/diagram/core/bridge/BridgeHelper.java
+++ b/org.eclipse.epf.diagram.core/src/org/eclipse/epf/diagram/core/bridge/BridgeHelper.java
@@ -424,24 +424,30 @@
// return null;
// }
- public static MethodElement getMethodElementFromAnnotation(EModelElement node, ResourceSet resourceSet) {
- EAnnotation eAnnotation = node.getEAnnotation(UMA_ELEMENT);
- if (eAnnotation != null) {
- String uri = (String) eAnnotation.getDetails().get(UMA_URI);
- if (uri != null) {
- EObject o = resourceSet.getEObject(
- URI.createURI(uri), false);
- if (o instanceof MethodElement) {
- return (MethodElement) o;
- } else {
- if(DEBUG) {
- System.err.println("Not a method element: " + o); //$NON-NLS-1$
- }
- }
- }
- }
- return null;
- }
+ public static MethodElement getMethodElementFromAnnotation(EModelElement node, ResourceSet resourceSet) {
+ EAnnotation eAnnotation = node.getEAnnotation(UMA_ELEMENT);
+ try {
+ if (eAnnotation != null) {
+ String uri = (String) eAnnotation.getDetails().get(UMA_URI);
+ if (uri != null) {
+ EObject o = resourceSet.getEObject(
+ URI.createURI(uri), false);
+ if (o instanceof MethodElement) {
+ return (MethodElement) o;
+ } else {
+ if(DEBUG) {
+ System.err.println("Not a method element: " + o); //$NON-NLS-1$
+ }
+ }
+ }
+ }
+ } catch (Exception e) {
+ DiagramCorePlugin.getDefault().getLogger().logError(e);
+ return null;
+ }
+
+ return null;
+ }
/**
* Gets the method element that the given diagram model object represents