Draw on the right, write (Umple) model code on the left. Analyse models and generate code. This tool stores your data in cookies and on a server. I understand. Click to learn about privacy. Download Donate For help: User manual Ask questions Report issue
// Test of queued state machines. // The word queued results in a thread being // created to process events. class TestSM { queued sm{ s1 { e1 /{System.out.println("e1");} ->s2; } s2 { e2 /{System.out.println("e2");} ->s3; } s3 { e3 /{System.out.println("e3");} ->s4; } s4 { e4 /{System.out.println("e4");} ->s1; } } public static void main(String [] ags){ TestSM test=new TestSM(); test.e1(); // processed s2 test.e2(); // processed s3 test.e3(); // processed s4 test.e4(); // processed s1 test.e1(); // processed s2 // queued: ignored // pooled: left in queue, until we test.e3(); // are next in s3 // pooled: left in queue, until test.e4(); // next in s4 // pooled: processed goes to s3 // pooled: process e3 from queue // goes to s4 // pooled: process s4 from queue test.e2(); // goes to s1 test.e1(); test.e3(); test.e2(); test.e4(); test.e1(); test.e2(); test.e3(); test.e4(); test.e1(); test.e2(); test.e4(); test.e3(); test.e4(); test.e1(); test.e3(); test.e2(); test.e3(); test.e1(); test.e4(); test.e2(); test.e1(); test.e2(); } } //$?[End_of_model]$? // @@@skipcppcompile - Contains Java Code // @@@skipphpcompile - Contains Java Code // @@@skiprubycompile - Contains Java Code // @@@skippythoncompile - Contains Java Code