Unverified Commit 7b840c9c authored by Jeno Attila Balasko's avatar Jeno Attila Balasko Committed by GitHub
Browse files

Merge pull request #602 from GergoUjhelyi/master

add almost every state machine for documentation
parents 23f1a39b bc5af875
///////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2000-2020 Ericsson Telecom AB
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v2.0
// which accompanies this distribution, and is available at
// https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
///////////////////////////////////////////////////////////////////////////////
/* state machine of port connection endpoints */
digraph state_mach_conn_endpoint {
// states
node [fontsize=16];
// start state (invisible)
START [style=invis];
// durable states
node[shape=box,style="filled,rounded"];
IDLE;
CONNECTED;
// transient states
node[shape=box,style=rounded];
LISTENING;
LAST_MSG_SENT;
LAST_MSG_RCVD;
// edges
edge [fontsize=12];
START -> IDLE [arrowtail=odot];
// state transitions for connect() operation
IDLE -> LISTENING [label="CONNECT_LISTEN/\nstarting server,\nCONNECT_LISTEN_ACK"];
LISTENING -> CONNECTED [label="incoming connection accepted/\nclosing server,\nCONNECTED"];
IDLE -> CONNECTED [label="CONNECT/\nconnection establishment"];
// state transitions for disconnect() operation
CONNECTED -> LAST_MSG_SENT [label="DISCONNECT_REQ/\nlast_message"];
CONNECTED -> LAST_MSG_RCVD [label="last_message/\nlast_message"];
LAST_MSG_SENT -> IDLE [label="last_message/\nconnection termination"];
LAST_MSG_RCVD -> IDLE [label="connection terminated/\nDISCONNECTED"];
// handling of connection-related errors
edge [fontsize=12,style=dashed];
IDLE -> IDLE [label="CONNECT_LISTEN,\nserver starting failed/\nCONNECT_ERROR"];
IDLE -> IDLE [label="CONNECT,\nconnection establishment failed/\nCONNECT_ERROR"];
LISTENING -> IDLE [label="DISCONNECT/\nclosing server"];
CONNECTED -> IDLE [label="component terminates\nor connection breakdown/\nDISCONNECTED"];
CONNECTED -> IDLE [label="DISCONNECT,\nsending of last_message failed/\nDISCONNECTED"];
CONNECTED -> IDLE [label="last_message,\nsending of last_message failed/\nDISCONNECTED"];
LAST_MSG_SENT -> IDLE [label="component terminates\nor connection breakdown/\nDISCONNECTED"];
}
///////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2000-2020 Ericsson Telecom AB
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v2.0
// which accompanies this distribution, and is available at
// https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
///////////////////////////////////////////////////////////////////////////////
/* state machine of port connections as seen by the MC */
digraph state_mach_conn_mc {
// states
node [fontsize=16];
// start state (invisible)
START [style=invis];
// durable states
node[shape=box,style="filled,rounded"];
IDLE;
CONNECTED;
// transient states
node[shape=box,style=rounded];
LISTENING;
CONNECTING;
DISCONNECTING;
// edges
edge [fontsize=12];
START -> IDLE [arrowtail=odot];
// state transitions for connect() operation
IDLE -> LISTENING [label="CONNECT_REQ/\nCONNECT_LISTEN"];
IDLE -> CONNECTING [label="CONNECT_REQ/\nCONNECT"];
LISTENING -> CONNECTING [label="CONNECT_LISTEN_ACK/\nCONNECT"];
CONNECTING -> CONNECTED [label="CONNECTED/\nCONNECT_ACK"];
CONNECTED -> CONNECTED [label="CONNECT_REQ/\nCONNECT_ACK"];
LISTENING -> LISTENING [label="CONNECT_REQ/\n-"];
CONNECTING -> CONNECTING [label="CONNECT_REQ/\n-"];
DISCONNECTING -> DISCONNECTING [label="CONNECT_REQ/\nERROR"];
// state transitions for disconnect() operation
CONNECTED -> DISCONNECTING [label="DISCONNECT_REQ/\nDISCONNECT"];
DISCONNECTING -> IDLE [label="DISCONNECTED or\ncomponent terminates/\nDISCONNECT_ACK"];
IDLE -> IDLE [label="DISCONNECT_REQ/\nDISCONNECT_ACK"];
LISTENING -> LISTENING [label="DISCONNECT_REQ/\nERROR"];
CONNECTING -> CONNECTING [label="DISCONNECT_REQ/\nERROR"];
DISCONNECTING -> DISCONNECTING [label="DISCONNECT_REQ/\n-"];
// handling of connection-related errors
edge [fontsize=12,style=dashed];
LISTENING -> IDLE [label="CONNECT_ERROR or\ncomponent terminates/\nERROR"];
CONNECTING -> IDLE [label="CONNECT_ERROR or\ncomponent terminates/\n[DISCONNECT,] ERROR"];
CONNECTED -> IDLE [label="DISCONNECTED or\ncomponent terminates/\n-"];
}
/******************************************************************************
* Copyright (c) 2000-2020 Ericsson Telecom AB
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
*
* Contributors:
* Ujhelyi, Gergo
*
******************************************************************************/
digraph state_mach_hc {
//states
node [fontsize = 20];
//start state (invisible)
START [style = invis];
//end state (invisible)
EXIT_HC [shape = point, width = 0];
node[shape = box, style = rounded];
IDLE;
PARAMETERS_SET;
//Edge
edge [fontsize = 14];
//FIXME: finish
//START -> IDLE [arrowtail="dot", label = " -/ connect to MC,\nVERSION"];
//edges to parameters_set
//IDLE -> PARAMETERS_SET [label = " SET_PARAM/\nSET_PARAM_OK "];
//PARAMETERS_SET -> PARAMETERS_SET [label = "SET_PARAM/\nSET_PARAM_OK"];
//PARAMETERS_SET -> PARAMETERS_SET [label = "KILL/\nkill()"];
//PARAMETERS_SET -> PARAMETERS_SET [label = "CREATE_MTC/\nfork()"];
//PARAMETERS_SET -> PARAMETERS_SET [ label = "CREATE/\nfork()"];
//edges to exit_hc
//IDLE -> EXIT_HC [ label = "EXIT_HC/\nclose connection"];
//PARAMETERS_SET -> EXIT_HC [ label = "EXIT_HC/\nclose connection, terminate"];
}
\ No newline at end of file
///////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2000-2020 Ericsson Telecom AB
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v2.0
// which accompanies this distribution, and is available at
// https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
///////////////////////////////////////////////////////////////////////////////
/* state machine of a HC as the MC sees */
digraph state_mach_mc_hc {
// states
node [fontsize=20];
// start state (invisible)
START [style=invis]
// durable states
node [shape=box,style="filled,rounded",fillcolor=lightgray];
IDLE;
ACTIVE [height=1.5,width=3,fixedsize=true,fontsize=28];
OVERLOADED;
DOWN;
// transient states
node[shape=box,style=rounded];
CONFIGURING;
CONFIGURING_OVERLOADED;
EXITING;
// edges
edge [fontsize=14];
START -> IDLE [arrowtail=odot];
{IDLE; ACTIVE} -> CONFIGURING [label="configure()/\nCONFIGURE"];
CONFIGURING -> ACTIVE [label="CONFIGURE_ACK"];
CONFIGURING -> IDLE [label="CONFIGURE_NAK/\nerror"];
ACTIVE -> OVERLOADED [label="CREATE_NAK/\nnotify"];
ACTIVE -> ACTIVE [label="create_mtc()/\nCREATE_MTC"];
ACTIVE -> ACTIVE [label="CREATE_REQ/\nCREATE_PTC"];
OVERLOADED -> ACTIVE [label="HC_READY/\nnotify"];
OVERLOADED -> CONFIGURING_OVERLOADED [label="configure()/\nCONFIGURE"];
CONFIGURING_OVERLOADED -> OVERLOADED [label="CONFIGURE_ACK"];
CONFIGURING_OVERLOADED -> IDLE [label="CONFIGURE_NAK/\nerror"];
CONFIGURING_OVERLOADED -> CONFIGURING [label="HC_READY/\nnotify"];
{IDLE; CONFIGURING; ACTIVE; OVERLOADED; CONFIGURING_OVERLOADED} -> EXITING [label="shutdown_session()/\nEXIT_HC"];
EXITING -> DOWN [label="connection termination"];
// error handling edges
// commented out, to get a clearer picture :)
/*
{IDLE; CONFIGURING; ACTIVE; OVERLOADED; CONFIGURING_OVERLOADED} -> DOWN [label="connection termination/\nerror"];
*/
}
/******************************************************************************
* Copyright (c) 2000-2020 Ericsson Telecom AB
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
*
* Contributors:
* Balasko, Jeno
* Szabo, Janos Zoltan – initial implementation
* Ujhelyi, Gergo
*
******************************************************************************/
digraph state_mach_mapping_mc {
//states
node [fontsize = 20]
//start state (invisible)
START [style = invis]
// durable states
node [shape = box, style = "filled,rounded", fillcolor = lightgray];
IDLE;
MAPPED;
// transient states
node[shape = box, style = rounded];
MAPPING;
UNMAPPING;
//Edge
edge [fontsize = 14];
START -> IDLE [arrowtail="dot"];
//edges to idle
IDLE -> IDLE [label = "UNMAP_REQ/\nUNMAP_ACK"];
UNMAPPING -> IDLE [label = "UNMAPPED or\ncomponent terminates/\nUNMAP_ACK"];
edge [fontsize = 14, style = dashed];
MAPPED -> IDLE [label = "UNMAPPED or\ncomponent terminates/\n-"];
MAPPING -> IDLE [label = "component terminates/\n -"];
//edges to mapping
edge [fontsize = 14, style = filled];
IDLE -> MAPPING [label = "MAP_REQ/\nMAP"];
MAPPING -> MAPPING [label = "MAP_REQ/\n-"];
MAPPING -> MAPPING [label = "UNMAP_REQ/\nERROR"];
//edges to mapped
MAPPING -> MAPPED [label = "MAPPED/\nMAP_ACK"];
MAPPED -> MAPPED [label = "MAP_REQ/\nMAP_ACK"];
//edges to unmapping
MAPPED -> UNMAPPING [label = "UNMAP_REQ/\nUNMAP"];
UNMAPPING -> UNMAPPING [label = "MAP_REQ/\nERROR"];
UNMAPPING -> UNMAPPING [label = "UNMAP_REQ/\n-"];
}
///////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2000-2020 Ericsson Telecom AB
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v2.0
// which accompanies this distribution, and is available at
// https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
///////////////////////////////////////////////////////////////////////////////
/* state machine of the MC */
digraph state_mach_mc {
// states
node [fontsize=20];
// start state (invisible)
START [style=invis]
// durable states
node [shape=box,style="filled,rounded",fillcolor=lightgray];
INACTIVE;
LISTENING;
LISTENING_CONFIGURED;
HC_CONNECTED;
ACTIVE;
READY;
EXECUTING_CONTROL;
EXECUTING_TESTCASE;
PAUSED;
// transient states
node[shape=box,style=rounded];
SHUTDOWN;
CONFIGURING;
CREATING_MTC;
TERMINATING_MTC;
TERMINATING_TESTCASE;
// edges
edge [fontsize=14];
START -> INACTIVE [arrowtail=odot];
INACTIVE -> LISTENING [label="start_session()/\nlisten()"];
{LISTENING; LISTENING_CONFIGURED} -> INACTIVE [label="shutdown_session()/\nclose()"];
{HC_CONNECTED; ACTIVE} -> SHUTDOWN [label="shutdown_session()/\nEXIT_HC"];
LISTENING -> HC_CONNECTED [label="VERSION/\n-"];
HC_CONNECTED -> HC_CONNECTED [label="VERSION/\n-"];
SHUTDOWN -> INACTIVE [label="all_hc_down()/\n-"];
{HC_CONNECTED; ACTIVE} -> CONFIGURING [label="configure()/\nCONFIGURE"];
{LISTENING; LISTENING_CONFIGURED} -> LISTENING_CONFIGURED [label="configure()/\n-"];
LISTENING_CONFIGURED -> CONFIGURING [label="VERSION/\nCONFIGURE"];
CONFIGURING -> CONFIGURING [label="VERSION/\n-"];
CONFIGURING -> ACTIVE [label="all_hc_configured()/\n-"];
ACTIVE -> CONFIGURING [label="VERSION/\nCONFIGURE"];
CONFIGURING -> HC_CONNECTED [label="CONFIGURE_NAK/\nerror"];
ACTIVE -> CREATING_MTC [label="create_mtc()/\nCREATE_MTC"];
CREATING_MTC -> ACTIVE [label="CREATE_NAK/\nerror"];
CREATING_MTC -> READY [label="MTC_CREATED/\n-"];
READY -> TERMINATING_MTC [label="exit_mtc()/\nEXIT_MTC"];
TERMINATING_MTC -> ACTIVE [label="MTC_connection_terminates/\n-"];
READY -> EXECUTING_CONTROL [label="execute_control()/\nEXECUTE_CONTROL"];
READY -> EXECUTING_CONTROL [label="execute_testcase()/\nEXECUTE_TESTCASE"];
EXECUTING_CONTROL -> READY [label="MTC_READY/\n-"];
EXECUTING_CONTROL -> EXECUTING_TESTCASE [label="TESTCASE_STARTED/\n-"];
EXECUTING_TESTCASE -> TERMINATING_TESTCASE [label="TESTCASE_FINISHED/\nSTOP"];
TERMINATING_TESTCASE -> EXECUTING_CONTROL [label="all_PTCs_terminated/\nPTC_VERDICT"];
TERMINATING_TESTCASE -> PAUSED [label="all_PTCs_terminated/\nPTC_VERDICT"];
PAUSED -> EXECUTING_CONTROL [label="continue_testcase()/\nCONTINUE"];
// error handling edges
// commented out, to get a clearer picture :)
/*
{HC_CONNECTED; CONFIGURING; ACTIVE} -> LISTENING_CONFIGURED [label="all_hc_down()/\nerror"];
*/
}
/******************************************************************************
* Copyright (c) 2000-2020 Ericsson Telecom AB
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
*
* Contributors:
* Ujhelyi, Gergo
*
******************************************************************************/
digraph state_mach_mtc {
//states
node [fontsize = 22];
//start state (invisible)
START [style = invis];
//ending states (invisible)
IDLE_END [style = invis];
EXECUTING_END [style = invis];
// transient states
node[shape = box, style = rounded];
IDLE;
EXECUTING;
{rank=same; IDLE_END, IDLE };
//Edge
edge [fontsize = 12];
//edges to idle
START -> IDLE [arrowtail="dot", label = "-/ connect to MC,\nMTC_CREATED"];
EXECUTING -> IDLE [dir = backward, label = "STOP/\nSTOPPED"];
EXECUTING -> IDLE [dir = backward, label = " execution finshed/\nCONTROL_FINISHED"];
//egde to idle end
IDLE -> IDLE_END [arrowhead = dotnormal, label = "EXIT_MTC/\nclose connection, terminate"];
//edge to executing
IDLE:sw -> EXECUTING [dir = forward, xlabel = " EXECUTE_CONTROL/\nstart generated code"];
//edge to executing end
EXECUTING -> EXECUTING_END [arrowhead = dotnormal, label = "EXIT_MTC/\nclose connection, terminate"]
}
\ No newline at end of file
///////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2000-2020 Ericsson Telecom AB
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v2.0
// which accompanies this distribution, and is available at
// https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
///////////////////////////////////////////////////////////////////////////////
/* state machine of PTCs as seen by the MC */
digraph state_mach_ptc_mc {
// states
node [fontsize=16];
// start state (invisible)
START [style=invis];
// states of both alive and non-alive PTCs
node[shape=box,style="filled,rounded"];
TC_INITIAL;
TC_IDLE;
PTC_FUNCTION;
PTC_STOPPING_KILLING;
PTC_KILLING;
TC_EXITING;
TC_EXITED;
// states of alive PTCs
node[shape=box,style=rounded];
PTC_STARTING;
TC_STOPPING;
PTC_STOPPED;
// edges for both alive and non-alive PTCs
edge [fontsize=12];
START -> TC_INITIAL [arrowtail=odot,label="CREATE_REQ/\nCREATE_PTC"];
TC_INITIAL -> TC_INITIAL [label="CREATE_NAK/\nCREATE_PTC"];
TC_INITIAL -> TC_IDLE [label="PTC_CREATED/\nCREATE_ACK"];
TC_INITIAL -> PTC_KILLING [label="PTC_CREATED/\nKILL"];
TC_IDLE -> PTC_FUNCTION [label="START_REQ/\nSTART, START_ACK"];
TC_IDLE -> PTC_KILLING [label="KILL_REQ/\nKILL"];
PTC_FUNCTION -> PTC_STOPPING_KILLING [label="KILL_REQ/\nKILL"];
PTC_FUNCTION -> TC_EXITING [label="STOPPED_KILLED/\nCOMPONENT_STATUS"];
PTC_STOPPING_KILLING -> PTC_STOPPING_KILLING [label="KILL_REQ/\n-"];
PTC_STOPPING_KILLING -> TC_EXITING [label="STOPPED_KILLED/\nCOMPONENT_STATUS,\nSTOP_ACK, KILL_ACK"];
PTC_KILLING -> PTC_KILLING [label="KILL_REQ/\n-"];
PTC_KILLING -> TC_EXITING [label="KILLED/\nCOMPONENT_STATUS,\nKILL_ACK"];
TC_EXITING -> TC_EXITING [label="KILL_REQ/\nKILL_ACK"];
TC_EXITING -> TC_EXITED [label="control connection closed/\n-"];
TC_EXITED -> TC_EXITED [label="KILL_REQ/\nKILL_ACK"];
// edges fior alive PTCs
edge [fontsize=12,style=dashed];
TC_IDLE -> TC_IDLE [label="STOP_REQ/\nSTOP_ACK"];
PTC_FUNCTION -> TC_STOPPING [label="STOP_REQ/\nSTOP"];
PTC_FUNCTION -> PTC_STOPPED [label="STOPPED/\nCOMPONENT_STATUS"];
PTC_STOPPING_KILLING -> PTC_STOPPING_KILLING [label="STOP_REQ/\n-"];
PTC_STOPPING_KILLING -> PTC_KILLING [label="STOPPED/\nCOMPONENT_STATUS,\nSTOP_ACK"];
PTC_KILLING -> PTC_KILLING [label="STOP_REQ/\nSTOP_ACK"];
TC_EXITING -> TC_EXITING [label="STOP_REQ/\nSTOP_ACK"];
TC_EXITED -> TC_EXITED [label="STOP_REQ/\nSTOP_ACK"];
PTC_STARTING -> PTC_FUNCTION [label="CANCEL_DONE_ACK/\nSTART,\nSTART_ACK"];
PTC_STARTING -> PTC_STARTING [label="STOP_REQ/\nERROR"];
PTC_STARTING -> PTC_STARTING [label="KILL_REQ/\nERROR"];
TC_STOPPING -> PTC_STOPPING_KILLING [label="KILL_REQ/\nKILL"];
TC_STOPPING -> TC_STOPPING [label="STOP_REQ/\n-"];
TC_STOPPING -> PTC_STOPPED [label="STOPPED/\nCOMPONENT_STATUS,\nSTOP_ACK"];
PTC_STOPPED -> PTC_KILLING [label="KILL_REQ/\nKILL"];
PTC_STOPPED -> PTC_FUNCTION [label="START_REQ/\nSTART,\nSTART_ACK"];
PTC_STOPPED -> PTC_STARTING [label="START_REQ/\nCANCEL_DONE"];
PTC_STOPPED -> PTC_STOPPED [label="STOP_REQ/\nSTOP_ACK"];
PTC_STOPPED -> TC_EXITING [label="KILLED/\nCOMPONENT_STATUS"];
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment