summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Pielmann2012-12-20 07:44:56 (EST)
committerStephan Born2013-01-25 12:36:49 (EST)
commit735642d6b1918285b20d8c7cdd88a39b1f67d157 (patch)
tree59a63afcafe3f73fb21e1d53e140f578ac2bd1ec
parent007c15362659b165548744e1b0f190b4d7fafdfb (diff)
downloadorg.eclipse.stardust.ui.web-735642d6b1918285b20d8c7cdd88a39b1f67d157.zip
org.eclipse.stardust.ui.web-735642d6b1918285b20d8c7cdd88a39b1f67d157.tar.gz
org.eclipse.stardust.ui.web-735642d6b1918285b20d8c7cdd88a39b1f67d157.tar.bz2
Jira-ID: CRNT-27424 Pepper: External Packages and Filereferences not removed from XPDL correctly when Structured Data changed to local reference
git-svn-id: http://emeafrazerg/svn/ipp/product/trunk/stardust/ui.web@61688 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b
-rw-r--r--web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/marshaling/ModelElementMarshaller.java106
1 files changed, 54 insertions, 52 deletions
diff --git a/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/marshaling/ModelElementMarshaller.java b/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/marshaling/ModelElementMarshaller.java
index c80e083..626432b 100644
--- a/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/marshaling/ModelElementMarshaller.java
+++ b/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/marshaling/ModelElementMarshaller.java
@@ -269,60 +269,62 @@ public abstract class ModelElementMarshaller implements ModelMarshaller
DataTypeType dataType = formalParameter.getDataType();
ModelType model = ModelUtils.findContainingModel(formalParameter);
+ if (model != null) {
+ if (dataType.getCarnotType()
+ .equals(ModelerConstants.STRUCTURED_DATA_TYPE_KEY))
+ {
+ formalParameterJson.addProperty(ModelerConstants.DATA_TYPE_PROPERTY,
+ ModelerConstants.STRUCTURED_DATA_TYPE_KEY);
- if (dataType.getCarnotType()
- .equals(ModelerConstants.STRUCTURED_DATA_TYPE_KEY))
- {
- formalParameterJson.addProperty(ModelerConstants.DATA_TYPE_PROPERTY,
- ModelerConstants.STRUCTURED_DATA_TYPE_KEY);
+ String typeDeclarationId = dataType.getDeclaredType().getId();
- String typeDeclarationId = dataType.getDeclaredType().getId();
+ TypeDeclarationType typeDeclaration = model.getTypeDeclarations()
+ .getTypeDeclaration(typeDeclarationId);
- TypeDeclarationType typeDeclaration = model.getTypeDeclarations()
- .getTypeDeclaration(typeDeclarationId);
+ String fullId = getModelBuilderFacade().createFullId(model,
+ typeDeclaration);
- String fullId = getModelBuilderFacade().createFullId(model,
- typeDeclaration);
+ formalParameterJson.addProperty(
+ ModelerConstants.STRUCTURED_DATA_TYPE_FULL_ID_PROPERTY, fullId);
+ }
+ else if (dataType.getCarnotType().equals(
+ ModelerConstants.DOCUMENT_DATA_TYPE_KEY))
+ {
+ formalParameterJson.addProperty(ModelerConstants.DATA_TYPE_PROPERTY,
+ ModelerConstants.DOCUMENT_DATA_TYPE_KEY);
- formalParameterJson.addProperty(
- ModelerConstants.STRUCTURED_DATA_TYPE_FULL_ID_PROPERTY, fullId);
- }
- else if (dataType.getCarnotType().equals(
- ModelerConstants.DOCUMENT_DATA_TYPE_KEY))
- {
- formalParameterJson.addProperty(ModelerConstants.DATA_TYPE_PROPERTY,
- ModelerConstants.DOCUMENT_DATA_TYPE_KEY);
+ String typeDeclarationId = dataType.getDeclaredType().getId();
- String typeDeclarationId = dataType.getDeclaredType().getId();
+ TypeDeclarationType typeDeclaration = model.getTypeDeclarations()
+ .getTypeDeclaration(typeDeclarationId);
- TypeDeclarationType typeDeclaration = model.getTypeDeclarations()
- .getTypeDeclaration(typeDeclarationId);
+ String fullId = getModelBuilderFacade().createFullId(model,
+ typeDeclaration);
- String fullId = getModelBuilderFacade().createFullId(model,
- typeDeclaration);
+ formalParameterJson.addProperty(
+ ModelerConstants.STRUCTURED_DATA_TYPE_FULL_ID_PROPERTY, fullId);
+ }
+ else if (dataType.getCarnotType().equals(
+ ModelerConstants.PRIMITIVE_DATA_TYPE_KEY))
+ {
+ formalParameterJson.addProperty(ModelerConstants.DATA_TYPE_PROPERTY,
+ ModelerConstants.PRIMITIVE_DATA_TYPE_KEY);
+ String type = mapPrimitiveTypes(formalParameter.getDataType()
+ .getBasicType()
+ .getType()
+ .getLiteral());
+ formalParameterJson.addProperty(
+ ModelerConstants.PRIMITIVE_DATA_TYPE_PROPERTY, type);
+ }
+ FormalParameterMappingsType mappingsType = processDefinition.getFormalParameterMappings();
+ if (mappingsType != null)
+ {
+ DataType data = mappingsType.getMappedData(formalParameter);
+ String fullID = getModelBuilderFacade().createFullId(model, data);
+ formalParameterJson.addProperty(ModelerConstants.DATA_FULL_ID_PROPERTY,
+ fullID);
+ }
- formalParameterJson.addProperty(
- ModelerConstants.STRUCTURED_DATA_TYPE_FULL_ID_PROPERTY, fullId);
- }
- else if (dataType.getCarnotType().equals(
- ModelerConstants.PRIMITIVE_DATA_TYPE_KEY))
- {
- formalParameterJson.addProperty(ModelerConstants.DATA_TYPE_PROPERTY,
- ModelerConstants.PRIMITIVE_DATA_TYPE_KEY);
- String type = mapPrimitiveTypes(formalParameter.getDataType()
- .getBasicType()
- .getType()
- .getLiteral());
- formalParameterJson.addProperty(
- ModelerConstants.PRIMITIVE_DATA_TYPE_PROPERTY, type);
- }
- FormalParameterMappingsType mappingsType = processDefinition.getFormalParameterMappings();
- if (mappingsType != null)
- {
- DataType data = mappingsType.getMappedData(formalParameter);
- String fullID = getModelBuilderFacade().createFullId(model, data);
- formalParameterJson.addProperty(ModelerConstants.DATA_FULL_ID_PROPERTY,
- fullID);
}
}
}
@@ -441,9 +443,9 @@ public abstract class ModelElementMarshaller implements ModelMarshaller
if ( !StringUtils.isEmpty(roleUri))
{
ModelType model = ModelUtils.findContainingModel(laneSymbol);
-
+
ModelType referencedModel = null;
-
+
if(model != null)
{
URI createURI = URI.createURI(roleUri);
@@ -451,7 +453,7 @@ public abstract class ModelElementMarshaller implements ModelMarshaller
+ createURI.authority() + "/"; //$NON-NLS-1$
referencedModel = ModelUtils.getReferencedModelByURI(model, uri);
}
-
+
if (referencedModel != null)
{
String roleId = getModelBuilderFacade().createFullId(referencedModel,
@@ -1171,7 +1173,7 @@ public abstract class ModelElementMarshaller implements ModelMarshaller
if (!StringUtils.isEmpty(dataUri))
{
ModelType referencedModel = null;
-
+
if(model != null)
{
URI createURI = URI.createURI(dataUri);
@@ -1179,7 +1181,7 @@ public abstract class ModelElementMarshaller implements ModelMarshaller
+ createURI.authority() + "/"; //$NON-NLS-1$
referencedModel = ModelUtils.getReferencedModelByURI(model, uri);
}
-
+
if(referencedModel != null)
{
String dataId = getModelBuilderFacade().createFullId(referencedModel, data);
@@ -1407,7 +1409,7 @@ public abstract class ModelElementMarshaller implements ModelMarshaller
if (!StringUtils.isEmpty(roleUri))
{
ModelType referencedModel = null;
-
+
if(model != null)
{
URI createURI = URI.createURI(roleUri);
@@ -1415,7 +1417,7 @@ public abstract class ModelElementMarshaller implements ModelMarshaller
+ createURI.authority() + "/"; //$NON-NLS-1$
referencedModel = ModelUtils.getReferencedModelByURI(model, uri);
}
-
+
if(referencedModel != null)
{
String roleId = getModelBuilderFacade().createFullId(referencedModel, role);