Author: Grid.Qian
Date: 2010-11-09 00:54:52 -0500 (Tue, 09 Nov 2010)
New Revision: 26349
Modified:
trunk/bpel/plugins/org.eclipse.bpel.model/src/org/eclipse/bpel/model/util/ReconciliationHelper.java
Log:
JBIDE-7504: fix the NPE when create a eventhandler for a scope
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 2010-11-09
05:49:18 UTC (rev 26348)
+++
trunk/bpel/plugins/org.eclipse.bpel.model/src/org/eclipse/bpel/model/util/ReconciliationHelper.java 2010-11-09
05:54:52 UTC (rev 26349)
@@ -1005,16 +1005,14 @@
reconcile(th, th.getElement());
System.err.println("TerminationHandler patch ok");
} else if (child instanceof OnEvent) {
-
+
} else if (child instanceof OnAlarm) {
- Activity activity = ((OnAlarm) child).getActivity();
- if(((OnAlarm) child).getActivity() != null) {
- Element childElement = ((WSDLElement)activity).getElement();
- if (childElement == null) {
- childElement =
ElementFactory.getInstance().createElement(((ExtensibleElement)activity), child);
- ((ExtensibleElement)activity).setElement(childElement);
- }
- }
+ // fix
https://jira.jboss.org/browse/JBIDE-7480
+ OnAlarm o = (OnAlarm)child;
+ Activity a = o.getActivity();
+ Element s = ReconciliationHelper.getBPELChildElementByLocalName(o.getElement(),
BPELConstants.ND_SCOPE);
+ a.setElement(s);
+ reconcile(a, s);
} else if (child instanceof FaultHandler) {
FaultHandler c = (FaultHandler)child;
EList<Catch> _catch = c.getCatch();
@@ -1025,7 +1023,22 @@
reconcile(ch, catchElement);
}
System.err.println("FaultHandler patch ok");
- }
+ } else if (child instanceof EventHandler) {
+ // fix
https://jira.jboss.org/browse/JBIDE-7504
+ EventHandler e = (EventHandler)child;
+ EList<OnEvent> _onEvent = e.getEvents();
+ OnEvent on = _onEvent.get(0);
+ Element onElement =
ReconciliationHelper.getBPELChildElementByLocalName(e.getElement(),
BPELConstants.ND_ON_EVENT);
+ on.setElement(onElement);
+ reconcile(on, onElement);
+ } else if (child instanceof CompensationHandler) {
+ // fix
https://jira.jboss.org/browse/JBIDE-7504
+ CompensationHandler c = (CompensationHandler)child;
+ Activity a = c.getActivity();
+ Element s = ReconciliationHelper.getBPELChildElementByLocalName(c.getElement(),
BPELConstants.ND_SEQUENCE);
+ a.setElement(s);
+ reconcile(a, s);
+ }
}