summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSidharth Singh2012-08-16 04:53:48 (EDT)
committer Manik Kishore2012-08-16 04:53:48 (EDT)
commit3d9373a886d37b9d694a77929da610fbe5110345 (patch)
treeca72a45da0d3e66d7f8401d9df9da9801a8efe84
parent2de34891c19a633a3eb9c78c3026fe12fdd214e8 (diff)
downloadorg.eclipse.stardust.ui.web-3d9373a886d37b9d694a77929da610fbe5110345.zip
org.eclipse.stardust.ui.web-3d9373a886d37b9d694a77929da610fbe5110345.tar.gz
org.eclipse.stardust.ui.web-3d9373a886d37b9d694a77929da610fbe5110345.tar.bz2
Jira-ID: CRNT-25692
1)Made changes to delete server data first then remove the UI elements for delete operations. 2)Made change in MBFacade findDataMappingConnectionByModelOid() git-svn-id: http://emeafrazerg/svn/ipp/product/trunk/stardust/ui.web@58444 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b
-rw-r--r--web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/edit/diagram/node/ConnectionCommandHandler.java6
-rw-r--r--web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/marshaling/ModelElementMarshaller.java141
-rw-r--r--web-modeler/src/main/resources/META-INF/xhtml/js/m_activitySymbol.js2
-rw-r--r--web-modeler/src/main/resources/META-INF/xhtml/js/m_connection.js18
-rw-r--r--web-modeler/src/main/resources/META-INF/xhtml/js/m_dataSymbol.js2
-rw-r--r--web-modeler/src/main/resources/META-INF/xhtml/js/m_diagram.js20
-rw-r--r--web-modeler/src/main/resources/META-INF/xhtml/js/m_eventSymbol.js2
-rw-r--r--web-modeler/src/main/resources/META-INF/xhtml/js/m_gatewaySymbol.js2
-rw-r--r--web-modeler/src/main/resources/META-INF/xhtml/js/m_poolSymbol.js3
-rw-r--r--web-modeler/src/main/resources/META-INF/xhtml/js/m_swimlaneSymbol.js4
-rw-r--r--web-modeler/src/main/resources/META-INF/xhtml/js/m_symbol.js7
11 files changed, 124 insertions, 83 deletions
diff --git a/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/edit/diagram/node/ConnectionCommandHandler.java b/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/edit/diagram/node/ConnectionCommandHandler.java
index 0704538..69d2bdd 100644
--- a/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/edit/diagram/node/ConnectionCommandHandler.java
+++ b/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/edit/diagram/node/ConnectionCommandHandler.java
@@ -233,6 +233,8 @@ public class ConnectionCommandHandler
processDefinition.getDiagram()
.get(0)
+ .getPoolSymbols()
+ .get(0)
.getDataMappingConnection()
.remove(dataMappingConnection);
}
@@ -394,7 +396,7 @@ public class ConnectionCommandHandler
{
dataMapping.setDirection(DirectionType.get(DirectionType.OUT));
}
-
+
dataMapping.setData(data);
// TODO Incomplete
@@ -419,7 +421,7 @@ public class ConnectionCommandHandler
.get(0)
.getDataMappingConnection()
.add(dataMappingConnection);
-
+
dataMappingConnection.setElementOid(++maxOid);
dataMappingConnection.setActivitySymbol(activitySymbol);
dataMappingConnection.setDataSymbol(dataSymbol);
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 8d0303b..6486847 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
@@ -364,8 +364,8 @@ public abstract class ModelElementMarshaller
for (DataSymbolType dataSymbol : laneSymbol.getDataSymbol())
{
- dataSymbolsJson.add(dataSymbol.getData().getId(), toDataJson(dataSymbol));
-
+ //Multiple Data Symbols can have same ID
+ dataSymbolsJson.add(String.valueOf(dataSymbol.getElementOid()), toDataJson(dataSymbol));
}
}
@@ -701,25 +701,29 @@ public abstract class ModelElementMarshaller
public JsonObject toDataTypeJson(DataType data)
{
JsonObject dataJson = new JsonObject();
-
- dataJson.addProperty(ModelerConstants.ID_PROPERTY, data.getId());
- dataJson.addProperty(ModelerConstants.NAME_PROPERTY, data.getName());
- dataJson.addProperty(ModelerConstants.UUID_PROPERTY, eObjectUUIDMapper().getUUID(data));
- ModelType model = ModelUtils.findContainingModel(data);
- dataJson.addProperty(ModelerConstants.MODEL_UUID_PROPERTY, eObjectUUIDMapper().getUUID(model));
- setContainingModelIdProperty(dataJson, data);
- if (null != data.getDescription())
- {
- dataJson.addProperty(ModelerConstants.DESCRIPTION_PROPERTY,
- (String) data.getDescription().getMixed().get(0).getValue());
- }
- else
- {
- dataJson.addProperty(ModelerConstants.DESCRIPTION_PROPERTY, "");
- }
- if (data.getType() != null)
+ if (null != data)
{
- dataJson.addProperty(ModelerConstants.TYPE_PROPERTY, data.getType().getId());
+ dataJson.addProperty(ModelerConstants.ID_PROPERTY, data.getId());
+ dataJson.addProperty(ModelerConstants.NAME_PROPERTY, data.getName());
+ dataJson.addProperty(ModelerConstants.UUID_PROPERTY,
+ eObjectUUIDMapper().getUUID(data));
+ ModelType model = ModelUtils.findContainingModel(data);
+ dataJson.addProperty(ModelerConstants.MODEL_UUID_PROPERTY,
+ eObjectUUIDMapper().getUUID(model));
+ setContainingModelIdProperty(dataJson, data);
+ if (null != data.getDescription())
+ {
+ dataJson.addProperty(ModelerConstants.DESCRIPTION_PROPERTY,
+ (String) data.getDescription().getMixed().get(0).getValue());
+ }
+ else
+ {
+ dataJson.addProperty(ModelerConstants.DESCRIPTION_PROPERTY, "");
+ }
+ if (data.getType() != null)
+ {
+ dataJson.addProperty(ModelerConstants.TYPE_PROPERTY, data.getType().getId());
+ }
}
return dataJson;
}
@@ -739,7 +743,7 @@ public abstract class ModelElementMarshaller
dataSymbolJson.addProperty(ModelerConstants.Y_PROPERTY, dataSymbol.getYPos());
dataSymbolJson.addProperty(ModelerConstants.UUID_PROPERTY, eObjectUUIDMapper().getUUID(dataSymbol));
dataSymbolJson.addProperty(ModelerConstants.TYPE_PROPERTY, ModelerConstants.DATA_SYMBOL);
- dataSymbolJson.add(ModelerConstants.DATA, toDataTypeJson(dataSymbol.getData()));
+ dataSymbolJson.add(ModelerConstants.DATA, toDataTypeJson(dataSymbol.getData()));
// Model returned will be null in case of data delete operation
ModelType containingModel = ModelUtils.findContainingModel(dataSymbol.getData());
@@ -912,58 +916,67 @@ public abstract class ModelElementMarshaller
JsonObject dataFlowJson = new JsonObject();
connectionJson.add(ModelerConstants.MODEL_ELEMENT_PROPERTY, dataFlowJson);
- dataFlowJson.addProperty(ModelerConstants.TYPE_PROPERTY,
- ModelerConstants.DATA_FLOW_LITERAL);
- dataFlowJson.addProperty(ModelerConstants.ID_PROPERTY,
- "" + dataMappingConnection.getElementOid());
- ActivityType activity = dataMappingConnection.getActivitySymbol().getActivity();
DataType data = dataMappingConnection.getDataSymbol().getData();
- for (DataMappingType dataMapping : activity.getDataMapping())
+ if (null != data)
{
- // Update the dataFlowJson for currentData symbol
- if (dataMapping.getData().getId() == data.getId())
+ dataFlowJson.addProperty(ModelerConstants.TYPE_PROPERTY,
+ ModelerConstants.DATA_FLOW_LITERAL);
+ dataFlowJson.addProperty(ModelerConstants.ID_PROPERTY,
+ "" + dataMappingConnection.getElementOid());
+ ActivityType activity = dataMappingConnection.getActivitySymbol().getActivity();
+ for (DataMappingType dataMapping : activity.getDataMapping())
{
- if (dataMapping.getDirection() == DirectionType.IN_LITERAL)
+ // Update the dataFlowJson for currentData symbol
+ if (dataMapping.getData().getId() == data.getId())
{
- dataFlowJson.addProperty(ModelerConstants.IN_DATA_MAPPING_PROPERTY, true);
- dataFlowJson.addProperty(ModelerConstants.OUT_DATA_MAPPING_PROPERTY, false);
- connectionJson.addProperty(ModelerConstants.FROM_MODEL_ELEMENT_OID,
- dataMappingConnection.getDataSymbol().getElementOid());
- connectionJson.addProperty(ModelerConstants.FROM_MODEL_ELEMENT_TYPE,
- ModelerConstants.DATA);
- connectionJson.addProperty(ModelerConstants.TO_MODEL_ELEMENT_OID,
- dataMappingConnection.getActivitySymbol().getElementOid());
- connectionJson.addProperty(ModelerConstants.TO_MODEL_ELEMENT_TYPE,
- ModelerConstants.ACTIVITY_KEY);
+ if (dataMapping.getDirection() == DirectionType.IN_LITERAL)
+ {
+ dataFlowJson.addProperty(ModelerConstants.IN_DATA_MAPPING_PROPERTY,
+ true);
+ dataFlowJson.addProperty(ModelerConstants.OUT_DATA_MAPPING_PROPERTY,
+ false);
+ connectionJson.addProperty(ModelerConstants.FROM_MODEL_ELEMENT_OID,
+ dataMappingConnection.getDataSymbol().getElementOid());
+ connectionJson.addProperty(ModelerConstants.FROM_MODEL_ELEMENT_TYPE,
+ ModelerConstants.DATA);
+ connectionJson.addProperty(ModelerConstants.TO_MODEL_ELEMENT_OID,
+ dataMappingConnection.getActivitySymbol().getElementOid());
+ connectionJson.addProperty(ModelerConstants.TO_MODEL_ELEMENT_TYPE,
+ ModelerConstants.ACTIVITY_KEY);
- }
- else if (dataMapping.getDirection() == DirectionType.OUT_LITERAL)
- {
- dataFlowJson.addProperty(ModelerConstants.IN_DATA_MAPPING_PROPERTY, false);
- dataFlowJson.addProperty(ModelerConstants.OUT_DATA_MAPPING_PROPERTY, true);
- // TODO - Currently API always assumes connectionJson.getSourceNode will be
- // Data, to set Activity in sourceNode for OUT Mapping for data this code is
- // placed here
- connectionJson.addProperty(ModelerConstants.FROM_MODEL_ELEMENT_OID,
- dataMappingConnection.getActivitySymbol().getElementOid());
- connectionJson.addProperty(ModelerConstants.FROM_MODEL_ELEMENT_TYPE,
- ModelerConstants.ACTIVITY_KEY);
- connectionJson.addProperty(ModelerConstants.TO_MODEL_ELEMENT_OID,
- dataMappingConnection.getDataSymbol().getElementOid());
- connectionJson.addProperty(ModelerConstants.TO_MODEL_ELEMENT_TYPE,
- ModelerConstants.DATA);
- }
- else
- {
- dataFlowJson.addProperty(ModelerConstants.IN_DATA_MAPPING_PROPERTY, true);
- dataFlowJson.addProperty(ModelerConstants.OUT_DATA_MAPPING_PROPERTY, true);
+ }
+ else if (dataMapping.getDirection() == DirectionType.OUT_LITERAL)
+ {
+ dataFlowJson.addProperty(ModelerConstants.IN_DATA_MAPPING_PROPERTY,
+ false);
+ dataFlowJson.addProperty(ModelerConstants.OUT_DATA_MAPPING_PROPERTY,
+ true);
+ // TODO - Currently API always assumes connectionJson.getSourceNode will
+ // be data, to set Activity in sourceNode for OUT Mapping for data this
+ // code is placed here
+ connectionJson.addProperty(ModelerConstants.FROM_MODEL_ELEMENT_OID,
+ dataMappingConnection.getActivitySymbol().getElementOid());
+ connectionJson.addProperty(ModelerConstants.FROM_MODEL_ELEMENT_TYPE,
+ ModelerConstants.ACTIVITY_KEY);
+ connectionJson.addProperty(ModelerConstants.TO_MODEL_ELEMENT_OID,
+ dataMappingConnection.getDataSymbol().getElementOid());
+ connectionJson.addProperty(ModelerConstants.TO_MODEL_ELEMENT_TYPE,
+ ModelerConstants.DATA);
+ }
+ else
+ {
+ dataFlowJson.addProperty(ModelerConstants.IN_DATA_MAPPING_PROPERTY,
+ true);
+ dataFlowJson.addProperty(ModelerConstants.OUT_DATA_MAPPING_PROPERTY,
+ true);
+ }
}
}
+ dataFlowJson.addProperty(ModelerConstants.DATA_FULL_ID_PROPERTY,
+ MBFacade.getInstance().createFullId(ModelUtils.findContainingModel(data), data));
+ dataFlowJson.addProperty(ModelerConstants.ACTIVITY_ID_PROPERTY, activity.getId());
}
- dataFlowJson.addProperty(ModelerConstants.DATA_FULL_ID_PROPERTY,
- MBFacade.getInstance().createFullId(ModelUtils.findContainingModel(data), data));
- dataFlowJson.addProperty(ModelerConstants.ACTIVITY_ID_PROPERTY, activity.getId());
return connectionJson;
}
diff --git a/web-modeler/src/main/resources/META-INF/xhtml/js/m_activitySymbol.js b/web-modeler/src/main/resources/META-INF/xhtml/js/m_activitySymbol.js
index 5568b47..8a0744b 100644
--- a/web-modeler/src/main/resources/META-INF/xhtml/js/m_activitySymbol.js
+++ b/web-modeler/src/main/resources/META-INF/xhtml/js/m_activitySymbol.js
@@ -528,7 +528,7 @@ define(
*
*/
function ActivitySymbol_removeClosure() {
- this.auxiliaryProperties.callbackScope.remove();
+ this.auxiliaryProperties.callbackScope.createAndSubmitDeleteCommand();
}
/**
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 08a5c97..0b8d82d 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
@@ -370,7 +370,9 @@ define(
if (this.isControlFlow()) {
// TODO Can we store in graphical element?
+ if(null != this.conditionExpressionTextXOffset)
transferObject.modelElement.attributes["carnot:engine:conditionExpressionTextXOffset"] = this.conditionExpressionTextXOffset;
+ if(null !=this.conditionExpressionTextYOffset)
transferObject.modelElement.attributes["carnot:engine:conditionExpressionTextYOffset"] = this.conditionExpressionTextYOffset;
// TODO Add later
transferObject.segments = null;
@@ -476,7 +478,6 @@ define(
*/
Connection.prototype.complete = function() {
this.completeNoTransfer();
- /*this.submitCreation();*/
var command = m_command.createCreateNodeCommand("connection.create",
this.diagram.model.id, this.diagram.process.oid,
this.createTransferObject());
@@ -1189,8 +1190,17 @@ define(
this.toAnchorPoint.symbol.connections, this);
m_utils.removeItemFromArray(
this.fromAnchorPoint.symbol.connections, this);
- var command = m_command.createRemoveNodeCommand("connection.delete", this.diagram.model.id,
- this.diagram.process.oid, this.createTransferObject());
+ };
+
+ /**
+ *
+ */
+ Connection.prototype.createDeleteCommand = function() {
+ var command = m_command.createRemoveNodeCommand(
+ "connection.delete", this.diagram.model.id,
+ this.diagram.process.oid, {
+ "oid" : this.oid
+ });
m_commandsController.submitCommand(command);
};
@@ -1294,7 +1304,7 @@ define(
}
function Connection_removeClosure() {
- this.auxiliaryProperties.callbackScope.remove();
+ this.auxiliaryProperties.callbackScope.createDeleteCommand();
}
function Connection_toggleConnectionType() {
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 8db1182..d2dd672 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
@@ -344,6 +344,6 @@ define(
*
*/
function DataSymbol_removeClosure() {
- this.auxiliaryProperties.callbackScope.remove();
+ this.auxiliaryProperties.callbackScope.createAndSubmitDeleteCommand();
}
}); \ No newline at end of file
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 964dd46..7a1ea3d 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
@@ -518,6 +518,8 @@ define(
if (this.connections[i].fromModelElementOid == conn.fromModelElementOid
&& this.connections[i].toModelElementOid == conn.toModelElementOid) {
return this.connections[i];
+ } else if (this.connections[i].oid == conn.oid) {
+ return this.connections[i];
}
}
@@ -594,6 +596,24 @@ define(
// modelElement change
}
}
+
+ // Delete removed elements
+ for ( var i = 0; i < obj.changes.removed.length; i++) {
+ var symbol = this
+ .findSymbolByGuid(obj.changes.removed[i].oid);
+ if (null == symbol) {
+ symbol = this
+ .findSymbolByModelElementGuid(obj.changes.removed[i].oid);
+ }
+ if (null == symbol) {
+ symbol = this
+ .findConnection(obj.changes.removed[i]);
+ }
+ if (null != symbol) {
+ symbol.remove();
+ }
+
+ }
}
};
diff --git a/web-modeler/src/main/resources/META-INF/xhtml/js/m_eventSymbol.js b/web-modeler/src/main/resources/META-INF/xhtml/js/m_eventSymbol.js
index ff571ef..05c25a1 100644
--- a/web-modeler/src/main/resources/META-INF/xhtml/js/m_eventSymbol.js
+++ b/web-modeler/src/main/resources/META-INF/xhtml/js/m_eventSymbol.js
@@ -327,6 +327,6 @@ define(
*
*/
function EventSymbol_removeClosure() {
- this.auxiliaryProperties.callbackScope.remove();
+ this.auxiliaryProperties.callbackScope.createAndSubmitDeleteCommand();
}
}); \ No newline at end of file
diff --git a/web-modeler/src/main/resources/META-INF/xhtml/js/m_gatewaySymbol.js b/web-modeler/src/main/resources/META-INF/xhtml/js/m_gatewaySymbol.js
index f653881..945a11b 100644
--- a/web-modeler/src/main/resources/META-INF/xhtml/js/m_gatewaySymbol.js
+++ b/web-modeler/src/main/resources/META-INF/xhtml/js/m_gatewaySymbol.js
@@ -471,7 +471,7 @@ define(
*
*/
function GatewaySymbol_removeClosure() {
- this.auxiliaryProperties.callbackScope.remove();
+ this.auxiliaryProperties.callbackScope.createAndSubmitDeleteCommand();
}
/**
diff --git a/web-modeler/src/main/resources/META-INF/xhtml/js/m_poolSymbol.js b/web-modeler/src/main/resources/META-INF/xhtml/js/m_poolSymbol.js
index 55ae179..a8a596c 100644
--- a/web-modeler/src/main/resources/META-INF/xhtml/js/m_poolSymbol.js
+++ b/web-modeler/src/main/resources/META-INF/xhtml/js/m_poolSymbol.js
@@ -601,9 +601,6 @@ define(
};
PoolSymbol.prototype.removeLane = function(laneSymbol) {
- /* Remove lane symbol and and its children. */
- laneSymbol.remove();
-
/* remove lane from lane symbols array. */
m_utils.removeItemFromArray(this.laneSymbols, laneSymbol);
diff --git a/web-modeler/src/main/resources/META-INF/xhtml/js/m_swimlaneSymbol.js b/web-modeler/src/main/resources/META-INF/xhtml/js/m_swimlaneSymbol.js
index c0fbc10..7492e35 100644
--- a/web-modeler/src/main/resources/META-INF/xhtml/js/m_swimlaneSymbol.js
+++ b/web-modeler/src/main/resources/META-INF/xhtml/js/m_swimlaneSymbol.js
@@ -664,7 +664,7 @@ define(
this.removeFlyOutMenu();
this.removeProximitySensor();
- this.createAndSubmitDeleteCommand();
+ this.parentSymbol.removeLane(this);
}
/**
@@ -1024,7 +1024,7 @@ define(
cancelButtonText : "Cancel",
acceptFunction : function() {
var thisLane = cbObj.auxiliaryProperties.callbackScope;
- thisLane.parentSymbol.removeLane(thisLane);
+ thisLane.createAndSubmitDeleteCommand();
}
}
});
diff --git a/web-modeler/src/main/resources/META-INF/xhtml/js/m_symbol.js b/web-modeler/src/main/resources/META-INF/xhtml/js/m_symbol.js
index 40eddd9..c3d9b25 100644
--- a/web-modeler/src/main/resources/META-INF/xhtml/js/m_symbol.js
+++ b/web-modeler/src/main/resources/META-INF/xhtml/js/m_symbol.js
@@ -1185,8 +1185,6 @@ define(
m_utils.removeItemFromArray(
this.parentSymbol.containedSymbols, this);
m_utils.removeItemFromArray(this.diagram.symbols, this);
-
- this.createAndSubmitDeleteCommand();
};
/**
@@ -1228,8 +1226,9 @@ define(
Symbol.prototype.removeConnections = function() {
var n = 0;
- while (this.connections.length > 0) {
- this.connections[n].remove();
+ while (n < this.connections.length) {
+ this.connections[n].createDeleteCommand();
+ n++;
}
};