我正在尝试在露天流程服务中运行脚本任务,而在编译脚本时,控制台中会抛出一些错误,例如:
I am trying to run a script task in alfresco process services, while compiling the script there were some error throw out in the console as like:
控制台无法运行'javascript'
the console couldn't run 'javascript'
var x=5; var y=5; var xy=x*y; document.write("The result is"+xy);
我希望结果为 25 脚本编译后在控制台中打印。谁能帮助我解决问题?
I expect the result as 25 that could be print in the console after the compilation of the script. Can anyone help me to resolve the issue?
推荐答案您在哪里/如何运行该代码?您有具体的错误吗?
Where/how are you running that code? Do you have a concrete error?
很可能文档被识别为根对象,因此写入方法失败。如果我的理论是正确的,只需注释掉该行或将其替换为 logger(另一个根对象)即可解决此问题。
Most probably the "document" gets recognized as a root object, so the "write" method fails. If my theory is true, simply commenting that line out or replacing it with "logger" (another root object) will solve the issue.
docs.alfresco/4.1/references/API-JS-rootscoped.html
编辑:现在,我意识到您指定了一个脚本任务。 我相信我的理论仍然有用,但是可用的根对象并不相同。
Now I realize you specified a Script Task. I believe my theory is still relevant, however, root objects available are not the same.
docs.alfresco/5.1/references/API-JS-WorkflowService.html
更多推荐
如何配置露天平台以运行脚本任务
发布评论