示例#1
0
文件: RunTests.cs 项目: juehv/uscxml
        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();

        }
示例#2
0
 public override Invoker create(Interpreter interpreter)
 {
     CustomInvoker invoker = new CustomInvoker();
     invoker.swigCMemOwn = false;
     return invoker;
 }