Browse Source

Merge branch 'master' of http://msdl.uantwerpen.be/git/simon/AToMPM

Simon Van Mierlo 8 years ago
parent
commit
f5b9010762

+ 11 - 0
client/data_utils.js

@@ -259,6 +259,17 @@ DataUtils = function(){
 							  'dest':it,
 							  'dest':it,
 							  'pos':[pathCenter.x,pathCenter.y],
 							  'pos':[pathCenter.x,pathCenter.y],
 							  'segments':segments}});
 							  'segments':segments}});
+                              
+                 __icons[it]['edgesIn'].forEach(
+                        function(edgeId)
+                        {
+                            var linkIn = __edgeId2ends(edgeId)[0];
+                            if( __isContainmentConnectionType(linkIn) ) {
+                                requests.push(
+                                     {'method':'DELETE',
+                                      'uri':HttpUtils.url(linkIn,__NO_USERNAME+__NO_WID)});
+                            }
+                        });
 			});
 			});
 		
 		
 		if( dryRun )
 		if( dryRun )

+ 18 - 12
client/geometry_utils.js

@@ -122,6 +122,8 @@ GeometryUtils = function(){
 	 * Applies the effects of the specified transformation to the preview overlay
 	 * Applies the effects of the specified transformation to the preview overlay
 	 */
 	 */
 	this.previewSelectionTransformation = function(op,dir) {
 	this.previewSelectionTransformation = function(op,dir) {
+        if (transformationPreviewOverlay == undefined)
+            return
 		var bbox  = __selection['bbox'],
 		var bbox  = __selection['bbox'],
 			 scale = (dir > 0 ? 1.05 : 0.95),
 			 scale = (dir > 0 ? 1.05 : 0.95),
 			 angle = (dir > 0 ? 3 : -3);
 			 angle = (dir > 0 ? 3 : -3);
@@ -139,6 +141,8 @@ GeometryUtils = function(){
 	 * Moves the transformation preview overlay to the specified coordinates
 	 * Moves the transformation preview overlay to the specified coordinates
 	 */
 	 */
 	this.previewSelectionTranslation = function(x,y) {
 	this.previewSelectionTranslation = function(x,y) {
+        if (transformationPreviewOverlay == undefined)
+            return
 		var _x = parseInt(transformationPreviewOverlay.node.getAttribute('_x')),
 		var _x = parseInt(transformationPreviewOverlay.node.getAttribute('_x')),
 			 _y = parseInt(transformationPreviewOverlay.node.getAttribute('_y'));
 			 _y = parseInt(transformationPreviewOverlay.node.getAttribute('_y'));
 		transformationPreviewOverlay.translate(x-_x,y-_y);
 		transformationPreviewOverlay.translate(x-_x,y-_y);
@@ -247,11 +251,7 @@ GeometryUtils = function(){
 	 				 }
 	 				 }
 				 };
 				 };
 	
 	
-		icons.filter(
-            function(ic) {
-                return reqs.map(function(_node) {return _node['uri'];}).indexOf(ic + '.cs') < 0;
-            })
-            .forEach(
+		icons.forEach(
 			function(it)
 			function(it)
 			{
 			{
 				if( !(it in __icons) || __isConnectionType(it) )
 				if( !(it in __icons) || __isConnectionType(it) )
@@ -261,11 +261,14 @@ GeometryUtils = function(){
 					function(edgeId)
 					function(edgeId)
 					{
 					{
 						var linkIn = __edgeId2ends(edgeId)[0];
 						var linkIn = __edgeId2ends(edgeId)[0];
-						if( __isContainmentConnectionType(linkIn) )
-							resizeContainer(
-								__edgeId2ends(__icons[linkIn]['edgesIn'][0])[0],
-								linkIn,
-								it);
+						if( __isContainmentConnectionType(linkIn) ) {
+                            if ( reqs.map(function(_node) {return _node['uri'];}).indexOf(__edgeId2ends(__icons[linkIn]['edgesIn'][0])[0] + '.cs') < 0 ) {
+                                resizeContainer(
+                                    __edgeId2ends(__icons[linkIn]['edgesIn'][0])[0],
+                                    linkIn,
+                                    it);
+                            }
+                        }
 					});
 					});
 	
 	
 				if( context.toBeInserted && it in context.toBeInserted )
 				if( context.toBeInserted && it in context.toBeInserted )
@@ -452,6 +455,8 @@ GeometryUtils = function(){
 				 former tasks are computed and bundled with those that effect the 
 				 former tasks are computed and bundled with those that effect the 
 				 latter... the results of this form the emitted batchEdit */
 				 latter... the results of this form the emitted batchEdit */
 	this.transformSelection = function(callingContext,insertInfo) {
 	this.transformSelection = function(callingContext,insertInfo) {
+        if (transformationPreviewOverlay == undefined)
+            return
 		var T = transformationPreviewOverlay.node.getAttribute('transform');
 		var T = transformationPreviewOverlay.node.getAttribute('transform');
 		if( T == null || T == 'matrix(1,0,0,1,0,0)' )
 		if( T == null || T == 'matrix(1,0,0,1,0,0)' )
 		{
 		{
@@ -483,7 +488,7 @@ GeometryUtils = function(){
 					}
 					}
 					else
 					else
 					{
 					{
-						/* rotation/scale only */ 						
+						/* rotation/scale only */
 						var offset	 = [icon.getAttr('__x') - __selection['bbox'].x,
 						var offset	 = [icon.getAttr('__x') - __selection['bbox'].x,
 						 				 	 icon.getAttr('__y') - __selection['bbox'].y],
 						 				 	 icon.getAttr('__y') - __selection['bbox'].y],
 							 rsOffset = GeometryUtils.transformPoint(
 							 rsOffset = GeometryUtils.transformPoint(
@@ -606,7 +611,8 @@ GeometryUtils = function(){
 				insertRequests.forEach(
 				insertRequests.forEach(
 					function(r)
 					function(r)
 					{
 					{
-						toBeInserted[r['reqData']['dest']] = r['reqData']['src'];
+                        if ('reqData' in r)
+                            toBeInserted[r['reqData']['dest']] = r['reqData']['src'];
 					});
 					});
 			}
 			}
 	
 	

+ 6 - 4
client/mmm_utils.js

@@ -428,12 +428,12 @@ function __legalConnections(uri1,uri2,ctype)
 	3. return 'setified' concatenation of results from steps 1 and 2 */
 	3. return 'setified' concatenation of results from steps 1 and 2 */
 function __getIconsInContainer(container)
 function __getIconsInContainer(container)
 {
 {
-	function getExplicitContents(container, contents)
+	function getExplicitContents(container, explored)
 	{
 	{
 		if( __isConnectionType(container) )
 		if( __isConnectionType(container) )
 			return [];
 			return [];
         
         
-        if( contents.indexOf(container) > -1 ) {
+        if( explored.indexOf(container) > -1 ) {
             return []
             return []
         }
         }
 	
 	
@@ -451,10 +451,12 @@ function __getIconsInContainer(container)
 									return __edges[_edgeId]['end'];	
 									return __edges[_edgeId]['end'];	
 								}).concat([linkuri]);
 								}).concat([linkuri]);
 				}));
 				}));
+                
+        explored.push(container)
 
 
         for (var ct_idx in contents) {
         for (var ct_idx in contents) {
-            var to_concat = utils.flatten(getExplicitContents(contents[ct_idx], contents));
-            contents.concat(to_concat);
+            var to_concat = utils.flatten(getExplicitContents(contents[ct_idx], explored));
+            contents = contents.concat(to_concat);
         }
         }
         return utils.toSet(contents);
         return utils.toSet(contents);
 	}
 	}

+ 18 - 7
csworker.js

@@ -711,12 +711,16 @@ with AToMPM.  If not, see <http://www.gnu.org/licenses/>.
 					continue;
 					continue;
 
 
 				var ldi 		= vobjs[vid]['$linkDecoratorInfo']['value'],
 				var ldi 		= vobjs[vid]['$linkDecoratorInfo']['value'],
-					 pp  		= _svg.fns.getPointOnPathAtRatio(path,ldi.xratio),
-					 yoffset	= new _svg.types.Point(0,ldi.yoffset).rotate(pp.O),
-					 endAt	= (ldi.xratio >= 1 ? 
+					 pp  		= _svg.fns.getPointOnPathAtRatio(path,ldi.xratio);
+                     
+                if (pp == undefined)
+                    continue
+                
+				var yoffset	= new _svg.types.Point(0,ldi.yoffset).rotate(pp.O),
+					endAt	= (ldi.xratio >= 1 ? 
 						 				new _svg.types.Point(100,0).rotate(pp.O) :
 						 				new _svg.types.Point(100,0).rotate(pp.O) :
 										new _svg.types.Point(0,0)),
 										new _svg.types.Point(0,0)),
-					 changes = {};
+					changes = {};
 				pp.x += yoffset.x - link['position']['value'][0];
 				pp.x += yoffset.x - link['position']['value'][0];
 				pp.y += yoffset.y - link['position']['value'][1];
 				pp.y += yoffset.y - link['position']['value'][1];
 
 
@@ -832,9 +836,16 @@ with AToMPM.  If not, see <http://www.gnu.org/licenses/>.
 									 var changes = {};
 									 var changes = {};
 	 								 for( var fullattr in attrVals )
 	 								 for( var fullattr in attrVals )
 	 									 changes[fullattr] = attrVals[fullattr];
 	 									 changes[fullattr] = attrVals[fullattr];
-									 changelogs.push(
-											 _mmmk.update(id,changes)['changelog'] );
-	 								 callback( _utils.flatten(changelogs) );
+                                     var result = _mmmk.update(id,changes);
+                                     if ( '$err' in result )
+                                         callback( 
+                                            [{'op':'SYSOUT',
+                                              'text':'ERROR :: '+result['$err']}]);
+                                     else {
+                                         changelogs.push(
+                                                 result['changelog'] );
+                                         callback( _utils.flatten(changelogs) );
+                                     }
 								 }
 								 }
  							 },
  							 },
 						 failuref = 
 						 failuref = 

BIN
doc/_build/doctrees/environment.pickle


BIN
doc/_build/doctrees/executing_transformation.doctree


BIN
doc/_build/doctrees/index.doctree


BIN
doc/_build/doctrees/installation.doctree


BIN
doc/_build/doctrees/modelling_transformation.doctree


BIN
doc/_build/doctrees/new_language.doctree


BIN
doc/_build/doctrees/overview.doctree


BIN
doc/_build/doctrees/troubleshooting.doctree


BIN
doc/_build/doctrees/using_language.doctree


+ 2 - 1
doc/_build/html/_sources/index.txt

@@ -22,4 +22,5 @@ Contents
     Using a Modelling Language <using_language>
     Using a Modelling Language <using_language>
     Modelling a Model Transformation <modelling_transformation>
     Modelling a Model Transformation <modelling_transformation>
     Executing a Model Transformation <executing_transformation>
     Executing a Model Transformation <executing_transformation>
-    Troubleshooting <troubleshooting>
+    Troubleshooting <troubleshooting>
+    Workflows <workflows>

+ 9 - 0
doc/_build/html/index.html

@@ -116,6 +116,15 @@
 </li>
 </li>
 <li class="toctree-l1"><a class="reference internal" href="executing_transformation.html"> Executing a Model Transformation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="executing_transformation.html"> Executing a Model Transformation</a></li>
 <li class="toctree-l1"><a class="reference internal" href="troubleshooting.html"> Troubleshooting</a></li>
 <li class="toctree-l1"><a class="reference internal" href="troubleshooting.html"> Troubleshooting</a></li>
+<li class="toctree-l1"><a class="reference internal" href="workflows.html"> Workflows</a><ul>
+<li class="toctree-l2"><a class="reference internal" href="workflows.html#using-workflows">Using Workflows</a></li>
+<li class="toctree-l2"><a class="reference internal" href="workflows.html#opening-the-workflow">Opening the workflow</a></li>
+<li class="toctree-l2"><a class="reference internal" href="workflows.html#setting-the-run-time-parameters">Setting the run-time parameters</a></li>
+<li class="toctree-l2"><a class="reference internal" href="workflows.html#execute-the-workflow">Execute the workflow</a></li>
+<li class="toctree-l2"><a class="reference internal" href="workflows.html#dependency">Dependency</a></li>
+<li class="toctree-l2"><a class="reference internal" href="workflows.html#example-workflow-for-creating-a-dsl">Example Workflow for Creating a DSL</a></li>
+</ul>
+</li>
 </ul>
 </ul>
 </div>
 </div>
 </div>
 </div>

BIN
doc/_build/html/objects.inv


File diff suppressed because it is too large
+ 1 - 1
doc/_build/html/searchindex.js


+ 2 - 1
doc/index.rst

@@ -22,4 +22,5 @@ Contents
     Using a Modelling Language <using_language>
     Using a Modelling Language <using_language>
     Modelling a Model Transformation <modelling_transformation>
     Modelling a Model Transformation <modelling_transformation>
     Executing a Model Transformation <executing_transformation>
     Executing a Model Transformation <executing_transformation>
-    Troubleshooting <troubleshooting>
+    Troubleshooting <troubleshooting>
+    Workflows <workflows>

+ 5 - 2
mt/ptcal/pytcore/tcore/messages.py

@@ -253,11 +253,14 @@ class Match(dict):
         '''
         '''
         mapping = {}
         mapping = {}
         for label in self.iterkeys():
         for label in self.iterkeys():
-            sourceNode = source_graph.get_node(self[label])
+            try:
+                sourceNode = source_graph.get_node(self[label])
+            except KeyError:
+                raise Exception('The matched node %s does not exist' % label)
             if sourceNode is not None:
             if sourceNode is not None:
                 mapping[label] = sourceNode
                 mapping[label] = sourceNode
             else:
             else:
-                raise Exception('The matched node does not exist')
+                raise Exception('The matched node %s does not exist' % label)
         return mapping
         return mapping
     
     
     def to_mapping(self, source_graph, pattern_graph):
     def to_mapping(self, source_graph, pattern_graph):

+ 1 - 1
utils.js

@@ -85,7 +85,7 @@ utils.flatten =
 	{
 	{
 		return (arrays.length == 0 ?
 		return (arrays.length == 0 ?
 					[] :
 					[] :
-					arrays.reduce(function(a,b) {return a.concat(b);}));
+					[].concat.apply([], arrays));
 	};
 	};