模板替换 
在Xgen中,在多个场景下可以使用模板替换功能。
模板替换使用mustache.js实现的,主要有两种替换方法:
{{}}/[[]]替换对象中的字段{{{}}}/[[[]]]替换对象中的字段,未转义。
在actions中可以使用${actionName}引用上一个节点的返回值。
示例:
json
{
  "title": "Unpublish",
  "icon": "icon-arrow-down",
  "style": "danger",
  "disabled": { "bind": "{{status}}", "value": "draft" },
  "action": [
    { "name": "Submit", "type": "Form.submit" },
    {
      "name": "Draft",
      "type": "Service.article",
      "payload": {
        "method": "UpdateStatus",
        "args": [{ "id": "[[$Submit]]", "status": "draft" }] // 在actions中引用上一个节点的返回值
      }
    },
    { "name": "Refetch", "type": "Common.refetch" }
  ]
}使用场景,可以xgen项目中查询函数getTemplateValue的引用:
- task中的payload对象
 - form中的action对象
 - form中的reference对象
 - form中的sections对象
 - table中的actions对象