summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSidharth Singh2012-11-21 09:04:59 (EST)
committer Sven Rottstock2012-11-21 09:04:59 (EST)
commit08926425286d81c608fcf5ea78346b000d111207 (patch)
treebe30e4e7d0721ce9b9fc703f9e1c96dfea5f4379
parent87de91d1382ed0f14572837ac1cfe008c1c7b878 (diff)
downloadorg.eclipse.stardust.ui.web-08926425286d81c608fcf5ea78346b000d111207.zip
org.eclipse.stardust.ui.web-08926425286d81c608fcf5ea78346b000d111207.tar.gz
org.eclipse.stardust.ui.web-08926425286d81c608fcf5ea78346b000d111207.tar.bz2
CRNT-26941
Made changes in ModelElementUnmarshaller for dataFlow reroute. git-svn-id: http://emeafrazerg/svn/ipp/product/trunk/stardust/ui.web@60994 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b
-rw-r--r--web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/marshaling/ModelElementUnmarshaller.java94
-rw-r--r--web-modeler/src/main/resources/META-INF/xhtml/js/m_diagram.js2
2 files changed, 54 insertions, 42 deletions
diff --git a/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/marshaling/ModelElementUnmarshaller.java b/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/marshaling/ModelElementUnmarshaller.java
index 36ece0f..42c531e 100644
--- a/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/marshaling/ModelElementUnmarshaller.java
+++ b/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/marshaling/ModelElementUnmarshaller.java
@@ -497,66 +497,78 @@ public abstract class ModelElementUnmarshaller implements ModelUnmarshaller
JsonObject dataFlowJson = dataFlowConnectionJson.getAsJsonObject(ModelerConstants.MODEL_ELEMENT_PROPERTY);
- if (dataFlowConnectionJson.has(ModelerConstants.FROM_ANCHOR_POINT_ORIENTATION_PROPERTY))
+ if (dataFlowJson.has(ModelerConstants.FROM_ANCHOR_POINT_ORIENTATION_PROPERTY))
{
- dataFlowConnection.setSourceAnchor(mapAnchorOrientation(extractInt(dataFlowConnectionJson,
+ dataFlowConnection.setSourceAnchor(mapAnchorOrientation(extractInt(dataFlowJson,
ModelerConstants.FROM_ANCHOR_POINT_ORIENTATION_PROPERTY)));
}
- if (dataFlowConnectionJson.has(ModelerConstants.TO_ANCHOR_POINT_ORIENTATION_PROPERTY))
+ if (dataFlowJson.has(ModelerConstants.TO_ANCHOR_POINT_ORIENTATION_PROPERTY))
{
- dataFlowConnection.setTargetAnchor(mapAnchorOrientation(extractInt(dataFlowConnectionJson,
+ dataFlowConnection.setTargetAnchor(mapAnchorOrientation(extractInt(dataFlowJson,
ModelerConstants.TO_ANCHOR_POINT_ORIENTATION_PROPERTY)));
}
- // Collect all data mappings between the activity and the data
+ // Mapping should be updated,if JSON contains mapping element
+ if (dataFlowJson.has(ModelerConstants.INPUT_DATA_MAPPING_PROPERTY)
+ || dataFlowJson.has(ModelerConstants.OUTPUT_DATA_MAPPING_PROPERTY))
+ {
+ // Collect all data mappings between the activity and the data
- List<DataMappingType> dataMappings = new ArrayList<DataMappingType>();
+ List<DataMappingType> dataMappings = new ArrayList<DataMappingType>();
- for (DataMappingType dataMapping : dataFlowConnection.getActivitySymbol()
- .getActivity()
- .getDataMapping())
- {
- if (dataMapping.getData()
- .getId()
- .equals(dataFlowConnection.getDataSymbol().getData().getId()))
+ for (DataMappingType dataMapping : dataFlowConnection.getActivitySymbol()
+ .getActivity()
+ .getDataMapping())
{
- dataMappings.add(dataMapping);
+ if (dataMapping.getData()
+ .getId()
+ .equals(dataFlowConnection.getDataSymbol().getData().getId()))
+ {
+ dataMappings.add(dataMapping);
+ }
}
- }
- // Delete all data mappings between the activity and the data
+ // Delete all data mappings between the activity and the data
- for (DataMappingType dataMapping : dataMappings)
- {
- dataFlowConnection.getActivitySymbol()
- .getActivity()
- .getDataMapping()
- .remove(dataMapping);
- dataFlowConnection.getDataSymbol()
- .getData()
- .getDataMappings()
- .remove(dataMapping);
- }
+ for (DataMappingType dataMapping : dataMappings)
+ {
+ dataFlowConnection.getActivitySymbol()
+ .getActivity()
+ .getDataMapping()
+ .remove(dataMapping);
+ dataFlowConnection.getDataSymbol()
+ .getData()
+ .getDataMappings()
+ .remove(dataMapping);
+ }
- // dataFlowJson holds an input and/or an output dataMappingJson; data mappings have to be created for both
+ // dataFlowJson holds an input and/or an output dataMappingJson; data mappings
+ // have to be created for both
- // Create input mapping
+ // Create input mapping
- if (dataFlowJson.has(ModelerConstants.INPUT_DATA_MAPPING_PROPERTY))
- {
- createDataMapping(dataFlowConnection.getActivitySymbol().getActivity(),
- dataFlowConnection.getDataSymbol().getData(), dataFlowJson, DirectionType.IN_LITERAL,
- dataFlowJson.getAsJsonObject(ModelerConstants.INPUT_DATA_MAPPING_PROPERTY));
- }
+ if (dataFlowJson.has(ModelerConstants.INPUT_DATA_MAPPING_PROPERTY))
+ {
+ createDataMapping(
+ dataFlowConnection.getActivitySymbol().getActivity(),
+ dataFlowConnection.getDataSymbol().getData(),
+ dataFlowJson,
+ DirectionType.IN_LITERAL,
+ dataFlowJson.getAsJsonObject(ModelerConstants.INPUT_DATA_MAPPING_PROPERTY));
+ }
- // Create output mapping
+ // Create output mapping
- if (dataFlowJson.has(ModelerConstants.OUTPUT_DATA_MAPPING_PROPERTY))
- {
- createDataMapping(dataFlowConnection.getActivitySymbol().getActivity(),
- dataFlowConnection.getDataSymbol().getData(), dataFlowJson, DirectionType.OUT_LITERAL,
- dataFlowJson.getAsJsonObject(ModelerConstants.OUTPUT_DATA_MAPPING_PROPERTY));
+ if (dataFlowJson.has(ModelerConstants.OUTPUT_DATA_MAPPING_PROPERTY))
+ {
+ createDataMapping(
+ dataFlowConnection.getActivitySymbol().getActivity(),
+ dataFlowConnection.getDataSymbol().getData(),
+ dataFlowJson,
+ DirectionType.OUT_LITERAL,
+ dataFlowJson.getAsJsonObject(ModelerConstants.OUTPUT_DATA_MAPPING_PROPERTY));
+ }
}
}
diff --git a/web-modeler/src/main/resources/META-INF/xhtml/js/m_diagram.js b/web-modeler/src/main/resources/META-INF/xhtml/js/m_diagram.js
index 88ff416..d22ccc2 100644
--- a/web-modeler/src/main/resources/META-INF/xhtml/js/m_diagram.js
+++ b/web-modeler/src/main/resources/META-INF/xhtml/js/m_diagram.js
@@ -452,7 +452,7 @@ define(
jQuery.data(document, "diagram")
.submitEditableArea(
$('textarea', this).val());
- },
+ }
}).css("font-family",
m_constants.DEFAULT_FONT_FAMILY).css(
"font-size", m_constants.DEFAULT_FONT_SIZE);