본문으로 건너뛰기
cccskills
무료GitHub에 공개

journalforing

Expert knowledge of Journalføring (document archiving) in melosys-api. Use when: (1) Creating/updating journalposts (Joark API), (2) Retrieving documents from SAF (GraphQL), (3) Understanding document workflows, (4) Debugging journalpost issues, (5) Mapping document types and categories. Triggers: "journalpost", "journalføring", "Joark", "dokarkiv", "SAF", "dokumentoversikt", "hentDokument", "ferdigstill journalpost", "Variantformat".

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(4)

  • SKILL.md7.4 KB
  • references/debugging.md6.1 KB
  • references/joark-api.md5.2 KB
  • references/saf.md6.5 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Journalføring System

Journalføring handles document archiving through Joark (create/update) and SAF (read/query). All documents in melosys are archived as journalposts linked to a fagsak.

Quick Reference

Module Structure

integrasjon/joark/
├── JoarkService.java              # Main service (creates, updates, finalizes)
├── JoarkFasade.java               # Interface for service layer
├── JournalpostOppdatering.java    # Update request builder
├── JournalpostRequestValidator.java
├── DokumentKategoriKode.java      # Document category codes
├── Variantformat.java             # ARKIV, ORIGINAL
├── journalpostapi/                # Joark REST API
│   └── dto/                       # Request/response DTOs
└── saf/                           # SAF GraphQL API
    ├── SafClient.java             # GraphQL client
    └── dto/                       # Response DTOs
        └── journalpost/           # Journalpost domain objects

saksflyt/steg/jfr/
└── OppdaterOgFerdigstillJournalpost.kt  # Saga step

domain/arkiv/
├── Journalposttype.kt             # INN, UT, NOTAT
├── ArkivDokument.kt               # Document domain model
├── FysiskDokument.kt              # Physical document
├── Vedlegg.kt                     # Attachments
└── DokumentReferanse.kt           # Document reference

Core Concepts

Two APIs:

APIPurposeProtocol
Joark (dokarkiv)Create, update, finalize journalpostsREST
SAFQuery, read documentsGraphQL

Journalpost Types:

TypeCodeDescription
INNIIncoming document (søknad, brev fra bruker)
UTUOutgoing document (vedtak, brev til bruker)
NOTATNInternal note

Journalpost Status Flow:

MOTTATT → UNDER_ARBEID → JOURNALFOERT → FERDIGSTILT → EKSPEDERT
                                    ↘ UTGAAR (if expired)
                                    ↘ FEILREGISTRERT (if error)

Key Operations

Create Journalpost (Outgoing Document)

// Entry point: JoarkService.opprettJournalpost(OpprettJournalpost, forsøkEndeligJfr)
// Build the domain OpprettJournalpost (tittel, tema "MED", journalposttype "U",
// bruker, sak (fagsaksystem "MELOSYS"), dokumenter), then:
val journalpostId: String = joarkService.opprettJournalpost(opprettJournalpost, forsøkEndeligJfr)
// JoarkService maps to OpprettJournalpostRequest.av(...) and calls
// journalpostapiClient.opprettJournalpost(request, forsøkEndeligJfr),
// returning OpprettJournalpostResponse.journalpostId.

Finalize Journalpost (Incoming)

// After attaching to case, finalize
joarkService.oppdaterOgFerdigstillJournalpost(
    journalpostId = "12345",
    oppdatering = JournalpostOppdatering.Builder()
        .medSaksnummer(saksnummer)
        .medBrukerID(fnr)
        .medTema("MED")
        .medTittel("Søknad om A1")
        .build()
)

Query Documents from SAF

// GraphQL query for documents linked to case
val dokumenter = safClient.hentDokumentoversikt(saksnummer)

// Get specific journalpost
val journalpost = safClient.hentJournalpost(journalpostId)

// Download document content (always ARKIV variant; no variantformat arg)
val bytes = safClient.hentDokument(journalpostId, dokumentInfoId)

Saga Step: Finalize After Behandling

// OppdaterOgFerdigstillJournalpost.utfør()
// Reads from ProsessDataKey:
// - JOURNALPOST_ID, DOKUMENT_ID
// - BRUKER_ID, AVSENDER_ID, AVSENDER_NAVN
// - MOTTATT_DATO, HOVEDDOKUMENT_TITTEL
// - FYSISKE_VEDLEGG, LOGISKE_VEDLEGG_TITLER

Document Categories

DokumentKategoriKode values:

CodeDescription
SOKSøknad
VBVedtaksbrev
BBrev
SEDStructured Electronic Document (EU)
SYS_SEDSystem-generated SED
KAKlage eller anke
ESElektronisk skjema
EPE-post
IBInfobrev
FORVALTNINGSNOTATInternal note
PUBL_BLANKETT_EOSEU form

Variant Formats

FormatDescription
ARKIVArchived version (PDF/PDFA)
ORIGINALOriginal format (XML/JSON metadata)

Integration Flow

Incoming Document (Søknad)

1. Document received (MOTTATT)
2. JoarkService.hentJournalpost() - fetch metadata
3. Create behandling, link to fagsak
4. JoarkService.oppdaterOgFerdigstillJournalpost()
   - Updates: bruker, sak, tema, tittel, avsender
   - Status: MOTTATT → FERDIGSTILT

Outgoing Document (Vedtak)

1. DokumentService produces document
2. JoarkService.opprettJournalpost()
   - Creates with status FERDIGSTILT
   - Returns journalpostId, dokumentInfoId
3. Distribution to recipient

Common Issues

Issue: Journalpost Not Found

Symptom: IkkeFunnetException when fetching journalpost

Causes:

  • Wrong journalpostId
  • Journalpost in different environment
  • Access denied (tema mismatch)

Debug:

val jp = safClient.hentJournalpost(journalpostId)
log.info("Status: ${jp?.journalstatus}, Tema: ${jp?.tema}")

Issue: Cannot Finalize

Symptom: Error when calling ferdigstillJournalføring

Check:

  1. Journalpost already finalized (FERDIGSTILT)?
  2. Missing required fields (bruker, sak)?
  3. Wrong tema for the case type?

Issue: Missing Document Content

Symptom: Empty bytes from hentDokument

Check:

  • Document exists in journalpost (correct dokumentInfoId)
  • ARKIV variant is present (hentDokument only fetches the ARKIV variant)
  • Access permissions (saksbehandlerHarTilgang)

SQL Queries

Check Journalpost on Behandling

-- Journalposts are NOT stored as a saksopplysning. The journalpost reference
-- is carried in the saga's prosessinstans data (JOURNALPOST_ID, DOKUMENT_ID).
SELECT pi.data
FROM prosessinstans pi
WHERE pi.behandling_id = :behandlingId
AND pi.data LIKE '%JOURNALPOST_ID%';
-- To list documents for a case, query SAF instead (see below).

Find Documents by Saksnummer

-- Via SAF GraphQL, not local DB
-- Use: safClient.hentDokumentoversikt(saksnummer)

Key Code Locations

ComponentLocation
Main Serviceintegrasjon/.../joark/JoarkService.java
Facade Interfaceintegrasjon/.../joark/JoarkFasade.java
Joark write clientintegrasjon/.../joark/journalpostapi/JournalpostapiClient.kt
SAF Clientintegrasjon/.../joark/saf/SafClient.java
Saga Stepsaksflyt/.../steg/jfr/OppdaterOgFerdigstillJournalpost.kt
Document Domaindomain/.../arkiv/*.kt
Category Codesintegrasjon/.../joark/DokumentKategoriKode.java

Detailed Documentation

  • Joark API: Creating and updating journalposts
  • SAF API: Querying and reading documents
  • Debugging: Common journalføring issues, log patterns, and SQL

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Expert knowledge of Altinn A1 application processing for posted workers in melosys-api. Use when: (1) Understanding Altinn søknad/skjema processing, (2) Debugging MedlemskapArbeidEOS form mapping, (3) Understanding SoeknadMapper transformations, (4) Investigating posted worker application issues, (5) Understanding the MOTTAK_SOKNAD_ALTINN saga flow.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

navikt/melosys-api22026년 10월 21일 업데이트

Expert knowledge of Employer/Employment integration (EREG/AAREG) in melosys-api. Use when: (1) Working with organization data from EREG (Enhetsregisteret), (2) Working with employment data from AAREG (Arbeidsforhold), (3) Understanding employer/organization lookup, (4) Debugging employer or employment issues, (5) Understanding the mapping between register data and domain models. Triggers: orgnummer, arbeidsforhold, EREG, AAREG, Enhetsregisteret, registeropplysninger, ansettelsesperiode, saksopplysning.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

navikt/melosys-api22026년 10월 21일 업데이트

Modular monolith architecture overview for melosys-api. Use when needing to understand module structure, dependencies between modules, where to place new code, or when changes in one module might affect others. Triggers: "architecture", "module dependencies", "where should I put", "which modules", "dependency graph".

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

navikt/melosys-api22026년 10월 21일 업데이트

Expert knowledge of Behandling (case treatment) domain in melosys-api. Use when: (1) Understanding the behandling lifecycle and status transitions, (2) Debugging issues with behandling creation, status changes, or closure, (3) Understanding relationships between Fagsak, Behandling, and Behandlingsresultat, (4) Investigating why a behandling is stuck or has wrong status, (5) Understanding Behandlingstyper, Behandlingstema, Behandlingsstatus enums, (6) Debugging journalføring or SED-triggered behandling creation, (7) Understanding behandling creation via saksflyt sagas.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

navikt/melosys-api22026년 10월 21일 업데이트

Expert knowledge of Behandlingsresultat (treatment result) domain in melosys-api. Use when: (1) Understanding result types and their meaning (FASTSATT_LOVVALGSLAND, MEDLEM_I_FOLKETRYGDEN, etc.), (2) Working with periods - Lovvalgsperiode, Medlemskapsperiode, Anmodningsperiode, Utpekingsperiode, (3) Debugging vedtak/decision metadata, criteria evaluation, or social insurance charges, (4) Understanding EU/EEA coordination logic and Article 16 exception handling, (5) Working with trygdeavgift (social insurance charge) calculations.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

navikt/melosys-api22026년 10월 21일 업데이트

brev

무료

Expert knowledge of Brev (letter generation) in melosys-api. Use when: (1) Producing letters and decision documents (vedtaksbrev), (2) Understanding Dokgen templates and mapping, (3) Configuring letter recipients and distribution, (4) Debugging letter generation issues, (5) Adding new letter types or templates.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

navikt/melosys-api22026년 10월 21일 업데이트

navikt의 스킬 모두 보기

이 스킬의 문제 신고