anchor.diff:          , data: formData
   		, complete: function(jqXHR, textStatus){
   			var res = $.parseJSON(jqXHR.responseText);
  +			drawDiagram(res);
   
  +		}
  +        , cache: false
  +        , contentType: false
  +        , processData: false
  +    });
  +};
   
  -	Joint.paper("myfsa1", 1000, 200);
  +function drawDiagram(res){
  +	Joint.paper("myfsa1", 500, 2000);
   	var fsa = Joint.dia.fsa;
   
  -	var cStart = fsa.State.create({ position: {x: 120, y: 120}, label: "Start" });
  -	var cEnd = fsa.State.create({ position: {x: 500, y: 120}, label: "End" });
  +	var yPos = 50;
  +
  +	var cStart = fsa.State.create({ position: {x: 200, y: yPos}, label: "Start" });
   	var circles = [];
  -	var xPos = 300;
   
  -	var all = [cStart, cEnd];
  +	var all = [];
   	for(var i = 0; i < res.decisionOrForkOrJoin.length; i++){
  +		yPos += 100;
   		var circle;
  -			circle = fsa.State.create({ position: {x: xPos, y: 50}, label: res.decisionOrForkOrJoin[i].name });
  +			circle = fsa.State.create({ position: {x: 200, y: yPos}, label: res.decisionOrForkOrJoin[i].name });
   //		if(res.decisionOrForkOrJoin[i].java !=null){
   //			var java = res.decisionOrForkOrJoin[i].java;
   //		}
   
   		all.push(circle);
   		circles.push(circle);
  -		xPos += 100;
   	}
  -//	var s2 = fsa.State.create({ position: {x: 300, y: 50}, label: "state 2" });
   
  +	yPos += 100;
  +
  +	var cEnd = fsa.State.create({ position: {x: 200, y: yPos}, label: "End" });
  +	all.push(cStart);
  +	all.push(cEnd);
   	
   	cStart.joint(circles[0], fsa.arrow).registerForever(all);
   
  
positive.code: 
  	circles[circles.length - 1].joint(cEnd, fsa.arrow).registerForever(all);
  
  
  		}
          , cache: false
          , contentType: false
          , processData: false
      });
  };
  
  $(function() {
  
  	$("#submitButton").click(submitButtonClicked);
  	Joint.paper("myfsa", 1000, 200);
  	var fsa = Joint.dia.fsa;
  //	var s0 = fsa.StartState.create({ position: {x: 50, y: 50} });
  	var se = fsa.EndState.create({ position: {x: 450, y: 150} });
  	var s1 = fsa.State.create({ position: {x: 120, y: 120}, label: "state 1" });
  	var s2 = fsa.State.create({ position: {x: 300, y: 50}, label: "state 2" });
  
  //	var all = [s0, s1, s2, se];
  	var all = [s1, s2, se];
  //	s0.joint(s1, fsa.arrow).registerForever(all);
  	s1.joint(s2, fsa.arrow).registerForever(all);
  	s2.joint(se, fsa.arrow).registerForever(all);
  
  //	var json = {"any":null,"credentials":null,"decisionOrForkOrJoin":[{"anyUnderChoice":null,"anyUnderSequence":null,"cred":null,"error":{"to":"fail"},"fs":null,"java":{"archive":[],"arg":["Hello","Oozie!"],"captureOutput":null,"configuration":{"property":[{"description":null,"name":"mapred.job.queue.name","value":"${queueName}"}]},"file":[],"javaOpt":[],"javaOpts":null,"jobTracker":"${jobTracker}","jobXml":[],"mainClass":"org.apache.oozie.example.DemoJavaMain","nameNode":"${nameNode}","prepare":null},"mapReduce":null,"name":"java-node","ok":{"to":"end"},"pig":null,"retryInterval":null,"retryMax":null,"subWorkflow":null},{"message":"Java failed, error","name":"fail"}],"end":{"name":"end"},"global":null,"name":"java-main-wf","parameters":null,"start":{"to":"java-node"}};
  
  }); // End of JQuery Initialization
  
  
negative.code: 		
  	</div>
  
  	<div id="myfsa1"></div>
  
  
  
  </body>
  