summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSidharth Singh2012-08-29 07:52:56 (EDT)
committerStephan Born2012-08-29 07:52:56 (EDT)
commit5db43bdb7014ca599274dd734917c2b6ee818b60 (patch)
treea36e3c80bdcc090b37057de337dfc4d8775c193d
parenta82d05642f20ebde6b9b3cb0aeb1fb94f03578a7 (diff)
downloadorg.eclipse.stardust.ui.web-5db43bdb7014ca599274dd734917c2b6ee818b60.zip
org.eclipse.stardust.ui.web-5db43bdb7014ca599274dd734917c2b6ee818b60.tar.gz
org.eclipse.stardust.ui.web-5db43bdb7014ca599274dd734917c2b6ee818b60.tar.bz2
CRNT-25974
1)Added method in m_process.js to generate gateway Id. 2)Made changes in createGatewayActivity() in m_activity.js to use getNewGatewayIndex() of m_process.js 3)Added code to register the gateway symbol while creation. git-svn-id: http://emeafrazerg/svn/ipp/product/trunk/stardust/ui.web@58764 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b
-rw-r--r--web-modeler/src/main/resources/META-INF/xhtml/js/m_activity.js2
-rw-r--r--web-modeler/src/main/resources/META-INF/xhtml/js/m_gatewaySymbol.js56
-rw-r--r--web-modeler/src/main/resources/META-INF/xhtml/js/m_process.js35
3 files changed, 55 insertions, 38 deletions
diff --git a/web-modeler/src/main/resources/META-INF/xhtml/js/m_activity.js b/web-modeler/src/main/resources/META-INF/xhtml/js/m_activity.js
index c3465ff..2c4f1e0 100644
--- a/web-modeler/src/main/resources/META-INF/xhtml/js/m_activity.js
+++ b/web-modeler/src/main/resources/META-INF/xhtml/js/m_activity.js
@@ -48,7 +48,7 @@ define(
},
createGatewayActivity : function(process) {
- var index = process.getNewActivityIndex();
+ var index = process.getNewGatewayIndex();
var activity = new Activity("Gateway" + index);
activity.initialize("Gateway " + index,
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 945a11b..a90bd2f 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
@@ -25,6 +25,8 @@ define(
gatewaySymbol.modelElement = m_activity
.createGatewayActivity(diagram.process);
+ // Register the symbol
+ gatewaySymbol.diagram.process.gateways[gatewaySymbol.modelElement.id] = gatewaySymbol.modelElement;
return gatewaySymbol;
},
@@ -56,11 +58,11 @@ define(
*/
GatewaySymbol.prototype.bind = function(diagram) {
this.type = m_constants.GATEWAY_SYMBOL;
-
+
this.diagram = diagram;
-
+
this.diagram.lastSymbol = this;
-
+
this.propertiesPanel = m_gatewayPropertiesPanel
.getInstance();
this.path = null;
@@ -70,14 +72,14 @@ define(
};
/**
- *
+ *
*/
GatewaySymbol.prototype.toString = function() {
return "Lightdust.GatewaySymbol";
};
/**
- *
+ *
*/
GatewaySymbol.prototype.initializeFromJson = function(lane) {
m_utils.inheritMethods(this.modelElement.prototype,
@@ -90,7 +92,7 @@ define(
this.parentSymbolId = lane.id;
// Patch width and height
-
+
this.width = m_constants.GATEWAY_SYMBOL_DEFAULT_WIDTH;
this.height = m_constants.GATEWAY_SYMBOL_DEFAULT_HEIGHT;
this.parentSymbol.containedSymbols.push(this);
@@ -100,7 +102,7 @@ define(
};
/**
- *
+ *
*/
GatewaySymbol.prototype.createTransferObject = function() {
var transferObject = {};
@@ -118,7 +120,7 @@ define(
};
/**
- *
+ *
*/
GatewaySymbol.prototype.getPath = function(withId) {
var path = "/models/" + this.diagram.model.id
@@ -128,12 +130,12 @@ define(
if (withId) {
path += "/" + this.modelElement.id;
}
-
+
return path;
};
/**
- *
+ *
*/
GatewaySymbol.prototype.createPrimitives = function() {
this.path = m_canvasManager
@@ -192,13 +194,13 @@ define(
};
/**
- *
+ *
*/
GatewaySymbol.prototype.initializeEventHandling = function() {
};
/**
- *
+ *
*/
GatewaySymbol.prototype.getPathSvgString = function() {
return "M "
@@ -224,7 +226,7 @@ define(
};
/**
- *
+ *
*/
GatewaySymbol.prototype.getPlusPathSvgString = function() {
return "M "
@@ -248,7 +250,7 @@ define(
};
/**
- *
+ *
*/
GatewaySymbol.prototype.getCrossPathSvgString = function() {
return "M "
@@ -274,7 +276,7 @@ define(
};
/**
- *
+ *
*/
GatewaySymbol.prototype.adjustPrimitives = function(dX, dY) {
this.path.attr({
@@ -294,7 +296,7 @@ define(
});
};
-
+
/**
* Registers symbol in specific lists in the diagram and model
* element in the process.
@@ -305,7 +307,7 @@ define(
};
/**
- *
+ *
*/
GatewaySymbol.prototype.refreshFromModelElement = function() {
if (this.modelElement.gatewayType == m_constants.AND_GATEWAY_TYPE) {
@@ -328,7 +330,7 @@ define(
};
/**
- *
+ *
*/
GatewaySymbol.prototype.createFlyOutMenu = function() {
this
@@ -383,7 +385,7 @@ define(
};
/**
- *
+ *
*/
GatewaySymbol.prototype.highlight = function() {
this.path.attr({
@@ -401,7 +403,7 @@ define(
};
/**
- *
+ *
*/
GatewaySymbol.prototype.dehighlight = function() {
this.path.attr({
@@ -436,7 +438,7 @@ define(
}
/**
- *
+ *
*/
function GatewaySymbol_connectToClosure() {
this.auxiliaryProperties.callbackScope.diagram
@@ -444,7 +446,7 @@ define(
}
/**
- *
+ *
*/
function GatewaySymbol_connectToActivityClosure() {
this.auxiliaryProperties.callbackScope.diagram
@@ -452,7 +454,7 @@ define(
}
/**
- *
+ *
*/
function GatewaySymbol_connectToGatewayClosure() {
this.auxiliaryProperties.callbackScope.diagram
@@ -460,7 +462,7 @@ define(
}
/**
- *
+ *
*/
function GatewaySymbol_connectToEndEventClosure() {
this.auxiliaryProperties.callbackScope.diagram
@@ -468,21 +470,21 @@ define(
}
/**
- *
+ *
*/
function GatewaySymbol_removeClosure() {
this.auxiliaryProperties.callbackScope.createAndSubmitDeleteCommand();
}
/**
- *
+ *
*/
function GatewaySymbol_switchToXorGatewayClosure() {
this.auxiliaryProperties.callbackScope.switchToXorGateway();
}
/**
- *
+ *
*/
function GatewaySymbol_switchToAndGatewayClosure() {
this.auxiliaryProperties.callbackScope.switchToAndGateway();
diff --git a/web-modeler/src/main/resources/META-INF/xhtml/js/m_process.js b/web-modeler/src/main/resources/META-INF/xhtml/js/m_process.js
index e5530f4..da29980 100644
--- a/web-modeler/src/main/resources/META-INF/xhtml/js/m_process.js
+++ b/web-modeler/src/main/resources/META-INF/xhtml/js/m_process.js
@@ -3,7 +3,7 @@
* program and the accompanying materials are made available under the terms of
* the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors: SunGard CSA LLC - initial API and implementation and/or initial
* documentation
******************************************************************************/
@@ -25,20 +25,20 @@ define([ "m_utils", "m_constants", "m_modelElement" ], function(m_utils,
};
/**
- *
+ *
*/
function Process() {
m_utils.inheritMethods(Process.prototype, m_modelElement.create());
/**
- *
+ *
*/
Process.prototype.toString = function() {
return "Lightdust.Process";
};
/**
- *
+ *
*/
Process.prototype.initializeFromJson = function(model) {
this.type = m_constants.PROCESS_DEFINITION;
@@ -48,7 +48,7 @@ define([ "m_utils", "m_constants", "m_modelElement" ], function(m_utils,
};
/**
- *
+ *
*/
Process.prototype.getPath = function(withId) {
var path = "/models/" + this.model.id + "/processes";
@@ -61,7 +61,7 @@ define([ "m_utils", "m_constants", "m_modelElement" ], function(m_utils,
};
/**
- *
+ *
*/
Process.prototype.rename = function(id, name) {
delete this.model.processes[this.id];
@@ -72,7 +72,7 @@ define([ "m_utils", "m_constants", "m_modelElement" ], function(m_utils,
};
/**
- *
+ *
*/
Process.prototype.getNewEventIndex = function() {
var index = 0;
@@ -87,7 +87,7 @@ define([ "m_utils", "m_constants", "m_modelElement" ], function(m_utils,
};
/**
- *
+ *
*/
Process.prototype.getNewActivityIndex = function() {
var index = 0;
@@ -102,7 +102,22 @@ define([ "m_utils", "m_constants", "m_modelElement" ], function(m_utils,
};
/**
- *
+ *
+ */
+ Process.prototype.getNewGatewayIndex = function() {
+ var index = 0;
+
+ for ( var n in this.gateways) {
+ ++index;
+ }
+
+ ++index;
+
+ return index;
+ };
+
+ /**
+ *
*/
Process.prototype.getDataFlowIndex = function() {
var index = 0;
@@ -117,7 +132,7 @@ define([ "m_utils", "m_constants", "m_modelElement" ], function(m_utils,
};
/**
- *
+ *
*/
Process.prototype.getControlFlowIndex = function() {
var index = 0;