...
所以配置 "iterator": "=node_ids"
4、执行效果:
配置举例二:
机器人设计规则:
1)取外部inspur6环境下车厘子的信息
2)取不到把错误信息填入到SyncOuterRecord模型日志下,能取到返回人员id信息
3)调用之前定义的机器人脚本示例 机器人脚本
4)利用机器人发消息配置给系统发送消息3. 脚本配置 示例
代码块 | ||||||
---|---|---|---|---|---|---|
| ||||||
{ "return": { "x_mobileid": "=x_mobileID" }, "stages": [{ "meta": { "url": "https://lizhongjieinspur6.hcmcloud.cn", "name": "hcm.model.list", "param": { "model": "Employee", "filter_dict": { "name": "李中杰车厘子" } }, "token": "hcmf214e3bb9830f574a89e52c476b58c7c56cade3dhcm0af7a670b548ccfab3352d74b52bf596b1084209" }, "name": "取外部数据", "engine": "RemoteAPI", "output": { "context": { "x_ID": "=ret['list'][0]['id']" }, "message": "='共{}条记录'.format(ret['count'])" } }, { "meta": { "name": "hcm.model.get", "param": { "id_": "=x_ID", "model": "Employee" } }, "name": "查看本系统是否有该数据", "error": { "ignore": true, "context": { "is_error": true, "get_mobile_error": "=err" } }, "engine": "OpenAPI", "output": { "context": { "is_error": false, "employee_id": "=ret['list'][0]['id']" }, "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": {} }, "namenode_ids": "调用其他机器人", [{ "engine": "Shortcut" }, { "metaid": {402186251, "context": "本次HCM机器人演示成功", "to":12212 "employee": { "name": "梁天华" } }] } }, "name": "调用其他机器人", "engine": "Shortcut" }, { "meta": { "to": 1508957, "sender": 1508957, "content": "本次HCM机器人演示成功" }, "name": "发送消息", "engine": "Message" }], "context": {} } |
配置地址:https://inspur6.hcmcloud.cn/#/pc/setting/setting.hcm_shortcut?page_index=1&page_size=20
代码块 | ||||||
---|---|---|---|---|---|---|
| ||||||
{ "stages": [{ "meta": { "name": "hcm.model.list", "param": { "model": "common_basic_item_data.语种", "page_size": 999 } }, "name": "部署元数据", "engine": "OpenAPI", "output": { "context": { "basic_item_info": "=ret['list']" }, "message": "='共获取{}条数据'.format(len(ret['list']))" } }, { "meta": { "name": "hcm.model.edit", "param": { "id_": "=ITER_V['id']", "info": { "description": "='第二次,{}'.format(ITER_V['name'])" }, "model": "common_basic_item_data.语种" } }, "name": "循环编辑代码项", "engine": "OpenAPI", "output": { "message": "='编辑代码项{}完成'.format(ret['name'])" }, "iterator": "=basic_item_info" }] } |
...