var mylink=encodeURI("/webscript-url?parameter1="+value1);
Alfresco.util.Ajax.request({
url: Alfresco.constants.PROXY_URI + mylink,
method: Alfresco.util.Ajax.GET,
});
将此代码放在repo webscript的JS文件中,并根据需要更改所需的属性
function startWorkflow()
{
var value2 = args["parameter1"];// you can get parameter by this
var workflowAction = workflow.getDefinitionByName("activiti$test_wf");
var package= workflow.createPackage();
var wfparams = new Array();
wfparams["model_prefix:req_props_name"] = value2;
wfparams["bpm:assignee"] = people.getPerson("admin");
workflowAction.startWorkflow(package, wfparams);
}
}
startWorkflow();
//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/alfresco/service/mytasks
this.alfrescoJsApi.webScript.executeWebScript('GET', 'mytasks').then(function (data) {
console.log('Data received form http://127.0.01:8080/alfresco/service/mytasks' + data);
}, function (error) {
console.log('Error' + error);
});
//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/service/mytasks
this.alfrescoJsApi.webScript.executeWebScript('GET', 'mytasks', null, 'share').then(function (data) {
console.log('Data received form http://127.0.01:8080/share/service/mytasks' + data);
}, function (error) {
console.log('Error' + error);
});
//Call a GET on a Web Scripts available at the following URIs: http://127.0.01:8080/share/differentServiceSlug/mytasks
this.alfrescoJsApi.webScript.executeWebScript('GET', 'mytasks', null, 'share', 'differentServiceSlug').then(function (data) {
console.log('Data received form http://127.0.01:8080/share/differentServiceSlug/mytasks' + data);
}, function (error) {
console.log('Error' + error);
});
# 1 楼答案
您可以像这样使用AJAX调用repo webscript
将此代码放在repo webscript的JS文件中,并根据需要更改所需的属性
# 2 楼答案
JSAPI也许可以帮助您:https://github.com/Alfresco/alfresco-js-api