07-12-2011 04:20 AM
#
Request: POST /process-instance
{
"processDefinitionId":"financialReport:1:1700",
"businessKey":"order-4711"
}
#
API: ProcessEngines.getProcessEngine(configuredProcessEngineName).getRuntimeService().startProcessInstanceById(processDefinitionId[, businessKey][, variables])
#
Response:
{
"id": "217",
"processDefinitionId": "financialReport:1:1700",
"activityNames": ["writeReportTask"],
"ended": true
}
function sendPost()
{
try {
var xhr = new XMLHttpRequest();
var url = "http://localhost:8080/activiti-rest/service/process-instance";
xhr.open("POST", url, true,"kermit","kermit");
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState==4 && xhr.status==200) {
//check for an error message contained in the REST response.
//If xhr.responseText is blank, update was successful.
alert("SUCCESS");
}
else
{
alert("ERROR in RESPONSE: "+xhr.status+" , "+xhr.responseText);
}
}
xhr.send("processDefinitionKey=bookorder"); //working[/color] // REST CALL
}
catch(ex)
{
alert("Exception"+ex.message);
}
}
ExceptionAccess to restricted URI denied
How to start the process using javascript? Where am i going wrong?07-19-2011 04:03 AM
09-19-2011 06:26 PM
09-20-2011 03:18 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.