You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by pa...@apache.org on 2017/02/08 11:02:31 UTC

ambari git commit: Revert "AMBARI-19889. Workflow Manager Should be able to handle fork with single path. (pallavkul)"

Repository: ambari
Updated Branches:
  refs/heads/trunk 0eeecbbd1 -> af781d1ac


Revert "AMBARI-19889. Workflow Manager Should be able to handle fork with single path. (pallavkul)"

This reverts commit 0eeecbbd16b7a95527ca4ee59c5460b2244127d3.


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/af781d1a
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/af781d1a
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/af781d1a

Branch: refs/heads/trunk
Commit: af781d1acdcf8edbc9fe2f99803b54ef6d831f7e
Parents: 0eeecbb
Author: pallavkul <pa...@gmail.com>
Authored: Wed Feb 8 16:32:17 2017 +0530
Committer: pallavkul <pa...@gmail.com>
Committed: Wed Feb 8 16:32:17 2017 +0530

----------------------------------------------------------------------
 .../src/main/resources/ui/app/domain/findnode-mixin.js    | 10 ++--------
 .../src/main/resources/ui/app/domain/node-handler.js      | 10 +++-------
 .../wfmanager/src/main/resources/ui/app/domain/node.js    |  2 +-
 .../src/main/resources/ui/app/domain/workflow.js          |  5 +++--
 4 files changed, 9 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/af781d1a/contrib/views/wfmanager/src/main/resources/ui/app/domain/findnode-mixin.js
----------------------------------------------------------------------
diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/domain/findnode-mixin.js b/contrib/views/wfmanager/src/main/resources/ui/app/domain/findnode-mixin.js
index fd84208..c770fb0 100644
--- a/contrib/views/wfmanager/src/main/resources/ui/app/domain/findnode-mixin.js
+++ b/contrib/views/wfmanager/src/main/resources/ui/app/domain/findnode-mixin.js
@@ -20,9 +20,6 @@ var FindNodeMixin= Ember.Mixin.create({
   findNodeById(startNode,id){
     return this._findNodeById(startNode,id);
   },
-  findNodeByType(startNode,type){
-    return this._findNodeByAttr(startNode,type,"type");
-  },
   findTransition(startNode,sourceId,targetId){
     return this._findTransition(startNode,sourceId,targetId);
   },
@@ -66,18 +63,15 @@ var FindNodeMixin= Ember.Mixin.create({
     return res;
   },
   _findNodeById(node,id){
-    return this._findNodeByAttr(node,id,"id");
-  },
-  _findNodeByAttr(node,id,attrType){
     var self=this;
-    if (node.get(attrType)===id){
+    if (node.get("id")===id){
       return node;
     }else{
       if (node.transitions){
         var res;
         for (var i = 0; i < node.transitions.length; i++) {
           var transition=node.transitions[i];
-          res= self._findNodeByAttr(transition.getTargetNode(false),id,attrType);
+          res= self._findNodeById(transition.getTargetNode(false),id);
           if (res){
             break;
           }

http://git-wip-us.apache.org/repos/asf/ambari/blob/af781d1a/contrib/views/wfmanager/src/main/resources/ui/app/domain/node-handler.js
----------------------------------------------------------------------
diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/domain/node-handler.js b/contrib/views/wfmanager/src/main/resources/ui/app/domain/node-handler.js
index 12d12d2..28ea527 100644
--- a/contrib/views/wfmanager/src/main/resources/ui/app/domain/node-handler.js
+++ b/contrib/views/wfmanager/src/main/resources/ui/app/domain/node-handler.js
@@ -164,10 +164,8 @@ var DecisionNodeHandler= NodeHandler.extend({
     return this.nodeFactory.createEmptyDecisionNode(node._name);
   },
   handleImportTransitions(node,json,nodeMap){
-    var self=this;
     var defaultPath=json.switch.default._to;
-    var placeholder=self.nodeFactory.createPlaceholderNode(nodeMap.get(defaultPath).node);
-    node.addTransitionTo(placeholder,"default");
+    node.addTransitionTo(nodeMap.get(defaultPath).node,"default");
     var cases=[];
     if (Ember.isArray(json.switch.case)){
       cases=json.switch.case;
@@ -175,8 +173,7 @@ var DecisionNodeHandler= NodeHandler.extend({
       cases.push(json.switch.case);
     }
     cases.forEach(function(caseExpr){
-      var placeholder=self.nodeFactory.createPlaceholderNode(nodeMap.get(caseExpr._to).node);
-      node.addTransitionTo(placeholder,caseExpr.__text);
+      node.addTransitionTo(nodeMap.get(caseExpr._to).node,caseExpr.__text);
     });
   }
 });
@@ -193,8 +190,7 @@ var ForkNodeHandler= NodeHandler.extend({
     return this.nodeFactory.createEmptyForkNode(node._name);
   },
   handleImportTransitions(node,json,nodeMap){
-    var paths=Ember.isArray(json.path)?json.path:[json.path];
-    paths.forEach(function(path){
+    json.path.forEach(function(path){
       node.addTransitionTo(nodeMap.get(path._start).node);
     });
   }

http://git-wip-us.apache.org/repos/asf/ambari/blob/af781d1a/contrib/views/wfmanager/src/main/resources/ui/app/domain/node.js
----------------------------------------------------------------------
diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/domain/node.js b/contrib/views/wfmanager/src/main/resources/ui/app/domain/node.js
index d815df1..db5bf1e 100644
--- a/contrib/views/wfmanager/src/main/resources/ui/app/domain/node.js
+++ b/contrib/views/wfmanager/src/main/resources/ui/app/domain/node.js
@@ -180,7 +180,7 @@ var Node = Ember.Object.extend(FindNodeMixin,{
   },
   getDefaultTransitionTarget(){
     if (this.isForkNode()){
-      return this.findNodeByType(this,"join");
+      return this.findNodeById(this,"join_"+this.get("id"));
     }
     var transitions=this.get("transitions");
     if (transitions.length===0){

http://git-wip-us.apache.org/repos/asf/ambari/blob/af781d1a/contrib/views/wfmanager/src/main/resources/ui/app/domain/workflow.js
----------------------------------------------------------------------
diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/domain/workflow.js b/contrib/views/wfmanager/src/main/resources/ui/app/domain/workflow.js
index 3ca20d2..900d692 100644
--- a/contrib/views/wfmanager/src/main/resources/ui/app/domain/workflow.js
+++ b/contrib/views/wfmanager/src/main/resources/ui/app/domain/workflow.js
@@ -70,10 +70,11 @@ var Workflow= Ember.Object.extend(FindNodeMixin,{
   },
 
   findJoinNode(node){
-    if (node.isDecisionNode()){
+    if (node.isDecisionNode() || node.isForkNode()){
       return this.findCommonTargetNode(this.startNode,node);
     }else if (node.isForkNode()) {
-      return node.getDefaultTransitionTarget();
+      //TODO find join node by id if it is efficient later..
+      return this.findCommonTargetNode(this.startNode,node);
     }else{
       return null;
     }