AnsweredAssumed Answered

help in scripting

Question asked by wps07032 on Jan 11, 2008
Latest reply on Jan 25, 2008 by pmonks
Hello,

I've put together a simple web script to kick off the predefined "review and approve" workflow but currently getting an error about the document object:

Here is the error:
Failed to execute script 'workspace://SpacesStore//Company Home/Data Dictionary/Web Scripts/org/alfresco/sample/myworkflow.get.js': Failed to execute script 'workspace://SpacesStore//Company Home/Data Dictionary/Web Scripts/org/alfresco/sample/myworkflow.get.js': ReferenceError: "document" is not defined. (AlfrescoScript#5)

Here is the script:

var workflow = actions.create("start-workflow");
workflow.parameters.workflowName = "jbpm$wf:review & approve";
workflow.parameters["bpm:workflowDescription"] = "proxy_server.gif";
workflow.parameters["bpm:assignee"] = "administrator";
workflow.execute(document);


proxy_server.gif is a document that is already being uploaded to the system and currently resides on "Company Home" content.

Isn't document is one of the objects available by default in the root scripting scope? 

BTW, please advice if there are any other errors found in the script above. 

Much Thanks.

Outcomes