I’m new to bonita. I’m trying to set a value in a “select” field using the formInput variable.
This is the definition of the formInput variable:
if ($data.request != null){
return {
“solicitudPlanningInput” : {
“nombreRequerimiento” : $data.request.gerenciaSolicita,
“capaRed” : $data.request.capaRed,
“gerenciaSolicita” : $data.request.gerenciaSolicita,
“prioridad” : $data.request.prioridad,
“areaSolicita” : $data.request.areaSolicita,
“tipoRequeremiento” : $data.request.tipoRequeremiento,
“requerimientoEn” : $data.request.requerimientoEn,
“nombreSitio” : $data.request.nombreSitio,
“IDSitio” : $data.request.IDSitio,
“latitud” : $data.request.latitud,
“longitud” : $data.request.longitud,
“motivosRequerimiento” : $data.request.motivosRequerimiento,
“solicitudEjecutada” : $data.SolicitudEjecutadaRule,
“atpValidado” : $data.ATPValidadoRule,
“procedeCorreccion” : $data.ProcedeCorreccionRule
}
};
}
else{
return {
“solicitudPlanningInput” : {
“nombreRequerimiento” : null,
“capaRed” : null,
“gerenciaSolicita” : null,
“prioridad” : null,
“areaSolicita” : null,
“tipoRequeremiento” : null,
“requerimientoEn” : null,
“nombreSitio” : null,
“IDSitio” : null,
“latitud” : null,
“longitud” : null,
“motivosRequerimiento” : null,
“solicitudEjecutada” : null,
“atpValidado” : null,
“procedeCorreccion” : null
}
};
}
This is the definition of request variable:
if ($data.context != null){
var xmlHttp = new XMLHttpRequest();
var url = window.location.origin+“/bonita/”+$data.context.solicitudPlanning_ref.link;
xmlHttp.open( “GET”, url, false);
xmlHttp.send( null );
var response = JSON.parse(xmlHttp.responseText);
return response;
}
else{
return null;
}
This is the definition of context variable:
if ($data.taskId != null){
var xmlHttp = new XMLHttpRequest();
var url = window.location.origin+“/bonita/API/bpm/userTask/”+$data.taskId+“/context”;
xmlHttp.open( “GET”, url, false);
xmlHttp.send( null );
var response = JSON.parse(xmlHttp.responseText);
return response;
}
else{
return null;
}
This is the definition of taskId:
var href = window.location.href;
var url = new URL(href);
var taskId = url.searchParams.get(“id”);
return taskId;
When I execute a console.log($data.request) it returns the values of the previous activity, but the problem is that the values of the “select” inputs are not reflected in those fields. If I assign the values of those “select” inputs to a input text field, it reflects the value that comes in the $data.request.
Does anyone know what could be wrong?
Im currently using Bonita 7.8.3.
Thank you.