In my case i get data from database and then synchronize it as a json object , after that i will write it in a json file and then i want to load this json file data into my embedded html form and use it properly for this reason i have tried this method:
https://forum.camunda.io/t/loading-previous-data-in-process-start-form/933/2
but i in my case received json file content was always empty i have also used this code:
inject([ '$scope', '$http', 'Uri', function($scope, $http, Uri) {
camForm.on('form-loaded', function() {
var deploymentId = camForm["options"]["deploymentId"];
function jsonFileNeeded(value) {
return value["name"] == "data.json";
}
$http.get(Uri.appUri('engine://engine/:engine/deployment/' + deploymentId + '/resources')).
success(function(data) {
var jsonResourceId = data.filter(jsonFileNeeded)[0]["id"];
$http.get(Uri.appUri('engine://engine/:engine/deployment/' + deploymentId + '/resources/' + jsonResourceId + '/data')).
success(function(data) {
// var jsonFile = data;
$scope.jsonFile = data;
// console.log(camForm);
});
});
});
}]);
but when i print this jsonFile in conosle i can’t see nor null neither any Json array
what should i change to load json file data in html form?