summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSidharth Singh2012-10-19 00:57:07 (EDT)
committer Manik Kishore2012-10-19 00:57:07 (EDT)
commitd2d69bca86a9f21ccdf38ca362c59c8ea53e523d (patch)
tree911e4dd1c91a50d4454d603138d5bd2848b18c44
parent766d20abb87cd1bc8244584fb595c55ee62c4f19 (diff)
downloadorg.eclipse.stardust.ui.web-d2d69bca86a9f21ccdf38ca362c59c8ea53e523d.zip
org.eclipse.stardust.ui.web-d2d69bca86a9f21ccdf38ca362c59c8ea53e523d.tar.gz
org.eclipse.stardust.ui.web-d2d69bca86a9f21ccdf38ca362c59c8ea53e523d.tar.bz2
Reverted the changes done for DataFlow.
git-svn-id: http://emeafrazerg/svn/ipp/product/trunk/stardust/ui.web@60171 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b
-rw-r--r--web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/marshaling/ModelElementUnmarshaller.java181
-rw-r--r--web-modeler/src/main/resources/META-INF/xhtml/js/m_connection.js31
-rw-r--r--web-modeler/src/main/resources/META-INF/xhtml/js/m_dataSymbol.js4
3 files changed, 82 insertions, 134 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 c74d37b..d670af4 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
@@ -25,7 +25,6 @@ import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.util.FeatureMapUtil;
import org.eclipse.stardust.common.CollectionUtils;
import org.eclipse.stardust.common.StringUtils;
-import org.eclipse.stardust.engine.api.model.PredefinedConstants;
import org.eclipse.stardust.engine.api.runtime.DmsUtils;
import org.eclipse.stardust.engine.api.runtime.Document;
import org.eclipse.stardust.engine.api.runtime.DocumentInfo;
@@ -36,7 +35,6 @@ import org.eclipse.stardust.model.xpdl.builder.common.AbstractElementBuilder;
import org.eclipse.stardust.model.xpdl.builder.strategy.ModelManagementStrategy;
import org.eclipse.stardust.model.xpdl.builder.utils.ModelBuilderFacade;
import org.eclipse.stardust.model.xpdl.builder.utils.ModelerConstants;
-import org.eclipse.stardust.model.xpdl.builder.utils.XpdlModelUtils;
import org.eclipse.stardust.model.xpdl.carnot.AccessPointType;
import org.eclipse.stardust.model.xpdl.carnot.ActivityImplementationType;
import org.eclipse.stardust.model.xpdl.carnot.ActivitySymbolType;
@@ -493,7 +491,19 @@ public abstract class ModelElementUnmarshaller implements ModelUnmarshaller
if (dataFlowJson.has(ModelerConstants.INPUT_DATA_MAPPING_PROPERTY)
|| dataFlowJson.has(ModelerConstants.OUTPUT_DATA_MAPPING_PROPERTY))
{
- updateDataMapping(dataFlowConnection, dataFlowJson);
+ for (DataMappingType dataMapping : dataFlowConnection.getActivitySymbol()
+ .getActivity()
+ .getDataMapping())
+ {
+ System.out.println("Data Mapping: " + dataMapping.getId());
+ System.out.println(" Direction: " + dataMapping.getDirection());
+
+ if (dataMapping.getData().getId().equals(
+ dataFlowConnection.getDataSymbol().getData().getId()))
+ {
+ updateDataMapping(dataFlowJson, dataMapping);
+ }
+ }
}
}
@@ -1706,138 +1716,77 @@ public abstract class ModelElementUnmarshaller implements ModelUnmarshaller
}
/**
- * Create new dataMapping when 1 dataMapping(IN) exist and user creates new(OUT)
- * between same 2 symbols
- *
- * @param activity
- * @param model
- * @param data
- * @return
- */
- private DataMappingType createDataMapping(ActivityType activity, ModelType model,
- DataType data)
- {
- long maxOid = XpdlModelUtils.getMaxUsedOid(model);
- DataMappingType newDataMapping = AbstractElementBuilder.F_CWM.createDataMappingType();
- newDataMapping.setElementOid(++maxOid);
- newDataMapping.setId(data.getId());
- newDataMapping.setName(data.getName());
- newDataMapping.setData(data);
- newDataMapping.setContext(PredefinedConstants.DEFAULT_CONTEXT);
- return newDataMapping;
- }
-
- /**
*
* @param dataFlowJson
* @param dataMapping
*/
- private void updateDataMapping(DataMappingConnectionType dataFlowConnection,
- JsonObject dataFlowJson)
+ private void updateDataMapping(JsonObject dataFlowJson, DataMappingType dataMapping)
{
- DataMappingType newDataMapping = null;
- DataMappingType currentDataMapping = null;
- boolean removeCurrentMapping = false;
- ActivitySymbolType activitySymbol = dataFlowConnection.getActivitySymbol();
- DataSymbolType dataSymbol = dataFlowConnection.getDataSymbol();
- ModelType model = ModelUtils.findContainingModel(dataFlowConnection.getDataSymbol());
- List<DataMappingType> activityMapping = activitySymbol.getActivity()
- .getDataMapping();
- for (DataMappingType dataMapping : activityMapping)
- {
- if (dataMapping.getData()
- .getId()
- .equals(dataFlowConnection.getDataSymbol().getData().getId()))
+ // If both IN-OUT mapping is present
+ if (dataFlowJson.has(ModelerConstants.INPUT_DATA_MAPPING_PROPERTY)
+ && dataFlowJson.has(ModelerConstants.OUTPUT_DATA_MAPPING_PROPERTY))
+ {
+ if (dataFlowJson.get(ModelerConstants.INPUT_DATA_MAPPING_PROPERTY).getAsBoolean()
+ && dataFlowJson.get(ModelerConstants.OUTPUT_DATA_MAPPING_PROPERTY)
+ .getAsBoolean())
{
-
- // In-Out mapping creation from canvas
- if (dataFlowJson.has(ModelerConstants.INPUT_DATA_MAPPING_PROPERTY)
- && dataFlowJson.has(ModelerConstants.OUTPUT_DATA_MAPPING_PROPERTY))
+ dataMapping.setDirection(DirectionType.INOUT_LITERAL);
+ }
+ }
+ // IN data mapping is updates
+ else if (dataFlowJson.has(ModelerConstants.INPUT_DATA_MAPPING_PROPERTY))
+ {
+ if (dataFlowJson.get(ModelerConstants.INPUT_DATA_MAPPING_PROPERTY).getAsBoolean())
+ {
+ // If OUT mapping was already set , update to IN-OUT mapping
+ if (dataMapping.getDirection().equals(DirectionType.OUT_LITERAL))
{
- if (dataFlowJson.get(ModelerConstants.INPUT_DATA_MAPPING_PROPERTY)
- .getAsBoolean()
- && dataFlowJson.get(ModelerConstants.OUTPUT_DATA_MAPPING_PROPERTY)
- .getAsBoolean())
- {
- newDataMapping = createDataMapping(activitySymbol.getActivity(), model,
- dataFlowConnection.getDataSymbol().getData());
- if (dataMapping.getDirection().equals(DirectionType.OUT_LITERAL))
- newDataMapping.setDirection(DirectionType.IN_LITERAL);
- else
- newDataMapping.setDirection(DirectionType.OUT_LITERAL);
- }
+ dataMapping.setDirection(DirectionType.INOUT_LITERAL);
}
-
- // In Data Mapping update from properties panel
- else if (dataFlowJson.has(ModelerConstants.INPUT_DATA_MAPPING_PROPERTY))
+ else
{
- if (dataFlowJson.get(ModelerConstants.INPUT_DATA_MAPPING_PROPERTY)
- .getAsBoolean())
- {
- // Create new mapping
- if (dataMapping.getDirection().equals(DirectionType.OUT_LITERAL))
- {
- newDataMapping = createDataMapping(activitySymbol.getActivity(),
- model, dataFlowConnection.getDataSymbol().getData());
- newDataMapping.setDirection(DirectionType.IN_LITERAL);
- }
- }
- else
- {
- // flag to remove exisiting IN mapping element
- if (dataMapping.getDirection().equals(DirectionType.IN_LITERAL))
- {
- removeCurrentMapping = true;
- currentDataMapping = dataMapping;
- }
- }
+ dataMapping.setDirection(DirectionType.IN_LITERAL);
}
-
- // Out Data Mapping update from properties panel.
- else if (dataFlowJson.has(ModelerConstants.OUTPUT_DATA_MAPPING_PROPERTY))
+ }
+ else
+ {
+ if (dataMapping.getDirection().equals(DirectionType.INOUT_LITERAL))
{
- if (dataFlowJson.get(ModelerConstants.OUTPUT_DATA_MAPPING_PROPERTY)
- .getAsBoolean())
- {
- // Create new mapping
- if (dataMapping.getDirection().equals(DirectionType.IN_LITERAL))
- {
- newDataMapping = createDataMapping(activitySymbol.getActivity(),
- model, dataFlowConnection.getDataSymbol().getData());
- newDataMapping.setDirection(DirectionType.OUT_LITERAL);
- }
- }
- else
- {
- // flag to remove exisiting IN mapping element
- if (dataMapping.getDirection().equals(DirectionType.OUT_LITERAL))
- {
- removeCurrentMapping = true;
- currentDataMapping = dataMapping;
- }
- }
+ dataMapping.setDirection(DirectionType.OUT_LITERAL);
}
-
- if (dataFlowJson.has(ModelerConstants.ACCESS_POINT_ID_PROPERTY))
+ }
+ }
+ // OUT data mapping is updates
+ else if (dataFlowJson.has(ModelerConstants.OUTPUT_DATA_MAPPING_PROPERTY))
+ {
+ if (dataFlowJson.get(ModelerConstants.OUTPUT_DATA_MAPPING_PROPERTY).getAsBoolean())
+ {
+ // If IN mapping was already set , update to IN-OUT mapping
+ if (dataMapping.getDirection().equals(DirectionType.IN_LITERAL))
+ {
+ dataMapping.setDirection(DirectionType.INOUT_LITERAL);
+ }
+ else
{
- dataMapping.setApplicationAccessPoint(dataFlowJson.get(
- ModelerConstants.ACCESS_POINT_ID_PROPERTY).getAsString());
- dataMapping.setContext(dataFlowJson.get(
- ModelerConstants.ACCESS_POINT_CONTEXT_PROPERTY).getAsString());
+ dataMapping.setDirection(DirectionType.OUT_LITERAL);
+ }
+ }
+ else
+ {
+ if (dataMapping.getDirection().equals(DirectionType.INOUT_LITERAL))
+ {
+ dataMapping.setDirection(DirectionType.IN_LITERAL);
}
}
}
- if (removeCurrentMapping && activityMapping.size() > 1)
- {
- dataSymbol.getData().getDataMappings().remove(currentDataMapping);
- activityMapping.remove(currentDataMapping);
- }
- if (newDataMapping != null)
+ if (dataFlowJson.has(ModelerConstants.ACCESS_POINT_ID_PROPERTY))
{
- activitySymbol.getActivity().getDataMapping().add(newDataMapping);
+ dataMapping.setApplicationAccessPoint(dataFlowJson.get(
+ ModelerConstants.ACCESS_POINT_ID_PROPERTY).getAsString());
+ dataMapping.setContext(dataFlowJson.get(
+ ModelerConstants.ACCESS_POINT_CONTEXT_PROPERTY).getAsString());
}
-
}
/**
diff --git a/web-modeler/src/main/resources/META-INF/xhtml/js/m_connection.js b/web-modeler/src/main/resources/META-INF/xhtml/js/m_connection.js
index f351ebd..ec6d67e 100644
--- a/web-modeler/src/main/resources/META-INF/xhtml/js/m_connection.js
+++ b/web-modeler/src/main/resources/META-INF/xhtml/js/m_connection.js
@@ -385,11 +385,11 @@ define(
this.diagram.process, data, activity);
if (this.fromModelElementType == m_constants.DATA) {
- this.modelElement.inputDataMapping = true;
- this.modelElement.outputDataMapping = false;
+ this.modelElement.inDataMapping = true;
+ this.modelElement.outDataMapping = false;
} else {
- this.modelElement.inputDataMapping = false;
- this.modelElement.outputDataMapping = true;
+ this.modelElement.inDataMapping = false;
+ this.modelElement.outDataMapping = true;
}
this.propertiesPanel = m_dataFlowPropertiesPanel
@@ -449,16 +449,15 @@ define(
updateConnection = dataSymbol.connections[n];
// This will be the case always, just cross
// verification for IN-OUT mapping
- if ((updateConnection.modelElement.inputDataMapping && this.modelElement.outputDataMapping)
- || (updateConnection.modelElement.outputDataMapping && this.modelElement.inputDataMapping)) {
- updateConnection.modelElement.inputDataMapping = true;
- updateConnection.modelElement.outputDataMapping = true;
+ if ((updateConnection.modelElement.inDataMapping && this.modelElement.outDataMapping)
+ || (updateConnection.modelElement.outDataMapping && this.modelElement.inDataMapping)) {
+ updateConnection.modelElement.inDataMapping = true;
+ updateConnection.modelElement.outDataMapping = true;
+ // While update only mapping change are required
var changes = {
modelElement : {
- toAnchorPointOrientation : this.toAnchorPoint.orientation,
- fromAnchorPointOrientation : this.fromAnchorPoint.orientation,
- inputDataMapping : updateConnection.modelElement.inputDataMapping,
- outputDataMapping : updateConnection.modelElement.outputDataMapping
+ inDataMapping : updateConnection.modelElement.inDataMapping,
+ outDataMapping : updateConnection.modelElement.outDataMapping
}
}
updateConnection.createUpdateCommand(changes);
@@ -818,13 +817,13 @@ define(
var connTemp = this.diagram.connections[n];
// For In-Mapping path will be from Data to Activity
// vice-versa for Out mapping
- if (connTemp.modelElement.inputDataMapping
- && connTemp.modelElement.outputDataMapping) {
+ if (connTemp.modelElement.inDataMapping
+ && connTemp.modelElement.outDataMapping) {
connTemp.path.attr("arrow-start",
"block-wide-long");
connTemp.path.attr("arrow-end",
"block-wide-long");
- } else if (connTemp.modelElement.inputDataMapping) {
+ } else if (connTemp.modelElement.inDataMapping) {
// When dataFlow modified from properties panel
// the From,To anchor point symbols to not change
if (connTemp.fromAnchorPoint.symbol.type == m_constants.ACTIVITY_SYMBOL) {
@@ -837,7 +836,7 @@ define(
connTemp.path.attr("arrow-end",
"block-wide-long");
}
- } else if (connTemp.modelElement.outputDataMapping) {
+ } else if (connTemp.modelElement.outDataMapping) {
if (connTemp.fromAnchorPoint.symbol.type == m_constants.DATA_SYMBOL) {
connTemp.path.attr("arrow-start",
"block-wide-long");
diff --git a/web-modeler/src/main/resources/META-INF/xhtml/js/m_dataSymbol.js b/web-modeler/src/main/resources/META-INF/xhtml/js/m_dataSymbol.js
index 58c92bf..6161ea0 100644
--- a/web-modeler/src/main/resources/META-INF/xhtml/js/m_dataSymbol.js
+++ b/web-modeler/src/main/resources/META-INF/xhtml/js/m_dataSymbol.js
@@ -319,8 +319,8 @@ define(
for ( var n in this.connections) {
var connection = this.connections[n];
if (null != connection.modelElement
- && connection.modelElement.inputDataMapping
- && connection.modelElement.outputDataMapping) {
+ && connection.modelElement.inDataMapping
+ && connection.modelElement.outDataMapping) {
if (connection.fromAnchorPoint.symbol.type == m_constants.ACTIVITY_SYMBOL) {
outMapping
.push(connection.fromAnchorPoint.symbol.oid);