| author | Rainer Pielmann | 2012-08-10 09:20:05 (EDT) |
|---|---|---|
| committer | Manik Kishore | 2012-08-10 09:20:05 (EDT) |
| commit | 6e9b9d1471c43fac4e51b3a16eef5090f3639d73 (patch) (side-by-side diff) | |
| tree | 2094d22641caf0c2dbe6d16b373f1bfc08dd32e9 | |
| parent | 80941338f8884e5aab538d6ccba7317baa6f35dd (diff) | |
| download | org.eclipse.stardust.ide-6e9b9d1471c43fac4e51b3a16eef5090f3639d73.zip org.eclipse.stardust.ide-6e9b9d1471c43fac4e51b3a16eef5090f3639d73.tar.gz org.eclipse.stardust.ide-6e9b9d1471c43fac4e51b3a16eef5090f3639d73.tar.bz2 | |
Jira-ID: CRNT-16871
Renaming a data does not automatically update department Id references in scoped organizations.
git-svn-id: http://emeafrazerg/svn/ipp/product/trunk/stardust/ide@58326 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b
2 files changed, 51 insertions, 15 deletions
diff --git a/model/org.eclipse.stardust.model.xpdl/src/org/eclipse/stardust/model/xpdl/carnot/util/ModelUtils.java b/model/org.eclipse.stardust.model.xpdl/src/org/eclipse/stardust/model/xpdl/carnot/util/ModelUtils.java index 4198b0d..5bc1d3d 100644 --- a/model/org.eclipse.stardust.model.xpdl/src/org/eclipse/stardust/model/xpdl/carnot/util/ModelUtils.java +++ b/model/org.eclipse.stardust.model.xpdl/src/org/eclipse/stardust/model/xpdl/carnot/util/ModelUtils.java @@ -880,6 +880,17 @@ public class ModelUtils } } + // resolve references for Organizations which are not part of ExtensionRegistry (see CRNT-16871) + if (extensible instanceof OrganizationType) + { + AttributeType attribute = AttributeUtil.getAttribute(extensible, + PredefinedConstants.BINDING_DATA_ID_ATT); + if (attribute != null) + { + setReference(attribute, model, "data"); //$NON-NLS-1$ + } + } + // resolve permissions // TODO: make permissions a first class element IAttributeCategory category = AttributeUtil.createAttributeCategory(extensible, "authorization"); //$NON-NLS-1$ diff --git a/modeling/org.eclipse.stardust.modeling.core/src/org/eclipse/stardust/modeling/core/properties/OrganizationRuntimeBindingPropertyPage.java b/modeling/org.eclipse.stardust.modeling.core/src/org/eclipse/stardust/modeling/core/properties/OrganizationRuntimeBindingPropertyPage.java index 8eaf603..9d06c72 100644 --- a/modeling/org.eclipse.stardust.modeling.core/src/org/eclipse/stardust/modeling/core/properties/OrganizationRuntimeBindingPropertyPage.java +++ b/modeling/org.eclipse.stardust.modeling.core/src/org/eclipse/stardust/modeling/core/properties/OrganizationRuntimeBindingPropertyPage.java @@ -10,13 +10,27 @@ *******************************************************************************/ package org.eclipse.stardust.modeling.core.properties; +import org.eclipse.emf.ecore.EObject;
import org.eclipse.jface.viewers.ArrayContentProvider; import org.eclipse.jface.viewers.ComboViewer; import org.eclipse.jface.viewers.ISelectionChangedListener; import org.eclipse.jface.viewers.SelectionChangedEvent; import org.eclipse.jface.viewers.StructuredSelection; import org.eclipse.jface.viewers.ViewerSorter; +import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Text;
+
import org.eclipse.stardust.engine.api.model.PredefinedConstants;
+import org.eclipse.stardust.model.xpdl.carnot.AttributeType;
import org.eclipse.stardust.model.xpdl.carnot.DataType; import org.eclipse.stardust.model.xpdl.carnot.DirectionType; import org.eclipse.stardust.model.xpdl.carnot.IExtensibleElement; @@ -38,17 +52,6 @@ import org.eclipse.stardust.modeling.core.ui.Data2DataPathModelAdapter2; import org.eclipse.stardust.modeling.core.ui.Data2DataPathWidgetAdapter2; import org.eclipse.stardust.modeling.core.utils.WidgetBindingManager; import org.eclipse.stardust.modeling.validation.Validation_Messages; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Group; -import org.eclipse.swt.widgets.Text; public class OrganizationRuntimeBindingPropertyPage extends AbstractModelElementPropertyPage @@ -149,7 +152,18 @@ public class OrganizationRuntimeBindingPropertyPage dataGroup.setVisible(selection); AttributeUtil.setBooleanAttribute((IExtensibleElement) getModelElement(), PredefinedConstants.BINDING_ATT, selection); - + if (selection)
+ {
+ ModelType modelType = (ModelType) getModelElement().eContainer();
+ AttributeUtil.setReference((IExtensibleElement) getModelElement(),
+ PredefinedConstants.BINDING_DATA_ID_ATT,
+ (EObject) modelType.getData().get(0));
+ }
+ else
+ {
+ AttributeUtil.setReference((IExtensibleElement) getModelElement(),
+ PredefinedConstants.BINDING_DATA_ID_ATT, null);
+ }
validate(null); } }); @@ -170,12 +184,23 @@ public class OrganizationRuntimeBindingPropertyPage { public void selectionChanged(SelectionChangedEvent event) { - if(event.getSelection() instanceof StructuredSelection) + if (event.getSelection() instanceof StructuredSelection)
{ Object element = ((StructuredSelection) event.getSelection()).getFirstElement(); - validate(element); + if (element != null)
+ {
+ AttributeType attributeType = AttributeUtil.getAttribute(
+ (IExtensibleElement) getModelElement(),
+ PredefinedConstants.BINDING_DATA_ID_ATT);
+ if ( !AttributeUtil.isReference(attributeType))
+ {
+ AttributeUtil.setReference((IExtensibleElement) getModelElement(),
+ PredefinedConstants.BINDING_DATA_ID_ATT, (EObject) element);
+ }
+ }
+ validate(element);
} - } + }
}); dataPathLabel = FormBuilder.createLabelWithRightAlignedStatus(dataGroup, |

