Alfresco 5.1 document root object -


my workflow.get.js file

var workflow = actions.create("start-workflow"); workflow.parameters.workflowname = "activiti$trainerempanelment"; workflow.parameters["bpm:assignee"] = people.getperson("admin"); workflow.parameters["bpm:workflowdescription"] = "test"; workflow.parameters["bpm:workflowpriority"] = "2"; workflow.parameters["bpm:sendemailnotifications"] = true; workflow.parameters["initiator"] = people.getperson("admin");  var today = new date(); var duedate = today.getdate() + 1;  workflow.parameters["bpm:workflowduedate"] = duedate; workflow.execute(document); 

when using webscript getting error

the web script /alfresco/s/workflow/ has responded status of 500 - internal error.

500 description: error inside http server prevented fulfilling request.

message: 06190087 wrapped exception (with status template): 06190504 failed execute script '/triggerworkflow.get.js (in repository store workspace://spacesstore/company home/data dictionary/web scripts)': 06190503 referenceerror: "document" not defined. (in repository store workspace://spacesstore/company home/data dictionary/web scripts)#11)

exception: org.mozilla.javascript.ecmaerror - referenceerror: "document" not defined. (in repository store workspace://spacesstore/company home/data dictionary/web scripts)#11) org.mozilla.javascript.scriptruntime.constructerror(scriptruntime.java:3687) org.mozilla.javascript.scriptruntime.constructerror(scriptruntime.java:3665) org.mozilla.javascript.scriptruntime.notfounderror(scriptruntime.java:3750) org.mozilla.javascript.scriptruntime.name(scriptruntime.java:1728) org.mozilla.javascript.gen._triggerworkflow_get_js__in_repository_store_workspace___spacesstore_company_home_data_dictionary_web_scripts__414._c_script_0(/triggerworkflow.get.js (in repository store workspace://spacesstore/company home/data dictionary/web scripts):11) org.mozilla.javascript.gen._triggerworkflow_get_js__in_repository_store_workspace___spacesstore_company_home_data_dictionary_web_scripts__414.call(/triggerworkflow.get.js (in repository store workspace://spacesstore/company home/data dictionary/web scripts)) org.mozilla.javascript.contextfactory.dotopcall(contextfactory.java:394) org.mozilla.javascript.scriptruntime.dotopcall(scriptruntime.java:3091) org.mozilla.javascript.gen._triggerworkflow_get_js__in_repository_store_workspace___spacesstore_company_home_data_dictionary_web_scripts__414.call(/triggerworkflow.get.js (in repository store workspace://spacesstore/company home/data dictionary/web scripts)) org.mozilla.javascript.gen._triggerworkflow_get_js__in_repository_store_workspace___spacesstore_company_home_data_dictionary_web_scripts__414.exec(/triggerworkflow.get.js (in repository store workspace://spacesstore/company home/data dictionary/web scripts)) org.alfresco.repo.jscript.rhinoscriptprocessor.executescriptimpl(rhinoscriptprocessor.java:502) org.alfresco.repo.jscript.rhinoscriptprocessor.execute(rhinoscriptprocessor.java:200) org.alfresco.repo.processor.scriptserviceimpl.execute(scriptserviceimpl.java:212) org.alfresco.repo.processor.scriptserviceimpl.executescript(scriptserviceimpl.java:174) org.alfresco.repo.web.scripts.repositoryscriptprocessor.executescript(repositoryscriptprocessor.java:102) org.springframework.extensions.webscripts.abstractwebscript.executescript(abstractwebscript.java:1376) org.springframework.extensions.webscripts.declarativewebscript.execute(declarativewebscript.java:86) org.alfresco.repo.web.scripts.repositorycontainer$3.execute(repositorycontainer.java:512) org.alfresco.repo.transaction.retryingtransactionhelper.dointransaction(retryingtransactionhelper.java:457) org.alfresco.repo.web.scripts.repositorycontainer.transactionedexecute(repositorycontainer.java:580) org.alfresco.repo.web.scripts.repositorycontainer.transactionedexecuteas(repositorycontainer.java:649) org.alfresco.repo.web.scripts.repositorycontainer.executescriptinternal(repositorycontainer.java:421) org.alfresco.repo.web.scripts.repositorycontainer.executescript(repositorycontainer.java:301) org.springframework.extensions.webscripts.abstractruntime.executescript(abstractruntime.java:378) org.springframework.extensions.webscripts.abstractruntime.executescript(abstractruntime.java:209) org.springframework.extensions.webscripts.servlet.webscriptservlet.service(webscriptservlet.java:132) javax.servlet.http.httpservlet.service(httpservlet.java:727) org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:303) org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:208) org.apache.tomcat.websocket.server.wsfilter.dofilter(wsfilter.java:52) org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:241) org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:208) org.alfresco.web.app.servlet.globallocalizationfilter.dofilter(globallocalizationfilter.java:61) org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:241) org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:208) org.apache.catalina.core.standardwrappervalve.invoke(standardwrappervalve.java:220) org.apache.catalina.core.standardcontextvalve.invoke(standardcontextvalve.java:122) org.apache.catalina.authenticator.authenticatorbase.invoke(authenticatorbase.java:504) org.apache.catalina.core.standardhostvalve.invoke(standardhostvalve.java:170) org.apache.catalina.valves.errorreportvalve.invoke(errorreportvalve.java:103) org.apache.catalina.valves.accesslogvalve.invoke(accesslogvalve.java:950) org.apache.catalina.core.standardenginevalve.invoke(standardenginevalve.java:116) org.apache.catalina.connector.coyoteadapter.service(coyoteadapter.java:421) org.apache.coyote.http11.abstracthttp11processor.process(abstracthttp11processor.java:1074) org.apache.coyote.abstractprotocol$abstractconnectionhandler.process(abstractprotocol.java:611) org.apache.tomcat.util.net.aprendpoint$socketprocessor.dorun(aprendpoint.java:2466) org.apache.tomcat.util.net.aprendpoint$socketprocessor.run(aprendpoint.java:2455) java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1142) java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:617) org.apache.tomcat.util.threads.taskthread$wrappingrunnable.run(taskthread.java:61) java.lang.thread.run(thread.java:745)

exception: org.alfresco.error.alfrescoruntimeexception - 06190503 referenceerror: "document" not defined. (in repository store workspace://spacesstore/company home/data dictionary/web scripts)#11) org.alfresco.repo.jscript.rhinoscriptprocessor.executescriptimpl(rhinoscriptprocessor.java:526)

exception: org.alfresco.scripts.scriptexception - 06190504 failed execute script '/triggerworkflow.get.js (in repository store workspace://spacesstore/company home/data dictionary/web scripts)': 06190503 referenceerror: "document" not defined. (in repository store workspace://spacesstore/company home/data dictionary/web scripts)#11) org.alfresco.repo.jscript.rhinoscriptprocessor.execute(rhinoscriptprocessor.java:204)

exception: org.springframework.extensions.webscripts.webscriptexception - 06190087 wrapped exception (with status template): 06190504 failed execute script '/triggerworkflow.get.js (in repository store workspace://spacesstore/company home/data dictionary/web scripts)': 06190503 referenceerror: "document" not defined. (in repository store workspace://spacesstore/company home/data dictionary/web scripts)#11) org.springframework.extensions.webscripts.abstractwebscript.createstatusexception(abstractwebscript.java:1138)

server: community v5.1.0 (r122274-b3) schema 9,016 time: jul 19, 2016 5:01:29 pm

can please try code

var workflowaction = workflow.getdefinitionbyname("activiti$trainerempanelment"); var package= workflow.createpackage(); var workflow = new array();  workflow["bpm:assignee"] = people.getperson("admin"); workflow["bpm:workflowdescription"] = "test"; workflow["bpm:workflowpriority"] = "2"; workflow["bpm:sendemailnotifications"] = true; workflow["initiator"] = people.getperson("admin");   var today = new date(); var duedate = today.getdate() + 1;   workflow["bpm:workflowduedate"] = duedate; workflowaction.startworkflow(package, workflow); 

Comments

Popular posts from this blog

gridview - Yii2 DataPorivider $totalSum for a column -

java - Suppress Jboss version details from HTTP error response -

Sass watch command compiles .scss files before full sftp upload -