summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSidharth Singh2012-09-17 03:14:18 (EDT)
committerStephan Born2012-09-17 03:14:18 (EDT)
commit94d4275d71471595627b9411b696d29c7ee39ffc (patch)
tree38323879dd39bd9c0d09c211312ca74bd348e475
parent1d5ba430eece215af9850ec90757ca590486d1bc (diff)
downloadorg.eclipse.stardust.ui.web-94d4275d71471595627b9411b696d29c7ee39ffc.zip
org.eclipse.stardust.ui.web-94d4275d71471595627b9411b696d29c7ee39ffc.tar.gz
org.eclipse.stardust.ui.web-94d4275d71471595627b9411b696d29c7ee39ffc.tar.bz2
CRNT-26001
1)Updated the code to validateCreateConnection in m_activitySymbol.js 2)made changes in updateAnchorPointForSymbol in m_connection.js git-svn-id: http://emeafrazerg/svn/ipp/product/trunk/stardust/ui.web@59248 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b
-rw-r--r--web-modeler/src/main/resources/META-INF/xhtml/js/m_activitySymbol.js22
-rw-r--r--web-modeler/src/main/resources/META-INF/xhtml/js/m_connection.js21
2 files changed, 24 insertions, 19 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 d00b7d4..0ba7aa0 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
@@ -552,8 +552,6 @@ define(
ActivitySymbol.prototype.validateCreateConnection = function() {
var outMappingActivity = new Array();
var inMappingActivity = new Array();
- var i = 0;
- var j = 0;
for ( var n in this.connections) {
var connection = this.connections[n];
if (connection.fromAnchorPoint.symbol.type == m_constants.ACTIVITY_SYMBOL
@@ -563,8 +561,12 @@ define(
&& connection.toAnchorPoint.symbol.type == m_constants.DATA_SYMBOL) {
//do nothing
}else{
- outMappingActivity[i] = true;
- i++;
+ if (-1 != jQuery.inArray(
+ connection.fromAnchorPoint.symbol.oid,
+ outMappingActivity)) {
+ return false;
+ }else
+ outMappingActivity.push(connection.fromAnchorPoint.symbol.oid);
}
} else if (null != connection.toAnchorPoint
&& null != connection.toAnchorPoint.symbol) {
@@ -573,16 +575,16 @@ define(
} else if (connection.fromAnchorPoint.symbol.type == m_constants.DATA_SYMBOL) {
// do nothing
} else if (connection.toAnchorPoint.symbol.oid == this.oid) {
- inMappingActivity[j] = true;
- j++;
+ if (-1 != jQuery.inArray(
+ connection.toAnchorPoint.symbol.oid,
+ inMappingActivity)) {
+ return false;
+ }else
+ inMappingActivity.push(connection.toAnchorPoint.symbol.oid);
}
}
}
- if (outMappingActivity.length > 1
- || inMappingActivity.length > 1) {
- return false;
- }
return true;
};
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 5df28f8..c7eef1e 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
@@ -289,8 +289,7 @@ define(
// default orientation is SOUTH for gateway
orientation = 2;
}
- this
- .setFirstAnchorPoint(startSymbol.anchorPoints[orientation]);
+ this.fromAnchorPoint = startSymbol.anchorPoints[orientation];
}
};
@@ -1365,10 +1364,14 @@ define(
this.toAnchorPoint.symbol.connections, this);
} else if (this.toModelElementOid != null) {
+ //On hover over symbol, connection gets added to symbol
+ //It may not be removed when connection is disengaged(canvas click)
+ //if connection is removed , but symbol contains the connection remove It.
var symbol = this.diagram
.findSymbolByGuid(this.toModelElementOid)
if (null != symbol) {
- m_utils.removeItemFromArray(symbol.connections, this);
+ m_utils.removeItemFromArray(symbol.connections,
+ this);
}
}
};
@@ -1433,7 +1436,6 @@ define(
*/
Connection.prototype.validateCreateConnection = function(
fromAnchorPoint, toAnchorPoint) {
- /*m_messageDisplay.clear();*/
if (fromAnchorPoint.symbol.type == m_constants.EVENT_SYMBOL) {
// Check for OUT connections on End Event
if (fromAnchorPoint.symbol.modelElement.eventType == m_constants.STOP_EVENT_TYPE) {
@@ -1481,7 +1483,7 @@ define(
if (!toAnchorPoint.symbol
.validateCreateConnection()) {
m_messageDisplay
- .showErrorMessage("No further OUT Connection allowed with this activity.");
+ .showErrorMessage("No further OUT Connection allowed from this activity.");
}
} else if (!fromAnchorPoint.symbol
.validateCreateConnection()) {
@@ -1515,14 +1517,15 @@ define(
if (!toAnchorPoint.symbol
.validateCreateConnection()) {
m_messageDisplay
- .showErrorMessage("No more OUT Connection allowed to this activity.");
+ .showErrorMessage("No more OUT Connection allowed from this activity.");
return false;
}
}else if (toAnchorPoint.symbol.type == m_constants.ACTIVITY_SYMBOL) {
- if (!toAnchorPoint.symbol
- .validateCreateConnection()) {
+ if ((fromAnchorPoint.symbol.type != m_constants.DATA_SYMBOL && fromAnchorPoint.symbol.type != m_constants.EVENT_SYMBOL)
+ && !toAnchorPoint.symbol
+ .validateCreateConnection()) {
m_messageDisplay
- .showErrorMessage("No more connections allowed to this symbol.");
+ .showErrorMessage("No more connections allowed to this activity.");
return false;
}
}