服务热线:13616026886

技术文档 欢迎使用技术文档,我们为你提供从新手到专业开发者的所有资源,你也可以通过它日益精进

位置:首页 > 技术文档 > JAVA > 新手入门 > 基础入门 > 查看文档

shark中的toolagent用法-javascripttoolagent

shark的文档中叙述如下:

  • javascripttoolagent - executes java script. if you set application mode to 0 (zero), tool agent will search for a java script file given as applicationname parameter (this file has to be in the class path), and if it founds it, it will try to execute it. otherwise, it will consider applicationname parameter to be the script itself, and will try to execute it. so far, we defined few java script files that execute simple arithmetic operations, generation of random number, and one that performs waiting.

    this tool agent is able to "understand" the extended attributes with the following names:

    • appname - value of this attribute should represent the name of script file to execute (this file has to be in class path)

    • script - the value of this represents the script to be executed. i.e. this extended attribute in xpdl can be defined as follows:

      <extendedattribute name="script" value="c=a-b;"/>

      (a, b and c in above text are formal parameter ids from xpdl application definition)

  • javascript工具有两种用法:

    1、当application mode设为0时,javascript代码以文件的形式给出。文件需以.js形式保存并放在:安装路径/c:/shark-1.0/lib/engine/sharktoolagent-standard.jar中。假设文件名javascript.js,给出的appname必须为javascript。

    2、当application mode设为1时,直接将要执行的代码写在appname的参数行中。

    扫描关注微信公众号