How to configure the alfresco to run a script-task

五迷三道 提交于 2019-12-13 05:29:59

问题


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:

the console couldn't run 'javascript'

var x=5;
var y=5;
var xy=x*y;
document.write("The result is"+xy);

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?


回答1:


Where/how are you running that code? Do you have a concrete error?

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.

https://docs.alfresco.com/4.1/references/API-JS-rootscoped.html

EDIT: Now I realize you specified a Script Task. I believe my theory is still relevant, however, root objects available are not the same.

https://docs.alfresco.com/5.1/references/API-JS-WorkflowService.html



来源:https://stackoverflow.com/questions/54343080/how-to-configure-the-alfresco-to-run-a-script-task

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!