Author: bbrodt
Date: 2011-02-04 13:32:19 -0500 (Fri, 04 Feb 2011)
New Revision: 29015
Modified:
trunk/bpel/plugins/org.eclipse.bpel.model/src/org/eclipse/bpel/model/extensions/BPELActivityDeserializer.java
trunk/bpel/plugins/org.eclipse.bpel.model/src/org/eclipse/bpel/model/resource/BPELReader.java
trunk/bpel/plugins/org.eclipse.bpel.model/src/org/eclipse/bpel/model/util/ReconciliationBPELReader.java
trunk/bpel/plugins/org.eclipse.bpel.model/src/org/eclipse/bpel/model/util/ReconciliationHelper.java
Log:
https://issues.jboss.org/browse/JBIDE-8132
Patch copied from
eclipse.org/bpel code line.
See also
https://bugs.eclipse.org/bugs/show_bug.cgi?id=332926 and
https://bugs.eclipse.org/bugs/show_bug.cgi?id=334424
Modified:
trunk/bpel/plugins/org.eclipse.bpel.model/src/org/eclipse/bpel/model/extensions/BPELActivityDeserializer.java
===================================================================
---
trunk/bpel/plugins/org.eclipse.bpel.model/src/org/eclipse/bpel/model/extensions/BPELActivityDeserializer.java 2011-02-04
17:33:33 UTC (rev 29014)
+++
trunk/bpel/plugins/org.eclipse.bpel.model/src/org/eclipse/bpel/model/extensions/BPELActivityDeserializer.java 2011-02-04
18:32:19 UTC (rev 29015)
@@ -31,6 +31,9 @@
/**
* This method deserializes elements into instances of classes
* which implement the Activity interface.
+ *
https://bugs.eclipse.org/bugs/show_bug.cgi?id=334424
+ *
https://issues.jboss.org/browse/JBIDE-8132
+ * Client needs to use the activity if not null
*/
- public Activity unmarshall(QName elementType, Node node, Process process, Map nsMap,
ExtensionRegistry extReg, URI uri, BPELReader bpelReader);
+ public Activity unmarshall(QName elementType, Node node, Activity activity, Process
process, Map nsMap, ExtensionRegistry extReg, URI uri, BPELReader bpelReader);
}
Modified:
trunk/bpel/plugins/org.eclipse.bpel.model/src/org/eclipse/bpel/model/resource/BPELReader.java
===================================================================
---
trunk/bpel/plugins/org.eclipse.bpel.model/src/org/eclipse/bpel/model/resource/BPELReader.java 2011-02-04
17:33:33 UTC (rev 29014)
+++
trunk/bpel/plugins/org.eclipse.bpel.model/src/org/eclipse/bpel/model/resource/BPELReader.java 2011-02-04
18:32:19 UTC (rev 29015)
@@ -2352,48 +2352,50 @@
/**
* Converts an XML extensionactivity element to a BPEL ExtensionActivity object.
*/
- protected Activity xml2ExtensionActivity(Element extensionActivityElement) {
- // Do not call setStandardAttributes here because extensionActivityElement
- // doesn't have them.
+ protected Activity xml2ExtensionActivity(Element extensionActivityElement) {
+ // Do not call setStandardAttributes here because extensionActivityElement
+ // doesn't have them.
+ Activity extensionActivity = BPELFactory.eINSTANCE.createExtensionActivity();
+
+ // Find the child element.
+ List<Element> nodeList = getChildElements(extensionActivityElement);
+
+ if (nodeList.size() == 1) {
+ Element child = nodeList.get(0);
+ // We found a child element. Look up a deserializer for this
+ // activity and call it.
+ String localName = child.getLocalName();
+ String namespace = child.getNamespaceURI();
+ QName qname = new QName(namespace, localName);
+ BPELActivityDeserializer deserializer =
extensionRegistry.getActivityDeserializer(qname);
+ if (deserializer != null) {
+ // Deserialize the DOM element and return the new Activity
+ Map<String,String> nsMap = getAllNamespacesForElement(child);
+ //
https://bugs.eclipse.org/bugs/show_bug.cgi?id=334424
+ //
https://issues.jboss.org/browse/JBIDE-8132
+ extensionActivity =
deserializer.unmarshall(qname,child,extensionActivity,process,nsMap,extensionRegistry,
getResource().getURI(), this);
+ // Now let's do the standard attributes and elements
+ setStandardAttributes(child, extensionActivity);
+ setStandardElements(child, extensionActivity);
+
+ // Don't do extensibility because extensionActivity is not extensible.
+ // If individual extensionActivity subclasses are actually extensible, they
+ // have to do this themselves in their deserializer.
+
+ // The created Activity that extends from ExtensioActivity should get the
+ // whole <extensionActivity>-DOM-Fragment, this is done here.
+ extensionActivity.setElement(extensionActivityElement);
+ return extensionActivity;
+ }
+ }
+ // Fallback is to create a new extensionActivity.
+ // Bugzilla 324115
+ setStandardAttributes(extensionActivityElement, extensionActivity);
+ setStandardElements(extensionActivityElement, extensionActivity);
+ extensionActivity.setElement(extensionActivityElement);
+ return extensionActivity;
+ }
- // Find the child element.
- List<Element> nodeList = getChildElements(extensionActivityElement);
-
- if (nodeList.size() == 1) {
- Element child = nodeList.get(0);
- // We found a child element. Look up a deserializer for this
- // activity and call it.
- String localName = child.getLocalName();
- String namespace = child.getNamespaceURI();
- QName qname = new QName(namespace, localName);
- BPELActivityDeserializer deserializer =
extensionRegistry.getActivityDeserializer(qname);
- if (deserializer != null) {
- // Deserialize the DOM element and return the new Activity
- Map<String,String> nsMap = getAllNamespacesForElement(child);
- Activity activity =
deserializer.unmarshall(qname,child,process,nsMap,extensionRegistry,getResource().getURI(),
this);
- // Now let's do the standard attributes and elements
- setStandardAttributes(child, activity);
- setStandardElements(child, activity);
-
- // Don't do extensibility because extensionActivity is not extensible.
- // If individual extensionActivity subclasses are actually extensible, they
- // have to do this themselves in their deserializer.
-
- // The created Activity that extends from ExtensioActivity should get the
- // whole <extensionActivity>-DOM-Fragment, this is done here.
- activity.setElement(extensionActivityElement);
- return activity;
- }
- }
- // Fallback is to create a new extensionActivity.
- //
https://jira.jboss.org/browse/JBIDE-6917
- Activity activity = BPELFactory.eINSTANCE.createExtensionActivity();
- setStandardAttributes(extensionActivityElement, activity);
- setStandardElements(extensionActivityElement, activity);
- activity.setElement(extensionActivityElement);
- return activity;
- }
-
/**
* Converts an XML wait element to a BPEL Wait object.
Modified:
trunk/bpel/plugins/org.eclipse.bpel.model/src/org/eclipse/bpel/model/util/ReconciliationBPELReader.java
===================================================================
---
trunk/bpel/plugins/org.eclipse.bpel.model/src/org/eclipse/bpel/model/util/ReconciliationBPELReader.java 2011-02-04
17:33:33 UTC (rev 29014)
+++
trunk/bpel/plugins/org.eclipse.bpel.model/src/org/eclipse/bpel/model/util/ReconciliationBPELReader.java 2011-02-04
18:32:19 UTC (rev 29015)
@@ -1757,11 +1757,13 @@
} else if (localName.equals("rethrow")) {
activity = xml2Rethrow(activity, activityElement);
} else if (localName.equals("extensionActivity")) {
- // extensionActivity is a special case. It does not have any
- // standard
- // attributes or elements, nor is it an extensible element.
- // Return immediately.
- activity = xml2ExtensionActivity(activityElement);
+ // extensionActivity is a special case. It does not have any
+ // standard attributes or elements, nor is it an extensible
+ // element. Return immediately.
+ //
https://bugs.eclipse.org/bugs/show_bug.cgi?id=334424
+ //
https://issues.jboss.org/browse/JBIDE-8132
+ // Need to pass the activity in to the deserializer
+ activity = xml2ExtensionActivity(activity,activityElement);
return activity;
} else if (localName.equals("opaqueActivity")) {
activity = xml2OpaqueActivity(activity, activityElement);
@@ -2689,9 +2691,10 @@
/**
* Converts an XML extensionactivity element to a BPEL ExtensionActivity
- * object.
+ * object.
*/
- protected Activity xml2ExtensionActivity(Element extensionActivityElement) {
+ protected Activity xml2ExtensionActivity(Activity extensionActivity,
+ Element extensionActivityElement) {
// Do not call setStandardAttributes here because
// extensionActivityElement
// doesn't have them.
@@ -2710,27 +2713,29 @@
.getActivityDeserializer(qname);
if (deserializer != null) {
// Deserialize the DOM element and return the new Activity
- Map<String, String> nsMap = getAllNamespacesForElement(child);
- Activity activity = deserializer.unmarshall(qname, child,
- process, nsMap, extensionRegistry, getResource()
+ Map<String, String> nsMap = getAllNamespacesForElement(child);
+ //
https://bugs.eclipse.org/bugs/show_bug.cgi?id=334424
+ //
https://issues.jboss.org/browse/JBIDE-8132
+ // pass the activity that was already created to the serializer
+ extensionActivity = deserializer.unmarshall(qname, child,
+ extensionActivity, process, nsMap, extensionRegistry, getResource()
.getURI(), this);
- // Now let's do the standard attributes and elements
- setStandardAttributes(child, activity);
- setStandardElements(child, activity);
-
- // Don't do extensibility because extensionActivity is not
- // extensible.
- // If individual extensionActivity subclasses are actually
- // extensible, they
- // have to do this themselves in their deserializer.
-
- // The created Activity that extends from ExtensioActivity
- // should get the
- // whole <extensionActivity>-DOM-Fragment, this is done here.
- activity.setElement(extensionActivityElement);
-
- return activity;
+ setStandardAttributes(child, extensionActivity);
+ setStandardElements(child, extensionActivity);
+
+ // Don't do extensibility because extensionActivity is not
+ // extensible.
+ // If individual extensionActivity subclasses are actually
+ // extensible, they
+ // have to do this themselves in their deserializer.
+
+ // The created Activity that extends from ExtensioActivity
+ // should get the
+ // whole <extensionActivity>-DOM-Fragment, this is done here.
+ extensionActivity.setElement(extensionActivityElement);
+
+ return extensionActivity;
}
}
// Fallback is to create a new extensionActivity.
Modified:
trunk/bpel/plugins/org.eclipse.bpel.model/src/org/eclipse/bpel/model/util/ReconciliationHelper.java
===================================================================
---
trunk/bpel/plugins/org.eclipse.bpel.model/src/org/eclipse/bpel/model/util/ReconciliationHelper.java 2011-02-04
17:33:33 UTC (rev 29014)
+++
trunk/bpel/plugins/org.eclipse.bpel.model/src/org/eclipse/bpel/model/util/ReconciliationHelper.java 2011-02-04
18:32:19 UTC (rev 29015)
@@ -215,6 +215,10 @@
//
https://issues.jboss.org/browse/JBIDE-8048
// this was left out inadevertently
reader.xml2CompensationHandler((CompensationHandler)element, changedElement);
+ } else if (element instanceof ExtensibleElement){
+ //
https://bugs.eclipse.org/bugs/show_bug.cgi?id=334424
+ //
https://issues.jboss.org/browse/JBIDE-8132
+ reader.xml2ExtensibleElement((ExtensibleElement)element, changedElement);
} else {
System.err.println("Cannot reconcile: " + element.getClass());
// throw new NotImplementedException(element.getClass().toString());