server: EO (servers MM, C; agents SA, MMSR, CSR),
states {ini, wait, ent_oper, left_oper, fatal, check},
services {start, befop, op, nop, ok, ne2, e2, error},
actions{
{SA.EO.start, EO.ini} -> {SA.MM.go, EO.wait},
{SA.EO.ok, EO.wait} -> {EO.wait},
{SA.EO.ok, EO.left_oper} -> {EO.left_oper},
{SA.EO.ok, EO.fatal} -> {EO.fatal},

{MMSR.EO.befop, EO.wait} -> {MMSR.MM.rep, EO.wait},
{MMSR.EO.op, EO.wait} -> {MMSR.MM.rep, EO.ent_oper},
{MMSR.EO.nop, EO.wait} -> {MMSR.MM.rep, EO.left_oper},
{MMSR.EO.op, EO.ent_oper} -> {MMSR.MM.rep, EO.ent_oper},
{MMSR.EO.nop, EO.ent_oper} -> {MMSR.MM.rep, EO.left_oper},
{MMSR.EO.befop, EO.left_oper} -> {EO.fatal},
{MMSR.EO.op, EO.left_oper} -> {EO.left_oper},
{MMSR.EO.nop, EO.left_oper} -> {EO.left_oper},
{MMSR.EO.befop, EO.fatal} -> {EO.fatal},
{MMSR.EO.op, EO.fatal} -> {EO.fatal},
{MMSR.EO.nop, EO.fatal} -> {EO.fatal},

{MMSR.EO.befop, EO.check} -> {MMSR.MM.rep, EO.wait},
{MMSR.EO.op, EO.check} -> {EO.fatal},
{MMSR.EO.nop, EO.check} -> {EO.left_oper},

{CSR.EO.ne2, EO.wait} -> {CSR.C.rep, EO.wait},
{CSR.EO.e2, EO.wait} -> {CSR.EO.e2, EO.check},
{CSR.EO.ne2, EO.ent_oper} -> {CSR.C.rep, EO.ent_oper},
{CSR.EO.e2, EO.ent_oper} -> {CSR.EO.e2, EO.check},
{CSR.EO.ne2, EO.left_oper} -> {EO.left_oper},
{CSR.EO.e2, EO.left_oper} -> {EO.left_oper},
{CSR.EO.ne2, EO.fatal} -> {EO.fatal},
{CSR.EO.e2, EO.fatal} -> {EO.fatal},
}

server: MM (servers EO, C, FDIR, IM; agents IMA, CR, AR, SA, MMSR),
states {idle, starts, oper, fail, shut, finish},
services {go, start, alarm, rep, e1, e2, ready},
actions{
{SA.MM.go, MM.idle} -> {SA.EO.ok, MM.starts},
{CR.MM.start, MM.starts} -> {CR.C.reset, MM.oper},
{AR.MM.alarm, MM.oper} -> {AR.C.inc, MM.fail},
{AR.MM.alarm, MM.finish} -> {MM.finish},
{AR.MM.e1, MM.fail} -> {AR.FDIR.ok, MM.oper},
{AR.MM.e2, MM.fail} -> {AR.FDIR.ok, MM.shut},
{IMA.MM.ready, MM.shut} -> {IMA.IM.close, MM.finish},

{MMSR.MM.rep, MM.idle} -> {MMSR.EO.befop, MM.idle},
{MMSR.MM.rep, MM.starts} -> {MMSR.EO.befop, MM.starts},
{MMSR.MM.rep, MM.oper} -> {MMSR.EO.op, MM.oper},
{MMSR.MM.rep, MM.shut} -> {MMSR.EO.nop, MM.shut},
{MMSR.MM.rep, MM.finish} -> {MMSR.EO.nop, MM.finish},
}

server: C (servers MM, EO; agents AR, CR, CSR),
states {undef, er0, er1, er2},
services {reset, inc, rep, err},
actions{
{CR.C.reset, C.undef} -> {C.er0},

{AR.C.inc, C.er0} -> {AR.MM.e1, C.er1},
{AR.C.inc, C.er1} -> {AR.MM.e2, C.er2},
{AR.C.inc, C.er2} -> {C.er2},

{CSR.C.rep, C.er0} -> {CSR.EO.ne2, C.er0},
{CSR.C.rep, C.er1} -> {CSR.EO.ne2, C.er1},
{CSR.C.rep, C.er2} -> {CSR.EO.e2, C.er2},
}

server: FDIR (servers MM; agents AR),
states {na, a},
services {run, ok},
actions{
{AR.FDIR.run, FDIR.na} -> {AR.FDIR.run, FDIR.na},
{AR.FDIR.run, FDIR.na} -> {AR.MM.alarm, FDIR.a},
{AR.FDIR.ok, FDIR.a} -> {AR.FDIR.run, FDIR.na},
}

server: IM (agents IMA),
states {i},
services {close},
actions{
{IMA.IM.close, IM.i} -> {IM.i},
}

servers EO, MM, C, FDIR, IM;
agents SA, IMA, CR, AR, MMSR, CSR;

init -> {
	EO(MM,C,SA,MMSR,CSR).ini,
	MM(EO,C,FDIR,IM,IMA,CR,AR,SA,MMSR).idle,
	C(MM,EO,AR,CR,CSR).undef,
	FDIR(MM,AR).na,
	IM(IMA).i,

	IMA.MM.ready,
	CR.MM.start,
	SA.EO.start,
	MMSR.EO.op,
	CSR.EO.ne2,
	AR.FDIR.run
}
