summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSidharth Singh2012-09-14 11:34:55 (EDT)
committerStephan Born2012-09-14 11:34:55 (EDT)
commitfeb672f7c0fbdbb34eeb7b18cdc7fc7643e1de01 (patch)
treeb1690034c62f0902aa9b5fe777998877d350426a
parente04eaf348cec6e6e556e6d9303f5e3ad8255c0b1 (diff)
downloadorg.eclipse.stardust.ui.web-feb672f7c0fbdbb34eeb7b18cdc7fc7643e1de01.zip
org.eclipse.stardust.ui.web-feb672f7c0fbdbb34eeb7b18cdc7fc7643e1de01.tar.gz
org.eclipse.stardust.ui.web-feb672f7c0fbdbb34eeb7b18cdc7fc7643e1de01.tar.bz2
CRNT-26001
1)Added code to remove connection if invalid in m_connection.js git-svn-id: http://emeafrazerg/svn/ipp/product/trunk/stardust/ui.web@59240 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b
-rw-r--r--web-modeler/src/main/resources/META-INF/xhtml/js/m_activitySymbol.js9
-rw-r--r--web-modeler/src/main/resources/META-INF/xhtml/js/m_connection.js12
-rw-r--r--web-modeler/src/main/resources/META-INF/xhtml/js/m_dataSymbol.js67
3 files changed, 35 insertions, 53 deletions
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 fbcdecd..d00b7d4 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
@@ -558,10 +558,11 @@ define(
var connection = this.connections[n];
if (connection.fromAnchorPoint.symbol.type == m_constants.ACTIVITY_SYMBOL
&& connection.fromAnchorPoint.symbol.oid == this.oid) {
- if ((null != connection.toAnchorPoint && null != connection.toAnchorPoint.symbol)
+ if ((null != connection.toAnchorPoint
+ && null != connection.toAnchorPoint.symbol)
&& connection.toAnchorPoint.symbol.type == m_constants.DATA_SYMBOL) {
- // do nothing
- } else {
+ //do nothing
+ }else{
outMappingActivity[i] = true;
i++;
}
@@ -571,7 +572,7 @@ define(
// do nothing
} else if (connection.fromAnchorPoint.symbol.type == m_constants.DATA_SYMBOL) {
// do nothing
- } else {
+ } else if (connection.toAnchorPoint.symbol.oid == this.oid) {
inMappingActivity[j] = true;
j++;
}
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 888252b..5df28f8 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
@@ -806,16 +806,6 @@ define(
*
*/
Connection.prototype.reroute = function() {
- if (this.path.removed) {
- // If dummy connections are there,remove it
- this.remove();
- var symbol = this.diagram
- .findSymbolByGuid(this.toModelElementOid)
- if (null != symbol) {
- m_utils.removeItemFromArray(symbol, this);
- }
- return;
- }
if (this.isControlFlow()) {
this.segments = new Array();
@@ -1378,7 +1368,7 @@ define(
var symbol = this.diagram
.findSymbolByGuid(this.toModelElementOid)
if (null != symbol) {
- m_utils.removeItemFromArray(symbol, this);
+ m_utils.removeItemFromArray(symbol.connections, this);
}
}
};
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 a72ca5c..ae327be 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
@@ -313,52 +313,43 @@ define(
var inMapping = new Array();
var outMapping = new Array();
var inOutMapping = new Array();
- var i = 0;
- var j = 0;
- var z = 0;
for ( var n in this.connections) {
var connection = this.connections[n];
- if (connection.oid > 0) {
- if (connection.modelElement.inDataMapping
- && connection.modelElement.outDataMapping) {
- inOutMapping[z] = connection.fromAnchorPoint.symbol.oid;
- z++;
- } else if (connection.fromAnchorPoint.symbol.type == m_constants.ACTIVITY_SYMBOL) {
- outMapping[i] = connection.fromAnchorPoint.symbol.oid;
- i++;
- } else if (null != connection.toAnchorPoint
- && null != connection.toAnchorPoint.symbol) {
- if (connection.toAnchorPoint.symbol.type == m_constants.ACTIVITY_SYMBOL) {
- inMapping[j] = connection.toAnchorPoint.symbol.oid;
- j++;
- }
- }
- } else {
+ if (null != connection.modelElement
+ && connection.modelElement.inDataMapping
+ && connection.modelElement.outDataMapping) {
if (connection.fromAnchorPoint.symbol.type == m_constants.ACTIVITY_SYMBOL) {
+ outMapping
+ .push(connection.fromAnchorPoint.symbol.oid);
+ inMapping
+ .push(connection.fromAnchorPoint.symbol.oid);
+ } else {
+ outMapping
+ .push(connection.toAnchorPoint.symbol.oid);
+ inMapping
+ .push(connection.toAnchorPoint.symbol.oid);
+ }
+ } else if (connection.fromAnchorPoint.symbol.type == m_constants.ACTIVITY_SYMBOL) {
+ if (-1 != jQuery.inArray(
+ connection.fromAnchorPoint.symbol.oid,
+ outMapping)) {
+ return false;
+ } else {
+ outMapping
+ .push(connection.fromAnchorPoint.symbol.oid);
+ }
+ } else if (null != connection.toAnchorPoint
+ && null != connection.toAnchorPoint.symbol) {
+ if (connection.toAnchorPoint.symbol.type == m_constants.ACTIVITY_SYMBOL) {
if (-1 != jQuery.inArray(
- connection.fromAnchorPoint.symbol.oid,
- inOutMapping)) {
- return false;
- } else {
- return (-1 == jQuery
- .inArray(
- connection.fromAnchorPoint.symbol.oid,
- outMapping));
- }
- } else if (null != connection.toAnchorPoint
- && null != connection.toAnchorPoint.symbol) {
- if (-1 != jQuery.inArray(
- connection.fromAnchorPoint.symbol.oid,
- inOutMapping)) {
+ connection.toAnchorPoint.symbol.oid,
+ inMapping)) {
return false;
} else {
- return (-1 == jQuery
- .inArray(
- connection.toAnchorPoint.symbol.oid,
- inMapping));
+ inMapping
+ .push(connection.toAnchorPoint.symbol.oid);
}
}
-
}
}