What does the resume keyword add to an NPL notification?
resume attaches a callback to a notification, so that after the external work is done, control comes back into the protocol via a named permission.
Often, firing an event is not the end of the story — a follow-up action must happen once the outside world responds. NPL supports this by letting the notification carry callback information. You declare it to return a callback argument type:
notification PayInterests(iban: Text, amount: Number) returns TypeOfCallbackArgument;
and fire it with a resume target:
notify PayInterests(iban, interests) resume userAction;
Here userAction is a permission defined on the protocol that sent the notification. When the external system finishes and calls back, the Runtime invokes userAction to continue the workflow. This closes the loop: fire an event out, and route the response back into the same protocol as a real state-changing action.