activiti任务处理
处理指定task
var wfservinfo = 'http://localhost:8080/aopas/service/';
var taskid = '4d21ed36e78548e2915b1d3abf6f96ba';
var url = wfservinfo + 'runtime/tasks/' + taskid;
var variablesobj = {};
variablesobj["action"] = "complete";
var variablessubobj = {};
variablessubobj["name"] = 'ispass';
variablessubobj["value"] = "1";
var variablessubarrayobj = [];
variablessubarrayobj.push(variablessubobj);
variablesobj["variables"] = variablessubarrayobj;
var variables = JSON.stringify(variablesobj);
$.ajax({
url: url,
contentType: "application/json",
data:variables,
type: "post",
headers: {
header: authtoken
},
dataType: "text",
success: function (result) {console.debug('>>>'+JSON.stringify(result));},
complete:function(s){console.debug('>>>'+JSON.stringify(s));
switch (s.status) {
case 200:
mui.toast('反馈结果:操作成功执行');break;
case 400:
console.log('反馈结果:请求包含了非法数据或当操作需要assignee参数时,却没有传');break;
case 404:
console.log('反馈结果:找不到任务。');break;
case 409:
console.log('反馈结果:因为冲突导致无法执行操作。可能任务正在被更新,或者,在claim认清任务时,任务已经被其他用户认领了');break;
default:break;
}
},
error:function(e){console.debug('>>>'+JSON.stringify(e));}
});