CamSDK: CamForm.escalate and .error: how to close task after submission of sync event?

@martin.stamm How can camForm.escalate and .error be used for sync and async boundary events?

When you call .escalate or .error it will submit the event, but the form does not close (in the case of a sync event). So is it possible to detect if it is a sync/async boundary and thus close or not close the task in the UI ?

After some further investigation, it seems only way to do this is similar to:

camForm.on('escalation-success', function() {
                                if ($scope.camForm.escalationInterrupt){
                                } else {
                                    // Clear variable manager if it was a non-interrupting escalation
                                inject(['Notifications', function(Notifications) {
                                    let taskId = $scope.camForm.taskId

                                        type: 'info',
                                        duration: 3500,
                                        status: 'Escalation Created',
                                        message: 'Escalation was triggered for Task ' + taskId

x-ref for similar issue: Dismissing task form for inexistent task

Hi @StephenOTT,

unfortunately the REST Api does not provide information about the type of escalation after an error was triggered[1][2].

The only way I can see it is calling $scope.$emit('refresh'); in the escalation-success event handler to force Tasklist to check all tasks again.


1 Like

@martin.stamm good idea. Will give that one a try as well.