include "primitives.alh" Diagram my_SCCD { name = "SimpleSCCD" author = "Yentl" } Class main { name = "Main" default = True } Attribute attr_a { name = "a" } Attribute attr_b { name = "b" } class_attributes (main, attr_a) {} class_attributes (main, attr_b) {} CompositeState main_statechart { name = "root" isInitial = True {composite_children} BasicState init { name = "initial" isInitial = True } {composite_children} ParallelState main_parallel { name = "parallel" isInitial = False {parallel_children} CompositeState parallel_x { {composite_children} BasicState x_a { name = "xa" isInitial = True onEntryScript = $ Void function entry(attributes : Element): log("ENTRY xa") return! $ onExitScript = $ Void function exit(attributes : Element): log("EXIT xa") return! $ } {composite_children} BasicState x_b { name = "xb" isInitial = False onEntryScript = $ Void function entry(attributes : Element): log("ENTRY xb") return! $ onExitScript = $ Void function exit(attributes : Element): log("EXIT xb") return! $ } {composite_children} BasicState x_c { name = "xc" isInitial = False } {composite_children} BasicState x_d { name = "xd" isInitial = False } } {parallel_children} CompositeState parallel_y { {composite_children} BasicState y_a { name = "ya" isInitial = True } {composite_children} BasicState y_b { name = "yb" isInitial = False } } } } transition (x_a, x_b) { name = "X" event = "X" script = $ Void function script(attributes : Element): log("In script") dict_overwrite(attributes, "a", 1) dict_overwrite(attributes, "b", 2) return! $ } transition (x_a, x_d) { name = "timeout" after = $ Float function after(attributes : Element): log("In after") return 3.0! $ } transition (x_b, x_c) { name = "Z" cond = $ Boolean function cond(attributes : Element): log("In condition") return integer_lt(attributes["a"], attributes["b"])! $ } transition (y_a, y_b) { name = "Y" event = "Y" } transition (init, main_parallel) { name = "init" event = "init" } diagram_classes (my_SCCD, main) {} behaviour (main, main_statechart) {}