-
1. Re: Starting jBPM process with parameters via REST API
lauradp Jul 25, 2014 12:03 PM (in response to lauradp)I solved this issue, the right URL was:
jbpmConsoleUrl + "/rest/runtime/" + deploymentId + "/withvars/process/" + processDefId + "/start" + "?" + encodedParameters;
but I omitted map_ prefix in parameters keys.
HTH
Laura
-
2. Re: Starting jBPM process with parameters via REST API
cjwallac Feb 18, 2015 3:09 PM (in response to lauradp)Hi Laura,
I was wondering since you were able to pass the parameters in the REST API, how do you then access the values in the jBPM Console? I would like to use them as process variables to assign the task to specific resources.
You input is appreciated as I am not seeing much documentation... unless I have haven't looked in the right place yet.
-CW
-
3. Re: Starting jBPM process with parameters via REST API
lauradp Feb 19, 2015 4:01 AM (in response to cjwallac)Hi, suppose you have defined var1 and var2 variables in your process.
encodedParameters is built as map_var1=value1&map_var2=value2
In this way you should be able to have value1 and value2 by mapping process variables on tasks parameters.
HTH
Laura
-
4. Re: Starting jBPM process with parameters via REST API
scarenci Mar 14, 2018 5:14 PM (in response to lauradp)Hi Laura,
I am trying to do the same, but its not working! Can you help me to understand what is going on? My parameters is not showing in the human task!
This is my code in angular:
let url:any = "http://site/processos/rest/runtime/br.com.test:Formulario:1.4/withvars/process/Formulario.formulario/start";
let body ={
nome:'start',
rg:'123456789'
}
let httpOptions = {
headers: new HttpHeaders({
'Authorization': 'Bearer ' + token,
'Accept':'application/json',
'Access-Control-Allow-Origin': '*',
'Content-Type':'application/json;charset=UTF-8'
})
};
this.http.post(url, body, httpOptions).subscribe(
res => {
//success
console.log("sucesso ao iniciar!");
alert(res);
},
err => {
console.log("Error ao iniciar:"+err);
}
);
});
In my flow i have setting a "data object" in the process and in the start. Is that correct?
-
5. Re: Starting jBPM process with parameters via REST API
scarenci Mar 15, 2018 1:30 PM (in response to scarenci)Its working!
I change the approach to primitive variable as string, int, etc.. and put in the name variable "map_" and in my flow a create a varible and set only in human task and not in start. My post was with x-www-form-urlencoded.
I hope it helps someone