import sys
sys.path.append("wrappers")
sys.path.append("examples")

from modelverse import *
import SCCD_callback_SCCD

init()
login("admin", "admin")

model_add("models/my_FSA", "formalisms/MyOwnFSA", """
    InitialState init{
        name = "initial"
    }
    State s1{
        name = "S1"
    }
    State s2{
        name = "S2"
    }
    Transition (init, s1) {
        trigger = "B"
        raise = "C"
    }
    Transition (s1, s2) {
        trigger = "A"
        raise = "D"
    }
    """)

ctrl = SCCD_callback_SCCD.Controller(keep_running=False)
thrd = threading.Thread(target=ctrl.start)
thrd.daemon = True
thrd.start()

transformation_execute_AL("formalisms/MyOwnFSA_activities/simulate", {"FSA": "models/my_FSA"}, {}, (ctrl, "inp", "outp"))
