^1640682295973
@
sname
ThingAction
slabel
事物的行为和动作
sisChapter
true
sdescriptors
xworker.ide.tools.autodemo.AutoDemo
sinheritDescription
false
sth_createIndex
false
sth_registMyChilds
false
sth_registDisabled
false
sth_mark
false
  @/@AutoDemo
  sname
  AutoDemo
  slabel
  介绍
  sisChapter
  true
  sdescriptors
  xworker.ide.tools.autodemo.AutoDemo/@AutoDemo
  sinheritDescription
  false
  sth_createIndex
  false
  sth_registMyChilds
  false
  sth_registDisabled
  false
  sth_mark
  false
  sid
  AutoDemo
    @/@AutoDemo/@ShowHtml
    sname
    ShowHtml
    slabel
    演示-展示本次主题
    swaitTime
    5000
    Sdescription
#$@text#$@
<p>事物的行为和动作相当于传统的编程，它们才是可执行的程序，本视频将讲述事物的行为和动作等概念。</p>

<p><strong>要点：</strong></p>

<ul>
	<li>行为和动作是可执行的程序，因此相当于传统的编程。</li>
	<li>基础的行为和动作是用Java语言编写的。</li>
	<li>使用Java可以封装Groovy、Lua、Jythong和Scala等脚本动作。</li>
	<li>高级的行为和动作可以用Groovy、Lua、Jython和Scala等脚本编写。</li>
	<li>更高级的动作可以用其他动作编写。</li>
	<li>行为和动作的差别是是否有self变量。</li>
</ul>
#$@text#$@
    sisChapter
    true
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@ShowThingDescription
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    ShowHtml
    @/@AutoDemo/@SysResponse
    sname
    SysResponse
    slabel
    系统-你好
    swaitTime
    3000
    sdescription
    <p>你好。</p>
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SysResponse
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SysResponse
    @/@AutoDemo/@SendText
    sname
    SendText
    slabel
    用户-你好
    swaitTime
    1000
    scontent
    你好，今天要讲什么呢？
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SendText
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SendText
    @/@AutoDemo/@SysResponse1
    sname
    SysResponse
    slabel
    系统-介绍主题
    swaitTime
    3000
    sdescription
    <p>今天我们将讲解事物的行为和动作。</p>
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SysResponse
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SysResponse1
    @/@AutoDemo/@SendText1
    sname
    SendText
    slabel
    用户-请介绍概念
    swaitTime
    1000
    scontent
    好的，请先介绍一下这些概念。
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SendText
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SendText1
  @/@概念
  sname
  概念
  sisChapter
  true
  sdescriptors
  xworker.ide.tools.autodemo.AutoDemo/@AutoDemo
  sinheritDescription
  false
  sth_createIndex
  false
  sth_registMyChilds
  false
  sth_registDisabled
  false
  sth_mark
  false
  sid
  概念
    @/@概念/@SysResponse
    sname
    SysResponse
    slabel
    系统-传统编程
    swaitTime
    3000
    sdescription
    <p>我们知道传统的编程是在编写程序，而程序的运行可以管理数据。</p>
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SysResponse
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SysResponse
    @/@概念/@SendText
    sname
    SendText
    slabel
    用户-对传统编程的理解
    swaitTime
    1000
    scontent
    是的，传统的编程是用各种编程语言写代码，然后代码编译程序。
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SendText
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SendText
    @/@概念/@SysResponse1
    sname
    SysResponse
    slabel
    系统-解释XWorker编程的差别
    swaitTime
    3000
    sdescription
    <p>是的，但是到了XWorker这里情形就不太一样了。</p>
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SysResponse
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SysResponse1
    @/@概念/@SendText1
    sname
    SendText
    slabel
    用户-疑惑
    swaitTime
    1000
    scontent
    是因为XWorker号称使用数据编程的缘故吗？
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SendText
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SendText1
    @/@概念/@SysResponse2
    sname
    SysResponse
    slabel
    系统-解释和传统编程的差别
    swaitTime
    3000
    sdescription
    <p>是的，XWorker使用数据编程，在XWorker中数据称为事物，但是我们知道数据本身不可能是程序。</p>
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SysResponse
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SysResponse2
    @/@概念/@SendText2
    sname
    SendText
    slabel
    用户-问数据如何变成程序
    swaitTime
    1000
    scontent
    是的，即使我们能够编写出各种事物，但又怎样能够把它们运行起来呢？
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SendText
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SendText2
    @/@概念/@SysResponse3
    sname
    SysResponse
    slabel
    系统-解释动作
    swaitTime
    3000
    sdescription
    <p>这就是今天我们要讲的内容了，在XWorker里我们动态解释事物，通过解释的方法执行事物。</p>
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SysResponse
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SysResponse3
    @/@概念/@SendText3
    sname
    SendText
    slabel
    用户-解释语言
    swaitTime
    1000
    scontent
    这么说的话，那么如果XWorker是一门编程语言，那么它就是解释性语言了？
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SendText
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SendText3
    @/@概念/@SysResponse4
    sname
    SysResponse
    slabel
    系统-提出动作的概念
    swaitTime
    3000
    sdescription
    <p>是的，在XWorker中我们也可以编写Java或其他编程语言的代码，通过这些代码来实时解释执行事物。</p>
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SysResponse
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SysResponse4
    @/@概念/@SendText4
    sname
    SendText
    slabel
    用户-还是传统编程
    swaitTime
    1000
    scontent
    这似乎和传统编程一样了嘛，还是要编写程序，然后程序处理数据。
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SendText
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SendText4
    @/@概念/@SysResponse5
    sname
    SysResponse
    slabel
    系统-理解动作
    swaitTime
    3000
    sdescription
    <p>这么理解也是可以的，不过你很快会发现在XWorker中代码是嵌入到事物里的。</p>
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SysResponse
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SysResponse5
    @/@概念/@SendText5
    sname
    SendText
    slabel
    用户-代码用动作封装了
    swaitTime
    1000
    scontent
    你的意思是在XWorker中代码也被封装到事物里了，我们编写代码实际上还是在编写事物？
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SendText
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SendText5
    @/@概念/@SysResponse6
    sname
    SysResponse
    slabel
    系统-动作是事物
    swaitTime
    3000
    sdescription
    <p>是的，这样的事物我们称它为动作，因为它可以被引擎执行。</p>
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SysResponse
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SysResponse6
    @/@概念/@SendText6
    sname
    SendText
    slabel
    用户-行为是什么
    swaitTime
    1000
    scontent
    现在我已了解动作了，那么事物的行为又是什么呢？
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SendText
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SendText6
    @/@概念/@SysResponse7
    sname
    SysResponse
    slabel
    系统-解释行为
    swaitTime
    5000
    sdescription
    <p>其实一个动作如果是被事物调用执行的，那么它就被看做是这个事物的行为，否则就是普通的动作。</p>
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SysResponse
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SysResponse7
    @/@概念/@SendText7
    sname
    SendText
    slabel
    用户-理解为函数和行为
    swaitTime
    1000
    scontent
    也就是其他编程里函数和对象的行为的差别？
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SendText
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SendText7
    @/@概念/@SysResponse8
    sname
    SysResponse
    slabel
    系统-可以这么理解
    swaitTime
    3000
    sdescription
    <p>是的，可以这么理解。</p>
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SysResponse
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SysResponse8
    @/@概念/@SendText8
    sname
    SendText
    slabel
    用户-已理解概念
    swaitTime
    1000
    scontent
    我现在已经理解事物的行为和动作的概念了，那么可以教我怎么编写它们么？
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SendText
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SendText8
  @/@AutoDemo1
  sname
  AutoDemo
  slabel
  编写JavaAction
  sisChapter
  true
  sdescriptors
  xworker.ide.tools.autodemo.AutoDemo/@AutoDemo
  sinheritDescription
  false
  sth_createIndex
  false
  sth_registMyChilds
  false
  sth_registDisabled
  false
  sth_mark
  false
  sid
  AutoDemo1
    @/@AutoDemo1/@SysResponse
    sname
    SysResponse
    slabel
    系统-编写JavaAction
    swaitTime
    3000
    sdescription
    <p>首先我们从基本的JavaAction开始讲起吧。</p>
    sisChapter
    true
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SysResponse
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SysResponse
    @/@AutoDemo1/@SendText
    sname
    SendText
    slabel
    用户-为什么
    swaitTime
    1000
    scontent
    为什么要先讲JavaAction呢？
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SendText
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SendText
    @/@AutoDemo1/@SysResponse1
    sname
    SysResponse
    slabel
    系统-讲解JavaAction
    swaitTime
    3000
    sdescription
    <p>这是因为X-Meta引擎是使用Java编写的，并且引擎本身只能执行Java代码。</p>
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SysResponse
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SysResponse1
    @/@AutoDemo1/@SendText1
    sname
    SendText
    slabel
    用户-怎么能够执行其他代码
    swaitTime
    1000
    scontent
    但是在XWorker中不是可以执行其他代码吗？
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SendText
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SendText1
    @/@AutoDemo1/@SysResponse2
    sname
    SysResponse
    slabel
    系统-解释其他代码
    swaitTime
    5000
    sdescription
    <p>是的，比如在XWorker中可以编写Groovy脚本，但Groovy动作本身是使用JavaAction编写的，所以JavaAction是最基础的动作。</p>
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SysResponse
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SysResponse2
    @/@AutoDemo1/@SendText2
    sname
    SendText
    slabel
    用户-请讲如何使用JavaAction
    swaitTime
    1000
    scontent
    那么就请告我我如何使用JavaAction吧。
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SendText
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SendText2
    @/@AutoDemo1/@CreateThingDialog
    sname
    CreateThingDialog
    slabel
    演示-打开创建JavaAction
    sthingName
    AJavaAction
    sdescriptorPath
    xworker.lang.actions.JavaAction
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@CreateThingDialog
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    CreateThingDialog
    @/@AutoDemo1/@SysResponse3
    sname
    SysResponse
    slabel
    系统-讲解JavaAciton
    swaitTime
    5000
    sdescription
    <p>请看右面，要创建一个Java动作，那么可以使用xworker.lang.actions.JavaAction作为描述者来创建。</p>
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SysResponse
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SysResponse3
    @/@AutoDemo1/@SendText3
    sname
    SendText
    slabel
    用户-是否是嵌入
    swaitTime
    1000
    scontent
    这样说来，我们是要把Java嵌入到事物中来了。
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SendText
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SendText3
    @/@AutoDemo1/@SysResponse4
    sname
    SysResponse
    slabel
    系统-是嵌入
    swaitTime
    2000
    sdescription
    <p>是的。</p>
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SysResponse
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SysResponse4
    @/@AutoDemo1/@SendText4
    sname
    SendText
    slabel
    用户-请继续
    swaitTime
    1000
    scontent
    好吧，请继续讲如何使用JavaAction。
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SendText
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SendText4
    @/@AutoDemo1/@GroovyScript
    sname
    GroovyScript
    slabel
    演示-创建AJavaAction
    sisSynchronized
    false
    sthrowException
    true
    suseOtherAction
    false
    svarScope
    Local
    sdisableGlobalContext
    false
    Scode
#$@text#$@
import org.xmeta.Thing;

def thing = new Thing("xworker.lang.actions.JavaAction");
thing.put("name", "hello");
actionContext.getScope(0).put("javaAction", thing);
#$@text#$@
    sinterpretationType
    Action
    screateLocalVarScope
    false
    ssaveReturn
    false
    sdebugLog
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@GroovyScript
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    GroovyScript
    @/@AutoDemo1/@EditThing
    sname
    EditThing
    slabel
    演示-打开JavaAction
    sthingPath
    var:javaAction
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@EditThing
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    EditThing
    @/@AutoDemo1/@SysResponse5
    sname
    SysResponse
    slabel
    系统-解释JavaAction
    swaitTime
    3000
    sdescription
    <p>现在看右面，已经打开了Java动作的编辑界面。</p>
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SysResponse
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SysResponse5
    @/@AutoDemo1/@SendText5
    sname
    SendText
    slabel
    用户-如何设置属性
    swaitTime
    1000
    scontent
    那么我如何设置JavaAction的属性呢？
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SendText
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SendText5
    @/@AutoDemo1/@SysResponse6
    sname
    SysResponse
    slabel
    系统-使用JavaAction的三种场景
    swaitTime
    10000
    Sdescription
#$@text#$@
<p>JavaAction有三种使用场景：</p>

<ol>
	<li>调用XWorker之外已经写好编译好的Java代码。</li>
	<li>调用编写在XWorker的项目目录下，但没有嵌入到事物中的Java代码。</li>
	<li>直接在JavaAction事物中编写代码。</li>
</ol>
#$@text#$@
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SysResponse
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SysResponse6
    @/@AutoDemo1/@SendText6
    sname
    SendText
    slabel
    用户-请一一介绍
    swaitTime
    1000
    scontent
    好的，请一一介绍一下吧。
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SendText
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SendText6
    @/@AutoDemo1/@SysResponse7
    sname
    SysResponse
    slabel
    系统-介绍外部Java
    swaitTime
    10000
    sdescription
    <p>首先介绍调用外部Java，这个场景是最常用的，就调用一般Java项目中的代码，并且因为Java代码在Eclipse或NetBeans等编辑器里写最方便，而且X-Meta引擎本身也是用Java编写的，所以还可以在Eclipse等编辑器中调试代码。</p>
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SysResponse
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SysResponse7
    @/@AutoDemo1/@SetThingEditorValue
    sname
    SetThingEditorValue
    slabel
    演示-设置外部Java属性
    Svalues
#$@text#$@
{
    "useOuterJava":"true",
    "outerClassName":"org.xmeta.test.AJavaAction",
    "methodName":"run"
}
#$@text#$@
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SetThingEditorValue
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SetThingEditorValue
    @/@AutoDemo1/@SysResponse8
    sname
    SysResponse
    slabel
    系统-外部Java属性
    swaitTime
    10000
    sdescription
    <p>调用外部Java，如右面的编辑界面，需要设置三个属性，使用外部Java（useOuterJava)设为true，Java类全名(outerClassName)是要调用的Java类，方法名称（methodName）是要调用的这个类的那个方法。</p>
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SysResponse
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SysResponse8
    @/@AutoDemo1/@SendText7
    sname
    SendText
    slabel
    用户-如何编写Java
    swaitTime
    1000
    scontent
    那么Java代码该怎么编写呢，是否有要求。
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SendText
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SendText7
    @/@AutoDemo1/@SendText8
    sname
    SendText
    slabel
    演示-显示Java代码
    scodeType
    java
    Scode
#$@text#$@
package org.xmeta.test;

import org.xmeta.ActionContext;

public class AJavaAction{
    public static void run(ActionContext actionContext){
        System.out.println("Hello World!");
    }
}
#$@text#$@
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@ShowCode
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SendText8
    @/@AutoDemo1/@SysResponse9
    sname
    SysResponse
    slabel
    系统-讲解Java代码
    swaitTime
    5000
    sdescription
    <p>现在右面显示的是外部的Java代码，这里要求被调用的方法是静态的，并且参数是ActionContext，返回值等没有特别要求。</p>
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SysResponse
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SysResponse9
    @/@AutoDemo1/@SendText9
    sname
    SendText
    slabel
    用户-actionContext是什么
    scontent
    Java代码我会编写，但是ActionContext是什么呢？
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SendText
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SendText9
    @/@AutoDemo1/@SysResponse10
    sname
    SysResponse
    slabel
    系统-讲解ActionContext
    swaitTime
    3000
    sdescription
    <p>ActionContext是一个变量容器，在不同的动作之间可以传递变量和参数。</p>
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SysResponse
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SysResponse10
    @/@AutoDemo1/@SendText10
    sname
    SendText
    slabel
    用户-大概知道了
    swaitTime
    1000
    scontent
    我大概知道ActionContext的用途了，那么请继续介绍JavaAction的其它两种方法。
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SendText
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SendText10
    @/@AutoDemo1/@EditThing1
    sname
    EditThing
    slabel
    演示-打开JavaAction
    sthingPath
    var:javaAction
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@EditThing
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    EditThing1
    @/@AutoDemo1/@SetThingEditorValue1
    sname
    SetThingEditorValue
    slabel
    演示-设置调用内部Java
    Svalues
#$@text#$@
{
    "useOuterJava":"false",
    "useInnerJava":"true",
    "outerClassName":"org.xmeta.test.AJavaAction",
    "methodName":"run"
}
#$@text#$@
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SetThingEditorValue
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SetThingEditorValue1
    @/@AutoDemo1/@SysResponse11
    sname
    SysResponse
    slabel
    系统-讲解内部Java
    swaitTime
    7000
    sdescription
    <p>如现在右面的事物编辑器，代用内部Java和外部Java类似，只是要设置使用外部Java（useOuterJava）为false，使用内部Java（useInnerJava）为true。</p>
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SysResponse
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SysResponse11
    @/@AutoDemo1/@SendText11
    sname
    SendText
    slabel
    用户-Java代码在哪里
    swaitTime
    1000
    scontent
    这个时候我的Java代码放哪里呢？
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SendText
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SendText11
    @/@AutoDemo1/@SysResponse12
    sname
    SysResponse
    slabel
    系统-放到Thing下
    swaitTime
    6000
    sdescription
    <p>这个时候Java源码，即*.java文件要放到XWorker项目的文件夹下，即放到存放事物的文件夹下，事物和Java的包名规则是一样的。</p>
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SysResponse
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SysResponse12
    @/@AutoDemo1/@SendText12
    sname
    SendText
    slabel
    用户-内置Java怎么写
    swaitTime
    1000
    scontent
    好的，最后内置的Java如何编写呢？
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SendText
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SendText12
    @/@AutoDemo1/@SetThingEditorValue2
    sname
    SetThingEditorValue
    slabel
    演示-设置Java属性
    Svalues
#$@text#$@
{
    "useOuterJava":"false",
    "useInnerJava":"false",
    "outerClassName":"",
    "methodName":"run",
    "code":"package org.xmeta.test;\n\nimport org.xmeta.ActionContext;\n\n    public class AJavaAction{\n    public static void run(ActionContext actionContext){\n        System.out.println(\"Hello World!\");\n    }\n}",
    "className":"AJavaAction"
    
}
#$@text#$@
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SetThingEditorValue
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SetThingEditorValue2
    @/@AutoDemo1/@SysResponse13
    sname
    SysResponse
    slabel
    系统-讲解内置Java
    swaitTime
    10000
    sdescription
    <p>如现在右面编辑器的属性，Java代码是直接写到事物里的，需要设置类名（className）为代码中的Java类名，方法名称（methodName）是要调用的Java方法，其它设置为false或空。</p>
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SysResponse
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SysResponse13
    @/@AutoDemo1/@SendText13
    sname
    SendText
    slabel
    用户-如何执行java
    swaitTime
    1000
    scontent
    好的，我现在知道如何编写Java动作了，那么该怎么执行它呢？
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SendText
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SendText13
  @/@AutoDemo2
  sname
  AutoDemo
  slabel
  执行动作
  sisChapter
  true
  sdescriptors
  xworker.ide.tools.autodemo.AutoDemo/@AutoDemo
  sinheritDescription
  false
  sth_createIndex
  false
  sth_registMyChilds
  false
  sth_registDisabled
  false
  sth_mark
  false
  sid
  AutoDemo2
    @/@AutoDemo2/@SysResponse
    sname
    SysResponse
    slabel
    系统-解释动作的执行
    swaitTime
    3000
    sdescription
    <p>动作代表的是可执行的代码，所以可以在代码或其他动作里调用它。</p>
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SysResponse
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SysResponse
    @/@AutoDemo2/@SendText
    sname
    SendText
    slabel
    用户-理解调用动作
    swaitTime
    1000
    scontent
    这个我知道，由于动作相当于传统编程中的函数，因此动作也应该在代码或其他函数中调用。
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SendText
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SendText
    @/@AutoDemo2/@ShowCode
    sname
    ShowCode
    slabel
    演示-显示调用动作的代码
    scodeType
    java
    Scode
#$@text#$@
import org.xmeta.World;
import org.xmeta.Thing;
import org.xmeta.Action;
import org.xmeta.ActionContext;

public class Test{
    public static void main(String[] args){
         //World是Thing的容器
         World world = World.getInstance();
         
         //获取Thing
         Thing aJavaAction = world.getThing("AJavaAction");
         
         //转化为Action
         Action action = aJavaAction.getAction();
         
         //执行Action
         action.run(new ActionContext());
    }
}
#$@text#$@
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@ShowCode
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    ShowCode
    @/@AutoDemo2/@SysResponse1
    sname
    SysResponse
    slabel
    系统-解释执行动作的代码
    swaitTime
    3000
    sdescription
    <p>右面现在显示的代码是执行动作的演示代码。</p>
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SysResponse
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SysResponse1
    @/@AutoDemo2/@SendText1
    sname
    SendText
    slabel
    用户-看到了文件
    swaitTime
    1000
    scontent
    嗯，在这里我看到了有World、Thing、Action和ActionContext等类。
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SendText
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SendText1
    @/@AutoDemo2/@SysResponse2
    sname
    SysResponse
    slabel
    系统-解释引擎基础类
    swaitTime
    12000
    Sdescription
#$@text#$@
<p>是的，这几个是X-Meta引擎的核心类：</p>

<ul>
	<li><strong>org.xmeta.Thing</strong><br />
	事物，代表数据，我们编写的各种数据模型都会封装为Thing对象。<br />
	&nbsp;</li>
	<li><strong>org.xmeta.Action</strong><br />
	动作，代表可执行的程序，动作是通Thing转化而来。<br />
	&nbsp;</li>
	<li><strong>org.xmeta.World</strong><br />
	世界，管理事物的容器。<br />
	&nbsp;</li>
	<li><strong>org.xmeta.ActionContext</strong><br />
	变量容器，在动作之间传递变量和参数的容器。</li>
</ul>
#$@text#$@
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SysResponse
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SysResponse2
    @/@AutoDemo2/@SendText2
    sname
    SendText
    slabel
    用户-理解动作的执行
    swaitTime
    1000
    scontent
    我现在知道了，world.getThing("AJavaAction")是获取事物，thing.getAction()是把事物转化为动作，而动作action.run(new ActionContext())是执行动作。
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SendText
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SendText2
    @/@AutoDemo2/@SysResponse3
    sname
    SysResponse
    slabel
    系统-解释执行
    swaitTime
    3000
    sdescription
    <p>是的，这是获取事物、动作和执行动作的基本方法。</p>
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SysResponse
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SysResponse3
    @/@AutoDemo2/@SendText3
    sname
    SendText
    slabel
    用户-理解了执行事物
    swaitTime
    1000
    scontent
    好的，我已经基本理解动作了，但是我们用动作能做什么呢？
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SendText
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SendText3
    @/@AutoDemo2/@SysResponse4
    sname
    SysResponse
    slabel
    系统-使用动作的用途
    swaitTime
    3000
    sdescription
    <p>主要有两种用途，一是可以用基础动作编辑高级动作，另一个是可以作为事物的行为。</p>
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SysResponse
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SysResponse4
    @/@AutoDemo2/@SendText4
    sname
    SendText
    slabel
    用户-请继续介绍
    swaitTime
    1000
    scontent
    好，请分别介绍一下。
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SendText
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SendText4
  @/@AutoDemo3
  sname
  AutoDemo
  slabel
  集成脚本语言动作
  sisChapter
  true
  sdescriptors
  xworker.ide.tools.autodemo.AutoDemo/@AutoDemo
  sinheritDescription
  false
  sth_createIndex
  false
  sth_registMyChilds
  false
  sth_registDisabled
  false
  sth_mark
  false
  sid
  AutoDemo3
    @/@AutoDemo3/@ShowBlank
    sname
    ShowBlank
    slabel
    演示-显示空白
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@ShowBlank
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    ShowBlank
    @/@AutoDemo3/@SysResponse
    sname
    SysResponse
    slabel
    系统-其它动作的好处
    swaitTime
    5000
    sdescription
    <p>前面我们讲了如何编写JavaAction，虽然所有的动作都可以用Java来编写，但是很快就会发现这并不是最有效的编写动作的方法。</p>
    sisChapter
    true
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SysResponse
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SysResponse
    @/@AutoDemo3/@SendText8
    sname
    SendText
    slabel
    演示-显示Java代码
    scodeType
    java
    Scode
#$@text#$@
package org.xmeta.test;

import org.xmeta.ActionContext;

public class AJavaAction{
    public static void run(ActionContext actionContext){
        System.out.println("Hello World!");
    }
}
#$@text#$@
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@ShowCode
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SendText8
    @/@AutoDemo3/@SendText
    sname
    SendText
    slabel
    用户-可以理解
    swaitTime
    1000
    scontent
    嗯，可以理解，比如我想在屏幕上输出一个Hello World字符串，用Java需要编写完整的类，就像右边显示的代码一样。
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SendText
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SendText
    @/@AutoDemo3/@SysResponse1
    sname
    SysResponse
    slabel
    系统-用脚本方便
    swaitTime
    3000
    sdescription
    <p>是的，这段Java代码换成脚本的话，就可以写的很简洁。</p>
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SysResponse
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SysResponse1
    @/@AutoDemo3/@ShowCode
    sname
    ShowCode
    slabel
    演示-显示Groovy代码
    scodeType
    java
    scode
    println("Hello World!");
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@ShowCode
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    ShowCode
    @/@AutoDemo3/@SysResponse2
    sname
    SysResponse
    slabel
    系统-介绍Groovy
    swaitTime
    3000
    sdescription
    <p>比如现在右面显示的Groovy代码，只需要一行就可以输出Hello World了。</p>
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SysResponse
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SysResponse2
    @/@AutoDemo3/@SendText9
    sname
    SendText
    slabel
    用户-担心性能损失
    swaitTime
    1000
    scontent
    但是这样可能会有性能的损失吧？
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SendText
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SendText9
    @/@AutoDemo3/@SysResponse3
    sname
    SysResponse
    slabel
    系统-有损失但方便
    swaitTime
    3000
    sdescription
    <p>是有一定的性能损失，所以我们建议对性能要求非常高的动作使用Java编写，而其他动作可以用更方便的脚本编写。</p>
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SysResponse
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SysResponse3
    @/@AutoDemo3/@SendText10
    sname
    SendText
    slabel
    用户-请告诉我如何集成脚本
    swaitTime
    1000
    scontent
    那么，我怎么样能够集成一个脚本呢？
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SendText
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SendText10
    @/@AutoDemo3/@SysResponse4
    sname
    SysResponse
    slabel
    系统-以Groovy脚本为例
    swaitTime
    5000
    Sdescription
#$@text#$@
<p>我们以Groovy脚本为例。</p>

<p><strong><span style="color:rgb(255, 0, 0)">（注：后面的显示会打开GroovyAction事物，但不要修改，因为GroovyAction在XWorker中大量使用了，修改了可能会使系统崩溃。）</span></strong></p>
#$@text#$@
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SysResponse
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SysResponse4
    @/@AutoDemo3/@SendText11
    sname
    SendText
    slabel
    用户-不会修改
    swaitTime
    1000
    scontent
    好的，我不会去修改它，至少在我了解它之前我不会修改它。
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SendText
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SendText11
    @/@AutoDemo3/@EditThing
    sname
    EditThing
    slabel
    系统-演示GroovyAction
    sthingPath
    xworker.groovy.GroovyAction/@actions/@run
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@EditThing
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    EditThing
    @/@AutoDemo3/@SysResponse5
    sname
    SysResponse
    slabel
    系统-解释GroovyAction
    swaitTime
    5000
    sdescription
    <p>现在右面的编辑器显示的是GroovyAction，可以看到在actions子节点下有一个run动作，这个run动作是使用Java编写的。</p>
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SysResponse
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SysResponse5
    @/@AutoDemo3/@SendText12
    sname
    SendText
    slabel
    用户-问run动作
    swaitTime
    1000
    scontent
    实现run动作是一个规范吗？
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SendText
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SendText12
    @/@AutoDemo3/@SysResponse6
    sname
    SysResponse
    slabel
    系统-解释run动作规范
    swaitTime
    3000
    sdescription
    <p>是的，任何一个事物要想转化为动作，那么就必须要实现一个run方法，当然JavaAction例外。</p>
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SysResponse
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SysResponse6
    @/@AutoDemo3/@SendText13
    sname
    SendText
    slabel
    用户-问actions
    swaitTime
    1000
    scontent
    那么，为什么要放到actions子节点下呢？
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SendText
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SendText13
    @/@AutoDemo3/@SysResponse7
    sname
    SysResponse
    slabel
    系统-解释actions
    swaitTime
    5000
    sdescription
    <p>因为这样好管理，我们约定事物的第一个actions子节点下的事物是这个事物的行为，所以事物的行为都编写在这个下面了。</p>
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SysResponse
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SysResponse7
    @/@AutoDemo3/@SendText14
    sname
    SendText
    slabel
    用户-明白是为了方便
    swaitTime
    1000
    scontent
    好的，我明白了这是一个约定，那么GroovyAction中的run方法的Java代码怎么写呢？
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SendText
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SendText14
    @/@AutoDemo3/@ShowCode1
    sname
    ShowCode
    slabel
    演示-显示groovyAction的run
    scodeType
    java
    Scode
#$@text#$@
/*******************************************************************************
* Copyright 2007-2013 See AUTHORS file.
 * 
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* 
*   http://www.apache.org/licenses/LICENSE-2.0
* 
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
******************************************************************************/
package xworker.core.actions;

import groovy.lang.Binding;
import groovy.lang.Script;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Properties;

import org.codehaus.groovy.control.CompilerConfiguration;
import org.codehaus.groovy.control.MultipleCompilationErrorsException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.xmeta.Action;
import org.xmeta.ActionContext;
import org.xmeta.ActionException;
import org.xmeta.Bindings;
import org.xmeta.Thing;
import org.xmeta.World;
import org.xmeta.thingManagers.FileThingManager;
import org.xmeta.util.UtilAction;

public class GroovyAction {
	private static Logger log = LoggerFactory.getLogger(GroovyAction.class);	
	
	public static Object run(ActionContext context) throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException{				
		//脚本的上下文		
		Bindings bindings = context.getScope(context.getScopesSize() - 2);
		
		World world = bindings.world;
		Action action = null;
		if(bindings.getCaller() instanceof Thing){
			Thing actionThing = (Thing) bindings.getCaller();
			action = actionThing.getAction();
			action.checkChanged();
		}else{
			action = (Action) bindings.getCaller();
		}
		
		if(action == null){
			log.error("er");
		}
		//log.info("run groovy action : " + action.thing.getMetadata().getPath());
		
		if(action.actionClass == null || action.changed){
			//查看代码是否需要重新编译			
			boolean recompile = false;
			if(action.changed){
				recompile = true;
			}
			if(action.actionClass == null){
				File classFile = new File(action.classFileName);
				if(!classFile.exists()){
					recompile = true;
				}
			}
			
			if(recompile){
				//重新编译并装载脚本
				Thing actionThing = action.getThing();
				if(actionThing.getStringBlankAsNull("outterClassName") == null){
					String className = actionThing.getStringBlankAsNull("innerClassName");
	
					org.codehaus.groovy.tools.Compiler compiler;
					Properties prop = new Properties();
					prop.setProperty("groovy.target.directory", world.getPath()
							+ "/actionClasses");
					prop.setProperty("groovy.classpath", action.getCompileClassPath());
					CompilerConfiguration config = new CompilerConfiguration(prop);
					config.setSourceEncoding("utf-8");
					//System.out.println(config.getClasspath());
					compiler = new org.codehaus.groovy.tools.Compiler(config);
					
					File codeFile = null;
					if(className != null){
						if(!(actionThing.getMetadata().getThingManager() instanceof FileThingManager)){
							throw new ActionException("Innter class only used in FileThingManager, actionThing=" + actionThing.getMetadata().getPath());
						}
						
						FileThingManager manager = (FileThingManager) actionThing.getMetadata().getThingManager();
						codeFile = new File(manager.getFilePath(), className.replace('.', '/') + ".groovy");
					}else{
						//更新代码
						codeFile = new File(action.fileName + ".groovy");
						if(!codeFile.exists()){
							codeFile.getParentFile().mkdirs();
						}
						
						FileOutputStream fout = new FileOutputStream(codeFile);
						try{					
							fout.write(("/*path:" + action.getThing().getMetadata().getPath() + "*/\n").getBytes());
							fout.write(("package " + action.packageName + ";\n\n").getBytes());
							fout.write(action.code.getBytes("utf-8"));
							
						}finally{
							fout.close();
						}
					}
					
					//int dotIndex = action.className.lastIndexOf(".");			
					//String compileClassName = action.className.substring(dotIndex + 1, action.className.length());
					//compiler.compile(file);
					try{
						compiler.compile(codeFile);
						//log.info("compile groovy " + action.getThing().getMetadata().getPath());
						action.updateCompileTime();					
					}catch(MultipleCompilationErrorsException me){
						log.error("compile groovy code : " + action.getThing().getMetadata().getPath());
						throw me;
					}
				}
			}
			action.changed = false;
		}
		
		if(action.actionClass == null){
			Thing actionThing = action.getThing();
			String className = actionThing.getStringBlankAsNull("outterClassName");
			if(className != null){
				action.actionClass = action.classLoader.loadClass(className);
			}else{			
				className = actionThing.getStringBlankAsNull("innerClassName");
				if(className != null){
					action.actionClass = action.classLoader.loadClass(className);
				}else{
					action.actionClass = action.classLoader.loadClass(action.className);	
				}
			}
			
			java.lang.Compiler.compileClass(action.actionClass);
		}
				
		if(action.actionClass  != null){			
			Script script = (Script) action.actionClass .newInstance();//(Script) action.getData("script");
			
			Bindings bindings1 = context.push(null);			
			bindings1.put("actionContext", context);
			
			try{
				//取原始的self调用者
				//if(context.getScopesSize() >= 5){
				//	Bindings callerBindings = context.getScope(context.getScopesSize() - 5);
				//	Object self = callerBindings.get("self");
				//	bindings1.put("self", self);
				//}
				context.pushAction(action);
				
				Binding binding = new Binding(context);
				script.setBinding(binding);								
				Object result = script.run();			
				return result;
			}finally{
				//bindings1.remove("self");
				context.popAction();
				bindings1.remove("actionContext");
				
				Bindings varBindings = UtilAction.getVarScope(action.getThing(), context);
				if(varBindings != null){
					varBindings.putAll(bindings1);
				}
				/*
				 * 2013-06-04 采用UtilAction的方式即X-Meta的默认方式获取变量范围，张玉祥
				String varScope = action.getThing().getString("varScope");
                if("Global".equals(varScope) || varScope == null){
                	context.getScope(0).putAll(bindings1);
                }else if("Local".equals(varScope)){
                	bindings.putAll(bindings1);
                }else{
                    try{
                        int scopeIndex = Integer.parseInt(varScope);
                        if(scopeIndex >= 0){
                        	context.getScope(scopeIndex).putAll(bindings1);
                        }else{
                        	context.getScope(context.getScopesSize() + scopeIndex).putAll(bindings1);
                        }
                    }catch(Exception e){
                        Bindings actionBindings = context.getScope(varScope);
                        if(actionBindings != null){
                            actionBindings.putAll(bindings1);
                        }else{
                            bindings.putAll(bindings1);
                        }
                    }
                }*/
                
				context.pop();								
			}
		}else{
			log.warn("groovy action " + action.getThing().getMetadata().getPath() + " class is null");
		}
		
		return null;
	}
}
#$@text#$@
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@ShowCode
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    ShowCode1
    @/@AutoDemo3/@SysResponse8
    sname
    SysResponse
    slabel
    系统-解释GroovyAction
    swaitTime
    10000
    sdescription
    <p>右面现在显示的GroovyAction的run方法的Java实现，其主要思路是获取定义Groovy动作的事物，从该事物的code属性获取Groovy代码，然后用Groovy引擎取执行这个代码。</p>
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SysResponse
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SysResponse8
    @/@AutoDemo3/@SendText15
    sname
    SendText
    slabel
    用户-是不是其他语言也可以类似继承
    swaitTime
    1000
    scontent
    是不是其它编程语言我也可以类似的集成进来呢？
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SendText
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SendText15
    @/@AutoDemo3/@SysResponse9
    sname
    SysResponse
    slabel
    系统-解释继承其它语言
    swaitTime
    3000
    sdescription
    <p>是的，目前XWorker用同样的方法已集成了Lua、 Jython、Scala等脚本语言。</p>
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SysResponse
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SysResponse9
    @/@AutoDemo3/@SendText16
    sname
    SendText
    slabel
    用户-如何使用脚本
    swaitTime
    1000
    scontent
    好的，那么我该如何使用这些脚本动作呢？
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SendText
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SendText16
    @/@AutoDemo3/@CreateThingDialog
    sname
    CreateThingDialog
    slabel
    演示-创建Groovy动作
    sthingName
    AGroovyAction
    sdescriptorPath
    xworker.groovy.GroovyAction
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@CreateThingDialog
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    CreateThingDialog
    @/@AutoDemo3/@SysResponse10
    sname
    SysResponse
    slabel
    系统-使用Groovy脚本创建动作
    swaitTime
    7000
    sdescription
    <p>如右面的创建事物界面，有了GroovyAtion后就可以它来创建相应的动作了。</p>
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SysResponse
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SysResponse10
    @/@AutoDemo3/@GroovyScript
    sname
    GroovyScript
    slabel
    演示-创建Groovy动作实例
    sisSynchronized
    false
    sthrowException
    true
    suseOtherAction
    false
    svarScope
    Local
    sdisableGlobalContext
    false
    Scode
#$@text#$@
import org.xmeta.Thing;

def thing = new Thing("xworker.groovy.GroovyAction");
thing.put("name", "AGroovyAction");
thing.put("code", "println(\"Hello World!\");");

actionContext.getScope(0).put("groovyAction", thing);
#$@text#$@
    sinterpretationType
    Action
    screateLocalVarScope
    false
    ssaveReturn
    false
    sdebugLog
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@GroovyScript
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    GroovyScript
    @/@AutoDemo3/@EditThing1
    sname
    EditThing
    slabel
    演示-编辑GroovyAction事物
    sthingPath
    var:groovyAction
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@EditThing
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    EditThing1
    @/@AutoDemo3/@SysResponse11
    sname
    SysResponse
    slabel
    系统-说明Groovy事物
    swaitTime
    5000
    sdescription
    <p>现在右边打开了用GroovyAction创建的事物，可以在这里编写Groovy代码。</p>
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SysResponse
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SysResponse11
    @/@AutoDemo3/@SendText17
    sname
    SendText
    slabel
    用户-理解编写Groovy
    swaitTime
    1000
    scontent
    好的，我知道怎么编写Groovy代码了，那么如何执行Groovy编写的动作呢？
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SendText
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SendText17
    @/@AutoDemo3/@ShowCode2
    sname
    ShowCode
    slabel
    演示-显示调用动作的代码
    scodeType
    java
    Scode
#$@text#$@
import org.xmeta.World;
import org.xmeta.Thing;
import org.xmeta.Action;
import org.xmeta.ActionContext;

public class Test{
    public static void main(String[] args){
         //World是Thing的容器
         World world = World.getInstance();
         
         //获取Thing
         Thing aGroovyAction = world.getThing("AGroovyAction");
         
         //转化为Action
         Action action = aGroovyAction.getAction();
         
         //执行Action
         action.run(new ActionContext());
    }
}
#$@text#$@
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@ShowCode
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    ShowCode2
    @/@AutoDemo3/@SysResponse12
    sname
    SysResponse
    slabel
    系统-解释如何执行Groovy动作
    swaitTime
    10000
    sdescription
    <p>和执行JavaAction的方法是一样的，请参看右面的代码。</p>
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SysResponse
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SysResponse12
  @/@AutoDemo4
  sname
  AutoDemo
  slabel
  编写非语言里的动作
  sisChapter
  true
  sdescriptors
  xworker.ide.tools.autodemo.AutoDemo/@AutoDemo
  sinheritDescription
  false
  sth_createIndex
  false
  sth_registMyChilds
  false
  sth_registDisabled
  false
  sth_mark
  false
  sid
  AutoDemo4
    @/@AutoDemo4/@SendText18
    sname
    SendText
    slabel
    用户-是否可以创建非语言的动作
    swaitTime
    1000
    scontent
    我知道现在可以集成使用其他语言了，那么是否可以编写非语言类的动作呢？
    sisChapter
    true
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SendText
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SendText18
    @/@AutoDemo4/@SysResponse
    sname
    SysResponse
    slabel
    系统-可以编写非语言类的动作
    swaitTime
    3000
    sdescription
    <p>可以啊，任何一个事物只要实现了run方法，那么都可以当做动作。</p>
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SysResponse
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SysResponse
    @/@AutoDemo4/@SendText
    sname
    SendText
    slabel
    用户-请举例
    swaitTime
    1000
    scontent
    能举一个例子么？
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SendText
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SendText
    @/@AutoDemo4/@EditThing
    sname
    EditThing
    slabel
    演示-打开Add
    sthingPath
    xworker.demo.xworker.editor.examples.Add/@actions/@run
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@EditThing
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    EditThing
    @/@AutoDemo4/@SysResponse1
    sname
    SysResponse
    slabel
    系统-解释Add
    swaitTime
    5000
    sdescription
    <p>比如现在右面的编辑打开的是一个Add动作，即加法动作，它的作用是把自己的属性x1和x2的值相加。</p>
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SysResponse
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SysResponse1
    @/@AutoDemo4/@SendText19
    sname
    SendText
    slabel
    用户-理解Add
    swaitTime
    1000
    scontent
    我看到这里的run方法是用的GroovyAction。
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SendText
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SendText19
    @/@AutoDemo4/@SysResponse2
    sname
    SysResponse
    slabel
    系统-解释Groovy
    swaitTime
    3000
    sdescription
    <p>是的，任何动作和JavaAction的使用方法都是一样，可以一起使用。</p>
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SysResponse
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SysResponse2
    @/@AutoDemo4/@SendText20
    sname
    SendText
    slabel
    用户-理解add的实现
    swaitTime
    1000
    scontent
    在run方法的Groovy代码里，我看到了self变量，self变量是什么呢？
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SendText
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SendText20
    @/@AutoDemo4/@SysResponse3
    sname
    SysResponse
    slabel
    系统-解释self变量
    swaitTime
    5000
    sdescription
    <p>我么之所以说一个事物可以是动作，因为定义了它有一个run的方法，即这个事物有一个名为run的行为。</p>
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SysResponse
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SysResponse3
    @/@AutoDemo4/@SendText21
    sname
    SendText
    slabel
    用户-把事物当对象
    swaitTime
    1000
    scontent
    你是把事物当做对象看待了？
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SendText
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SendText21
    @/@AutoDemo4/@SysResponse4
    sname
    SysResponse
    slabel
    系统-事物和对象
    swaitTime
    3000
    sdescription
    <p>是的，执行一个用事物表示的动作，实际上是在执行它的run方法，而此时self变量就是事物自己。</p>
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SysResponse
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SysResponse4
    @/@AutoDemo4/@SendText22
    sname
    SendText
    slabel
    用户-解释this变量
    swaitTime
    1000
    scontent
    在Java对象的方法里，可以使用this变量，那么self变量是和this变量作用是一样的吗？
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SendText
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SendText22
    @/@AutoDemo4/@SysResponse5
    sname
    SysResponse
    slabel
    系统-解释self变量
    swaitTime
    3000
    sdescription
    <p>是的，this变量和self变量的作用是一样的。</p>
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SysResponse
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SysResponse5
    @/@AutoDemo4/@EditThing1
    sname
    EditThing
    slabel
    演示-编辑dd
    sthingPath
    xworker.demo.xworker.editor.examples.Add
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@EditThing
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    EditThing1
    @/@AutoDemo4/@SysResponse6
    sname
    SysResponse
    slabel
    系统-SelfAction
    swaitTime
    6000
    sdescription
    <p>需要注意的是一个动作要求self变量是自己，那么它必须继承SelfAction，见右面的编辑器。</p>
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SysResponse
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SysResponse6
    @/@AutoDemo4/@SendText23
    sname
    SendText
    slabel
    用户-如何使用Add
    swaitTime
    1000
    scontent
    好的，我知道了，那么我如何使用Add动作呢？
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SendText
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SendText23
    @/@AutoDemo4/@CreateThingDialog
    sname
    CreateThingDialog
    slabel
    演示-创建Add
    sthingName
    TestAdd
    sdescriptorPath
    xworker.demo.xworker.editor.examples.Add
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@CreateThingDialog
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    CreateThingDialog
    @/@AutoDemo4/@SysResponse7
    sname
    SysResponse
    slabel
    系统-创建Add对象
    swaitTime
    3000
    sdescription
    <p>如右面的创建时事物界面，我们可以使用它创建新的动作。</p>
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SysResponse
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SysResponse7
    @/@AutoDemo4/@EditThing2
    sname
    EditThing
    slabel
    演示-显示TestAdd
    sthingPath
    xworker.demo.xworker.editor.examples.TestAdd
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@EditThing
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    EditThing2
    @/@AutoDemo4/@SysResponse8
    sname
    SysResponse
    slabel
    系统-解释TestAdd
    swaitTime
    5000
    sdescription
    <p>在TestAdd中输入属性x1和x2的值，那么TestAdd动作执行后就会把两个值相加。</p>
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SysResponse
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SysResponse8
    @/@AutoDemo4/@SendText24
    sname
    SendText
    slabel
    用户-问执行方法
    swaitTime
    1000
    scontent
    那么它的执行方法和其他动作还是一样的吗？
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SendText
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SendText24
    @/@AutoDemo4/@ShowCode2
    sname
    ShowCode
    slabel
    演示-显示调用动作的代码
    scodeType
    java
    Scode
#$@text#$@
import org.xmeta.World;
import org.xmeta.Thing;
import org.xmeta.Action;
import org.xmeta.ActionContext;

public class Test{
    public static void main(String[] args){
         //World是Thing的容器
         World world = World.getInstance();
         
         //获取Thing
         Thing testAdd = world.getThing("xworker.demo.xworker.editor.examples.TestAdd");
         
         //转化为Action
         Action action = testAdd.getAction();
         
         //执行Action
         action.run(new ActionContext());
    }
}
#$@text#$@
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@ShowCode
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    ShowCode2
    @/@AutoDemo4/@SysResponse9
    sname
    SysResponse
    slabel
    系统-是的
    swaitTime
    3000
    sdescription
    <p>是的，如同右面显示的代码，和执行其他动作的方法是一样的。</p>
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SysResponse
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SysResponse9
  @/@AutoDemo5
  sname
  AutoDemo
  slabel
  事物的行为
  sisChapter
  true
  sdescriptors
  xworker.ide.tools.autodemo.AutoDemo/@AutoDemo
  sinheritDescription
  false
  sth_createIndex
  false
  sth_registMyChilds
  false
  sth_registDisabled
  false
  sth_mark
  false
  sid
  AutoDemo5
    @/@AutoDemo5/@SendText
    sname
    SendText
    slabel
    用户-问事物的行为
    swaitTime
    1000
    scontent
    好的，我现在已基本理解动作了，那么动作又怎么作为事物的行为呢？
    sisChapter
    true
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SendText
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SendText
    @/@AutoDemo5/@SysResponse
    sname
    SysResponse
    slabel
    系统-解释行为
    swaitTime
    3000
    sdescription
    <p>嗯，在前面讲述Add动作时，其实已经讲到事物的行为了。</p>
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SysResponse
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SysResponse
    @/@AutoDemo5/@ShowBlank
    sname
    ShowBlank
    slabel
    演示-显示空白
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@ShowBlank
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    ShowBlank
    @/@AutoDemo5/@SendText1
    sname
    SendText
    slabel
    用户-请更详细
    swaitTime
    1000
    scontent
    是的，请更详细的说明一下。
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SendText
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SendText1
    @/@AutoDemo5/@EditThing
    sname
    EditThing
    slabel
    演示-显示Person
    sthingPath
    xworker.demo.xworker.editor.examples.Person/@actions/@hello
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@EditThing
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    EditThing
    @/@AutoDemo5/@SysResponse1
    sname
    SysResponse
    slabel
    系统-解说Person
    swaitTime
    7000
    sdescription
    <p>现在右面显示的是Person事物，它定义了一个名为hello的动作，这个动作打印一个字符串，其中用到了self变量。</p>
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SysResponse
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SysResponse1
    @/@AutoDemo5/@SendText2
    sname
    SendText
    slabel
    用户-Person是类事物
    swaitTime
    1000
    scontent
    Person事物是将来要用作类的作用吧？
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SendText
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SendText2
    @/@AutoDemo5/@CreateThingDialog
    sname
    CreateThingDialog
    slabel
    演示-创建张三
    sthingName
    Zhangsan
    sdescriptorPath
    xworker.demo.xworker.editor.examples.Person
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@CreateThingDialog
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    CreateThingDialog
    @/@AutoDemo5/@SysResponse2
    sname
    SysResponse
    slabel
    系统-解释创建张三
    swaitTime
    3000
    sdescription
    <p>比如我们可以用人（Person）可以创建一个张三（Zhangsan）。</p>
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SysResponse
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SysResponse2
    @/@AutoDemo5/@EditThing1
    sname
    EditThing
    slabel
    演示-编辑张三
    sthingPath
    xworker.demo.xworker.editor.examples.Zhangsan
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@EditThing
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    EditThing1
    @/@AutoDemo5/@SysResponse3
    sname
    SysResponse
    slabel
    系统-解释张三
    swaitTime
    3000
    sdescription
    <p>这时张三就有了Person定义的hello方法。</p>
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SysResponse
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SysResponse3
    @/@AutoDemo5/@SendText3
    sname
    SendText
    slabel
    用户-用类和对象理解
    swaitTime
    1000
    scontent
    似乎是和类和对象的关系是一样的，如果在Java中定义了一个Person类，用它实例化了一个Zhangsan，那么Zhangsan也有Person定义的方法。
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SendText
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SendText3
    @/@AutoDemo5/@SysResponse4
    sname
    SysResponse
    slabel
    系统-是的
    swaitTime
    3000
    sdescription
    <p>是的，理解正确。</p>
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SysResponse
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SysResponse4
    @/@AutoDemo5/@SendText4
    sname
    SendText
    slabel
    用户-如何执行张三的方法
    swaitTime
    1000
    scontent
    那么，我该如何执行张三的hello方法呢？
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SendText
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SendText4
    @/@AutoDemo5/@ShowCode2
    sname
    ShowCode
    slabel
    演示-显示调用动作的代码
    scodeType
    java
    Scode
#$@text#$@
import org.xmeta.World;
import org.xmeta.Thing;
import org.xmeta.Action;
import org.xmeta.ActionContext;

public class Test{
    public static void main(String[] args){
         //World是Thing的容器
         World world = World.getInstance();
         
         //获取Thing
         Thing zhangsan = world.getThing("xworker.demo.xworker.editor.examples.Zhangsan");         
         
         //执行事物的行为
         zhangsan.doActoin("hello", new ActionContext());
    }
}
#$@text#$@
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@ShowCode
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    ShowCode2
    @/@AutoDemo5/@SysResponse5
    sname
    SysResponse
    slabel
    系统-解释执行代码
    swaitTime
    10000
    sdescription
    <p>请看右面的示例代码，执行一个事物的行为时不同转化为动作(Action），而是执行它的doAction方法，其中第一个参数是事物的行为名。</p>
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SysResponse
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SysResponse5
    @/@AutoDemo5/@SendText5
    sname
    SendText
    slabel
    用户-理解行为
    swaitTime
    1000
    scontent
    感觉和其他编程方法是类似的，动作本身相当于函数，所以可以直接运行，而行为是属于对象的，所以要通过对象本身来调用。
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SendText
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SendText5
    @/@AutoDemo5/@SysResponse6
    sname
    SysResponse
    slabel
    系统-说理解正确
    swaitTime
    3000
    sdescription
    <p>是的，理解正确，只有这样对象才能把自己以self变量传入到动作中。</p>
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SysResponse
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SysResponse6
  @/@AutoDemo6
  sname
  AutoDemo
  slabel
  变量上下文
  sisChapter
  true
  sdescriptors
  xworker.ide.tools.autodemo.AutoDemo/@AutoDemo
  sinheritDescription
  false
  sth_createIndex
  false
  sth_registMyChilds
  false
  sth_registDisabled
  false
  sth_mark
  false
  sid
  AutoDemo6
    @/@AutoDemo6/@ShowBlank
    sname
    ShowBlank
    slabel
    演示-显示空白
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@ShowBlank
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    ShowBlank
    @/@AutoDemo6/@SendText
    sname
    SendText
    slabel
    用户-请解释变量上下文
    swaitTime
    1000
    scontent
    说到传入变量，能解释一下变量上下文ActionContext吗？
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SendText
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SendText
    @/@AutoDemo6/@SysResponse
    sname
    SysResponse
    slabel
    系统-解释变量上下文
    swaitTime
    3000
    sdescription
    <p>可以啊，首先变量上下文相当于一个Map，是一个变量的容器。</p>
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SysResponse
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SysResponse
    @/@AutoDemo6/@SendText1
    sname
    SendText
    slabel
    用户-它还能是什么呢？
    swaitTime
    1000
    scontent
    它还能是什么呢？
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SendText
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SendText1
    @/@AutoDemo6/@SysResponse1
    sname
    SysResponse
    slabel
    系统-函数栈
    swaitTime
    3000
    sdescription
    <p>ActionContext另一个重要的角色是函数栈。</p>
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SysResponse
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SysResponse1
    @/@AutoDemo6/@SendText2
    sname
    SendText
    slabel
    用户-理解栈
    swaitTime
    1000
    scontent
    和Java中的线程的栈是一个意思么？
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SendText
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SendText2
    @/@AutoDemo6/@SysResponse2
    sname
    SysResponse
    slabel
    系统-解释栈
    swaitTime
    5000
    sdescription
    <p>是的，通过栈可以表示全局变量、本地变量和参数等，它也可以表示线程执行的状态。</p>
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SysResponse
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SysResponse2
    @/@AutoDemo6/@SendText3
    sname
    SendText
    slabel
    用户-太复杂了
    swaitTime
    1000
    scontent
    这个好像有点太复杂了，普通编程时会用到么？
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SendText
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SendText3
    @/@AutoDemo6/@SysResponse3
    sname
    SysResponse
    slabel
    系统-解释普通编程
    swaitTime
    3000
    sdescription
    <p>普通编程中要理解如何表示全局变量、局部变量和参数等。</p>
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SysResponse
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SysResponse3
    @/@AutoDemo6/@SendText4
    sname
    SendText
    slabel
    用户-请说
    swaitTime
    1000
    scontent
    请说......
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SendText
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SendText4
    @/@AutoDemo6/@ShowCode
    sname
    ShowCode
    slabel
    演示-显示压栈和出栈
    scodeType
    java
    Scode
#$@text#$@
import org.xmeta.ActionContext;
import org.xmeta.Bindings;

//声明一个变量上下文
def ac = new ActionContext();

//压入栈和放入变量
ac.push().put("name", "zhangsan");
//获取变量，此时打印的是zhangsan
println(ac.get("name")):


//继续压入栈和放入变量
ac.push().put("name", "lisi");
//获取变量，此时打印的是lisi
println(ac.get("name")):

//如果出栈
ac.pop();
//获取变量，此时打印的是zhangsan
println(ac.get("name")):


//如果再出栈
ac.pop();
//获取变量，此时打印的是null
println(ac.get("name")):
#$@text#$@
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@ShowCode
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    ShowCode
    @/@AutoDemo6/@SysResponse4
    sname
    SysResponse
    slabel
    系统-解释压栈和出栈
    swaitTime
    15000
    sdescription
    <p>如右面的代码所演示的，同一个变量名name可以放入多个栈层中，但从变量上下文中取name是，总是优先去顶层栈层的变量，通过这种方法可以实现参数的传入以及表示本地范围的变量等。</p>
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SysResponse
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SysResponse4
    @/@AutoDemo6/@SendText5
    sname
    SendText
    slabel
    用户-如何表示全局变量
    swaitTime
    1000
    scontent
    那么全局变量又是怎么表示的呢？
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SendText
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SendText5
    @/@AutoDemo6/@ShowCode1
    sname
    ShowCode
    slabel
    演示-显示全局变量
    scodeType
    java
    Scode
#$@text#$@
import org.xmeta.ActionContext;
import org.xmeta.Bindings;

//声明一个变量上下文
def ac = new ActionContext();

//范围0是全局变量
ac.getScope(0).put("name", "zhangsan");
#$@text#$@
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@ShowCode
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    ShowCode1
    @/@AutoDemo6/@SysResponse5
    sname
    SysResponse
    slabel
    系统-解释全局变量
    swaitTime
    6000
    sdescription
    <p>如右面的代码所演示的，变量范围0层的栈是全局变量，它和线程无关，任何线程里都可以获取到它。</p>
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SysResponse
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SysResponse5
    @/@AutoDemo6/@SendText6
    sname
    SendText
    slabel
    用户-是否线程安全
    swaitTime
    1000
    scontent
    你是说ActionContext是线程安全的吗？
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SendText
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SendText6
    @/@AutoDemo6/@SysResponse6
    sname
    SysResponse
    slabel
    系统-是线程安全的
    swaitTime
    3000
    sdescription
    <p>是的，ActionContext是线程安全的，但是在压栈和出现时应该是成对出现的。</p>
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SysResponse
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SysResponse6
    @/@AutoDemo6/@ShowCode2
    sname
    ShowCode
    slabel
    演示-显示try/catch
    scodeType
    java
    Scode
#$@text#$@
import org.xmeta.ActionContext;
import org.xmeta.Bindings;

//声明一个变量上下文
def ac = new ActionContext();

try{
    //压入栈
    ac.push();\
}finally{
    ac.pop();
}
#$@text#$@
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@ShowCode
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    ShowCode2
    @/@AutoDemo6/@SendText7
    sname
    SendText
    slabel
    用户-解释成对
    swaitTime
    1000
    scontent
    是像右面显示的代码那样在finally里出栈吗？
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SendText
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SendText7
    @/@AutoDemo6/@SysResponse7
    sname
    SysResponse
    slabel
    系统-是的
    swaitTime
    3000
    sdescription
    <p>是的，要确保压栈和出栈是成对的，除非你有特殊的需求。</p>
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SysResponse
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SysResponse7
  @/@AutoDemo7
  sname
  AutoDemo
  slabel
  结尾
  sisChapter
  true
  sdescriptors
  xworker.ide.tools.autodemo.AutoDemo/@AutoDemo
  sinheritDescription
  false
  sth_createIndex
  false
  sth_registMyChilds
  false
  sth_registDisabled
  false
  sth_mark
  false
  sid
  AutoDemo7
    @/@AutoDemo7/@ShowBlank
    sname
    ShowBlank
    slabel
    演示-显示空白
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@ShowBlank
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    ShowBlank
    @/@AutoDemo7/@SendText
    sname
    SendText
    slabel
    用户-说内容多
    swaitTime
    1000
    scontent
    好的，今天讲的内容可真多啊！
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SendText
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SendText
    @/@AutoDemo7/@SysResponse
    sname
    SysResponse
    slabel
    系统-是的
    swaitTime
    3000
    sdescription
    <p>是的，以上就是本次演示的全部内容。</p>
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SysResponse
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SysResponse
    @/@AutoDemo7/@SendText1
    sname
    SendText
    slabel
    用户-再见
    swaitTime
    1000
    scontent
    好的，谢谢讲解，再见。
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SendText
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SendText1
    @/@AutoDemo7/@SysResponse1
    sname
    SysResponse
    slabel
    系统-再见
    swaitTime
    3000
    sdescription
    <p>再见。</p>
    sisChapter
    false
    sdescriptors
    xworker.ide.tools.autodemo.AutoDemo/@SysResponse
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SysResponse1
