-
Notifications
You must be signed in to change notification settings - Fork 50
List of all available interfaces for custom code #2339
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
WalkthroughAdds six new documentation pages (English and Norwegian Bokmål) covering concepts, guides, and reference for implementing custom code in Altinn Studio/Altinn 3 apps, including scenarios, interface overviews, DI registration, examples (processors, validators, actions), testing/deployment steps, and notes on deprecated interfaces. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User
participant App as Altinn App
participant DI as DI Container
rect rgba(230,245,255,0.6)
note over App,DI: Startup / Registration
App->>DI: Register implementations<br/>(AddTransient/AddScoped/AddSingleton)
end
rect rgba(235,255,235,0.6)
note over User,App: Instantiation
User->>App: Start instance
App->>DI: Resolve IInstantiationValidator / IInstantiationProcessor
App->>+IInstantiationValidator: ValidateAsync(...)
IInstantiationValidator-->>-App: Result
App->>IInstantiationProcessor: ProcessAsync(...)
end
rect rgba(255,245,230,0.6)
note over User,App: Data Read/Write
User->>App: Load/submit form data
App->>DI: Resolve IDataProcessor
App->>+IDataProcessor: ProcessDataRead(...)
IDataProcessor-->>-App: Possibly modified data
App->>+IDataProcessor: ProcessDataWrite(...)
IDataProcessor-->>-App: changed(bool)
end
rect rgba(245,235,255,0.6)
note over App,DI: Process transitions
App->>DI: Resolve IProcessTaskStart/End, IProcessEnd, IProcessExclusiveGateway
App->>IProcessTaskStart: OnStartAsync(...)
App->>IProcessExclusiveGateway: FilterAsync(instance, accessor)
end
rect rgba(255,235,245,0.6)
note over User,App: User actions and options
User->>App: Click custom action
App->>DI: Resolve IUserAction (+ IUserActionAuthorizer)
App->>IUserAction: ExecuteAsync(...)
App->>DI: Resolve IAppOptionsProvider / IInstanceAppOptionsProvider
App->>IAppOptionsProvider: GetOptionsAsync(context)
end
note over App: Logs, error handling, performance considerations per guide
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
Status, Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🧹 Nitpick comments (9)
content/altinn-studio/reference/custom-development/_index.nb.md (9)
27-27: Språk: “instans-kontekst” → “instanskontekst”.- - Kodelister som krever instans-kontekst + - Kodelister som krever instanskontekst
82-84: Språk: fjern bindestrek i “oppgave-spesifikk”.Bokmål: “oppgavespesifikk”.
- - Oppgave-spesifikk validering + - Oppgavespesifikk validering - - Initialisering av oppgave-spesifikk tilstand + - Initialisering av oppgavespesifikk tilstandAlso applies to: 118-120
162-163: Presiser norsk ordlyd i avviklingsnotis.- OBS! En av metodene i dette grensesnittet er avviklet. Bruk den nyere versjonen av `FilterAsync` som inkluderer `IInstanceDataAccessor` parameter. + OBS! En av metodene i dette grensesnittet er avviklet. Bruk den nyere versjonen av `FilterAsync` som inkluderer parameteren `IInstanceDataAccessor`.
172-176: IPageOrder er avviklet – juster tekst til historisk bruk og unngå å oppfordre til implementering.- ### IPageOrder [AVVIKLET] + ### IPageOrder [AVVIKLET] {{<notice warning>}} - OBS! Dette grensesnittet er avviklet f.o.m. versjon 4 av frontend. Bruk heller + OBS! Dette grensesnittet er avviklet f.o.m. frontend versjon 4. Bruk heller [dynamiske uttrykk](../logic/expressions/) for å styre om sider vises/skjules. {{</notice>}} - Implementer dette grensesnittet for å styre rekkefølgen på sider i skjemaet. + Tidligere brukt for å styre rekkefølgen på sider i skjemaet. Ikke anbefalt i nye apper.Og vurder å merke “Bruksområder” som “Historiske bruksområder”.
Also applies to: 178-184
215-215: Språk: mer idiomatisk formulering av “instanstilstand”.- - Inspeksjon av instanstilstand + - Inspeksjon av tilstanden til instansen - - Manipulering av instanstilstand + - Manipulering av tilstanden til instansenAlso applies to: 223-223
236-237: Norsk terminologi for PDF: unngå “headere/footers”.- - Tillegg av vannmerker eller headere/footers + - Tillegg av vannmerker eller topptekst/bunntekst
254-258: Begrep: “spørringsparametre” er ok; vurder konsekvent “spørringsparametere”.Begge former brukes; velg én og bruk konsekvent i docs.
265-276: DI‑eksempel: bra, men vurder å nevne livstid.Kort setning som sier at de fleste implementasjoner bør være
Scopedi web-kontekst kan hjelpe.**Eksempel:** ```csharp - services.AddTransient<IDataProcessor, MyDataProcessor>(); + // Velg passende livstid; i web-kontekst er ofte Scoped et godt valg: + services.AddScoped<IDataProcessor, MyDataProcessor>();--- `229-231`: **Legg til lenke til dokumentasjon for egendefinert PDF-layout** Oppdater notisen til å inkludere en lenke til PDF-dokumentasjonen: ```diff @@ content/altinn-studio/reference/custom-development/_index.nb.md:229-231 - Lag heller en tilpasset PDF-layout. + Lag heller en tilpasset PDF-layout. Se [PDF-dokumentasjon](https://docs.altinn.studio/nb/altinn-studio/reference/ux/pdf/) for mer informasjon.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
content/altinn-studio/reference/custom-development/_index.nb.md(1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.nb.md
⚙️ CodeRabbit configuration file
Check for Norwegian Bokmål (nb-NO) grammar and spelling with extra care. Pay special attention to specialized terminology and Norwegian-specific words.
Files:
content/altinn-studio/reference/custom-development/_index.nb.md
content/**/*
⚙️ CodeRabbit configuration file
Check for links, markdown formatting, headings, grammar, and spelling in multiple languages (en-US, nb-NO, nn-NO).
Files:
content/altinn-studio/reference/custom-development/_index.nb.md
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (2)
content/altinn-studio/reference/custom-development/_index.nb.md (2)
1-8: Solid addition and structure.God inndeling, korrekt front matter, og tydelig introduksjon på nb-NO.
19-19: All internal NB documentation links resolve correctly.
content/altinn-studio/reference/custom-development/_index.nb.md
Outdated
Show resolved
Hide resolved
content/altinn-studio/reference/custom-development/_index.nb.md
Outdated
Show resolved
Hide resolved
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
…nn/altinn-studio-docs into studio/interfaces-reference
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (11)
content/altinn-studio/guides/development/custom-code/_index.nb.md (11)
8-21: Språkvask og terminologi (nb-NO).Foreslår små rettelser for naturlig Bokmål og konsekvent terminologi (bygger på tidligere læring om ekstra språksjekk i .nb.md-filer):
- Denne guiden viser deg hvordan du kan implementere egendefinerte grensesnitt i din Altinn 3-app for å utvide funksjonaliteten utover det som er tilgjengelig i Altinn Studio. + Denne guiden viser hvordan du kan implementere egendefinerte grensesnitt i Altinn 3-appen din for å utvide funksjonaliteten utover det som er tilgjengelig i Altinn Studio. @@ - - Du har satt opp [lokal utviklingsmiljø](/nb/altinn-studio/guides/development/local-dev/) + - Du har satt opp [lokalt utviklingsmiljø](/nb/altinn-studio/guides/development/local-dev/) @@ - **Eksempel:** Hvis du trenger å beregne verdier automatisk når bruker fyller inn data, bør du implementere `IDataProcessor`. + **Eksempel:** Hvis du trenger å beregne verdier automatisk når brukeren fyller inn data, bør du implementere `IDataProcessor`.
30-83: Oppdater eksempel til dagens grensesnittnavn (IDataReadProcessor/IDataWriteProcessor).I nyere utgaver av app-lib-dotnet er databehandlingskontraktene splittet i egne grensesnitt for lesing og skriving (bl.a. introduksjon/justeringer av IDataWriteProcessor). Vurder å endre overskrift/eksempel eller legge inn en merknad som peker på disse navnene for prosjekter på nyere versjoner. Dette vil redusere forvirring og kompilasjonsfeil for nye apper.
Kort forslag (behold koden, men tydeliggjør valget):
- ### Eksempel: Implementere IDataProcessor + ### Eksempel: Implementere IDataProcessor + > Merk: I nyere biblioteksversjoner kan du i stedet bruke `IDataReadProcessor` og/eller `IDataWriteProcessor`. Se versjonsnotater og aktuell API i app-lib-dotnet.Relevans i versjonsnotater: referanser til endringer rundt IDataWriteProcessor. (github.com)
Vil dere at jeg oppdaterer hele eksempelet til å bruke
IDataWriteProcessor/IDataReadProcessorslik det ser ut i siste stabile versjon?
63-71: Penger/avrunding: bruk decimal og eksplisitt avrunding.For pengeberegning anbefales decimal og eksplisitt avrunding (bank-/halv-opp) for stabilitet.
- var calculatedVat = model.Amount.Value * model.VatRate.Value / 100; + decimal calculatedVat = Math.Round( + model.Amount.Value * model.VatRate.Value / 100m, + 2, + MidpointRounding.AwayFromZero);
46-55: Unødvendigasyncutenawait.Begge metodene bruker
await Task.FromResult(...). Enten:
- fjern
asyncogawait, ogreturn Task.FromResult(...), eller- legg inn reell asynkron I/O om tilgjengelig.
Dette er en liten opprydding for klarhet.
Also applies to: 79-80
89-103: Juster DI-eksempel til ny og gammel mal.Noen app-maler bruker fortsatt
RegisterCustomAppServices(...), mens nyere maler registrerer direkte viabuilder.Services. Foreslår å vise begge for å unngå forvirring:-1. Åpne `Program.cs` i rot-mappen av appprosjektet -2. Legg til registrering av din implementering i `RegisterCustomAppServices`-metoden +1. Åpne `Program.cs` i rot-mappen av appprosjektet +2. Legg til registrering av din implementering: + - Eldre mal: i `RegisterCustomAppServices`-metoden (se under) + - Nyere mal: `builder.Services.AddTransient<IDataProcessor, DataProcessor>();`
140-144: Port og URL kan variere lokalt.Port 5005 er vanlig, men varierer. Anbefaler å skrive “åpne URL-en som vises i konsollen” for færre supportspørsmål.
-2. Naviger til appen i nettleseren (vanligvis `http://localhost:5005`) +2. Naviger til appen i nettleseren på URL-en som skrives ut i konsollen (ofte `http://localhost:5005`)
161-164: Terminologi og norsk språk i råd-seksjon.
- “Return-verdier” → “Returverdier”
- “try-catch blokker” → “try-catch-blokker”
- Unngå engelsk “gracefully” → “på en kontrollert måte”
- “parameteriserte queries” → “parameteriserte spørringer”
-## Vanlige fallgruver og tips -### Return-verdier +## Vanlige fallgruver og tips +### Returverdier @@ -### Feilhåndtering -- Bruk try-catch blokker for å håndtere unntak gracefully +### Feilhåndtering +- Bruk try-catch-blokker for å håndtere unntak på en kontrollert måte @@ -- Bruk parameteriserte queries ved databasekall +- Bruk parameteriserte spørringer ved databasekallAlso applies to: 165-169, 176-179
182-201: Tidssonebevisst validering.
DateTime.Nowkan gi overraskelser i servermiljøer. Vurder å bruke Norge-tid eller UTC eksplisitt:- if (DateTime.Now.DayOfWeek == DayOfWeek.Saturday || - DateTime.Now.DayOfWeek == DayOfWeek.Sunday) + var osloTz = TimeZoneInfo.FindSystemTimeZoneById("Europe/Oslo"); + var nowOslo = TimeZoneInfo.ConvertTime(DateTime.UtcNow, osloTz); + if (nowOslo.DayOfWeek is DayOfWeek.Saturday or DayOfWeek.Sunday)
105-110: Levetider: kort presisering.Legg til at
AddSingletonkun bør brukes for trådsikre, statsløse tjenester eller cache/konfig, og atIHttpClientFactoryer riktig vei for HTTP i stedet for å single-toneHttpClient.
20-21: Terminologi-konsistens (“egendefinert” vs. “egendefinert/egendefinerte”).Dokumentet bruker både “egendefinert kode” (tittel) og “egendefinerte grensesnitt” (brødtekst). Dette er ok grammatisk, men sørg for konsekvent bruk innen samme setning/avsnitt for lesbarhet.
30-83: Tillegg: eksempler bør viseusingfor modell.For fullstendighet, vurder å inkludere en enkel
MyDataModel-definisjon i snippet eller en kort tekst som peker til hvor den hører hjemme (appens datamodellprosjekt). Dette reduserer barrierer for kopier–lim-inn.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (2)
content/altinn-studio/guides/development/custom-code/_index.nb.md(1 hunks)content/altinn-studio/reference/custom-development/_index.nb.md(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- content/altinn-studio/reference/custom-development/_index.nb.md
🧰 Additional context used
📓 Path-based instructions (2)
**/*.nb.md
⚙️ CodeRabbit configuration file
Check for Norwegian Bokmål (nb-NO) grammar and spelling with extra care. Pay special attention to specialized terminology and Norwegian-specific words.
Files:
content/altinn-studio/guides/development/custom-code/_index.nb.md
content/**/*
⚙️ CodeRabbit configuration file
Check for links, markdown formatting, headings, grammar, and spelling in multiple languages (en-US, nb-NO, nn-NO).
Files:
content/altinn-studio/guides/development/custom-code/_index.nb.md
🧠 Learnings (1)
📓 Common learnings
Learnt from: mSunberg
PR: Altinn/altinn-studio-docs#0
File: :0-0
Timestamp: 2025-04-04T08:22:36.805Z
Learning: When reviewing Norwegian content (files with .nb.md or .nn.md extensions), carefully check for spelling and grammar issues, particularly watching for changes to specialized terminology like "Digitaliseringsrundskrivet" and Norwegian-specific words.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (3)
content/altinn-studio/guides/development/custom-code/_index.nb.md (3)
30-83: Underbygg henvisningen til “dataId” (Guid) i signaturene.Historisk har dataelement-IDer vært GUID-er. Referanser i issues/controller-kode viser Guid i ruter og kontroller. Dette støtter eksempelets
Guid? dataId, men vi bør likevel verifisere mot gjeldende interface. (github.com)
204-223: Bekreft API-typer i egendefinert brukerhandling
Sørg for atIUserAction,UserActionResult,UserActionContextogNavigateClientActionfaktisk finnes i gjeldende app-lib-dotnet API med riktige signaturer—feil navn i dokumentasjonen gir kompilasjonsfeil for utviklere.
225-232: Ingen manglende lenker – alle interne referanser er verifisert og eksisterer. Legg til Hugo link-sjekk i CI for å fange framtidige brudd.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 4
🧹 Nitpick comments (6)
content/altinn-studio/reference/custom-code/_index.en.md (1)
8-8: Standardize to en-US spellingUse US English consistently across docs.
-The interfaces are organised by functional area and include only interfaces marked with the `[ImplementableByApps]` attribute. +The interfaces are organized by functional area and include only interfaces marked with the `[ImplementableByApps]` attribute. -Implement this interface for specialised handling of data writing. +Implement this interface for specialized handling of data writing. -- Specialised validation of specific data types +- Specialized validation of specific data types -- Initialising external systems +- Initializing external systems -- Initialising task-specific state +- Initializing task-specific state -Implement this interface to authorise user actions. +Implement this interface to authorize user actions.Also applies to: 48-48, 71-71, 112-112, 121-121, 174-174
content/altinn-studio/concepts/custom-code/_index.en.md (1)
7-7: US English style nitsMinor wording to align with en-US style.
-Whilst Altinn Studio enables you to build many apps without writing code, ... +While Altinn Studio enables you to build many apps without writing code, ... -... customise the app based on who is starting it. +... customize the app based on who is starting it. -- **Optimise user experience** - automate tasks and reduce manual completion +- **Optimize user experience** - automate tasks and reduce manual completion -- **Customise functionality** - create specialised solutions for your use case +- **Customize functionality** - create specialized solutions for your use caseAlso applies to: 17-17, 71-71, 74-74
content/altinn-studio/guides/development/custom-code/_index.nb.md (2)
9-10: Små språk- og typografirettinger (nb-NO)Hyphen og adjektivbøying.
-Denne guiden viser deg hvordan du kan implementere grensesnitt i din Altinn-app for å utvide funksjonaliteten utover det -som er tilgjengelig i Altinn Studio verktøyet. +Denne guiden viser deg hvordan du kan implementere grensesnitt i din Altinn-app for å utvide funksjonaliteten utover det +som er tilgjengelig i Altinn Studio‑verktøyet. -- Du har satt opp [lokal utviklingsmiljø](/nb/altinn-studio/guides/development/local-dev/) +- Du har satt opp [lokalt utviklingsmiljø](/nb/altinn-studio/guides/development/local-dev/)Also applies to: 14-14
168-171: Forbedre norsk fagspråkBytt ut engelske ord og bruk korrekt bøying/terminologi.
-- Bruk try-catch blokker for å håndtere unntak gracefully - - Logg feil med tilstrekkelig kontekst for debugging - - Test edge-cases og feilsituasjoner +- Bruk try‑catch‑blokker for å håndtere unntak på en kontrollert måte +- Logg feil med tilstrekkelig kontekst for feilsøking +- Test hjørnetilfeller og feilsituasjoner- // Cast til din datamodell + // Cast til datamodellen din-- Bruk parameteriserte queries ved databasekall +- Bruk parametriserte spørringer ved databasekallAlso applies to: 149-151, 180-180
content/altinn-studio/reference/custom-code/_index.nb.md (2)
8-9: Språkjustering (nb-NO) – bruk “grensesnitt” konsekventBytt ut “interface” i løpende tekst og forbedre attributt-formulering.
-Denne siden gir en oversikt over alle tilgjengelige grensesnitt (interfaces) som kan implementeres for å legge til egendefinert kode i Altinn-apper. -Grensesnittene er organisert etter funksjonsområde og inkluderer kun interface som er markert med `[ImplementableByApps]` attributtet. +Denne siden gir en oversikt over alle tilgjengelige grensesnitt som kan implementeres for å legge til egendefinert kode i Altinn‑apper. +Grensesnittene er organisert etter funksjonsområde og inkluderer kun grensesnitt som er markert med attributtet `[ImplementableByApps]`.
169-169: Rett stavefeil“externe” → “eksterne”.
-- Integrasjon med externe tjenester fra brukergrensesnitt +- Integrasjon med eksterne tjenester fra brukergrensesnitt
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (5)
content/altinn-studio/concepts/custom-code/_index.en.md(1 hunks)content/altinn-studio/guides/development/custom-code/_index.en.md(1 hunks)content/altinn-studio/guides/development/custom-code/_index.nb.md(1 hunks)content/altinn-studio/reference/custom-code/_index.en.md(1 hunks)content/altinn-studio/reference/custom-code/_index.nb.md(1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.nb.md
⚙️ CodeRabbit configuration file
Check for Norwegian Bokmål (nb-NO) grammar and spelling with extra care. Pay special attention to specialized terminology and Norwegian-specific words.
Files:
content/altinn-studio/reference/custom-code/_index.nb.mdcontent/altinn-studio/guides/development/custom-code/_index.nb.md
content/**/*
⚙️ CodeRabbit configuration file
Check for links, markdown formatting, headings, grammar, and spelling in multiple languages (en-US, nb-NO, nn-NO).
Files:
content/altinn-studio/reference/custom-code/_index.nb.mdcontent/altinn-studio/concepts/custom-code/_index.en.mdcontent/altinn-studio/guides/development/custom-code/_index.en.mdcontent/altinn-studio/guides/development/custom-code/_index.nb.mdcontent/altinn-studio/reference/custom-code/_index.en.md
🪛 LanguageTool
content/altinn-studio/concepts/custom-code/_index.en.md
[grammar] ~15-~15: There might be a mistake here.
Context: ... beyond the access rules set in the app. - Pre-populate the form with data - fetc...
(QB_NEW_EN)
[grammar] ~16-~16: There might be a mistake here.
Context: ... sources or based on the user's profile. - Set up specific configurations - custo...
(QB_NEW_EN)
[style] ~19-~19: Since ownership is already implied, this phrasing may be redundant.
Context: ... be pre-populated with information from your own systems. ### When loading and/or chang...
(PRP_OWN)
[style] ~21-~21: Redundant conjunctions can lead to confusion; consider removing a conjunction here.
Context: ...rom your own systems. ### When loading and/or changing data During form completion, ...
(AND_OR)
[grammar] ~25-~25: There might be a mistake here.
Context: ...te fees based on what the user fills in. - Transfer values between fields - copy ...
(QB_NEW_EN)
[grammar] ~26-~26: There might be a mistake here.
Context: ...ransform data from one field to another. - Fetch data from external sources - loo...
(QB_NEW_EN)
[grammar] ~27-~27: There might be a mistake here.
Context: ...rmation based on what the user fills in. - Validate complex business rules - chec...
(QB_NEW_EN)
[grammar] ~72-~72: There might be a mistake here.
Context: ...date and correct data during the process - Customise functionality - create specialised so...
(QB_NEW_EN)
[grammar] ~79-~79: There might be a mistake here.
Context: ...alidations and pre-population at startup - [Data processing](/altinn-studio/referenc...
(QB_NEW_EN)
[grammar] ~80-~80: There might be a mistake here.
Context: ...g/) - calculations and data manipulation - [Validation](/altinn-studio/reference/log...
(QB_NEW_EN)
[grammar] ~81-~81: There might be a mistake here.
Context: ...c/validation/) - custom validation rules - [Process actions](/altinn-studio/referenc...
(QB_NEW_EN)
[grammar] ~82-~82: There might be a mistake here.
Context: ...s/actions/) - custom buttons and actions - [Dynamic code lists](/altinn-studio/guide...
(QB_NEW_EN)
[grammar] ~92-~92: There might be a mistake here.
Context: ...existing functionality in Altinn Studio? - Complexity vs. benefit - will the code...
(QB_NEW_EN)
[grammar] ~93-~93: There might be a mistake here.
Context: ...gnificantly more complex than necessary? - Maintenance - who will maintain the co...
(QB_NEW_EN)
[grammar] ~94-~94: There might be a mistake here.
Context: ... - who will maintain the code over time? - Testing - how will you ensure that the...
(QB_NEW_EN)
[grammar] ~95-~95: There might be a mistake here.
Context: ... ensure that the code works as expected? - Performance - will the code negatively...
(QB_NEW_EN)
content/altinn-studio/guides/development/custom-code/_index.en.md
[grammar] ~108-~108: There might be a mistake here.
Context: ...e it's used (recommended for most cases) - AddScoped: One instance per HTTP reque...
(QB_NEW_EN)
[grammar] ~109-~109: There might be a mistake here.
Context: ...hat should share state within a request) - AddSingleton: One instance for the ent...
(QB_NEW_EN)
[grammar] ~156-~156: There might be a mistake here.
Context: ...o your git repository 2. Deploy the app to test environment 3. Test the functional...
(QB_NEW_EN)
[grammar] ~157-~157: There might be a mistake here.
Context: ...t environment 3. Test the functionality in test environment 4. Deploy to productio...
(QB_NEW_EN)
[grammar] ~171-~171: There might be a mistake here.
Context: ...hey are critical errors ### Performance - Avoid heavy operations that can affect u...
(QB_NEW_EN)
[grammar] ~176-~176: There might be a mistake here.
Context: ... that doesn't change often ### Security - Validate all input from users or externa...
(QB_NEW_EN)
[grammar] ~228-~228: There might be a mistake here.
Context: ... - Overview of all available interfaces - [Data processing](/altinn-studio/referenc...
(QB_NEW_EN)
[grammar] ~229-~229: There might be a mistake here.
Context: .../custom-development/) - Data processing - [Validation](/altinn-studio/reference/log...
(QB_NEW_EN)
[grammar] ~230-~230: There might be a mistake here.
Context: ...nce/logic/dataprocessing/) - Validation - [Instantiation](/altinn-studio/reference/...
(QB_NEW_EN)
[grammar] ~231-~231: There might be a mistake here.
Context: ...ence/logic/validation/) - Instantiation - [Process actions](/altinn-studio/referenc...
(QB_NEW_EN)
[grammar] ~232-~232: There might be a mistake here.
Context: ...logic/instantiation/) - Process actions - [Local development](/altinn-studio/guides...
(QB_NEW_EN)
content/altinn-studio/reference/custom-code/_index.en.md
[grammar] ~7-~7: There might be a mistake here.
Context: ...nted to add custom code to Altinn apps. The interfaces are organised by function...
(QB_NEW_EN)
[grammar] ~14-~14: There might be a mistake here.
Context: ...sts and options ### IAppOptionsProvider Implement this interface to create open ...
(QB_NEW_EN)
[grammar] ~17-~17: There might be a mistake here.
Context: ...ed dynamically at runtime. Use cases: - Code lists fetched from external sources...
(QB_NEW_EN)
[grammar] ~18-~18: There might be a mistake here.
Context: ...Code lists fetched from external sources - Code lists that do not contain sensitive...
(QB_NEW_EN)
[grammar] ~19-~19: There might be a mistake here.
Context: ...lists that do not contain sensitive data - Static code lists that are generated pro...
(QB_NEW_EN)
[grammar] ~24-~24: There might be a mistake here.
Context: ...namic/) ### IInstanceAppOptionsProvider Implement this interface to create secur...
(QB_NEW_EN)
[grammar] ~27-~27: There might be a mistake here.
Context: ...re access to the instance. Use cases: - Code lists with sensitive or personal da...
(QB_NEW_EN)
[grammar] ~28-~28: There might be a mistake here.
Context: ...de lists with sensitive or personal data - Code lists that vary based on the user's...
(QB_NEW_EN)
[grammar] ~29-~29: There might be a mistake here.
Context: ...hat vary based on the user's permissions - Code lists that require instance context...
(QB_NEW_EN)
[grammar] ~36-~36: There might be a mistake here.
Context: .../) ## Data handling ### IDataProcessor Implement this interface to process data...
(QB_NEW_EN)
[grammar] ~39-~39: There might be a mistake here.
Context: ...during saving and loading. Use cases: - Automatic calculations when data is save...
(QB_NEW_EN)
[grammar] ~40-~40: There might be a mistake here.
Context: ...utomatic calculations when data is saved - Copying values between fields - Formatti...
(QB_NEW_EN)
[grammar] ~41-~41: There might be a mistake here.
Context: ...is saved - Copying values between fields - Formatting and transforming data - Calls...
(QB_NEW_EN)
[grammar] ~42-~42: There might be a mistake here.
Context: ...ields - Formatting and transforming data - Calls to external services when data cha...
(QB_NEW_EN)
[grammar] ~47-~47: There might be a mistake here.
Context: ...ataprocessing/) ### IDataWriteProcessor Implement this interface for specialised...
(QB_NEW_EN)
[grammar] ~50-~50: There might be a mistake here.
Context: ... handling of data writing. Use cases: - Custom logic for data storage - Integrat...
(QB_NEW_EN)
[grammar] ~51-~51: There might be a mistake here.
Context: ...cases:** - Custom logic for data storage - Integration with external storage system...
(QB_NEW_EN)
[grammar] ~52-~52: There might be a mistake here.
Context: ...ntegration with external storage systems - Complex data validation before saving #...
(QB_NEW_EN)
[grammar] ~57-~57: There might be a mistake here.
Context: ...aving ## Validation ### ITaskValidator Implement this interface to validate spe...
(QB_NEW_EN)
[grammar] ~60-~60: There might be a mistake here.
Context: ...ific tasks in the process. Use cases: - Task-specific validation - Validation of...
(QB_NEW_EN)
[grammar] ~61-~61: There might be a mistake here.
Context: ...Use cases:* - Task-specific validation - Validation of states during task transit...
(QB_NEW_EN)
[grammar] ~62-~62: There might be a mistake here.
Context: ...dation of states during task transitions - Conditional validation based on task typ...
(QB_NEW_EN)
[grammar] ~67-~67: There might be a mistake here.
Context: .../validation/) ### IDataElementValidator Implement this interface to validate ind...
(QB_NEW_EN)
[grammar] ~71-~71: There might be a mistake here.
Context: ...alised validation of specific data types - Validation of attachments or files - Ele...
(QB_NEW_EN)
[grammar] ~72-~72: There might be a mistake here.
Context: ...pes - Validation of attachments or files - Element-specific business rules **Docum...
(QB_NEW_EN)
[grammar] ~77-~77: There might be a mistake here.
Context: ...gic/validation/) ### IFormDataValidator Implement this interface to validate for...
(QB_NEW_EN)
[grammar] ~80-~80: There might be a mistake here.
Context: ...ace to validate form data. Use cases: - Complex validation of form content - Cro...
(QB_NEW_EN)
[grammar] ~81-~81: There might be a mistake here.
Context: ...:** - Complex validation of form content - Cross-field validation - Dynamic validat...
(QB_NEW_EN)
[grammar] ~82-~82: There might be a mistake here.
Context: ...of form content - Cross-field validation - Dynamic validation based on form status ...
(QB_NEW_EN)
[grammar] ~87-~87: There might be a mistake here.
Context: ...alidation/) ### IInstantiationValidator Implement this interface to validate whe...
(QB_NEW_EN)
[grammar] ~90-~90: There might be a mistake here.
Context: ... can start a new instance. Use cases: - Access control beyond standard authorisa...
(QB_NEW_EN)
[grammar] ~92-~92: There might be a mistake here.
Context: ... authorisation - Time-based restrictions - Validation against external systems at s...
(QB_NEW_EN)
[grammar] ~97-~97: There might be a mistake here.
Context: ...iation/) ### IValidateQueryParamPrefill Implement this interface to validate pre...
(QB_NEW_EN)
[grammar] ~100-~100: There might be a mistake here.
Context: ...tion via query parameters. Use cases: - Validation of data sent via URL paramete...
(QB_NEW_EN)
[grammar] ~101-~101: There might be a mistake here.
Context: ...lidation of data sent via URL parameters - Securing pre-population data - Control o...
(QB_NEW_EN)
[grammar] ~102-~102: There might be a mistake here.
Context: ...arameters - Securing pre-population data - Control of allowed values from external ...
(QB_NEW_EN)
[grammar] ~107-~107: There might be a mistake here.
Context: ...d lifecycle ### IInstantiationProcessor Implement this interface to handle proce...
(QB_NEW_EN)
[grammar] ~110-~110: There might be a mistake here.
Context: ...sing during instantiation. Use cases: - Pre-populating data at startup - Initial...
(QB_NEW_EN)
[grammar] ~112-~112: There might be a mistake here.
Context: ... startup - Initialising external systems - Setting up instance-specific configurati...
(QB_NEW_EN)
[grammar] ~117-~117: There might be a mistake here.
Context: ...c/instantiation/) ### IProcessTaskStart Implement this interface to handle the s...
(QB_NEW_EN)
[grammar] ~120-~120: There might be a mistake here.
Context: ...he start of process tasks. Use cases: - Logic that should run when a task starts...
(QB_NEW_EN)
[grammar] ~122-~122: There might be a mistake here.
Context: ...tarts - Initialising task-specific state - Integration with external systems at tas...
(QB_NEW_EN)
[grammar] ~125-~125: There might be a mistake here.
Context: ...stems at task start ### IProcessTaskEnd Implement this interface to handle the c...
(QB_NEW_EN)
[grammar] ~128-~128: There might be a mistake here.
Context: ...mpletion of process tasks. Use cases: - Cleanup logic at task completion - Savin...
(QB_NEW_EN)
[grammar] ~129-~129: There might be a mistake here.
Context: ...es:** - Cleanup logic at task completion - Saving intermediate results - Reporting ...
(QB_NEW_EN)
[grammar] ~130-~130: There might be a mistake here.
Context: ...completion - Saving intermediate results - Reporting to external systems ### IProc...
(QB_NEW_EN)
[grammar] ~133-~133: There might be a mistake here.
Context: ...ing to external systems ### IProcessEnd Implement this interface to handle the c...
(QB_NEW_EN)
[grammar] ~136-~136: There might be a mistake here.
Context: ...ion of the entire process. Use cases: - Final processing of data - Archiving and...
(QB_NEW_EN)
[grammar] ~137-~137: There might be a mistake here.
Context: ...Use cases:* - Final processing of data - Archiving and reporting - Resource clean...
(QB_NEW_EN)
[grammar] ~138-~138: There might be a mistake here.
Context: ...essing of data - Archiving and reporting - Resource cleanup ### IProcessTaskAbando...
(QB_NEW_EN)
[grammar] ~141-~141: There might be a mistake here.
Context: ...esource cleanup ### IProcessTaskAbandon Implement this interface to handle aband...
(QB_NEW_EN)
[grammar] ~144-~144: There might be a mistake here.
Context: ...to handle abandoned tasks. Use cases: - Cleanup when tasks are abandoned - Loggi...
(QB_NEW_EN)
[grammar] ~145-~145: There might be a mistake here.
Context: ...es:** - Cleanup when tasks are abandoned - Logging of abandoned processes - Handlin...
(QB_NEW_EN)
[grammar] ~146-~146: There might be a mistake here.
Context: ...andoned - Logging of abandoned processes - Handling partially completed tasks ### ...
(QB_NEW_EN)
[grammar] ~156-~156: There might be a mistake here.
Context: ...ional process transitions. Use cases: - Dynamic process flow based on data - Pro...
(QB_NEW_EN)
[grammar] ~157-~157: There might be a mistake here.
Context: ...:** - Dynamic process flow based on data - Process branching based on business logi...
(QB_NEW_EN)
[grammar] ~158-~158: There might be a mistake here.
Context: ...rocess branching based on business logic - Conditional routing between tasks ## Us...
(QB_NEW_EN)
[grammar] ~163-~163: There might be a mistake here.
Context: ... tasks ## User actions ### IUserAction Implement this interface to define custo...
(QB_NEW_EN)
[grammar] ~166-~166: There might be a mistake here.
Context: ...efine custom user actions. Use cases: - Custom buttons in the user interface - S...
(QB_NEW_EN)
[grammar] ~168-~168: There might be a mistake here.
Context: ...ns not covered by standard functionality - Integration with external services from ...
(QB_NEW_EN)
[grammar] ~173-~173: There might be a mistake here.
Context: ...erveraction/) ### IUserActionAuthorizer Implement this interface to authorise us...
(QB_NEW_EN)
[grammar] ~176-~176: There might be a mistake here.
Context: ...to authorise user actions. Use cases: - Access control for custom actions - Cond...
(QB_NEW_EN)
[grammar] ~177-~177: There might be a mistake here.
Context: ...s:** - Access control for custom actions - Conditional access based on user roles -...
(QB_NEW_EN)
[grammar] ~178-~178: There might be a mistake here.
Context: ...- Conditional access based on user roles - Dynamic authorisation based on data or s...
(QB_NEW_EN)
[grammar] ~183-~183: There might be a mistake here.
Context: ...a or state ## Events ### IEventHandler Implement this interface to handle appli...
(QB_NEW_EN)
[grammar] ~186-~186: There might be a mistake here.
Context: ...handle application events. Use cases: - Response to system or user actions - Int...
(QB_NEW_EN)
[grammar] ~187-~187: There might be a mistake here.
Context: ...:** - Response to system or user actions - Integration with event-driven architectu...
(QB_NEW_EN)
[grammar] ~188-~188: There might be a mistake here.
Context: ...egration with event-driven architectures - Logging and monitoring of application ac...
(QB_NEW_EN)
[grammar] ~195-~195: There might be a mistake here.
Context: ...s/) ## Other interfaces ### IValidator General validation interface for custom ...
(QB_NEW_EN)
[grammar] ~198-~198: There might be a mistake here.
Context: ...ce for custom validations. Use cases: - Basis for specialised validators - Gener...
(QB_NEW_EN)
[grammar] ~199-~199: There might be a mistake here.
Context: ...es:** - Basis for specialised validators - General validation that doesn't fit othe...
(QB_NEW_EN)
[grammar] ~200-~200: There might be a mistake here.
Context: ...dation that doesn't fit other categories - Flexible validation with custom rules -...
(QB_NEW_EN)
[grammar] ~209-~209: There might be a mistake here.
Context: ...ions: ### IInstanceValidator [OBSOLETE] {{}} NOTE! This interfac...
(QB_NEW_EN)
[grammar] ~210-~210: There might be a mistake here.
Context: ...alidator [OBSOLETE] {{}} NOTE! This interface is obsolete. Use `I...
(QB_NEW_EN)
🪛 GitHub Check: Build and Check links
content/altinn-studio/concepts/custom-code/_index.en.md
[failure] 86-86:
bad links:
altinn-studio/reference/custom-development
content/altinn-studio/guides/development/custom-code/_index.en.md
[failure] 228-228:
bad links:
altinn-studio/reference/custom-development
[failure] 19-19:
bad links:
altinn-studio/reference/custom-development
content/altinn-studio/guides/development/custom-code/_index.nb.md
[failure] 229-229:
bad links:
nb/altinn-studio/reference/custom-development
[failure] 20-20:
bad links:
nb/altinn-studio/reference/custom-development
🪛 GitHub Actions: Hugo Verifications
content/altinn-studio/concepts/custom-code/_index.en.md
[error] 86-86: Hyperlink: bad link '/altinn-studio/reference/custom-development' at line 86.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (2)
content/altinn-studio/reference/custom-code/_index.en.md (1)
149-153: Verify deprecation note for IProcessExclusiveGatewayConfirm in Altinn.App.Core that the obsolete method has been superseded by
FilterAsync(IInstanceDataAccessor, ...), and that the signature here matches current code. If not, update the note.content/altinn-studio/reference/custom-code/_index.nb.md (1)
151-152: Begrepsbruk for deprecated metodeVurder “avviklet” vs. “obsolete” og presiser signaturen som i koden:
FilterAsync(IInstanceDataAccessor, ...).
| - [Dynamic code lists](/altinn-studio/guides/development/options/sources/dynamic/) - code lists generated at runtime | ||
|
|
||
|
|
||
| Also see [overview of all available interfaces that can be implemented](/altinn-studio/reference/custom-development). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix broken link to the overview page
Broken in pipeline; update target.
-Also see [overview of all available interfaces that can be implemented](/altinn-studio/reference/custom-development).
+Also see [overview of all available interfaces that can be implemented](/altinn-studio/reference/custom-code/).📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| Also see [overview of all available interfaces that can be implemented](/altinn-studio/reference/custom-development). | |
| Also see [overview of all available interfaces that can be implemented](/altinn-studio/reference/custom-code/). |
🧰 Tools
🪛 GitHub Check: Build and Check links
[failure] 86-86:
bad links:
altinn-studio/reference/custom-development
🪛 GitHub Actions: Hugo Verifications
[error] 86-86: Hyperlink: bad link '/altinn-studio/reference/custom-development' at line 86.
🤖 Prompt for AI Agents
In content/altinn-studio/concepts/custom-code/_index.en.md around line 86, the
markdown link currently targets /altinn-studio/reference/custom-development
which is broken in the pipeline; update the link target to the correct overview
page for available interfaces (replace the URL with the correct path in the docs
tree), ensure the link uses the canonical relative/absolute docs path, and
verify by running a local site build or link check to confirm the link resolves.
|
|
||
| ## Step 1: Choose the right interface | ||
|
|
||
| Before you start coding, you need to identify which interface best fits your needs. See the [overview of available interfaces](/altinn-studio/reference/custom-development/) to find the one that suits you. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix broken links to the overview page
The build flags these as bad links. Point to the new reference page path.
-See the [overview of available interfaces](/altinn-studio/reference/custom-development/) to find the one that suits you.
+See the [overview of available interfaces](/altinn-studio/reference/custom-code/) to find the one that suits you.-- [Overview of all available interfaces](/altinn-studio/reference/custom-development/)
+- [Overview of all available interfaces](/altinn-studio/reference/custom-code/)Also applies to: 228-228
🧰 Tools
🪛 GitHub Check: Build and Check links
[failure] 19-19:
bad links:
altinn-studio/reference/custom-development
🤖 Prompt for AI Agents
In content/altinn-studio/guides/development/custom-code/_index.en.md around line
19 (and also at line 228), the link to the overview page is broken; update the
markdown link target to the new reference path
/altinn-studio/reference/custom-code/ (replace the existing
/altinn-studio/reference/custom-development/ URL), ensuring both occurrences are
changed so the build no longer flags bad links.
| ## Steg 1: Velg riktig grensesnitt | ||
|
|
||
| Før du begynner å kode, må du identifisere hvilket grensesnitt som passer best for ditt behov. | ||
| Se [oversikten over tilgjengelige grensesnitt](/nb/altinn-studio/reference/custom-development/) for å finne det som passer. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fiks brutte lenker til oversiktssiden
Peker til feil sti; oppdater til ny referanseside.
-Se [oversikten over tilgjengelige grensesnitt](/nb/altinn-studio/reference/custom-development/) for å finne det som passer.
+Se [oversikten over tilgjengelige grensesnitt](/nb/altinn-studio/reference/custom-code/) for å finne det som passer.-- [Oversikt over alle tilgjengelige grensesnitt](/nb/altinn-studio/reference/custom-development/)
+- [Oversikt over alle tilgjengelige grensesnitt](/nb/altinn-studio/reference/custom-code/)Also applies to: 229-229
🧰 Tools
🪛 GitHub Check: Build and Check links
[failure] 20-20:
bad links:
nb/altinn-studio/reference/custom-development
🤖 Prompt for AI Agents
In content/altinn-studio/guides/development/custom-code/_index.nb.md around
lines 20 and also at line 229, the link points to an outdated path
(/nb/altinn-studio/reference/custom-development/); update both links to the new
reference page path (use the repository's current canonical URL for the
reference/oversiktsside) so the anchor text remains the same but the href points
to the correct new route; verify both instances are updated and run a local link
check to confirm they no longer 404.
| title: Development | ||
| description: Overview of available interfaces for custom code | ||
| weight: 25 | ||
| --- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Fix page title to reflect content and improve navigation
Change the title to match the reference topic.
---
-title: Development
+title: Custom code interfaces
description: Overview of available interfaces for custom code
weight: 25
---📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| title: Development | |
| description: Overview of available interfaces for custom code | |
| weight: 25 | |
| --- | |
| --- | |
| title: Custom code interfaces | |
| description: Overview of available interfaces for custom code | |
| weight: 25 | |
| --- |
🤖 Prompt for AI Agents
In content/altinn-studio/reference/custom-code/_index.en.md around lines 2 to 5,
the current page title "Development" is too generic and does not match the
reference topic; update the frontmatter title to a more specific one such as
"Custom code reference" (or "Custom code — Reference") so it reflects the page
content and improves navigation/TOC clarity, keeping the description and weight
intact.
Claude-generated. Based on list of interfaces in https://github.com/Altinn/app-lib-dotnet/tree/main/src/Altinn.App.Core/Features, as well as any references to these interfaces in the documentation.
Also added basic explanation article on use of custom code in Altinn apps in general, and a general guide for adding custom code via our defined interfaces.
Summary by CodeRabbit