^1651632694938
@
sname
ResMonitorGuide
slabel
资源监控向导
sdescription
<p>资源监控向导。</p>
sinterpretationType
Self
sattributeTemplate
false
schildsAttributeTemplate
false
svarScope
Local
sisSynchronized
false
sthrowException
true
suseOtherAction
false
screateLocalVarScope
false
ssaveReturn
false
sdisableGlobalContext
false
sdebugLog
false
sdescriptors
xworker.function.ui.guide.Guide
sinheritDescription
false
sth_createIndex
true
sth_registThing
action|xworker.function.ui.topic.xworker.BaseApps
sth_registMyChilds
false
sth_registDisabled
false
sgroup
监控
sth_mark
false
  @/@NextGuides
  sname
  NextGuides
  sdescriptors
  xworker.function.ui.guide.Guide/@NextGuides
  sinheritDescription
  false
  sth_createIndex
  false
  sth_registMyChilds
  false
  sth_registDisabled
  false
  sth_mark
  false
  sid
  NextGuides
    @/@NextGuides/@monitorManager
    sname
    monitorManager
    slabel
    监控向导式管理
    sguidePath
    xworker.app.appmanager.swt.editors.monitor.guides.ResMonitorGuide/@PreparedGuides/@viewAndEditResTask
    sdescriptors
    xworker.function.ui.guide.Guide/@NextGuides/@GuideReference
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    monitorManager
    @/@NextGuides/@monitorManagerAll
    sname
    monitorManagerAll
    slabel
    监控一站式管理
    scompositePath
    xworker.app.appmanager.swt.editors.monitor.ResMonitor/@Control/@mainSash
    sdescriptors
    xworker.function.ui.guide.Guide/@NextGuides/@Composite
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    monitorManagerAll
    @/@NextGuides/@Help1
    sname
    HelpContents
    slabel
    帮助内容
    sinterpretationType
    Self
    sattributeTemplate
    false
    schildsAttributeTemplate
    false
    svarScope
    Local
    sisSynchronized
    false
    sthrowException
    true
    suseOtherAction
    false
    screateLocalVarScope
    false
    ssaveReturn
    false
    sdisableGlobalContext
    false
    sdebugLog
    false
    sdescriptors
    xworker.function.ui.guide.Guide/@NextGuides/@Guide
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    Help1
      @/@NextGuides/@Help1/@NextGuides
      sname
      NextGuides
      sdescriptors
      xworker.function.ui.guide.Guide/@NextGuides
      sinheritDescription
      false
      sth_createIndex
      false
      sth_registMyChilds
      false
      sth_registDisabled
      false
      sth_mark
      false
      sid
      NextGuides
        @/@NextGuides/@Help1/@NextGuides/@Help
        sname
        Monitor简介
        slabel
        监控简介
        stype
        description
        sbuttonText
        更多帮助内容
        Sdescription
#$@text#$@
<h3>资源监控</h3>

<p>&nbsp;&nbsp;&nbsp; 资源监控是一个监控各种资源的监控工具，比如可以从SQL、Linux、Http和其他发送抓取数据，然后分析数据发送报数据报告，或把数据保存到数据库中等。</p>

<p><strong>基本概念：</strong></p>

<ul>
	<li><strong>监控：</strong>一个监控是一个定时任务，一个监控可以包含多个任务。</li>
	<li><strong>任务：</strong>一个任务是一个具体的执行程序，它负负责对资源的数据获取、检查等操作，一个任务通常对应一类资源，一个任务可以包含多个资源。</li>
	<li><strong>资源：</strong>用户检查或抓取数据的数据库、服务器等。</li>
</ul>

<p><strong>资源监控使用指南</strong></p>

<ul>
	<li><strong>创建一个监控</strong><br />
	主要是设置执行的间隔顶定时信息。<br />
	&nbsp;</li>
	<li><strong>添加任务和资源</strong><br />
	一个监控可以添加多个任务，一个任务可以添加多个资源。<br />
	&nbsp;</li>
	<li><strong>设置任务</strong><br />
	任务设置一般包括如何分解数据、如何处理数据和如何形成报警信息等，不同的任务设置方法可能是不同的，参看任务本身的说明。<br />
	&nbsp;</li>
	<li><strong>添加子任务</strong><br />
	一个任务如果有后续，比如发现一个应用死机了，那么用一个子任务把它重启等。</li>
</ul>

<p><strong>资源监控的执行流程</strong></p>

<div style="margin-left: 40px;">
<p><strong>1. 监控定时器</strong></p>

<p>&nbsp;&nbsp;&nbsp;&nbsp;首先启动的定时的监控，监控在定时触发式会启动监控子任务。</p>

<p><strong>2. 监控任务的执行</strong></p>

<p>&nbsp;&nbsp;&nbsp; 监控子任务执行时会传入监控数据、资源列表和监控上下文等变量，然后执行run方法处理资源。</p>

<div style="margin-left: 40px;">
<p><strong>2.1 资源一起或单个处理</strong></p>

<p>&nbsp;&nbsp;&nbsp; 任务可以自定义一次处理所有资源，或者每个资源单独处理，如果资源是单独处理的，那么会对每一个资源启动一个新的任务，这样任务的子任务每个资源子任务都会各自触发。</p>

<p><strong>2.2 任务所抓取的数据</strong></p>

<p>&nbsp;&nbsp;&nbsp; 任务对资源处理后通常会有结果数据，任务可以自行决定在变量上下文保存那些变量，也可以返回具有一定格式的字符串。</p>

<p>&nbsp;&nbsp;&nbsp; 任务返回的字符串结果可以如下，即是一个可以分行分列的数据，每个数据是一个值。</p>

<p>&nbsp;&nbsp;&nbsp;&nbsp; xxxx,xxx,xxx,xxxx,xxx<br />
&nbsp;&nbsp;&nbsp;&nbsp; xxxx,xxx,xx,xxx,xxx</p>

<p>&nbsp;&nbsp;&nbsp; 如果结果是上面格式的字符串，那么可以分解为单个值。首先单个值优先转化成double类型，其次数据按列会以v1,v2....vn保存到变量上下文中，行会以r1,r2....rn保存到变量山下文中，如果设置了列映射，那么还会有映射的变量名保存到变量上下文中。</p>

<p>&nbsp;&nbsp;&nbsp; 行和列的值还会保存到vmap和vlist变量中。</p>

<p><strong>2.3 结果数据处理和子任务</strong></p>

<p>&nbsp;&nbsp;&nbsp; 任务获取到结果后，可以进入处理结果的流程。通常是任务主动调用MonitorUtils.handleStringResult方法来触发的。</p>

<div style="margin-left: 40px;">
<p><strong>2.3.1 监控数据保存</strong></p>

<p>&nbsp;&nbsp;&nbsp; 如果在任务里设置了保存监控数据，那么数据会保存到数据库中。</p>

<p>&nbsp;&nbsp;&nbsp; 数据如何保存取决于文本返回结果的分割和映射，只有有列映射的才会被保存。</p>

<p><strong>2.3.2 后置子任务</strong></p>

<p>&nbsp;&nbsp;&nbsp; 如果有子任务，那么子任务的前置条件是ognl表达式，使用当前变量上下文如果执行ognl表达式返回true，那么执行子任务，否则不执行。</p>

<p><strong>2.3.3 邮件内容</strong></p>

<p>&nbsp;&nbsp;&nbsp; 这是还会处理邮件内容，如果任务返回值不是null，那么会加入到邮件内容中，否则不会。</p>

<p>&nbsp;&nbsp;&nbsp; 每个任务生成邮件内容的方法不一样，参看具体的任务说明，一般是message消息的设置。</p>
</div>

<p><strong>2.4 发送监控邮件</strong></p>

<p>&nbsp;&nbsp;&nbsp; 如果一个监控的当前所有任务都执行完毕了，那么如果有邮件内容则发送邮件，否则任务执行完毕。</p>

<p><strong>2.5 异常处理-监控超时</strong></p>

<p>&nbsp;&nbsp;&nbsp; 如果监控执行超时，有可能会被设置为无效状态。</p>
</div>
</div>
#$@text#$@
        sinterpretationType
        Self
        sattributeTemplate
        false
        schildsAttributeTemplate
        false
        svarScope
        Local
        sisSynchronized
        false
        sthrowException
        true
        suseOtherAction
        false
        screateLocalVarScope
        false
        ssaveReturn
        false
        sdisableGlobalContext
        false
        sdebugLog
        false
        sdescriptors
        xworker.function.ui.guide.Guide/@NextGuides/@HtmlGuide
        sinheritDescription
        false
        sth_createIndex
        false
        sth_registMyChilds
        false
        sth_registDisabled
        false
        sth_mark
        false
        sid
        Help
        @/@NextGuides/@Help1/@NextGuides/@HtmlGuide
        sname
        HtmlGuide
        slabel
        监控简介-监控数据
        stype
        description
        sbuttonText
        下一步
        Sdescription
#$@text#$@
<p><strong>监控数据</strong></p>

<p>&nbsp;&nbsp;&nbsp; 一般情况下，监控任务会抓取数据，我对监控任务的使用就是如何处理这些数据。</p>

<p><strong>参看监控任务的文档</strong></p>

<p>&nbsp;&nbsp;&nbsp; 数据是由任务抓取的，因此首先参看监控任务本身的文档。</p>

<p><strong>文字数据和通用数据设置</strong></p>

<p>&nbsp;&nbsp;&nbsp; 如果监控任务抓取的是文字数据，或者像我们建议的那样监控最好使用以下的格式保存数据。</p>

<p>&nbsp;&nbsp;&nbsp;&nbsp; xxxx,xxx,xxx,xxxx,xxx<br />
&nbsp;&nbsp;&nbsp;&nbsp; xxxx,xxx,xx,xxx,xxx</p>

<p>&nbsp;&nbsp;&nbsp; 即数据是像表格那种的行和列的数据，如果结果是上面格式的字符串，那么可以分解为单个值。首先单个值优先转化成double类型，其次数据按列会以v1,v2....vn保存到变量上下文中，行会以r1,r2....rn保存到变量山下文中，如果设置了列映射，那么还会有映射的变量名保存到变量上下文中。</p>

<p>&nbsp;&nbsp;&nbsp; 行和列的值还会保存到vmap和vlist变量中。比如vmap.get(&quot;v1&quot;)取v1的值，vlist.get(0)取第一行的值。</p>

<p><strong>监控数据的保存</strong></p>

<p>&nbsp;&nbsp;&nbsp; 如果监控数据是通用的格式，并且列映射了名字，那么映射了名字的列的值可以保存到监控数据中。</p>

<p>&nbsp;&nbsp;&nbsp; 见MonitorUtils.saveMonitorData(MonitorContext monitorContext, DataObject monitorTask,<br />
&nbsp;&nbsp;&nbsp;DataObject monitorTaskResource, Thing taskThing, Object resourceId,<br />
&nbsp;&nbsp;&nbsp;String[] columnMappings, int rowIdIndex, List&lt;Map&lt;String, Object&gt;&gt; listDatas)方法。</p>
#$@text#$@
        sinterpretationType
        Self
        sattributeTemplate
        false
        schildsAttributeTemplate
        false
        svarScope
        Local
        sisSynchronized
        false
        sthrowException
        true
        suseOtherAction
        false
        screateLocalVarScope
        false
        ssaveReturn
        false
        sdisableGlobalContext
        false
        sdebugLog
        false
        sdescriptors
        xworker.function.ui.guide.Guide/@NextGuides/@HtmlGuide
        sinheritDescription
        false
        sth_createIndex
        false
        sth_registMyChilds
        false
        sth_registDisabled
        false
        sth_mark
        false
        sid
        HtmlGuide
        @/@NextGuides/@Help1/@NextGuides/@HtmlGuide2
        sname
        HtmlGuide
        slabel
        监控简介-监控消息
        stype
        description
        sbuttonText
        下一步
        Sdescription
#$@text#$@
<p><strong>监控消息</strong></p>

<p>&nbsp;&nbsp;&nbsp; 监控消息是通过邮件发送的内容。</p>

<p><strong>监控消息的一般处理方式</strong></p>

<p>&nbsp;&nbsp;&nbsp; 监控消息一般在任务参数或者资源参数中设置，一般使用freemarker模板生成消息，一般如果消息不为null时认为消息有效，有些了支持ognl表达式，如果ognl表达式返回true返回消息。</p>

<p>&nbsp;</p>
#$@text#$@
        sinterpretationType
        Self
        sattributeTemplate
        false
        schildsAttributeTemplate
        false
        svarScope
        Local
        sisSynchronized
        false
        sthrowException
        true
        suseOtherAction
        false
        screateLocalVarScope
        false
        ssaveReturn
        false
        sdisableGlobalContext
        false
        sdebugLog
        false
        sdescriptors
        xworker.function.ui.guide.Guide/@NextGuides/@HtmlGuide
        sinheritDescription
        false
        sth_createIndex
        false
        sth_registMyChilds
        false
        sth_registDisabled
        false
        sth_mark
        false
        sid
        HtmlGuide2
        @/@NextGuides/@Help1/@NextGuides/@HtmlGuide3
        sname
        HtmlGuide
        slabel
        监控简介-子任务
        stype
        description
        sbuttonText
        下一步
        Sdescription
#$@text#$@
<p><strong>子任务</strong></p>

<p>&nbsp;&nbsp;&nbsp; 通过子任务可以实现一些特殊的操作，比如监控发现一个应用已经关闭，那么就可以调用子任务（如Linux任务）去把它重启。</p>

<p><strong>前置条件</strong></p>

<p>&nbsp;&nbsp;&nbsp; 子任务一般满足前置条件才会激活，通常前置条件使用Ognl表达式编写。</p>
#$@text#$@
        sinterpretationType
        Self
        sattributeTemplate
        false
        schildsAttributeTemplate
        false
        svarScope
        Local
        sisSynchronized
        false
        sthrowException
        true
        suseOtherAction
        false
        screateLocalVarScope
        false
        ssaveReturn
        false
        sdisableGlobalContext
        false
        sdebugLog
        false
        sdescriptors
        xworker.function.ui.guide.Guide/@NextGuides/@HtmlGuide
        sinheritDescription
        false
        sth_createIndex
        false
        sth_registMyChilds
        false
        sth_registDisabled
        false
        sth_mark
        false
        sid
        HtmlGuide3
        @/@NextGuides/@Help1/@NextGuides/@monitorContent
        sname
        monitorContent
        slabel
        监控上下文
        stype
        description
        sbuttonText
        下一步
        Sdescription
#$@text#$@
<h3><strong>监控上下文</strong></h3>

<p>&nbsp;&nbsp;&nbsp; 一个定时器监控可以包含多个任务，而每个任务又可以包含子任务和多个资源，因此一个监控可能会执行多次，所以监控上下文是同步管理一个监控中的所有任务的，尤其是在所有任务都完成后才会发送邮件。</p>

<p>&nbsp;&nbsp;&nbsp; 监控上下文是MonitorContext。</p>

<p><strong>把任务添加到监控上下文中</strong></p>

<p>&nbsp;&nbsp;&nbsp; 如果一个任务是继承了MonitableTask类，那么在构造时会自动加入到监控上下文中。</p>

<p><strong>监控上下文的主要方法</strong></p>

<ul>
	<li><strong>public void appendContent(DataObject monitorTask, DataObject resource, String resourceName, String text)</strong><br />
	添加报警的邮件内容。</li>
</ul>

<p>&nbsp;</p>
#$@text#$@
        sinterpretationType
        Self
        sattributeTemplate
        false
        schildsAttributeTemplate
        false
        svarScope
        Local
        sisSynchronized
        false
        sthrowException
        true
        suseOtherAction
        false
        screateLocalVarScope
        false
        ssaveReturn
        false
        sdisableGlobalContext
        false
        sdebugLog
        false
        sdescriptors
        xworker.function.ui.guide.Guide/@NextGuides/@HtmlGuide
        sinheritDescription
        false
        sth_createIndex
        false
        sth_registMyChilds
        false
        sth_registDisabled
        false
        sth_mark
        false
        sid
        monitorContent
        @/@NextGuides/@Help1/@NextGuides/@defineTask
        sname
        defineTask
        slabel
        如何定义新的任务
        stype
        description
        sbuttonText
        下一步
        Sdescription
#$@text#$@
<h3>如何定义新的任务</h3>

<p>&nbsp;&nbsp;&nbsp; 拥有run方法的事物都可以当做任务。</p>

<p><strong>任务需要重写的方法</strong></p>

<ul>
	<li><strong>run</strong><br />
	任务执行时要调用的方法。<br />
	&nbsp;</li>
	<li><strong>String getParameterThing</strong><br />
	获取资源参数事物，资源可以额外设置10个参数，从param1到param10，通过paramterThing来编辑。<br />
	&nbsp;</li>
	<li><strong>String getTaskParameterThing</strong><br />
	获取任务参数编辑事物，用于替代param1和param10的标签。<br />
	&nbsp;</li>
	<li><strong>String getResSelectorPath</strong><br />
	如果任务包含资源，那么返回资源选择器的事物路径。</li>
</ul>

<p><strong>示例代码</strong></p>

<p><strong>run</strong></p>

<pre class="brush:java;">
	public static void run(ActionContext actionContext) throws IOException, TemplateException{
		try{
                        //资源监控数据对象，包含定时器设置的那个
			DataObject monitor = (DataObject) actionContext.get(&quot;monitor&quot;);
                        //在监控列表中设置的任务
			DataObject monitorTask = (DataObject) actionContext.get(&quot;monitorTask&quot;);
                        //任务定义数据对象
			DataObject monitorTaskTask = (DataObject) actionContext.get(&quot;monitorTaskTask&quot;);
                        //包含的资源列表
			List&lt;DataObject&gt; resources = (List&lt;DataObject&gt;) actionContext.get(&quot;resources&quot;);
                         //任务事物
			Thing taskThing = (Thing) actionContext.get(&quot;taskThing&quot;);
                        //监控上下文
			MonitorContext monitorContext = (MonitorContext) actionContext.get(&quot;monitorContext&quot;);
			
			for(DataObject monitorTaskResource : resources){
     			HttpTask httpTask = new HttpTask(monitorContext, actionContext, monitor, monitorTask, monitorTaskTask, monitorTaskResource, taskThing);
     			httpTask.paramBindings = (Bindings) actionContext.get(&quot;paramBindings&quot;);
				MonitorUtils.execute(httpTask);
			}			
		}catch(Exception e){
			logger.error(&quot;http task error&quot;, e);
		}
	}</pre>

<p>&nbsp;&nbsp;&nbsp; 如果是用Java编写Task的代码，那么可以实现xworker.app.monitor.res.MonitableTask接口，会让编程更简单一些。</p>

<p><strong>getParameterThing</strong></p>

<p>&nbsp;&nbsp;&nbsp; 事物xworker.app.monitor.tasks.http.paramthings.HttpTaskParam。</p>

<p><strong>getTaskParameterThing</strong></p>

<p>&nbsp;&nbsp;&nbsp; 事物：xworker.app.monitor.tasks.linux.paramthings.LinuxTaskParam。</p>

<p><strong>getResSelectorPath</strong></p>

<p>&nbsp;&nbsp;&nbsp; 事物：xworker.app.appmanager.swt.editors.server.SelectServerShell。</p>

<p>&nbsp;</p>

<p>&nbsp;</p>
#$@text#$@
        sinterpretationType
        Self
        sattributeTemplate
        false
        schildsAttributeTemplate
        false
        svarScope
        Local
        sisSynchronized
        false
        sthrowException
        true
        suseOtherAction
        false
        screateLocalVarScope
        false
        ssaveReturn
        false
        sdisableGlobalContext
        false
        sdebugLog
        false
        sdescriptors
        xworker.function.ui.guide.Guide/@NextGuides/@HtmlGuide
        sinheritDescription
        false
        sth_createIndex
        false
        sth_registMyChilds
        false
        sth_registDisabled
        false
        sth_mark
        false
        sid
        defineTask
        @/@NextGuides/@Help1/@NextGuides/@HtmlGuide1
        sname
        HtmlGuide
        slabel
        如何定义新的任务-MonitableTask
        stype
        description
        sbuttonText
        下一步
        Sdescription
#$@text#$@
<p><strong>MonitableTask</strong></p>

<p>&nbsp;&nbsp;&nbsp; 是一个监控任务的Java基础类，使用它实现任务相对简单一些，因为它封装了一个常用的方法。</p>

<p>&nbsp;&nbsp;&nbsp; 对于监控抓取的数据，分字符串和非字符串两种典型的处理。</p>

<p><strong>字符串数据的处理</strong></p>

<p>&nbsp;&nbsp;&nbsp; 如果使用了MonitableTask且抓取的原始数据是字符串，那么可以让参数设置事物继承xworker.app.monitor.CommonParameters，这里包含了消息、数据解析和保存等设置。</p>

<p>&nbsp;&nbsp;&nbsp; 且可以使用public void handleStringResult(Thing paramsThing, String result, String resourceId, &nbsp;String resourcenName, ActionContext actionContext)来处理所有其他数据分析、子流程、数据保存和邮件消息等设置。</p>

<p><strong>非字符串数据的处理</strong></p>

<p>&nbsp;&nbsp;&nbsp; 对于非字符串结果数据，请让参数继承xworker.app.monitor.CommonParametersMin，且自行处理数据生成listData等，调用public void handleListResult(Thing paramsThing, String resourceId, String resourceName, List&lt;Map&lt;String, Object&gt;&gt; listDatas, ActionContext actionContext) 方法来处理剩余流程。</p>
#$@text#$@
        sinterpretationType
        Self
        sattributeTemplate
        false
        schildsAttributeTemplate
        false
        svarScope
        Local
        sisSynchronized
        false
        sthrowException
        true
        suseOtherAction
        false
        screateLocalVarScope
        false
        ssaveReturn
        false
        sdisableGlobalContext
        false
        sdebugLog
        false
        sdescriptors
        xworker.function.ui.guide.Guide/@NextGuides/@HtmlGuide
        sinheritDescription
        false
        sth_createIndex
        false
        sth_registMyChilds
        false
        sth_registDisabled
        false
        sth_mark
        false
        sid
        HtmlGuide1
        @/@NextGuides/@Help1/@NextGuides/@addTaskToList
        sname
        addTaskToList
        slabel
        如何添加任务到任务列表
        stype
        description
        sbuttonText
        下一步
        Sdescription
#$@text#$@
<h3>如何把新的任务添加到可选的任务列表中</h3>

<p>&nbsp;&nbsp;&nbsp; 任务在应用管理中初始化数据时可以自动加入到任shixi表中。</p>

<p><strong>步骤：</strong></p>

<ol>
	<li><strong>实现一个init方法</strong><br />
	可以直接使用类：xworker.app.monitor.db.DbActions的initTasks方法，使用JavaAction。<br />
	&nbsp;</li>
	<li><strong>注册</strong><br />
	把该事物以子事物的方式注册到xworker.app.task.TaskInitIndex。</li>
</ol>
#$@text#$@
        sinterpretationType
        Self
        sattributeTemplate
        false
        schildsAttributeTemplate
        false
        svarScope
        Local
        sisSynchronized
        false
        sthrowException
        true
        suseOtherAction
        false
        screateLocalVarScope
        false
        ssaveReturn
        false
        sdisableGlobalContext
        false
        sdebugLog
        false
        sdescriptors
        xworker.function.ui.guide.Guide/@NextGuides/@HtmlGuide
        sinheritDescription
        false
        sth_createIndex
        false
        sth_registMyChilds
        false
        sth_registDisabled
        false
        sth_mark
        false
        sid
        addTaskToList
        @/@NextGuides/@Help1/@NextGuides/@tasksViewer
        sname
        tasksViewer
        slabel
        任务浏览
        sdescription
        <p>浏览可以使用的任务信息。</p>
        sinterpretationType
        Self
        sattributeTemplate
        false
        schildsAttributeTemplate
        false
        svarScope
        Local
        sisSynchronized
        false
        sthrowException
        true
        suseOtherAction
        false
        screateLocalVarScope
        false
        ssaveReturn
        false
        sdisableGlobalContext
        false
        sdebugLog
        false
        sdescriptors
        xworker.function.ui.guide.Guide/@NextGuides/@Composite
        sinheritDescription
        false
        sth_createIndex
        false
        sth_registMyChilds
        false
        sth_registDisabled
        false
        sth_mark
        false
        sid
        tasksViewer
          @/@NextGuides/@Help1/@NextGuides/@tasksViewer/@Composite
          sname
          Composite
          sBORDER
          false
          sH_SCROLL
          false
          sV_SCROLL
          false
          sNO_BACKGROUND
          false
          sNO_FOCUS
          false
          sNO_MERGE_PAINTS
          false
          sNO_REDRAW_RESIZE
          false
          sNO_RADIO_GROUP
          false
          sEMBEDDED
          false
          sDOUBLE_BUFFERED
          false
          scapture
          false
          senabled
          true
          sredraw
          true
          svisible
          true
          sdescriptors
          xworker.function.ui.guide.Guide/@NextGuides/@Composite/@Composite
          sinheritDescription
          false
          sth_createIndex
          false
          sth_registMyChilds
          false
          sth_registDisabled
          false
          sth_mark
          false
          sid
          Composite
            @/@NextGuides/@Help1/@NextGuides/@tasksViewer/@Composite/@compositeFillLayout
            sname
            compositeFillLayout
            stype
            SWT.HORIZONTAL
            sdescriptors
            xworker.swt.Layouts/@FillLayout
            sinheritDescription
            false
            sth_createIndex
            false
            sth_registMyChilds
            false
            sth_registDisabled
            false
            sth_mark
            false
            sid
            compositeFillLayout
            @/@NextGuides/@Help1/@NextGuides/@tasksViewer/@Composite/@taskSashForm
            sname
            taskSashForm
            sstyle
            HORIZONTAL
            sSMOOTH
            false
            sweights
            40,60
            sBORDER
            false
            sH_SCROLL
            false
            sV_SCROLL
            false
            sNO_BACKGROUND
            false
            sNO_FOCUS
            false
            sNO_MERGE_PAINTS
            false
            sNO_REDRAW_RESIZE
            false
            sNO_RADIO_GROUP
            false
            sEMBEDDED
            false
            sDOUBLE_BUFFERED
            false
            scapture
            false
            senabled
            true
            sredraw
            true
            svisible
            true
            sdescriptors
            xworker.swt.Widgets/@SashForm
            sinheritDescription
            false
            sth_createIndex
            false
            sth_registMyChilds
            false
            sth_registDisabled
            false
            sth_mark
            false
            sid
            taskSashForm
              @/@NextGuides/@Help1/@NextGuides/@tasksViewer/@Composite/@taskSashForm/@editor
              sname
              editor
              sdataObject
              xworker.app.monitor.dataobjects.ResMonitorTasks
              squeryButton
              true
              snewButton
              false
              seditButton
              false
              seditBatchButton
              false
              sdeleteButton
              false
              sselectAllButton
              false
              sselectRerverseButton
              false
              spagingToolbar
              true
              sactionContext
              dataObjectContext
              stableCheck
              false
              sdebug
              false
              sdescriptors
              xworker.swt.app.view.swt.Items/@DataObjectEditCompoiste
              sinheritDescription
              false
              sth_createIndex
              false
              sth_registMyChilds
              false
              sth_mark
              false
              sid
              editor
                @/@NextGuides/@Help1/@NextGuides/@tasksViewer/@Composite/@taskSashForm/@editor/@editorGridData
                sname
                editorGridData
                sstyle
                FILL_BOTH
                shorizontalIndent
                0
                swidth
                -1
                sheight
                -1
                shorizontalAlignment
                BEGINNING
                sverticalAlignment
                CENTER
                shorizontalSpan
                1
                sverticalSpan
                1
                sgrabExcessHorizontalSpace
                false
                sgrabExcessVerticalSpace
                false
                sdescriptors
                xworker.swt.layout.LayoutDatas/@GridData
                sinheritDescription
                false
                sth_createIndex
                false
                sth_registMyChilds
                false
                sth_mark
                false
                sid
                editorGridData
                @/@NextGuides/@Help1/@NextGuides/@tasksViewer/@Composite/@taskSashForm/@editor/@actions
                sname
                actions
                sdescriptors
                xworker.swt.app.view.swt.widgets.DataObjectEditCompoiste/@actions1
                sinheritDescription
                false
                sth_createIndex
                false
                sth_registMyChilds
                false
                sth_registDisabled
                false
                sth_mark
                false
                sid
                actions
                  @/@NextGuides/@Help1/@NextGuides/@tasksViewer/@Composite/@taskSashForm/@editor/@actions/@tableSelection
                  sname
                  tableSelection
                  sisSynchronized
                  false
                  sthrowException
                  true
                  suseOtherAction
                  false
                  svarScope
                  Local
                  sdisableGlobalContext
                  false
                  Scode
#$@text#$@
import xworker.lang.util.XWorkerUtils;

def data = dataObjectContext.dataTable.getSelection()[0].getData();
browser.setUrl(XWorkerUtils.getThingDescUrl(data.getString("taskPath")));
#$@text#$@
                  sinterpretationType
                  Action
                  screateLocalVarScope
                  false
                  ssaveReturn
                  false
                  sdebugLog
                  false
                  sdescriptors
                  xworker.lang.actions.Actions/@GroovyAction
                  sinheritDescription
                  false
                  sth_createIndex
                  false
                  sth_registMyChilds
                  false
                  sth_registDisabled
                  false
                  sth_mark
                  false
                  sid
                  tableSelection
              @/@NextGuides/@Help1/@NextGuides/@tasksViewer/@Composite/@taskSashForm/@browser
              sname
              browser
              sMOZILLA
              false
              sWEBKIT
              false
              sjavascriptEnabled
              true
              sdescriptors
              xworker.swt.Widgets/@Browser
              sinheritDescription
              false
              sth_createIndex
              false
              sth_registMyChilds
              false
              sth_registDisabled
              false
              sth_mark
              false
              sid
              browser
                @/@NextGuides/@Help1/@NextGuides/@tasksViewer/@Composite/@taskSashForm/@browser/@UtilBrowser
                sname
                UtilBrowser
                sdescriptors
                xworker.swt.browser.Browser/@UtilBrowser
                sinheritDescription
                false
                sth_createIndex
                false
                sth_registMyChilds
                false
                sth_registDisabled
                false
                sth_mark
                false
                sid
                UtilBrowser
  @/@PreparedGuides
  sname
  PreparedGuides
  sdescriptors
  xworker.function.ui.guide.Guide/@PreparedGuides
  sinheritDescription
  false
  sth_createIndex
  false
  sth_registMyChilds
  false
  sth_registDisabled
  false
  sth_mark
  false
  sid
  PreparedGuides
    @/@PreparedGuides/@viewAndEditResTask
    sname
    viewAndEditResTask
    slabel
    监控向导式管理
    sdescription
    <p>查看和编辑资源监控。</p>
    sdescriptors
    xworker.function.ui.guide.Guide/@NextGuides/@Composite
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    viewAndEditResTask
      @/@PreparedGuides/@viewAndEditResTask/@Composite
      sname
      Composite
      sBORDER
      false
      sH_SCROLL
      false
      sV_SCROLL
      false
      sNO_BACKGROUND
      false
      sNO_FOCUS
      false
      sNO_MERGE_PAINTS
      false
      sNO_REDRAW_RESIZE
      false
      sNO_RADIO_GROUP
      false
      sEMBEDDED
      false
      sDOUBLE_BUFFERED
      false
      scapture
      false
      senabled
      true
      sredraw
      true
      svisible
      true
      sdescriptors
      xworker.function.ui.guide.Guide/@NextGuides/@Composite/@Composite
      sinheritDescription
      false
      sth_createIndex
      false
      sth_registMyChilds
      false
      sth_registDisabled
      false
      sth_mark
      false
      sid
      Composite
        @/@PreparedGuides/@viewAndEditResTask/@Composite/@compositeGridLayout
        sname
        compositeGridLayout
        smakeColumnsEqualWidth
        false
        smarginWidth
        5
        smarginHeight
        5
        smarginLeft
        0
        smarginTop
        0
        smarginRight
        0
        smarginBottom
        0
        shorizontalSpacing
        5
        sverticalSpacing
        5
        sdescriptors
        xworker.swt.Layouts/@GridLayout
        sinheritDescription
        false
        sth_createIndex
        false
        sth_registMyChilds
        false
        sth_registDisabled
        false
        sth_mark
        false
        sid
        compositeGridLayout
        @/@PreparedGuides/@viewAndEditResTask/@Composite/@dbMonitorEditor
        sname
        dbMonitorEditor
        sdataObject
        xworker.app.monitor.dataobjects.ResMonitor
        squeryButton
        true
        snewButton
        true
        seditButton
        true
        seditBatchButton
        false
        sdeleteButton
        true
        sselectAllButton
        false
        sselectRerverseButton
        false
        spagingToolbar
        true
        sactionContext
        monitorObjectContext
        stableCheck
        false
        sdebug
        false
        sdescriptors
        xworker.swt.app.view.swt.Items/@DataObjectEditCompoiste
        sinheritDescription
        false
        sth_createIndex
        false
        sth_registMyChilds
        false
        sth_mark
        false
        sid
        dbMonitorEditor
          @/@PreparedGuides/@viewAndEditResTask/@Composite/@dbMonitorEditor/@actions
          sname
          actions
          sdescriptors
          xworker.swt.app.view.swt.widgets.DataObjectEditCompoiste/@actions1
          sinheritDescription
          false
          sth_createIndex
          false
          sth_registMyChilds
          false
          sth_mark
          false
          sid
          actions
            @/@PreparedGuides/@viewAndEditResTask/@Composite/@dbMonitorEditor/@actions/@tableSelection
            sname
            tableSelection
            sisSynchronized
            false
            sthrowException
            true
            suseOtherAction
            false
            svarScope
            Local
            sdisableGlobalContext
            false
            Scode
#$@text#$@
taskButton.setEnabled(true);
setMailSessionButton.setEnabled(true);
setMailReceiverButton.setEnabled(true);
/*
taskDataStore.doAction("load", actionContext, 
    ["params":["monitorId": monitorObjectContext.dataTable.getSelection()[0].getData().get("id"), 
     "parentId":0]]);
    
dbDataStore.doAction("load", actionContext, 
    ["params":["taskId": -1]]);
    
helpBrowser.setText("");

for(int i=7; i<=16; i++){
    def column = tasksTable.getColumn(i);
    column.setText("参数" + (i -6));
}
*/
#$@text#$@
            sinterpretationType
            Action
            screateLocalVarScope
            false
            ssaveReturn
            false
            sdebugLog
            false
            sdescriptors
            xworker.lang.actions.Actions/@GroovyAction
            sinheritDescription
            false
            sth_createIndex
            false
            sth_registMyChilds
            false
            sth_mark
            false
            sid
            tableSelection
            @/@PreparedGuides/@viewAndEditResTask/@Composite/@dbMonitorEditor/@actions/@tableDeleted
            sname
            tableDeleted
            sisSynchronized
            false
            sthrowException
            true
            suseOtherAction
            false
            svarScope
            Local
            sdisableGlobalContext
            false
            Scode
#$@text#$@
taskButton.setEnabled(false);
setMailSessionButton.setEnabled(false);
setMailReceiverButton.setEnabled(false);
/*
deleteTaskButton.setEnabled(false);
addDBButton.setEnabled(false);
deleteDbButton.setEnabled(false);
editParamButton.setEnabled(false);
editTaskButton.setEnabled(false);
editTaskParamButton.setEnabled(false);
addChildTaskButton.setEnabled(false);
editTaskThingButton.setEnabled(false);

taskDataStore.doAction("load", actionContext, 
    ["params":["monitorId": monitorObjectContext.dataTable.getSelection()[0].getData().get("id")]]);
    
dbDataStore.doAction("load", actionContext, 
    ["params":["taskId": -1]]);
    
helpBrowser.setText("");
*/
#$@text#$@
            sinterpretationType
            Action
            screateLocalVarScope
            false
            ssaveReturn
            false
            sdebugLog
            false
            sdescriptors
            xworker.lang.actions.Actions/@GroovyAction
            sinheritDescription
            false
            sth_createIndex
            false
            sth_registMyChilds
            false
            sth_mark
            false
            sid
            tableDeleted
            @/@PreparedGuides/@viewAndEditResTask/@Composite/@dbMonitorEditor/@actions/@onStoreLoaded1
            sname
            onStoreLoaded
            swidgetForDisplay
            mainSash
            stype
            async
            scancelTaskOnWidgetDisposed
            false
            sinterpretationType
            Self
            sattributeTemplate
            false
            schildsAttributeTemplate
            false
            svarScope
            Local
            sisSynchronized
            false
            sthrowException
            true
            suseOtherAction
            false
            screateLocalVarScope
            false
            ssaveReturn
            false
            sdisableGlobalContext
            false
            sdescriptors
            xworker.swt.actions.DisplayActions/@DisplayExec
            sinheritDescription
            false
            sth_createIndex
            false
            sth_registMyChilds
            false
            sth_mark
            false
            sid
            onStoreLoaded1
              @/@PreparedGuides/@viewAndEditResTask/@Composite/@dbMonitorEditor/@actions/@onStoreLoaded1/@actions
              sname
              actions
              sdescriptors
              xworker.swt.actions.DisplayActions/@DisplayExec/@actions
              sinheritDescription
              false
              sth_createIndex
              false
              sth_registMyChilds
              false
              sth_mark
              false
              sid
              actions
                @/@PreparedGuides/@viewAndEditResTask/@Composite/@dbMonitorEditor/@actions/@onStoreLoaded1/@actions/@onStoreLoaded
                sname
                doAction
                sisSynchronized
                false
                sthrowException
                true
                suseOtherAction
                false
                svarScope
                Local
                sdisableGlobalContext
                false
                Scode
#$@text#$@
taskButton.setEnabled(false);
setMailSessionButton.setEnabled(false);
setMailReceiverButton.setEnabled(false);
/*
deleteTaskButton.setEnabled(false);
addDBButton.setEnabled(false);
deleteDbButton.setEnabled(false);
editParamButton.setEnabled(false);
editTaskButton.setEnabled(false);
editTaskParamButton.setEnabled(false);
addChildTaskButton.setEnabled(false);
editTaskThingButton.setEnabled(false);

taskDataStore.doAction("load", actionContext, 
    ["params":["monitorId": -1]]);
    
dbDataStore.doAction("load", actionContext, 
    ["params":["taskId": -1]]);
    
helpBrowser.setText("");
*/
#$@text#$@
                sinterpretationType
                Action
                screateLocalVarScope
                false
                ssaveReturn
                false
                sdebugLog
                false
                sdescriptors
                xworker.lang.actions.Actions/@GroovyAction
                sinheritDescription
                false
                sth_createIndex
                false
                sth_registMyChilds
                false
                sth_mark
                false
                sid
                onStoreLoaded
          @/@PreparedGuides/@viewAndEditResTask/@Composite/@dbMonitorEditor/@monitorEditorGridData
          sname
          monitorEditorGridData
          sstyle
          FILL_BOTH
          shorizontalIndent
          0
          swidth
          -1
          sheight
          -1
          shorizontalAlignment
          BEGINNING
          sverticalAlignment
          CENTER
          shorizontalSpan
          1
          sverticalSpan
          1
          sgrabExcessHorizontalSpace
          false
          sgrabExcessVerticalSpace
          false
          sdescriptors
          xworker.swt.layout.LayoutDatas/@GridData
          sinheritDescription
          false
          sth_createIndex
          false
          sth_registMyChilds
          false
          sth_registDisabled
          false
          sth_mark
          false
          sid
          monitorEditorGridData
        @/@PreparedGuides/@viewAndEditResTask/@Composite/@27404
        sname
        buttonComposite
        sBORDER
        false
        sH_SCROLL
        false
        sV_SCROLL
        false
        sNO_BACKGROUND
        false
        sNO_FOCUS
        false
        sNO_MERGE_PAINTS
        false
        sNO_REDRAW_RESIZE
        false
        sNO_RADIO_GROUP
        false
        sEMBEDDED
        false
        sDOUBLE_BUFFERED
        false
        scapture
        false
        senabled
        true
        sredraw
        true
        svisible
        true
        sdescriptors
        xworker.swt.Widgets/@Composite
        sid
        27404
          @/@PreparedGuides/@viewAndEditResTask/@Composite/@27404/@27405
          sname
          buttonCompositeGridData
          sstyle
          FILL_HORIZONTAL
          shorizontalIndent
          0
          swidth
          -1
          sheight
          -1
          shorizontalAlignment
          END
          sverticalAlignment
          CENTER
          shorizontalSpan
          1
          sverticalSpan
          1
          sgrabExcessHorizontalSpace
          false
          sgrabExcessVerticalSpace
          false
          sdescriptors
          xworker.swt.layout.LayoutDatas/@GridData
          sid
          27405
          @/@PreparedGuides/@viewAndEditResTask/@Composite/@27404/@27406
          sname
          buttonCompositeRowLayout
          sfill
          false
          sjustify
          false
          smarginWidth
          0
          smarginHeight
          0
          smarginLeft
          3
          smarginTop
          3
          smarginRight
          3
          smarginBottom
          3
          spack
          true
          sspacing
          3
          stype
          SWT.HORIZONTAL
          swrap
          true
          sdescriptors
          xworker.swt.Layouts/@RowLayout
          sid
          27406
          @/@PreparedGuides/@viewAndEditResTask/@Composite/@27404/@27407
          sname
          taskButton
          stext
          设置任务
          stype
          SWT.PUSH
          sflat
          false
          sborder
          false
          sselected
          false
          scapture
          false
          senabled
          true
          sredraw
          true
          svisible
          true
          sdescriptors
          xworker.swt.Widgets/@Button
          sth_createIndex
          false
          sid
          27407
            @/@PreparedGuides/@viewAndEditResTask/@Composite/@27404/@27407/@27408
            sname
            RowData
            sexclude
            false
            swidth
            80
            sheight
            -1
            sdescriptors
            xworker.swt.layout.LayoutDatas/@RowData
            sth_createIndex
            false
            sid
            27408
            @/@PreparedGuides/@viewAndEditResTask/@Composite/@27404/@27407/@27409
            sname
            Listeners
            sdescriptors
            xworker.swt.widgets.Widget/@Listeners
            sth_createIndex
            false
            sid
            27409
              @/@PreparedGuides/@viewAndEditResTask/@Composite/@27404/@27407/@27409/@27410
              sname
              taskButtonSelection
              stype
              Selection
              sdescriptors
              xworker.swt.events.Listeners/@listeners/@Listener
              sth_createIndex
              false
              sid
              27410
                @/@PreparedGuides/@viewAndEditResTask/@Composite/@27404/@27407/@27409/@27410/@GroovyAction
                sname
                GroovyAction
                sisSynchronized
                false
                sthrowException
                true
                suseOtherAction
                false
                svarScope
                Local
                sdisableGlobalContext
                false
                Scode
#$@text#$@
guide.put("monitorId", monitorObjectContext.dataTable.getSelection()[0].getData().get("id"));
guide.guideFinished(guideThing);
#$@text#$@
                sinterpretationType
                Action
                screateLocalVarScope
                false
                ssaveReturn
                false
                sdebugLog
                false
                sdescriptors
                xworker.lang.actions.Actions/@GroovyAction
                sinheritDescription
                false
                sth_createIndex
                false
                sth_registMyChilds
                false
                sth_registDisabled
                false
                sth_mark
                false
                sid
                GroovyAction
          @/@PreparedGuides/@viewAndEditResTask/@Composite/@27404/@274071
          sname
          setMailSessionButton
          stext
          设置邮件会话
          stype
          SWT.PUSH
          sflat
          false
          sborder
          false
          sselected
          false
          scapture
          false
          senabled
          true
          sredraw
          true
          svisible
          true
          sdescriptors
          xworker.swt.Widgets/@Button
          sth_createIndex
          false
          sid
          274071
            @/@PreparedGuides/@viewAndEditResTask/@Composite/@27404/@274071/@27408
            sname
            RowData
            sexclude
            false
            swidth
            90
            sheight
            -1
            sdescriptors
            xworker.swt.layout.LayoutDatas/@RowData
            sth_createIndex
            false
            sid
            27408
            @/@PreparedGuides/@viewAndEditResTask/@Composite/@27404/@274071/@27409
            sname
            Listeners
            sdescriptors
            xworker.swt.widgets.Widget/@Listeners
            sth_createIndex
            false
            sid
            27409
              @/@PreparedGuides/@viewAndEditResTask/@Composite/@27404/@274071/@27409/@27410
              sname
              taskButtonSelection
              stype
              Selection
              sdescriptors
              xworker.swt.events.Listeners/@listeners/@Listener
              sth_createIndex
              false
              sid
              27410
                @/@PreparedGuides/@viewAndEditResTask/@Composite/@27404/@274071/@27409/@27410/@GroovyAction
                sname
                GroovyAction
                sisSynchronized
                false
                sthrowException
                true
                suseOtherAction
                false
                svarScope
                Local
                sdisableGlobalContext
                false
                Scode
#$@text#$@
guide.put("monitorId", monitorObjectContext.dataTable.getSelection()[0].getData().get("id"));
guide.guideFinished(guideThing);
#$@text#$@
                sinterpretationType
                Action
                screateLocalVarScope
                false
                ssaveReturn
                false
                sdebugLog
                false
                sdescriptors
                xworker.lang.actions.Actions/@GroovyAction
                sinheritDescription
                false
                sth_createIndex
                false
                sth_registMyChilds
                false
                sth_registDisabled
                false
                sth_mark
                false
                sid
                GroovyAction
          @/@PreparedGuides/@viewAndEditResTask/@Composite/@27404/@274072
          sname
          setMailReceiverButton
          stext
          设置邮件接收组
          stype
          SWT.PUSH
          sflat
          false
          sborder
          false
          sselected
          false
          scapture
          false
          senabled
          true
          sredraw
          true
          svisible
          true
          sdescriptors
          xworker.swt.Widgets/@Button
          sth_createIndex
          false
          sid
          274072
            @/@PreparedGuides/@viewAndEditResTask/@Composite/@27404/@274072/@27408
            sname
            RowData
            sexclude
            false
            swidth
            100
            sheight
            -1
            sdescriptors
            xworker.swt.layout.LayoutDatas/@RowData
            sth_createIndex
            false
            sid
            27408
            @/@PreparedGuides/@viewAndEditResTask/@Composite/@27404/@274072/@27409
            sname
            Listeners
            sdescriptors
            xworker.swt.widgets.Widget/@Listeners
            sth_createIndex
            false
            sid
            27409
              @/@PreparedGuides/@viewAndEditResTask/@Composite/@27404/@274072/@27409/@27410
              sname
              taskButtonSelection
              stype
              Selection
              sdescriptors
              xworker.swt.events.Listeners/@listeners/@Listener
              sth_createIndex
              false
              sid
              27410
                @/@PreparedGuides/@viewAndEditResTask/@Composite/@27404/@274072/@27409/@27410/@GroovyAction
                sname
                GroovyAction
                sisSynchronized
                false
                sthrowException
                true
                suseOtherAction
                false
                svarScope
                Local
                sdisableGlobalContext
                false
                Scode
#$@text#$@
guide.put("monitorId", monitorObjectContext.dataTable.getSelection()[0].getData().get("id"));
guide.guideFinished(guideThing);
#$@text#$@
                sinterpretationType
                Action
                screateLocalVarScope
                false
                ssaveReturn
                false
                sdebugLog
                false
                sdescriptors
                xworker.lang.actions.Actions/@GroovyAction
                sinheritDescription
                false
                sth_createIndex
                false
                sth_registMyChilds
                false
                sth_registDisabled
                false
                sth_mark
                false
                sid
                GroovyAction
      @/@PreparedGuides/@viewAndEditResTask/@NextGuides
      sname
      NextGuides
      sdescriptors
      xworker.function.ui.guide.Guide/@NextGuides
      sinheritDescription
      false
      sth_createIndex
      false
      sth_registMyChilds
      false
      sth_registDisabled
      false
      sth_mark
      false
      sid
      NextGuides
        @/@PreparedGuides/@viewAndEditResTask/@NextGuides/@monitorTaskEditor
        sname
        monitorTaskEditor
        slabel
        监控任务管理
        sguidePath
        xworker.app.appmanager.swt.editors.monitor.guides.ResMonitorGuide/@PreparedGuides/@monitorTaskEditor
        sdescriptors
        xworker.function.ui.guide.Guide/@NextGuides/@GuideReference
        sinheritDescription
        false
        sth_createIndex
        false
        sth_registMyChilds
        false
        sth_registDisabled
        false
        sth_mark
        false
        sid
        monitorTaskEditor
    @/@PreparedGuides/@monitorTaskEditor
    sname
    monitorTaskEditor
    slabel
    监控任务管理
    sdescriptors
    xworker.function.ui.guide.Guide/@NextGuides/@Composite
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    monitorTaskEditor
      @/@PreparedGuides/@monitorTaskEditor/@Composite
      sname
      Composite
      sBORDER
      false
      sH_SCROLL
      false
      sV_SCROLL
      false
      sNO_BACKGROUND
      false
      sNO_FOCUS
      false
      sNO_MERGE_PAINTS
      false
      sNO_REDRAW_RESIZE
      false
      sNO_RADIO_GROUP
      false
      sEMBEDDED
      false
      sDOUBLE_BUFFERED
      false
      scapture
      false
      senabled
      true
      sredraw
      true
      svisible
      true
      sdescriptors
      xworker.function.ui.guide.Guide/@NextGuides/@Composite/@Composite
      sinheritDescription
      false
      sth_createIndex
      false
      sth_registMyChilds
      false
      sth_registDisabled
      false
      sth_mark
      false
      sid
      Composite
        @/@PreparedGuides/@monitorTaskEditor/@Composite/@compositeFillLayout
        sname
        compositeFillLayout
        stype
        SWT.HORIZONTAL
        sdescriptors
        xworker.swt.Layouts/@FillLayout
        sinheritDescription
        false
        sth_createIndex
        false
        sth_registMyChilds
        false
        sth_registDisabled
        false
        sth_mark
        false
        sid
        compositeFillLayout
        @/@PreparedGuides/@monitorTaskEditor/@Composite/@tasksComposite
        sname
        tasksComposite
        sBORDER
        false
        sH_SCROLL
        false
        sV_SCROLL
        false
        sNO_BACKGROUND
        false
        sNO_FOCUS
        false
        sNO_MERGE_PAINTS
        false
        sNO_REDRAW_RESIZE
        false
        sNO_RADIO_GROUP
        false
        sEMBEDDED
        false
        sDOUBLE_BUFFERED
        false
        scapture
        false
        senabled
        true
        sredraw
        true
        svisible
        true
        sdescriptors
        xworker.swt.Widgets/@Composite
        sinheritDescription
        false
        sth_createIndex
        false
        sth_registMyChilds
        false
        sth_mark
        false
        sid
        tasksComposite
          @/@PreparedGuides/@monitorTaskEditor/@Composite/@tasksComposite/@tasksCompositeGridLayout
          sname
          tasksCompositeGridLayout
          smakeColumnsEqualWidth
          false
          smarginWidth
          5
          smarginHeight
          5
          smarginLeft
          0
          smarginTop
          0
          smarginRight
          0
          smarginBottom
          0
          shorizontalSpacing
          5
          sverticalSpacing
          5
          sdescriptors
          xworker.swt.Layouts/@GridLayout
          sinheritDescription
          false
          sth_createIndex
          false
          sth_registMyChilds
          false
          sth_mark
          false
          sid
          tasksCompositeGridLayout
          @/@PreparedGuides/@monitorTaskEditor/@Composite/@tasksComposite/@tasksTable1
          sname
          tasksTable
          sselectStyle
          SINGLE
          sV_SCROLL
          true
          sH_SCROLL
          true
          sCHECK
          false
          sFULL_SELECTION
          true
          sHIDE_SELECTION
          true
          sBORDER
          false
          slineVisible
          true
          smultipleColumns
          true
          sheaderVisible
          true
          ssortIndicator
          true
          smoveableColumns
          true
          sheadImages
          false
          ssubImages
          false
          scheckSelection
          false
          scapture
          false
          senabled
          true
          sredraw
          true
          svisible
          true
          sVIRTUAL
          false
          sdescriptors
          xworker.swt.Widgets/@Tree,xworker.swt.Widgets/@Table
          sinheritDescription
          false
          sth_createIndex
          false
          sth_registMyChilds
          false
          sth_mark
          false
          sid
          tasksTable1
            @/@PreparedGuides/@monitorTaskEditor/@Composite/@tasksComposite/@tasksTable1/@DataStore
            sname
            taskDataStore
            sattachToParent
            true
            sloadBackground
            false
            sautoLoad
            false
            sautoSave
            true
            sdataObject
            xworker.app.monitor.dataobjects.ResMonitorTaskItems
            spaging
            extend
            spageSize
            50
            sstoreSortField
            _extend
            sstoreSortDir
            ASC
            seditable
            extend
            seditmethod
            extend
            sidName
            id
            sparentIdName
            parentId
            sdescriptors
            xworker.swt.widgets.Table/@DataStore
            sinheritDescription
            false
            sth_createIndex
            false
            sth_registMyChilds
            false
            sth_mark
            false
            sid
            DataStore
              @/@PreparedGuides/@monitorTaskEditor/@Composite/@tasksComposite/@tasksTable1/@DataStore/@queryConfig
              sname
              queryConfig
              boperator
              1
              sjoin
              and
              signoreNull
              true
              sdummySql
              false
              saddOneDay
              false
              sdescriptors
              xworker.swt.app.view.swt.data.DataStore/@Condition
              sinheritDescription
              false
              sth_createIndex
              false
              sth_registMyChilds
              false
              sth_mark
              false
              sid
              queryConfig
                @/@PreparedGuides/@monitorTaskEditor/@Composite/@tasksComposite/@tasksTable1/@DataStore/@queryConfig/@parentId
                sname
                parentId
                sattributeName
                parentId
                sdataName
                parentId
                boperator
                1
                sjoin
                and
                signoreNull
                true
                sdummySql
                false
                saddOneDay
                false
                sdescriptors
                xworker.dataObject.query.Condition/@Condition
                sinheritDescription
                false
                sth_createIndex
                false
                sth_registMyChilds
                false
                sth_mark
                false
                sid
                parentId
                @/@PreparedGuides/@monitorTaskEditor/@Composite/@tasksComposite/@tasksTable1/@DataStore/@queryConfig/@monitorId
                sname
                monitorId
                sattributeName
                monitorId
                sdataName
                monitorId
                boperator
                1
                sjoin
                and
                signoreNull
                true
                sdummySql
                false
                saddOneDay
                false
                sdescriptors
                xworker.dataObject.query.Condition/@Condition
                sinheritDescription
                false
                sth_createIndex
                false
                sth_registMyChilds
                false
                sth_mark
                false
                sid
                monitorId
              @/@PreparedGuides/@monitorTaskEditor/@Composite/@tasksComposite/@tasksTable1/@DataStore/@Listeners
              sname
              Listeners
              sdescriptors
              xworker.swt.app.view.swt.data.DataStore/@Listeners
              sinheritDescription
              false
              sth_createIndex
              false
              sth_registMyChilds
              false
              sth_registDisabled
              false
              sth_mark
              false
              sid
              Listeners
                @/@PreparedGuides/@monitorTaskEditor/@Composite/@tasksComposite/@tasksTable1/@DataStore/@Listeners/@Listener
                sname
                Listener
                safterAttach
                false
                sdescriptors
                xworker.swt.app.view.swt.data.DataStore/@Listeners/@Listener
                sinheritDescription
                false
                sth_createIndex
                false
                sth_registMyChilds
                false
                sth_registDisabled
                false
                sth_mark
                false
                sid
                Listener
                  @/@PreparedGuides/@monitorTaskEditor/@Composite/@tasksComposite/@tasksTable1/@DataStore/@Listeners/@Listener/@actions
                  sname
                  actions
                  sdescriptors
                  xworker.swt.app.view.swt.data.DataStore/@Listeners/@Listener/@actions1
                  sinheritDescription
                  false
                  sth_createIndex
                  false
                  sth_registMyChilds
                  false
                  sth_registDisabled
                  false
                  sth_mark
                  false
                  sid
                  actions
                    @/@PreparedGuides/@monitorTaskEditor/@Composite/@tasksComposite/@tasksTable1/@DataStore/@Listeners/@Listener/@actions/@onLoaded
                    sname
                    onLoaded
                    sisSynchronized
                    false
                    sthrowException
                    true
                    suseOtherAction
                    false
                    svarScope
                    Local
                    sdisableGlobalContext
                    false
                    Scode
#$@text#$@
for(item in tasksTable.getItems()){
    expandAll(item);
}

def expandAll(item){
    for(child in item.getItems()){
        expandAll(child);
    }
    
    item.setExpanded(true);
}
#$@text#$@
                    sinterpretationType
                    Action
                    screateLocalVarScope
                    false
                    ssaveReturn
                    false
                    sdebugLog
                    false
                    sdescriptors
                    xworker.lang.actions.Actions/@GroovyAction
                    sinheritDescription
                    false
                    sth_createIndex
                    false
                    sth_registMyChilds
                    false
                    sth_registDisabled
                    false
                    sth_mark
                    false
                    sid
                    onLoaded
            @/@PreparedGuides/@monitorTaskEditor/@Composite/@tasksComposite/@tasksTable1/@Listeners
            sname
            Listeners
            sdescriptors
            xworker.swt.widgets.Widget/@Listeners
            sinheritDescription
            false
            sth_createIndex
            false
            sth_registMyChilds
            false
            sth_mark
            false
            sid
            Listeners
              @/@PreparedGuides/@monitorTaskEditor/@Composite/@tasksComposite/@tasksTable1/@Listeners/@tasksTableSelection
              sname
              tasksTableSelection
              stype
              Selection
              sdescriptors
              xworker.swt.events.Listeners/@listeners/@Listener
              sinheritDescription
              false
              sth_createIndex
              false
              sth_registMyChilds
              false
              sth_mark
              false
              sid
              tasksTableSelection
                @/@PreparedGuides/@monitorTaskEditor/@Composite/@tasksComposite/@tasksTable1/@Listeners/@tasksTableSelection/@GroovyAction
                sname
                GroovyAction
                sisSynchronized
                false
                sthrowException
                true
                suseOtherAction
                false
                svarScope
                Local
                sdisableGlobalContext
                false
                Scode
#$@text#$@
import xworker.dataObject.DataObject;
import xworker.lang.util.XWorkerUtils;

deleteTaskButton.setEnabled(true);
//addDBButton.setEnabled(true);
//deleteDbButton.setEnabled(false);
//editParamButton.setEnabled(false);
editTaskButton.setEnabled(true);
addChildTaskButton.setEnabled(true);
editTaskThingButton.setEnabled(true);
editResourceButton.setEnabled(true);

def task = tasksTable.getSelection()[0].getData();
/*
//装载数据库
dbDataStore.doAction("load", actionContext, 
    ["params":["taskId": task.get("id")]]);
//log.info("taskId=" + task.get("id"));
*/    
//显示任务的文档    
def taskId = task.get("taskId");
def rtask = new DataObject("xworker.app.monitor.dataobjects.ResMonitorTasks");
rtask.put("id", taskId);
rtask = rtask.load(actionContext);

//参数的名称
for(int i=7; i<=16; i++){
    def column = tasksTable.getColumn(i);
    column.setText("参数" + (i - 6));
}
/*
for(int i=3; i<=12; i++){
    def column = dbsTable.getColumn(i);
    column.setText("参数" + (i - 2));
}
*/
def helpBrowser = guide.getActionContext().get("guideBrowser");

def taskPath = rtask.getString("taskPath");
if(taskPath != null){
    def taskThing = world.getThing(taskPath);
    if(taskThing != null){    
        helpBrowser.setUrl(XWorkerUtils.getThingDescUrl(taskThing));
        
        //任务资源参数
        def paramThing = taskThing.doAction("getParameterThing", actionContext);
        if(paramThing != null){
            tasksTable.setData("paramThing", paramThing);     
            
            def pthing = world.getThing(paramThing);
            if(pthing != null){
                for(pm in pthing.getChilds()){
                    int index = 0;
                    String name = pm.getMetadata().getLabel();;
                    String sname = pm.getString("name");
                    sname = sname.substring(5, sname.length());
                    index = 2 + Integer.parseInt(sname);
                    
                    if(index != 0){
                        def column = dbsTable.getColumn(index);
                        column.setText(name);
                    }
                }
            }      
        }
        
        //任务本身的参数
        def taskParamThing = taskThing.doAction("getTaskParameterThing", actionContext);
        if(taskParamThing != null){
            tasksTable.setData("taskParamThing", taskParamThing);     
            
            def pthing = world.getThing(taskParamThing);
            if(pthing != null){
                for(pm in pthing.getChilds()){
                    int index = 0;
                    String name = pm.getMetadata().getLabel();;
                    String sname = pm.getString("name");
                    sname = sname.substring(5, sname.length());
                    index = 6 + Integer.parseInt(sname);
                    
                    if(index != 0){
                        def column = tasksTable.getColumn(index);
                        column.setText(name);
                    }
                }
            }     
            
            editTaskParamButton.setEnabled(true); 
        }else{
            editTaskParamButton.setEnabled(false);
        }
    }
}
#$@text#$@
                sinterpretationType
                Action
                screateLocalVarScope
                false
                ssaveReturn
                false
                sdebugLog
                false
                sdescriptors
                xworker.lang.actions.Actions/@GroovyAction
                sinheritDescription
                false
                sth_createIndex
                false
                sth_registMyChilds
                false
                sth_mark
                false
                sid
                GroovyAction
            @/@PreparedGuides/@monitorTaskEditor/@Composite/@tasksComposite/@tasksTable1/@tasksTableGridData
            sname
            tasksTableGridData
            sstyle
            FILL_BOTH
            shorizontalIndent
            0
            swidth
            -1
            sheight
            -1
            shorizontalAlignment
            BEGINNING
            sverticalAlignment
            CENTER
            shorizontalSpan
            1
            sverticalSpan
            1
            sgrabExcessHorizontalSpace
            false
            sgrabExcessVerticalSpace
            false
            sdescriptors
            xworker.swt.layout.LayoutDatas/@GridData
            sinheritDescription
            false
            sth_createIndex
            false
            sth_registMyChilds
            false
            sth_mark
            false
            sid
            tasksTableGridData
          @/@PreparedGuides/@monitorTaskEditor/@Composite/@tasksComposite/@18163
          sname
          taskButtonComposite
          sBORDER
          false
          sH_SCROLL
          false
          sV_SCROLL
          false
          sNO_BACKGROUND
          false
          sNO_FOCUS
          false
          sNO_MERGE_PAINTS
          false
          sNO_REDRAW_RESIZE
          false
          sNO_RADIO_GROUP
          false
          sEMBEDDED
          false
          sDOUBLE_BUFFERED
          false
          scapture
          false
          senabled
          true
          sredraw
          true
          svisible
          true
          sdescriptors
          xworker.swt.Widgets/@Composite
          sid
          18163
            @/@PreparedGuides/@monitorTaskEditor/@Composite/@tasksComposite/@18163/@18164
            sname
            buttonCompositeGridData
            sstyle
            FILL_HORIZONTAL
            shorizontalIndent
            0
            swidth
            -1
            sheight
            -1
            shorizontalAlignment
            END
            sverticalAlignment
            CENTER
            shorizontalSpan
            1
            sverticalSpan
            1
            sgrabExcessHorizontalSpace
            false
            sgrabExcessVerticalSpace
            false
            sdescriptors
            xworker.swt.layout.LayoutDatas/@GridData
            sid
            18164
            @/@PreparedGuides/@monitorTaskEditor/@Composite/@tasksComposite/@18163/@18165
            sname
            buttonCompositeRowLayout
            sfill
            false
            sjustify
            false
            smarginWidth
            0
            smarginHeight
            0
            smarginLeft
            3
            smarginTop
            3
            smarginRight
            3
            smarginBottom
            3
            spack
            true
            sspacing
            3
            stype
            SWT.HORIZONTAL
            swrap
            true
            sdescriptors
            xworker.swt.Layouts/@RowLayout
            sid
            18165
            @/@PreparedGuides/@monitorTaskEditor/@Composite/@tasksComposite/@18163/@18166
            sname
            addTaskButton
            stext
            添加任务
            stype
            SWT.PUSH
            sflat
            false
            sborder
            false
            sselected
            false
            scapture
            false
            senabled
            true
            sredraw
            true
            svisible
            true
            sdescriptors
            xworker.swt.Widgets/@Button
            sth_createIndex
            false
            sid
            18166
              @/@PreparedGuides/@monitorTaskEditor/@Composite/@tasksComposite/@18163/@18166/@18167
              sname
              RowData
              sexclude
              false
              swidth
              80
              sheight
              -1
              sdescriptors
              xworker.swt.layout.LayoutDatas/@RowData
              sth_createIndex
              false
              sid
              18167
              @/@PreparedGuides/@monitorTaskEditor/@Composite/@tasksComposite/@18163/@18166/@18168
              sname
              Listeners
              sdescriptors
              xworker.swt.widgets.Widget/@Listeners
              sth_createIndex
              false
              sid
              18168
                @/@PreparedGuides/@monitorTaskEditor/@Composite/@tasksComposite/@18163/@18166/@18168/@18169
                sname
                addTaskButtonSelection
                stype
                Selection
                sdescriptors
                xworker.swt.events.Listeners/@listeners/@Listener
                sth_createIndex
                false
                sid
                18169
                  @/@PreparedGuides/@monitorTaskEditor/@Composite/@tasksComposite/@18163/@18166/@18168/@18169/@GroovyAction
                  sname
                  GroovyAction
                  sisSynchronized
                  false
                  sthrowException
                  true
                  suseOtherAction
                  false
                  svarScope
                  Local
                  sdisableGlobalContext
                  false
                  Scode
#$@text#$@
import org.xmeta.ActionContext;
import xworker.swt.util.SwtDialog;
import xworker.dataObject.DataObject;
import xworker.dataObject.utils.DataObjectUtil;

//选择数据
def ac = new ActionContext();
ac.put("parent", addTaskButton.getShell());
def shellThing = world.getThing("xworker.app.appmanager.swt.editors.monitor.ResTaskSelector");
def shell = shellThing.doAction("create", ac);
def datas = SwtDialog.open(shell, ac);

//插入数据
for(data in datas){
    def dataObject = new DataObject("xworker.app.monitor.dataobjects.ResMonitorTaskItems");
    dataObject.put("monitorId", monitorObjectContext.dataTable.getSelection()[0].getData().get("id"));
    dataObject.put("taskId", data.get("id"));
    dataObject.put("parentId", 0);
    dataObject.put("taskName", data.get("name")); 
    dataObject.put("status", 0);
    taskDataStore.doAction("insert", actionContext, ["records":[dataObject]]);
    //DataObjectUtil.createIfNotExists(dataObject, ["monitorId", "taskId"] as String[], actionContext);
}

//重新刷新
//taskDataStore.doAction("reload", actionContext);
#$@text#$@
                  sinterpretationType
                  Action
                  screateLocalVarScope
                  false
                  ssaveReturn
                  false
                  sdescriptors
                  xworker.lang.actions.Actions/@GroovyAction
                  sinheritDescription
                  false
                  sth_createIndex
                  false
                  sth_registMyChilds
                  false
                  sth_mark
                  false
                  sid
                  GroovyAction
            @/@PreparedGuides/@monitorTaskEditor/@Composite/@tasksComposite/@18163/@181661
            sname
            addChildTaskButton
            stext
            添加子任务
            stype
            SWT.PUSH
            sflat
            false
            sborder
            false
            sselected
            false
            scapture
            false
            senabled
            false
            sredraw
            true
            svisible
            true
            sdescriptors
            xworker.swt.Widgets/@Button
            sth_createIndex
            false
            sid
            181661
              @/@PreparedGuides/@monitorTaskEditor/@Composite/@tasksComposite/@18163/@181661/@18167
              sname
              RowData
              sexclude
              false
              swidth
              80
              sheight
              -1
              sdescriptors
              xworker.swt.layout.LayoutDatas/@RowData
              sth_createIndex
              false
              sid
              18167
              @/@PreparedGuides/@monitorTaskEditor/@Composite/@tasksComposite/@18163/@181661/@18168
              sname
              Listeners
              sdescriptors
              xworker.swt.widgets.Widget/@Listeners
              sth_createIndex
              false
              sid
              18168
                @/@PreparedGuides/@monitorTaskEditor/@Composite/@tasksComposite/@18163/@181661/@18168/@18169
                sname
                addTaskButtonSelection
                stype
                Selection
                sdescriptors
                xworker.swt.events.Listeners/@listeners/@Listener
                sth_createIndex
                false
                sid
                18169
                  @/@PreparedGuides/@monitorTaskEditor/@Composite/@tasksComposite/@18163/@181661/@18168/@18169/@GroovyAction
                  sname
                  GroovyAction
                  sisSynchronized
                  false
                  sthrowException
                  true
                  suseOtherAction
                  false
                  svarScope
                  Local
                  sdisableGlobalContext
                  false
                  Scode
#$@text#$@
import org.xmeta.ActionContext;
import xworker.swt.util.SwtDialog;
import xworker.dataObject.DataObject;
import xworker.dataObject.utils.DataObjectUtil;

//选择数据
def ac = new ActionContext();
ac.put("parent", addTaskButton.getShell());
def shellThing = world.getThing("xworker.app.appmanager.swt.editors.monitor.ResTaskSelector");
def shell = shellThing.doAction("create", ac);
def datas = SwtDialog.open(shell, ac);

def parentItem = tasksTable.getSelection()[0];
def parentData = parentItem.getData();
//插入数据
for(data in datas){
    def dataObject = new DataObject("xworker.app.monitor.dataobjects.ResMonitorTaskItems");
    dataObject.put("monitorId", monitorObjectContext.dataTable.getSelection()[0].getData().get("id"));
    dataObject.put("taskId", data.get("id"));
    dataObject.put("taskName", data.get("name")); 
    dataObject.put("status", 1);
    dataObject.put("parentId", parentData.get("id"));    
    taskDataStore.doAction("insert", actionContext, ["records":[dataObject]]);
}
#$@text#$@
                  sinterpretationType
                  Action
                  screateLocalVarScope
                  false
                  ssaveReturn
                  false
                  sdescriptors
                  xworker.lang.actions.Actions/@GroovyAction
                  sinheritDescription
                  false
                  sth_createIndex
                  false
                  sth_registMyChilds
                  false
                  sth_mark
                  false
                  sid
                  GroovyAction
            @/@PreparedGuides/@monitorTaskEditor/@Composite/@tasksComposite/@18163/@1817012
            sname
            editTaskButton
            stext
            编辑任务
            stype
            SWT.PUSH
            sflat
            false
            sborder
            false
            sselected
            false
            scapture
            false
            senabled
            false
            sredraw
            true
            svisible
            true
            sdescriptors
            xworker.swt.Widgets/@Button
            sth_createIndex
            false
            sid
            1817012
              @/@PreparedGuides/@monitorTaskEditor/@Composite/@tasksComposite/@18163/@1817012/@18171
              sname
              RowData
              sexclude
              false
              swidth
              80
              sheight
              -1
              sdescriptors
              xworker.swt.layout.LayoutDatas/@RowData
              sth_createIndex
              false
              sid
              18171
              @/@PreparedGuides/@monitorTaskEditor/@Composite/@tasksComposite/@18163/@1817012/@18172
              sname
              Listeners
              sdescriptors
              xworker.swt.widgets.Widget/@Listeners
              sth_createIndex
              false
              sid
              18172
                @/@PreparedGuides/@monitorTaskEditor/@Composite/@tasksComposite/@18163/@1817012/@18172/@editTaskButtonSelection
                sname
                editTaskButtonSelection
                stype
                Selection
                sdescriptors
                xworker.swt.events.Listeners/@listeners/@Listener
                sinheritDescription
                false
                sth_createIndex
                false
                sth_registMyChilds
                false
                sth_mark
                false
                sid
                editTaskButtonSelection
                  @/@PreparedGuides/@monitorTaskEditor/@Composite/@tasksComposite/@18163/@1817012/@18172/@editTaskButtonSelection/@DataStoreAction
                  sname
                  DataStoreAction
                  sstoreName
                  taskDataStore
                  smethod
                  openEditForm
                  srecordSource
                  DataObjectTable
                  srecordName
                  tasksTable
                  sdeleteConfirm
                  true
                  scrateConfirm
                  false
                  supdateConfirm
                  false
                  scommitConfirm
                  false
                  supdateBatchConfirm
                  true
                  sremoveBatchConfirm
                  true
                  sinterpretationType
                  Self
                  sattributeTemplate
                  false
                  schildsAttributeTemplate
                  false
                  svarScope
                  Local
                  sisSynchronized
                  false
                  sthrowException
                  true
                  suseOtherAction
                  false
                  screateLocalVarScope
                  false
                  ssaveReturn
                  false
                  sdisableGlobalContext
                  false
                  sdescriptors
                  xworker.swt.app.view.swt.data.DataStoreAction
                  sinheritDescription
                  false
                  sth_createIndex
                  false
                  sth_registMyChilds
                  false
                  sth_mark
                  false
                  sid
                  DataStoreAction
            @/@PreparedGuides/@monitorTaskEditor/@Composite/@tasksComposite/@18163/@18170
            sname
            deleteTaskButton
            stext
            删除任务
            stype
            SWT.PUSH
            sflat
            false
            sborder
            false
            sselected
            false
            scapture
            false
            senabled
            false
            sredraw
            true
            svisible
            true
            sdescriptors
            xworker.swt.Widgets/@Button
            sth_createIndex
            false
            sid
            18170
              @/@PreparedGuides/@monitorTaskEditor/@Composite/@tasksComposite/@18163/@18170/@18171
              sname
              RowData
              sexclude
              false
              swidth
              80
              sheight
              -1
              sdescriptors
              xworker.swt.layout.LayoutDatas/@RowData
              sth_createIndex
              false
              sid
              18171
              @/@PreparedGuides/@monitorTaskEditor/@Composite/@tasksComposite/@18163/@18170/@18172
              sname
              Listeners
              sdescriptors
              xworker.swt.widgets.Widget/@Listeners
              sth_createIndex
              false
              sid
              18172
                @/@PreparedGuides/@monitorTaskEditor/@Composite/@tasksComposite/@18163/@18170/@18172/@18173
                sname
                deleteTaskButtonSelection
                stype
                Selection
                sdescriptors
                xworker.swt.events.Listeners/@listeners/@Listener
                sth_createIndex
                false
                sid
                18173
                  @/@PreparedGuides/@monitorTaskEditor/@Composite/@tasksComposite/@18163/@18170/@18172/@18173/@If
                  sname
                  If
                  sinterpretationType
                  Self
                  sattributeTemplate
                  false
                  schildsAttributeTemplate
                  false
                  svarScope
                  Local
                  sisSynchronized
                  false
                  sthrowException
                  true
                  suseOtherAction
                  false
                  screateLocalVarScope
                  false
                  ssaveReturn
                  false
                  sdisableGlobalContext
                  false
                  sdescriptors
                  xworker.lang.actions.Actions/@If
                  sinheritDescription
                  false
                  sth_createIndex
                  false
                  sth_registMyChilds
                  false
                  sth_mark
                  false
                  sid
                  If
                    @/@PreparedGuides/@monitorTaskEditor/@Composite/@tasksComposite/@18163/@18170/@18172/@18173/@If/@actions
                    sname
                    actions
                    sdescriptors
                    xworker.lang.actions.If/@actions
                    sinheritDescription
                    false
                    sth_createIndex
                    false
                    sth_registMyChilds
                    false
                    sth_mark
                    false
                    sid
                    actions
                      @/@PreparedGuides/@monitorTaskEditor/@Composite/@tasksComposite/@18163/@18170/@18172/@18173/@If/@actions/@condition
                      sname
                      condition
                      sisSynchronized
                      false
                      sthrowException
                      true
                      suseOtherAction
                      false
                      svarScope
                      Local
                      sdisableGlobalContext
                      false
                      Scode
#$@text#$@
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.MessageBox;

if(dbsTable.getItems().length > 0){
    def box = new MessageBox(dbsTable.getShell(), SWT.ICON_WARNING | SWT.OK | SWT.CANCEL);
    box.setText("删除任务");
    box.setMessage("资源不为空，还是确定要删除么？");
    
    if(SWT.OK ==  box.open()){
        return true;
    }else{
        return false;
    }
}else{
    return true;
}
#$@text#$@
                      sinterpretationType
                      Action
                      screateLocalVarScope
                      false
                      ssaveReturn
                      false
                      sdescriptors
                      xworker.lang.actions.Actions/@GroovyAction
                      sinheritDescription
                      false
                      sth_createIndex
                      false
                      sth_registMyChilds
                      false
                      sth_mark
                      false
                      sid
                      condition
                    @/@PreparedGuides/@monitorTaskEditor/@Composite/@tasksComposite/@18163/@18170/@18172/@18173/@If/@ChildAction
                    sname
                    Then
                    sdescriptors
                    xworker.lang.actions.If/@ChildAction
                    sinheritDescription
                    false
                    sth_createIndex
                    false
                    sth_registMyChilds
                    false
                    sth_mark
                    false
                    sid
                    ChildAction
                      @/@PreparedGuides/@monitorTaskEditor/@Composite/@tasksComposite/@18163/@18170/@18172/@18173/@If/@ChildAction/@DataStoreAction
                      sname
                      DataStoreAction
                      sstoreName
                      taskDataStore
                      smethod
                      remove
                      srecordSource
                      DataObjectTable
                      srecordName
                      tasksTable
                      sdeleteConfirm
                      true
                      scrateConfirm
                      false
                      supdateConfirm
                      false
                      scommitConfirm
                      false
                      supdateBatchConfirm
                      true
                      sremoveBatchConfirm
                      true
                      sdeleteMessage
                      确定要删除选中的任务么？
                      sinterpretationType
                      Self
                      sattributeTemplate
                      false
                      schildsAttributeTemplate
                      false
                      svarScope
                      Local
                      sisSynchronized
                      false
                      sthrowException
                      true
                      suseOtherAction
                      false
                      screateLocalVarScope
                      false
                      ssaveReturn
                      false
                      sdisableGlobalContext
                      false
                      sdescriptors
                      xworker.swt.app.view.swt.data.DataStoreAction
                      sinheritDescription
                      false
                      sth_createIndex
                      false
                      sth_registMyChilds
                      false
                      sth_mark
                      false
                      sid
                      DataStoreAction
            @/@PreparedGuides/@monitorTaskEditor/@Composite/@tasksComposite/@18163/@1817011
            sname
            editTaskParamButton
            stext
            编辑参数
            stype
            SWT.PUSH
            sflat
            false
            sborder
            false
            sselected
            false
            scapture
            false
            senabled
            false
            sredraw
            true
            svisible
            true
            sdescriptors
            xworker.swt.Widgets/@Button
            sth_createIndex
            false
            sid
            1817011
              @/@PreparedGuides/@monitorTaskEditor/@Composite/@tasksComposite/@18163/@1817011/@18171
              sname
              RowData
              sexclude
              false
              swidth
              100
              sheight
              -1
              sdescriptors
              xworker.swt.layout.LayoutDatas/@RowData
              sth_createIndex
              false
              sid
              18171
              @/@PreparedGuides/@monitorTaskEditor/@Composite/@tasksComposite/@18163/@1817011/@18172
              sname
              Listeners
              sdescriptors
              xworker.swt.widgets.Widget/@Listeners
              sth_createIndex
              false
              sid
              18172
                @/@PreparedGuides/@monitorTaskEditor/@Composite/@tasksComposite/@18163/@1817011/@18172/@18173
                sname
                deleteTaskButtonSelection
                stype
                Selection
                sdescriptors
                xworker.swt.events.Listeners/@listeners/@Listener
                sth_createIndex
                false
                sid
                18173
                  @/@PreparedGuides/@monitorTaskEditor/@Composite/@tasksComposite/@18163/@1817011/@18172/@18173/@GroovyAction
                  sname
                  GroovyAction
                  sisSynchronized
                  false
                  sthrowException
                  true
                  suseOtherAction
                  false
                  svarScope
                  Local
                  sdisableGlobalContext
                  false
                  Scode
#$@text#$@
import org.xmeta.Thing;
import org.xmeta.ActionContext;
import xworker.swt.util.SwtDialog;

def paramThing = tasksTable.getData("taskParamThing");
def param = new Thing(paramThing);
def item = tasksTable.getSelection()[0];
def data = tasksTable.getSelection()[0].getData();
param.putAll(data);

def ac = new ActionContext();
ac.put("parent", editTaskParamButton.getShell());
ac.put("paramThing", param);

def shellThing = world.getThing("xworker.app.appmanager.swt.editors.monitor.ParamsEditor");
def newShell = shellThing.doAction("create", ac);
def dialog = new SwtDialog(newShell, ac);
def result = dialog.open();
if(result != null){
    data.putAll(result);
    //data.update(actionContext);
    taskDataStore.doAction("update", actionContext, ["record": data]);
}
#$@text#$@
                  sinterpretationType
                  Action
                  screateLocalVarScope
                  false
                  ssaveReturn
                  false
                  sdebugLog
                  false
                  sdescriptors
                  xworker.lang.actions.Actions/@GroovyAction
                  sinheritDescription
                  false
                  sth_createIndex
                  false
                  sth_registMyChilds
                  false
                  sth_mark
                  false
                  sid
                  GroovyAction
            @/@PreparedGuides/@monitorTaskEditor/@Composite/@tasksComposite/@18163/@181701
            sname
            editTaskThingButton
            stext
            编辑任务事物
            stype
            SWT.PUSH
            sflat
            false
            sborder
            false
            sselected
            false
            scapture
            false
            senabled
            false
            sredraw
            true
            svisible
            true
            sdescriptors
            xworker.swt.Widgets/@Button
            sth_createIndex
            false
            sid
            181701
              @/@PreparedGuides/@monitorTaskEditor/@Composite/@tasksComposite/@18163/@181701/@18171
              sname
              RowData
              sexclude
              false
              swidth
              100
              sheight
              -1
              sdescriptors
              xworker.swt.layout.LayoutDatas/@RowData
              sth_createIndex
              false
              sid
              18171
              @/@PreparedGuides/@monitorTaskEditor/@Composite/@tasksComposite/@18163/@181701/@18172
              sname
              Listeners
              sdescriptors
              xworker.swt.widgets.Widget/@Listeners
              sth_createIndex
              false
              sid
              18172
                @/@PreparedGuides/@monitorTaskEditor/@Composite/@tasksComposite/@18163/@181701/@18172/@18173
                sname
                deleteTaskButtonSelection
                stype
                Selection
                sdescriptors
                xworker.swt.events.Listeners/@listeners/@Listener
                sth_createIndex
                false
                sid
                18173
                  @/@PreparedGuides/@monitorTaskEditor/@Composite/@tasksComposite/@18163/@181701/@18172/@18173/@GroovyAction
                  sname
                  GroovyAction
                  sisSynchronized
                  false
                  sthrowException
                  true
                  suseOtherAction
                  false
                  svarScope
                  Local
                  sdisableGlobalContext
                  false
                  Scode
#$@text#$@
import xworker.dataObject.DataObject;
import xworker.lang.util.XWorkerUtils;

def task = tasksTable.getSelection()[0].getData();
def taskObj = new DataObject("xworker.app.monitor.dataobjects.ResMonitorTasks");
taskObj.put("id", task.get("taskId"));
taskObj = taskObj.load(actionContext);
if(taskObj != null){
    def path = taskObj.getString("taskPath");
    def thing = world.getThing(path);
    XWorkerUtils.ideOpenThing(thing);
}
#$@text#$@
                  sinterpretationType
                  Action
                  screateLocalVarScope
                  false
                  ssaveReturn
                  false
                  sdescriptors
                  xworker.lang.actions.Actions/@GroovyAction
                  sinheritDescription
                  false
                  sth_createIndex
                  false
                  sth_registMyChilds
                  false
                  sth_mark
                  false
                  sid
                  GroovyAction
            @/@PreparedGuides/@monitorTaskEditor/@Composite/@tasksComposite/@18163/@1817013
            sname
            editResourceButton
            stext
            编辑资源
            stype
            SWT.PUSH
            sflat
            false
            sborder
            false
            sselected
            false
            scapture
            false
            senabled
            false
            sredraw
            true
            svisible
            true
            sdescriptors
            xworker.swt.Widgets/@Button
            sth_createIndex
            false
            sid
            1817013
              @/@PreparedGuides/@monitorTaskEditor/@Composite/@tasksComposite/@18163/@1817013/@18171
              sname
              RowData
              sexclude
              false
              swidth
              100
              sheight
              -1
              sdescriptors
              xworker.swt.layout.LayoutDatas/@RowData
              sth_createIndex
              false
              sid
              18171
              @/@PreparedGuides/@monitorTaskEditor/@Composite/@tasksComposite/@18163/@1817013/@18172
              sname
              Listeners
              sdescriptors
              xworker.swt.widgets.Widget/@Listeners
              sth_createIndex
              false
              sid
              18172
                @/@PreparedGuides/@monitorTaskEditor/@Composite/@tasksComposite/@18163/@1817013/@18172/@18173
                sname
                editResButtonSelection
                stype
                Selection
                sdescriptors
                xworker.swt.events.Listeners/@listeners/@Listener
                sth_createIndex
                false
                sid
                18173
                  @/@PreparedGuides/@monitorTaskEditor/@Composite/@tasksComposite/@18163/@1817013/@18172/@18173/@GroovyAction
                  sname
                  GroovyAction
                  sisSynchronized
                  false
                  sthrowException
                  true
                  suseOtherAction
                  false
                  svarScope
                  Local
                  sdisableGlobalContext
                  false
                  Scode
#$@text#$@
def task = tasksTable.getSelection()[0].getData();
guide.put("taskId", task.get("taskId"));
guide.put("task", task);
guide.put("taskParamThing", tasksTable.getData("paramThing"));

guide.guideFinished(guideThing);
#$@text#$@
                  sinterpretationType
                  Action
                  screateLocalVarScope
                  false
                  ssaveReturn
                  false
                  sdebugLog
                  false
                  sdescriptors
                  xworker.lang.actions.Actions/@GroovyAction
                  sinheritDescription
                  false
                  sth_createIndex
                  false
                  sth_registMyChilds
                  false
                  sth_mark
                  false
                  sid
                  GroovyAction
        @/@PreparedGuides/@monitorTaskEditor/@Composite/@init
        sname
        init
        sisSynchronized
        false
        sthrowException
        true
        suseOtherAction
        false
        svarScope
        Local
        sdisableGlobalContext
        false
        Scode
#$@text#$@
def monitorId = guide.get("monitorId");
taskDataStore.doAction("load", actionContext, 
    ["params":["monitorId": monitorId,  "parentId":0]]);
    
/*    
dbDataStore.doAction("load", actionContext, 
    ["params":["taskId": -1]]);
*/    
    
for(int i=7; i<=16; i++){
    def column = tasksTable.getColumn(i);
    column.setText("参数" + (i -6));
}
#$@text#$@
        sinterpretationType
        Action
        screateLocalVarScope
        false
        ssaveReturn
        false
        sdebugLog
        false
        sdescriptors
        xworker.swt.widgets.Widget/@Code
        sinheritDescription
        false
        sth_createIndex
        false
        sth_registMyChilds
        false
        sth_registDisabled
        false
        sth_mark
        false
        sid
        init
      @/@PreparedGuides/@monitorTaskEditor/@NextGuides
      sname
      NextGuides
      sdescriptors
      xworker.function.ui.guide.Guide/@NextGuides
      sinheritDescription
      false
      sth_createIndex
      false
      sth_registMyChilds
      false
      sth_registDisabled
      false
      sth_mark
      false
      sid
      NextGuides
        @/@PreparedGuides/@monitorTaskEditor/@NextGuides/@monitorResEditor
        sname
        monitorResEditor
        slabel
        监控资源管理
        sguidePath
        xworker.app.appmanager.swt.editors.monitor.guides.ResMonitorGuide/@PreparedGuides/@monitorResourceEditor
        sdescriptors
        xworker.function.ui.guide.Guide/@NextGuides/@GuideReference
        sinheritDescription
        false
        sth_createIndex
        false
        sth_registMyChilds
        false
        sth_registDisabled
        false
        sth_mark
        false
        sid
        monitorResEditor
    @/@PreparedGuides/@monitorResourceEditor
    sname
    monitorResourceEditor
    slabel
    监控资源管理
    sdescriptors
    xworker.function.ui.guide.Guide/@NextGuides/@Composite
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    monitorResourceEditor
      @/@PreparedGuides/@monitorResourceEditor/@Composite
      sname
      Composite
      sBORDER
      false
      sH_SCROLL
      false
      sV_SCROLL
      false
      sNO_BACKGROUND
      false
      sNO_FOCUS
      false
      sNO_MERGE_PAINTS
      false
      sNO_REDRAW_RESIZE
      false
      sNO_RADIO_GROUP
      false
      sEMBEDDED
      false
      sDOUBLE_BUFFERED
      false
      scapture
      false
      senabled
      true
      sredraw
      true
      svisible
      true
      sdescriptors
      xworker.function.ui.guide.Guide/@NextGuides/@Composite/@Composite,xworker.swt.Widgets/@Composite
      sinheritDescription
      false
      sth_createIndex
      false
      sth_registMyChilds
      false
      sth_registDisabled
      false
      sth_mark
      false
      sid
      Composite
        @/@PreparedGuides/@monitorResourceEditor/@Composite/@dbsCompositeGridLayout
        sname
        dbsCompositeGridLayout
        smakeColumnsEqualWidth
        false
        smarginWidth
        5
        smarginHeight
        5
        smarginLeft
        0
        smarginTop
        0
        smarginRight
        0
        smarginBottom
        0
        shorizontalSpacing
        5
        sverticalSpacing
        5
        sdescriptors
        xworker.swt.Layouts/@GridLayout
        sinheritDescription
        false
        sth_createIndex
        false
        sth_registMyChilds
        false
        sth_mark
        false
        sid
        dbsCompositeGridLayout
        @/@PreparedGuides/@monitorResourceEditor/@Composite/@dbsTable
        sname
        dbsTable
        sselectStyle
        SINGLE
        sV_SCROLL
        true
        sH_SCROLL
        true
        sCHECK
        true
        sFULL_SELECTION
        true
        sHIDE_SELECTION
        true
        sBORDER
        false
        slineVisible
        true
        smultipleColumns
        true
        sheaderVisible
        true
        ssortIndicator
        true
        smoveableColumns
        true
        sheadImages
        false
        ssubImages
        false
        sVIRTUAL
        false
        scapture
        false
        senabled
        true
        sredraw
        true
        svisible
        true
        sdescriptors
        xworker.swt.Widgets/@Table
        sinheritDescription
        false
        sth_createIndex
        false
        sth_registMyChilds
        false
        sth_mark
        false
        sid
        dbsTable
          @/@PreparedGuides/@monitorResourceEditor/@Composite/@dbsTable/@dbsTableGridData
          sname
          dbsTableGridData
          sstyle
          FILL_BOTH
          shorizontalIndent
          0
          swidth
          -1
          sheight
          -1
          shorizontalAlignment
          BEGINNING
          sverticalAlignment
          CENTER
          shorizontalSpan
          1
          sverticalSpan
          1
          sgrabExcessHorizontalSpace
          false
          sgrabExcessVerticalSpace
          false
          sdescriptors
          xworker.swt.layout.LayoutDatas/@GridData
          sinheritDescription
          false
          sth_createIndex
          false
          sth_registMyChilds
          false
          sth_mark
          false
          sid
          dbsTableGridData
          @/@PreparedGuides/@monitorResourceEditor/@Composite/@dbsTable/@dbDataStore
          sname
          dbDataStore
          sattachToParent
          true
          sloadBackground
          true
          sautoLoad
          false
          sautoSave
          true
          sdataObject
          xworker.app.monitor.dataobjects.ResMonitorResItems
          spaging
          extend
          spageSize
          50
          sstoreSortField
          _extend
          sstoreSortDir
          ASC
          seditable
          extend
          seditmethod
          extend
          sdescriptors
          xworker.swt.widgets.Table/@DataStore
          sinheritDescription
          false
          sth_createIndex
          false
          sth_registMyChilds
          false
          sth_mark
          false
          sid
          dbDataStore
            @/@PreparedGuides/@monitorResourceEditor/@Composite/@dbsTable/@dbDataStore/@queryConfig
            sname
            queryConfig
            sattributeName
            taskId
            sdataName
            taskId
            boperator
            1
            sjoin
            and
            signoreNull
            true
            sdummySql
            false
            saddOneDay
            false
            sdescriptors
            xworker.swt.app.view.swt.data.DataStore/@Condition
            sinheritDescription
            false
            sth_createIndex
            false
            sth_registMyChilds
            false
            sth_mark
            false
            sid
            queryConfig
          @/@PreparedGuides/@monitorResourceEditor/@Composite/@dbsTable/@Listeners
          sname
          Listeners
          sdescriptors
          xworker.swt.widgets.Widget/@Listeners
          sinheritDescription
          false
          sth_createIndex
          false
          sth_registMyChilds
          false
          sth_mark
          false
          sid
          Listeners
            @/@PreparedGuides/@monitorResourceEditor/@Composite/@dbsTable/@Listeners/@dbsTableSelection
            sname
            dbsTableSelection
            stype
            Selection
            sdescriptors
            xworker.swt.events.Listeners/@listeners/@Listener
            sinheritDescription
            false
            sth_createIndex
            false
            sth_registMyChilds
            false
            sth_mark
            false
            sid
            dbsTableSelection
              @/@PreparedGuides/@monitorResourceEditor/@Composite/@dbsTable/@Listeners/@dbsTableSelection/@GroovyAction
              sname
              GroovyAction
              sisSynchronized
              false
              sthrowException
              true
              suseOtherAction
              false
              svarScope
              Local
              sdisableGlobalContext
              false
              Scode
#$@text#$@
deleteDbButton.setEnabled(true);
if(guide.get("taskParamThing") != null){
    editParamButton.setEnabled(true);
}
#$@text#$@
              sinterpretationType
              Action
              screateLocalVarScope
              false
              ssaveReturn
              false
              sdebugLog
              false
              sdescriptors
              xworker.lang.actions.Actions/@GroovyAction
              sinheritDescription
              false
              sth_createIndex
              false
              sth_registMyChilds
              false
              sth_mark
              false
              sid
              GroovyAction
        @/@PreparedGuides/@monitorResourceEditor/@Composite/@18163
        sname
        dbsButtonComposite
        sBORDER
        false
        sH_SCROLL
        false
        sV_SCROLL
        false
        sNO_BACKGROUND
        false
        sNO_FOCUS
        false
        sNO_MERGE_PAINTS
        false
        sNO_REDRAW_RESIZE
        false
        sNO_RADIO_GROUP
        false
        sEMBEDDED
        false
        sDOUBLE_BUFFERED
        false
        scapture
        false
        senabled
        true
        sredraw
        true
        svisible
        true
        sdescriptors
        xworker.swt.Widgets/@Composite
        sid
        18163
          @/@PreparedGuides/@monitorResourceEditor/@Composite/@18163/@18164
          sname
          buttonCompositeGridData
          sstyle
          FILL_HORIZONTAL
          shorizontalIndent
          0
          swidth
          -1
          sheight
          -1
          shorizontalAlignment
          END
          sverticalAlignment
          CENTER
          shorizontalSpan
          1
          sverticalSpan
          1
          sgrabExcessHorizontalSpace
          false
          sgrabExcessVerticalSpace
          false
          sdescriptors
          xworker.swt.layout.LayoutDatas/@GridData
          sid
          18164
          @/@PreparedGuides/@monitorResourceEditor/@Composite/@18163/@18165
          sname
          buttonCompositeRowLayout
          sfill
          false
          sjustify
          false
          smarginWidth
          0
          smarginHeight
          0
          smarginLeft
          3
          smarginTop
          3
          smarginRight
          3
          smarginBottom
          3
          spack
          true
          sspacing
          3
          stype
          SWT.HORIZONTAL
          swrap
          true
          sdescriptors
          xworker.swt.Layouts/@RowLayout
          sid
          18165
          @/@PreparedGuides/@monitorResourceEditor/@Composite/@18163/@18166
          sname
          addDBButton
          stext
          添加资源
          stype
          SWT.PUSH
          sflat
          false
          sborder
          false
          sselected
          false
          scapture
          false
          senabled
          true
          sredraw
          true
          svisible
          true
          sdescriptors
          xworker.swt.Widgets/@Button
          sth_createIndex
          false
          sid
          18166
            @/@PreparedGuides/@monitorResourceEditor/@Composite/@18163/@18166/@18167
            sname
            RowData
            sexclude
            false
            swidth
            80
            sheight
            -1
            sdescriptors
            xworker.swt.layout.LayoutDatas/@RowData
            sth_createIndex
            false
            sid
            18167
            @/@PreparedGuides/@monitorResourceEditor/@Composite/@18163/@18166/@18168
            sname
            Listeners
            sdescriptors
            xworker.swt.widgets.Widget/@Listeners
            sth_createIndex
            false
            sid
            18168
              @/@PreparedGuides/@monitorResourceEditor/@Composite/@18163/@18166/@18168/@18169
              sname
              addTaskButtonSelection
              stype
              Selection
              sdescriptors
              xworker.swt.events.Listeners/@listeners/@Listener
              sth_createIndex
              false
              sid
              18169
                @/@PreparedGuides/@monitorResourceEditor/@Composite/@18163/@18166/@18168/@18169/@GroovyAction
                sname
                GroovyAction
                sisSynchronized
                false
                sthrowException
                true
                suseOtherAction
                false
                svarScope
                Local
                sdisableGlobalContext
                false
                Scode
#$@text#$@
import org.xmeta.ActionContext;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.MessageBox;

import xworker.swt.util.SwtDialog;
import xworker.dataObject.DataObject;
import xworker.dataObject.utils.DataObjectUtil;

//任务
def task = guide.get("task");
def taskDataObject = new DataObject("xworker.app.monitor.dataobjects.ResMonitorTasks");
taskDataObject.put("id", task.taskId);
taskDataObject = taskDataObject.load(actionContext);
//log.info("" + taskDataObject.taskPath);
def taskThing = world.getThing(taskDataObject.taskPath);
if(taskThing == null){
    def box = new MessageBox(dbsTable.getShell(), SWT.ICON_WARNING | SWT.OK);
    box.setText("添加资源");
    box.setMessage("任务不存在！任务没有设置taskPath或taskPath指向的事物不存在！");
    box.open();
    return;
}

def resSelectorPath = taskThing.doAction("getResSelectorPath");
if(resSelectorPath == null || world.getThing(resSelectorPath) == null){
    def box = new MessageBox(dbsTable.getShell(), SWT.ICON_WARNING | SWT.OK);
    box.setText("添加资源");
    box.setMessage("通过任务事物getResSelectorPath获取的选择资源的窗口事物不存在！");
    box.open();
    return;
}

//选择数据
def ac = new ActionContext();
ac.put("parent", dbsTable.getShell());
def shellThing = world.getThing(resSelectorPath);
def shell = shellThing.doAction("create", ac);
def datas = SwtDialog.open(shell, ac);

//插入数据
for(data in datas){
    def dataObject = new DataObject("xworker.app.monitor.dataobjects.ResMonitorResItems");
    dataObject.put("taskId",dbsTable.getSelection()[0].getData().get("id"));
    dataObject.put("resId", data.get("id"));
    dataObject.put("resName", data.get("name")); 
    dataObject.put("status", 1);
    DataObjectUtil.createIfNotExists(dataObject, ["resId", "taskId"] as String[], actionContext);
}

//重新刷新
dbDataStore.doAction("reload", actionContext);
#$@text#$@
                sinterpretationType
                Action
                screateLocalVarScope
                false
                ssaveReturn
                false
                sdebugLog
                false
                sdescriptors
                xworker.lang.actions.Actions/@GroovyAction
                sinheritDescription
                false
                sth_createIndex
                false
                sth_registMyChilds
                false
                sth_mark
                false
                sid
                GroovyAction
          @/@PreparedGuides/@monitorResourceEditor/@Composite/@18163/@18170
          sname
          deleteDbButton
          stext
          删除资源
          stype
          SWT.PUSH
          sflat
          false
          sborder
          false
          sselected
          false
          scapture
          false
          senabled
          true
          sredraw
          true
          svisible
          true
          sdescriptors
          xworker.swt.Widgets/@Button
          sth_createIndex
          false
          sid
          18170
            @/@PreparedGuides/@monitorResourceEditor/@Composite/@18163/@18170/@18171
            sname
            RowData
            sexclude
            false
            swidth
            80
            sheight
            -1
            sdescriptors
            xworker.swt.layout.LayoutDatas/@RowData
            sth_createIndex
            false
            sid
            18171
            @/@PreparedGuides/@monitorResourceEditor/@Composite/@18163/@18170/@18172
            sname
            Listeners
            sdescriptors
            xworker.swt.widgets.Widget/@Listeners
            sth_createIndex
            false
            sid
            18172
              @/@PreparedGuides/@monitorResourceEditor/@Composite/@18163/@18170/@18172/@18173
              sname
              deleteTaskButtonSelection
              stype
              Selection
              sdescriptors
              xworker.swt.events.Listeners/@listeners/@Listener
              sth_createIndex
              false
              sid
              18173
                @/@PreparedGuides/@monitorResourceEditor/@Composite/@18163/@18170/@18172/@18173/@DataStoreAction
                sname
                DataStoreAction
                sstoreName
                dbDataStore
                smethod
                remove
                srecordSource
                DataObjectTable
                srecordName
                dbsTable
                sdeleteConfirm
                true
                scrateConfirm
                false
                supdateConfirm
                false
                scommitConfirm
                false
                supdateBatchConfirm
                true
                sremoveBatchConfirm
                true
                sdeleteMessage
                却是要删除选中的资源么？
                sinterpretationType
                Self
                sattributeTemplate
                false
                schildsAttributeTemplate
                false
                svarScope
                Local
                sisSynchronized
                false
                sthrowException
                true
                suseOtherAction
                false
                screateLocalVarScope
                false
                ssaveReturn
                false
                sdisableGlobalContext
                false
                sdescriptors
                xworker.swt.app.view.swt.data.DataStoreAction
                sinheritDescription
                false
                sth_createIndex
                false
                sth_registMyChilds
                false
                sth_mark
                false
                sid
                DataStoreAction
          @/@PreparedGuides/@monitorResourceEditor/@Composite/@18163/@181701
          sname
          editParamButton
          stext
          编辑参数
          stype
          SWT.PUSH
          sflat
          false
          sborder
          false
          sselected
          false
          scapture
          false
          senabled
          false
          sredraw
          true
          svisible
          true
          sdescriptors
          xworker.swt.Widgets/@Button
          sth_createIndex
          false
          sid
          181701
            @/@PreparedGuides/@monitorResourceEditor/@Composite/@18163/@181701/@18171
            sname
            RowData
            sexclude
            false
            swidth
            80
            sheight
            -1
            sdescriptors
            xworker.swt.layout.LayoutDatas/@RowData
            sth_createIndex
            false
            sid
            18171
            @/@PreparedGuides/@monitorResourceEditor/@Composite/@18163/@181701/@18172
            sname
            Listeners
            sdescriptors
            xworker.swt.widgets.Widget/@Listeners
            sth_createIndex
            false
            sid
            18172
              @/@PreparedGuides/@monitorResourceEditor/@Composite/@18163/@181701/@18172/@editParamButtonSelection
              sname
              editParamButtonSelection
              stype
              Selection
              sdescriptors
              xworker.swt.events.Listeners/@listeners/@Listener
              sinheritDescription
              false
              sth_createIndex
              false
              sth_registMyChilds
              false
              sth_mark
              false
              sid
              editParamButtonSelection
                @/@PreparedGuides/@monitorResourceEditor/@Composite/@18163/@181701/@18172/@editParamButtonSelection/@GroovyAction
                sname
                GroovyAction
                sisSynchronized
                false
                sthrowException
                true
                suseOtherAction
                false
                svarScope
                Local
                sdisableGlobalContext
                false
                Scode
#$@text#$@
import org.xmeta.Thing;
import org.xmeta.ActionContext;
import xworker.swt.util.SwtDialog;

def paramThing = tasksTable.getData("paramThing");
def param = new Thing(paramThing);
def item = dbsTable.getSelection()[0];
def data = dbsTable.getSelection()[0].getData();
param.putAll(data);

def ac = new ActionContext();
ac.put("parent", editParamButton.getShell());
ac.put("paramThing", param);

def shellThing = world.getThing("xworker.app.appmanager.swt.editors.monitor.ParamsEditor");
def newShell = shellThing.doAction("create", ac);
def dialog = new SwtDialog(newShell, ac);
def result = dialog.open();
if(result != null){
    data.putAll(result);
    //data.update(actionContext);
    dbDataStore.doAction("update", actionContext, ["record": data]);
}
#$@text#$@
                sinterpretationType
                Action
                screateLocalVarScope
                false
                ssaveReturn
                false
                sdescriptors
                xworker.lang.actions.Actions/@GroovyAction
                sinheritDescription
                false
                sth_createIndex
                false
                sth_registMyChilds
                false
                sth_mark
                false
                sid
                GroovyAction
        @/@PreparedGuides/@monitorResourceEditor/@Composite/@init
        sname
        init
        sisSynchronized
        false
        sthrowException
        true
        suseOtherAction
        false
        svarScope
        Local
        sdisableGlobalContext
        false
        Scode
#$@text#$@
addDBButton.setEnabled(true);
deleteDbButton.setEnabled(false);
editParamButton.setEnabled(false);

dbDataStore.doAction("load", actionContext, 
    ["params":["taskId": guide.get("taskId")]]);
#$@text#$@
        sinterpretationType
        Action
        screateLocalVarScope
        false
        ssaveReturn
        false
        sdebugLog
        false
        sdescriptors
        xworker.swt.widgets.Widget/@Code
        sinheritDescription
        false
        sth_createIndex
        false
        sth_registMyChilds
        false
        sth_registDisabled
        false
        sth_mark
        false
        sid
        init
    @/@PreparedGuides/@mailSetting
    sname
    mailSetting
    slabel
    邮件设置向导
    sdescriptors
    xworker.function.ui.guide.Guide/@PreparedGuides/@PreparedGuides
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    mailSetting
      @/@PreparedGuides/@mailSetting/@setMailSession
      sname
      setMailSession
      slabel
      设置邮件会话
      sdescription
      <p>选择邮件会话。</p>
      sdescriptors
      xworker.function.ui.guide.Guide/@NextGuides/@Composite
      sinheritDescription
      false
      sth_createIndex
      false
      sth_registMyChilds
      false
      sth_registDisabled
      false
      sth_mark
      false
      sid
      setMailSession
