I have a process built in Bonita 7.1.2. and I’ve made a summary page for all the active cases. I use some widgets as a Data Table, texts, etc.
My question is, how can I put a button or something that refreshes the data on the summary page? I don’t want implement a method that refreshes the window, I only want to refresh the Data Table.
I think you can simply add the button and set the followings:
action = POST (corrected)
url = the URL to your case list (should the the url where you load your data table)
Data to Send = empty variable
Successful value = the bind variable of your data table
If you need auto refresh, you may need to create custom widget which uses a setTimeout script to call http request periodically.
Something like (not tested, please do the debug yourself :):
function doPeriodicRequest(httpAction, url){
$http({method:httpAction,url:url})
.success(function (response){
$scope.properties.dataOnSuccess = response;
}).error(function (response){
$scope.properties.dataOnFailed = response;
});
setTimeout(doPeriodicRequest(httpAction, url),$scope.properties.period);
}
setTimeout( doPeriodicRequest($scope.properties.action, $scope.properties.url), $scope.properties.period);
sorry, I was wrong about that, POST should also work, just return an empty variable in the data sent on click. I used this trick to load dynamic table on click.
Well, I’ve tried it, but the POST method to get data does not work with BDM. I always get this:
"code":405,"contactEmail":null,"description":"The method specified in the request is not allowed for the resource identified by the request URI","homeRef":"/","reasonPhrase":"Method Not Allowed","uri":"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.6"
Sorry, I got the same problem switching to POST. I have created a custom widget to handle the refresh.
Basically you can copy the pbButton.js logic from workspace/default/web_widgets/pbButton/ folder. Add one more option to the action list for GET. Then you can refresh as you press the button.
As for auto-refresh, I found setTimeout() may cause dead loop in Angular. Use $interval to callback the doRequestDelayed function to reload the content.
Bonitasoft empowers development teams with Bonita, the open-source and extensible platform to solve the most demanding process automation use cases. The Bonita platform accelerates delivery of complex applications with clear separation between capabilities for visual programming and for coding. Bonita integrates with existing solutions, orchestrates heterogeneous systems, and provides deep visibility into processes across the organization.