版本比较

标识

  • 该行被添加。
  • 该行被删除。
  • 格式已经改变。

...

代码块
languagejson
themeMidnight
titleHCM机器人脚本示例HCM机器人脚本示例一
{
  "stages": [  "return": {
        "x_mobile": "=x_mobile"
    },
    "stages": [{
        "meta": {
            "url": "https://hrlizhongjie.cscechcmcloud.comcn",
            "name": "private.company_init_itemhcm.model.list",
            "param": {
                "model": "Employee",
                "filter_dict": {
          "number          "name": "DynamicScriptList"李中杰"
                }
            },
            "token": "hcmecea7bc7b01a1c0828fbbe655b49927edb325515hcmf214e3bb9830f574a89e52c476b58c7c56cade3d"
        },
        "name": "取外部数据测试取外部数据",
        "engine": "RemoteAPI",
        "output": {
            "context" //外部调用引擎,必须在meta 里面有url 和token 两个参数
: {
                "x_ID": "=ret['list'][0]['id']"
            },
            "message": "='共{}条记录'.format(ret['count'])"
        }
    }, {
        "meta": {
            "name": "hcm.model.listget",
            "param": {
                "id_": "=x_ID",
                "model": "Employee"
            }
        },
        "name": "获取员工列表查看本系统是否有该数据",
        "engineerror": {
   "OpenAPI", //执行内部接口调用         "ignore": true,
            "context": {
      "condition          "is_error": true,
                "get_mobile_error": "=err"
            }
        },
  //有这个参数执行过程中将跳过,支持表达式      "engine": "OpenAPI",
        "output": {
            "context": {
                "is_error": false,
                "employee_id": "=ret['list'][0]['id']"
  //每个人物执行结束返回的参数 为ret 可将返回的结果定义到参数池
        },
            "message": "='共{}条记录'.format(ret['count'])"
        }
    }, {
        "meta": {
            "name": "hcm.model.create",
            "param": {
                "info": {
                    "name": "机器人测试日志",
                    "type": 2,
                    "content": {
                        "get_mobile_error": "=str(get_mobile_error)"
                    }
                },
                "model": "SyncOuterRecord"
            }
        },
        "name": "记录日志",
        "engine": "OpenAPI",
        "output": {},
        "condition": "=is_error"
    }, {
        "meta": {
            "name": "HCM机器人迭代模式",
            "param": {}
        },
        "name": "调用其他机器人",
        "engine": "Shortcut"
    }, {
        "meta": {
        "ignore    "context": "本次HCM机器人演示成功"
        },
        "name": true, //作为 该任务执行失败跳过的标志 不然整个链条停止"发送消息",
        "engine": "Message"
    }],
    "context": {}
}  


代码块
languagejson
themeMidnight
titleHCM机器人示例2
{
    "stages": [{
        "meta": {
            "name": "hcm_model_list_error.model.list",
            "param": {
                "model": "common_basic_item_data.语种",
                "page_size": 999
            }
        },
        "name": "部署元数据",
        "engine": "OpenAPI",
        "output": {
            "context": {
                "basic_item_info": "=err" //可以将本任务执行失败的失败信息放到 参数池里
ret['list']"
            },
            "message": "='共获取{}条数据'.format(len(ret['list']))"
        },
    }, {
        "meta": {
            "name": "hcm.model.getedit",
            "param": {
                "id_": "=employeeITER_V['id']",
                "info": {
                    "description": "='第二次,{}'.format(ITER_V['name'])"
                },
                "model": "Employeecommon_basic_item_data.语种"
            }
        },
        "name": "检查员工名称循环编辑代码项",
        "engine": "OpenAPI",
        "output": {
            "message": "='编辑代码项{}完成'.format(ret['name'])"
        },
        "iterator": "=basic_item_info"
    }]
}


代码块
languagejson
themeMidnight
titleHCM机器人示例三
{},
    "stages": [{
        "meta": {
            "name": "元数据hcm.model.list", //调用的机器人名称

            "param": {
                "model": "common_basic_item_data.语种",
                "page_size": 999
            }
        },
        "name": "调用机器人部署元数据",
        "engine": "OpenAPI",
        "Shortcut" //启动另外机器人
"output": {
            "context": {
                "basic_item_info": "=ret['list']"
            },
            "message": "='共获取{}条数据'.format(len(ret['list']))"
        }
    }, {
        "meta": {
        "content    "name": "hcm.model.edit",
            "param": {
                "id_": "按需调整", //发消息的内容 没有这个参数将发送默认的消息=ITER_V['id']",
                "info": {
                    "description": "='第一次{}'.format(ITER_V['name'])"
                },
        "to": 2332323  //发送消息的人,没有这个参数时给当前登录人发消息
        "model": "common_basic_item_data.语种"
            }
        },
        "name": "发送消息循环编辑代码项",
        "enginequeue": "Messagesyn" //给别人发送消息
,
       }
  ]"engine": "OpenAPI",
        "contextoutput": {
       "employee_id": 123  //将会加入到参数池

  }
}

     "message": "='编辑代码项{}完成'.format(ret['name'])"
        },
        "parallel": "=basic_item_info"
    }]
}