digraph finite_state_machine {
	//rankdir=LR;
	rankdir=TB;
	ranksep=1.2;
	orientation=portrait;
	fontpath="C:\WINNT\Fonts";
	size="9.5,7.5";
	graph [	fontname = "Times-Bold",fontsize = 24,
//
//Use Case Title
//
		label = "Hybrid - LBS - UE-Assisted X3P - Accurate GPS Result - Facility Timeout"];
//
	node [shape=box,style="rounded,filled", color=greenyellow, fontname="Helvetica-Bold",fontsize=16];
	edge [fontname="Helvetica",fontsize=14];
//
// 	[fontname="Helvetica-Bold",fontsize=16, fontcolor=red, color=red]
//

//
// List of State
//
{ rank = same;
	Idle [label="Idle"];
	UE_Based [label="Performing UE-Based positioning\nunder Hybrid Positioning"];
}
	UE_Assisted [label="Performing UE-Assisted positioning\n(UE-Based positioning continue)"];
	Waiting_MC [label="Waiting for M.C. Release"];
{ rank = same;
	Waiting_Facility [label="Waiting for Facility"];
	End [label="Positioning Ends"];
}


//	UE_Based -> Waiting_MC [label = "UE-Based success/\nStop UE-Based Positioning,\nSend M.R.\n(confidence=68)"];


//
// Idle State
//
	Idle -> UE_Based [label = "Send M.C. (Setup)\nStart a2,a4 timer"
				,fontname="Helvetica-Bold",fontsize=16, fontcolor=red, color=red];


//
// UE Based State
//
	//
	//Transition to UE-Assisted	
	//
	UE_Based -> UE_Assisted [label="Timer a2 expired/\nSend M.R\nReceive M.C.\n(Modify,Reporting Interval=t)\nStart up Timer t"
				,fontname="Helvetica-Bold",fontsize=16, fontcolor=red, color=red];
	//
	//Transition to Waiting for M.C.	
	//
	UE_Based -> "Waiting_MC":e [label = "UE-Based success/\nStop UE-Based Positioning,\nSend M.R.\n(confidence=68)"];
	UE_Based -> "Waiting_MC":e [label = "UE-Based (Futile)/\nStop UE-Based Positioning,\nSend M.R.(RefPos)\n(confidence=100)"];
	//UE_Based -> "Waiting_MC":e [label = "Ref Position\naccurate enough/\nStop UE-Based Positioning,\nSend M.R.\n(confidence=0)"];
	
 	
//
// UE Assisted State
//

	//Loopback
	UE_Assisted:n -> UE_Assisted:w [label="Timer t expired/\nSend M.R,\nrestart timer t"];
	//
	//Transition to Waiting for M.C.	
	//
	UE_Assisted -> Waiting_MC:w [label = "timer a4 expired/\nStop UE-Based Positioning,\nSend M.R.\n(confidence=100)"];
	UE_Assisted -> Waiting_MC:w [label = "UE-Based (Futile)/\nStop UE-Based Positioning,\nSend M.R.(RefPos)\n(confidence=100)"];
	UE_Assisted -> Waiting_Facility [label = "Receive M.C. Release/\nStop UE-Based Positioning"];
	UE_Assisted -> Waiting_MC [label = "UE-Based success/\nStop UE-Based Positioning,\nSend M.R.\n(confidence=68)"
				,fontname="Helvetica-Bold",fontsize=16, fontcolor=red, color=red];


//
// Waiting for M.C. Release State
//
	Waiting_MC -> Waiting_Facility [label = "Receive M.C Release"
				,fontname="Helvetica-Bold",fontsize=16, fontcolor=red, color=red];
	Waiting_MC -> End:e [label = "M.C. wait timer expired\nSend M.R (some error)"];
//
// Waiting for Facility
//
	Waiting_Facility -> End [label="Facility wait timer expired"
				,fontname="Helvetica-Bold",fontsize=16, fontcolor=red, color=red];
	Waiting_Facility -> End [label="Receive Facility"];
 
//
// End State
//

}