Event Scenarios
Description of the event-driven architecture for Altinn Apps and Altinn Platform.
Below you find some functional scenarios for use of events functionality in Altinn 3
Org waiting on ProcessComplete for a given app
In this scenario, an org is waiting on end-users to complete one given app.
-
System (consumer) authenticates using Maskinporten and requests scope
altinn:events/{org}/{app}
-
System exchanges Maskinporten token to an Altinn token. Scopes is included in new token.
-
System calls
GET {platformurl}/events/api/v1/app/{org}/{app}?from={lastchanged}&eventType=instance.process.completed
-
Event component verifies that scope matches request
-
Event components searches Cosmos DB for events that matches search criteria
-
Event component returns the filtered and possible capped response ordered by sequence
-
Consumer process the received events and call other API to download related data (instances, files, etc)
User needing to know if there is anything new for a party
In this scenario, a user wants to see if there are any changes for a client or the user itself.
-
System authenticates end user with ID-porten
-
System exchanges token with Altinn
-
System calls event API
POST {platformurl}/events/api/v1/party/
-
Event component query events in database.
-
Event components authorized the event and filter away events where user is not authorized
-
Events are returned
-
Consumer process events
-
Consumer gets relevant data
Organization needing to know if there are anything new for a party
In this scenario a professional organization wants to see if there are any changes for a client or the organization itself.
-
System authenticates end user with Maskinporten
-
System exchanges token with Altinn
-
System calls event api
POST {platformurl}/events/api/v1/party/
-
Event component query events in database
-
Event components authorized the event and filter away events where user is not authorized
-
Events are returned
-
Consumer process events
-
Consumer gets relevant data
Approved organization needs to know about changes for all reportees
This is a scenario where some organizations like banks need to be informed when somebody dies and a “deathestate” is created for that user.
Anonym access to a given instances events
In this scenario the end user has used a system to submit data, and the system needs to follow up if any feedback is given to the instance without the user needing to log in.
- System calls event api
POST {platformurl}/events/instanceeventsforinstance/{instanceId}
- Event component query events in database
- Events are returned
- The Consumer process events
- The Consumer gets relevant data