Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBob Brodt2014-06-27 13:38:20 -0400
committerBob Brodt2014-06-27 13:38:20 -0400
commit0c4970c9f77ccf352aeffb4c3444a62d073af3d6 (patch)
treee1934e17a81e0326ef740546fe64595562ea1172
parent4f74d2715a45d3b448001bd8d28ce5514bab46dd (diff)
downloadorg.eclipse.bpmn2-modeler-0c4970c9f77ccf352aeffb4c3444a62d073af3d6.tar.gz
org.eclipse.bpmn2-modeler-0c4970c9f77ccf352aeffb4c3444a62d073af3d6.tar.xz
org.eclipse.bpmn2-modeler-0c4970c9f77ccf352aeffb4c3444a62d073af3d6.zip
New value for extension attributes can not be null - use default value.
-rw-r--r--examples/plugins/org.eclipse.bpmn2.modeler.examples.dynamic/bpmnResources/.bpmn2config/CallActivityExtension.xml (renamed from examples/plugins/org.eclipse.bpmn2.modeler.examples.dynamic/bpmnResources/.bpmnconfig/CallActivityExtension.xml)0
-rw-r--r--examples/plugins/org.eclipse.bpmn2.modeler.examples.dynamic/bpmnResources/.bpmn2config/readme.txt (renamed from examples/plugins/org.eclipse.bpmn2.modeler.examples.dynamic/bpmnResources/.bpmnconfig/readme.txt)0
-rw-r--r--plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/model/ModelDecorator.java16
3 files changed, 12 insertions, 4 deletions
diff --git a/examples/plugins/org.eclipse.bpmn2.modeler.examples.dynamic/bpmnResources/.bpmnconfig/CallActivityExtension.xml b/examples/plugins/org.eclipse.bpmn2.modeler.examples.dynamic/bpmnResources/.bpmn2config/CallActivityExtension.xml
index cae7af99..cae7af99 100644
--- a/examples/plugins/org.eclipse.bpmn2.modeler.examples.dynamic/bpmnResources/.bpmnconfig/CallActivityExtension.xml
+++ b/examples/plugins/org.eclipse.bpmn2.modeler.examples.dynamic/bpmnResources/.bpmn2config/CallActivityExtension.xml
diff --git a/examples/plugins/org.eclipse.bpmn2.modeler.examples.dynamic/bpmnResources/.bpmnconfig/readme.txt b/examples/plugins/org.eclipse.bpmn2.modeler.examples.dynamic/bpmnResources/.bpmn2config/readme.txt
index 962e61fc..962e61fc 100644
--- a/examples/plugins/org.eclipse.bpmn2.modeler.examples.dynamic/bpmnResources/.bpmnconfig/readme.txt
+++ b/examples/plugins/org.eclipse.bpmn2.modeler.examples.dynamic/bpmnResources/.bpmn2config/readme.txt
diff --git a/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/model/ModelDecorator.java b/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/model/ModelDecorator.java
index e2eedc54..e3181a36 100644
--- a/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/model/ModelDecorator.java
+++ b/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/model/ModelDecorator.java
@@ -1073,6 +1073,9 @@ public class ModelDecorator {
EPackage pkg = ModelDecorator.getEPackage(namespace);
EDataType eDataType = (EDataType)ModelDecorator.findEClassifier(pkg, type);//(EDataType)EcorePackage.eINSTANCE.getEClassifier(type);
if (eDataType!=null) {
+ // value can not be null - use the default value instead
+ if (value==null)
+ value = eDataType.getEPackage().getEFactoryInstance().createFromString(eDataType,"");
if (attr==null) {
attr = createEAttribute(name, type, eclass.getName(), null);
anyMap.add( FeatureMapUtil.createEntry(attr, value) );
@@ -1094,11 +1097,16 @@ public class ModelDecorator {
anyMap.add( FeatureMapUtil.createEntry(attr, value) );
}
}
- else if (attr==null) {
- attr = createEAttribute(name, type, eclass.getName(), null);
- anyMap.add( FeatureMapUtil.createEntry(attr, value) );
- }
else {
+ if (attr==null) {
+ attr = createEAttribute(name, type, eclass.getName(), null);
+ }
+ if (value==null) {
+ if (attr.getEType() instanceof EDataType) {
+ eDataType = (EDataType) attr.getEType();
+ value = eDataType.getEPackage().getEFactoryInstance().createFromString(eDataType,"");
+ }
+ }
anyMap.add( FeatureMapUtil.createEntry(attr, value) );
}
return attr;

Back to the top