summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSidharth Singh2012-08-03 03:58:16 (EDT)
committerManik Kishore2012-08-07 05:02:16 (EDT)
commitbbb584bf6880db7920ce9c006eabb271358b33e9 (patch)
tree811405e0695353a64a91db80daba04145e52f341
parent37b9bf7d605bf8dc8abeff425a4d865e58d29008 (diff)
downloadorg.eclipse.stardust.ui.web-bbb584bf6880db7920ce9c006eabb271358b33e9.zip
org.eclipse.stardust.ui.web-bbb584bf6880db7920ce9c006eabb271358b33e9.tar.gz
org.eclipse.stardust.ui.web-bbb584bf6880db7920ce9c006eabb271358b33e9.tar.bz2
Jira-ID: CRNT-25577
1)Added a check for null handling in findSymbolByGuid and findSymbolByModelElementGuid 2)Moved the code to set modelElement inside if block in refreshFromModelElement in m_dataSymbol.js git-svn-id: http://emeafrazerg/svn/ipp/product/trunk/stardust/ui.web@58151 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b
-rw-r--r--web-modeler/src/main/resources/META-INF/xhtml/js/m_dataSymbol.js5
-rw-r--r--web-modeler/src/main/resources/META-INF/xhtml/js/m_diagram.js34
2 files changed, 23 insertions, 16 deletions
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 99b0d23..96b597f 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
@@ -288,12 +288,15 @@ define(
*/
DataSymbol.prototype.refreshFromModelElement = function() {
var data = m_model.findData(this.dataFullId);
- this.modelElement = data;
// Data mayno have been created yet
if (data != null) {
this.text.attr("text", data.name);
+ if (null == this.modelElement) {
+ this.modelElement = data;
+ }
}
+
};
/**
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 5bc63bd..0d56d84 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
@@ -480,13 +480,15 @@ define(
*
*/
Diagram.prototype.findSymbolByGuid = function(guid) {
-
- for ( var i = 0; i < this.symbols.length; i++) {
- if (this.symbols[i].oid == guid) {
- return this.symbols[i];
+
+ if (null != guid) {
+ for ( var i = 0; i < this.symbols.length; i++) {
+ if (this.symbols[i].oid == guid) {
+ return this.symbols[i];
+ }
}
}
-
+
return null;
};
@@ -495,10 +497,12 @@ define(
*/
Diagram.prototype.findSymbolByModelElementGuid = function(guid) {
- for ( var i = 0; i < this.symbols.length; i++) {
- if (this.symbols[i].modelElement != null
- && this.symbols[i].modelElement.oid == guid) {
- return this.symbols[i];
+ if (null != guid) {
+ for ( var i = 0; i < this.symbols.length; i++) {
+ if (this.symbols[i].modelElement != null
+ && this.symbols[i].modelElement.oid == guid) {
+ return this.symbols[i];
+ }
}
}
@@ -508,11 +512,11 @@ define(
/**
*
*/
- Diagram.prototype.findConnectionByModelId = function(id) {
+ Diagram.prototype.findConnection = function(conn) {
for ( var i = 0; i < this.connections.length; i++) {
- if (this.connections[i].modelElement != null
- && this.connections[i].modelElement.id == id) {
+ if (this.connections[i].fromModelElementOid == conn.fromModelElementOid
+ && this.connections[i].toModelElementOid == conn.toModelElementOid) {
return this.connections[i];
}
}
@@ -549,9 +553,9 @@ define(
// for connections , search by connectionId to
// set OID
var conn = this
- .findConnectionByModelId(obj.changes.added[i].modelElement.id);
- if (null != symbol) {
- conn.oid = obj.changes.added[i].oid;
+ .findConnection(obj.changes.added[i]);
+ if (null != conn) {
+ conn.applyChanges(obj.changes.added[i]);
conn.refresh();
}
}