lxmgg 发表于 2021-6-1 16:33:02

为什么我在脚本里写的applications是空的

我根据开发手册里的指导,在流程脚本里var applications = this.applications;
然后测试的时候显示applications是undefined
请问是怎么回事?

论坛管理员 发表于 2021-6-2 10:43:02

您好:请问您在什么脚本中this.applications
因为this的对象不对。情况就不同
或者您使用
resources.getContext().applications();

lxmgg 发表于 2021-6-2 13:02:51

是流程里的脚本https://www.o2oa.net:443/x_file_assemble_control/jaxrs/file/cbb7783b-4a16-4428-a954-629bf669c345/download/stream

论坛管理员 发表于 2021-6-3 16:13:37

您好:脚本是可以直接使用的
https://www.o2oa.net:443/x_file_assemble_control/jaxrs/file/176c9db5-90e6-4f0f-a7fe-4cefc316e195/download/stream

print("-----------------------------------")
var data = {};
var apps = this.applications;
var serviceRoot = "x_processplatform_assemble_designer";
var path = "application/d807a20d-e4eb-4548-b00e-2ebbb76e0760";
var resp = apps.getQuery( serviceRoot, path );
var json = JSON.parse( resp.toString() );
print(JSON.stringify(json))

您可以直接验证
页: [1]
查看完整版本: 为什么我在脚本里写的applications是空的