public static void testInvoker() { Console.WriteLine("testInvoker"); CustomInvoker invoker = new CustomInvoker(); // just register prototype at global factory Factory.getInstance().registerInvoker(invoker); String xml = "<scxml>" + " <state id=\"s1\">" + " <invoke type=\"custom\" id=\"custominvoker1\">" + " <content>Some string content</content>" + " </invoke>" + " <invoke type=\"custom\" id=\"custominvoker2\" />" + " <state id=\"s11\">" + " <transition event=\"received1\" target=\"s12\">" + " </transition>" + " </state>" + " <state id=\"s12\">" + " <onentry>" + " <send target=\"#_custominvoker2\" event=\"foo\" />" + " <log label=\"label\" expr=\"foo\" />" + " </onentry>" + " <transition event=\"received2\" target=\"done\" />" + " </state>" + " </state>" + " <final id=\"done\" />" + "</scxml>"; // parse and interpret Interpreter interpreter = Interpreter.fromXML(xml, ""); interpreter.interpret(); }
public override Invoker create(Interpreter interpreter) { CustomInvoker invoker = new CustomInvoker(); invoker.swigCMemOwn = false; return invoker; }