Hey guys.
Can I reload the current task from WITHIN the task form?
Background: I have a task form which starts a new event sub process. This event sub process might change the current task, e.g. setting a follow-up-date. Now I would like to update the current UI to reflect this change. I know how to load the task via REST – but how can I change the visible task in the Camunda Angular Surrounding?
Hopefully understandable? Maybe this screenshot helps:
Thanks
Bernd
Hi Roman.
Sounds great – but unfortunately does not work for me:
<script cam-script type="text/form-script">
inject([ '$location', function($location) {
function loadCaseStatus() {
…
};
$scope.sendMessage = function(messageName) {
$.ajax('/camunda/api/engine/engine/default/message/', {
…
success: function (result) {
loadCaseStatus();
//window.location.reload();
// reload task
$location.search('task', camForm.taskId);
}
});
};
}]);
</script>
Nothing changes on the UI (but I also do not get any error on the console).
Cheers
Bernd
--
You received this message because you are subscribed to the Google Groups "camunda BPM users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
camunda-bpm-us...@googlegroups.com.
To post to this group, send email to
camunda-...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/camunda-bpm-users/6e9d0fb1-923b-4b7c-b64d-6e5be1740998%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
$location.search('task', camForm.taskId);
$route.reload() // you have to inject the $route service
window.location.reload();
<script cam-script type="text/form-script">
// get the angular-data-depend service 'taskData'
var getTaskData = function(scope) {
if (scope.taskData) { return scope.taskData; } return scope.$parent && getTaskData(scope.$parent); };
$scope.taskData = getTaskData($scope);
$scope.sendMessage = function(...) {
...
success: function(result) {
if ($scope.taskData) { $scope.taskData.set('taskId', {taskId: camForm.taskId});
// or
$scope.taskData.changed('task');
}
}
...
};
</script>
The hack works – thanks a lot! That gives a much better feeling than a whole page reload (which was my workaround so far).
Von: camunda-...@googlegroups.com [mailto:camunda-...@googlegroups.com] Im Auftrag von Roman Smirnov
Gesendet: Donnerstag, 1. Oktober 2015 11:14
An: camunda BPM users <camunda-...@googlegroups.com>
<script cam-script type="text/form-script">
$scope.taskData.set('taskId', {taskId: camForm.taskId});
// or
$scope.taskData.changed('task');
}
...
};
</script>
--
You received this message because you are subscribed to the Google Groups "camunda BPM users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
camunda-bpm-us...@googlegroups.com.
To post to this group, send email to
camunda-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/camunda-bpm-users/66df971d-f3d7-4cc8-bf12-12af1f4f50b6%40googlegroups.com.