# Business Logic — JKKCancelSvcKeiMapperCC.getContents() [94 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `com.fujitsu.futurity.bp.custom.common.JKKCancelSvcKeiMapperCC` |
| Layer | CC/Common Component (Package: `com.fujitsu.futurity.bp.custom.common`) |
| Module | `common` (Package: `com.fujitsu.futurity.bp.custom.common`) |

## 1. Role

### JKKCancelSvcKeiMapperCC.getContents()

This method serves as a **message template router** (dispatcher) for the K-Opticom Service Contract Cancellation system. It receives a `templateId` string that identifies a specific service interface (S/IF) and returns the column/field layout definition (`Object[][]`) that the calling screen or CBS uses to render or validate request/response data. The `Object[][]` structure represents a two-dimensional array where each row defines a field — typically containing the field key name, display label, data type, and validation metadata — consistent with the framework's message class conventions. The method implements a **routing/dispatch pattern**: it instantiates the appropriate message class and delegates to that class's `getContents()` method, which contains the actual field definitions. It supports cancellation service templates for multiple service types including FTTH (fiber optic), general telephone, and mail service contracts, as well as newer service lines such as EZM (television/new codec services) added in the Step 2 quality improvement initiative (ANK-4494). The method is called both from the same class's own mapping methods (`mappin*`, `editInMsg`, `editResultRP`) and dynamically via reflection from parameter handling classes (`JSCTelSvcScParamHenshu`, `JCNDslScParamHenshu`, `JCKPmpScParamHenshu`), making it a shared utility used across many screens and CBS operations throughout the system.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["getContents(templateId)"])
    CHECK["Check templateId value"]

    CHECK -->|"templateId equals EKK0011B020"| INST1["new EKK0011B020CBSMsg()"]
    CHECK -->|"templateId equals EKK0011B020CBSMsg1List"| INST2["new EKK0011B020CBSMsg1List()"]
    CHECK -->|"templateId equals EKK0011C060"| INST3["new EKK0011C060CBSMsg()"]
    CHECK -->|"templateId equals EKK0011C060CBSMsg1List"| INST4["new EKK0011C060CBSMsg1List()"]
    CHECK -->|"templateId equals EKK0011D020"| INST5["new EKK0011D020CBSMsg()"]
    CHECK -->|"templateId equals EKK0011D020CBSMsg1List"| INST6["new EKK0011D020CBSMsg1List()"]
    CHECK -->|"templateId equals EKK0021C060"| INST7["new EKK0021C060CBSMsg()"]
    CHECK -->|"templateId equals EKK0021C070"| INST8["new EKK0021C070CBSMsg()"]
    CHECK -->|"templateId equals EKK0251C050"| INST9["new EKK0251C050CBSMsg()"]
    CHECK -->|"templateId equals EKK0251C050CBSMsg1List"| INST10["new EKK0251C050CBSMsg1List()"]
    CHECK -->|"templateId equals EKU0011A010"| INST11["new EKU0011A010CBSMsg()"]
    CHECK -->|"templateId equals EKU0011A010CBSMsg1List"| INST12["new EKU0011A010CBSMsg1List()"]
    CHECK -->|"templateId equals EKK1021B003"| INST13["new EKK1021B003CBSMsg()"]
    CHECK -->|"templateId equals EKK1021B003CBSMsg1List"| INST14["new EKK1021B003CBSMsg1List()"]
    CHECK -->|"templateId equals EKK1021C010"| INST15["new EKK1021C010CBSMsg()"]
    CHECK -->|"templateId equals EKK0771A010"| INST16["new EKK0771A010CBSMsg()"]
    CHECK -->|"templateId equals EKK0771A010CBSMsg1List"| INST17["new EKK0771A010CBSMsg1List()"]
    CHECK -->|"templateId equals EZM0121A010"| INST18["new EZM0121A010CBSMsg()"]
    CHECK -->|"templateId equals EZM0121A010CBSMsg1List"| INST19["new EZM0121A010CBSMsg1List()"]
    CHECK -->|"templateId equals EZM0121C010"| INST20["new EZM0121C010CBSMsg()"]
    CHECK -->|"no match (null)"| RET_NULL["contents remains null"]

    INST1 --> CALL1["call getContents()"]
    INST2 --> CALL2["call getContents()"]
    INST3 --> CALL3["call getContents()"]
    INST4 --> CALL4["call getContents()"]
    INST5 --> CALL5["call getContents()"]
    INST6 --> CALL6["call getContents()"]
    INST7 --> CALL7["call getContents()"]
    INST8 --> CALL8["call getContents()"]
    INST9 --> CALL9["call getContents()"]
    INST10 --> CALL10["call getContents()"]
    INST11 --> CALL11["call getContents()"]
    INST12 --> CALL12["call getContents()"]
    INST13 --> CALL13["call getContents()"]
    INST14 --> CALL14["call getContents()"]
    INST15 --> CALL15["call getContents()"]
    INST16 --> CALL16["call getContents()"]
    INST17 --> CALL17["call getContents()"]
    INST18 --> CALL18["call getContents()"]
    INST19 --> CALL19["call getContents()"]
    INST20 --> CALL20["call getContents()"]

    CALL1 --> ASSIGN1["contents = result"]
    CALL2 --> ASSIGN2["contents = result"]
    CALL3 --> ASSIGN3["contents = result"]
    CALL4 --> ASSIGN4["contents = result"]
    CALL5 --> ASSIGN5["contents = result"]
    CALL6 --> ASSIGN6["contents = result"]
    CALL7 --> ASSIGN7["contents = result"]
    CALL8 --> ASSIGN8["contents = result"]
    CALL9 --> ASSIGN9["contents = result"]
    CALL10 --> ASSIGN10["contents = result"]
    CALL11 --> ASSIGN11["contents = result"]
    CALL12 --> ASSIGN12["contents = result"]
    CALL13 --> ASSIGN13["contents = result"]
    CALL14 --> ASSIGN14["contents = result"]
    CALL15 --> ASSIGN15["contents = result"]
    CALL16 --> ASSIGN16["contents = result"]
    CALL17 --> ASSIGN17["contents = result"]
    CALL18 --> ASSIGN18["contents = result"]
    CALL19 --> ASSIGN19["contents = result"]
    CALL20 --> ASSIGN20["contents = result"]

    RET_NULL --> RETURN(["return contents"])
    ASSIGN1 --> RETURN
    ASSIGN2 --> RETURN
    ASSIGN3 --> RETURN
    ASSIGN4 --> RETURN
    ASSIGN5 --> RETURN
    ASSIGN6 --> RETURN
    ASSIGN7 --> RETURN
    ASSIGN8 --> RETURN
    ASSIGN9 --> RETURN
    ASSIGN10 --> RETURN
    ASSIGN11 --> RETURN
    ASSIGN12 --> RETURN
    ASSIGN13 --> RETURN
    ASSIGN14 --> RETURN
    ASSIGN15 --> RETURN
    ASSIGN16 --> RETURN
    ASSIGN17 --> RETURN
    ASSIGN18 --> RETURN
    ASSIGN19 --> RETURN
    ASSIGN20 --> RETURN
```

**CRITICAL — Constant Resolution:**
This method does not reference external constants for branching. Instead, it uses **literal string values** directly as `templateId` match values. Each string is a service interface ID (S/IF_ID) that follows the K-Opticom convention:

| Prefix | Business Meaning |
|--------|-----------------|
| `EKK` | General service contract cancellation (FTTH/telephone/mail) |
| `EKU` | Telephone-related service contract cancellation |
| `EZM` | Television/new codec service (added in ANK-4494 Step 2, Dec 2024) |

The `CBSMsg` suffix indicates a standard message layout. The `CBSMsg1List` suffix indicates a list/table-type message layout (for multi-row data such as itemized service contracts).

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `templateId` | `String` | The service interface ID that identifies which message template's field layout to return. It corresponds to a specific CBS (Call Back Service) screen or data transfer object. The value determines which message class is instantiated and queried. Valid values include `EKK0011B020`, `EKK0011C060`, `EKK0021C060`, `EKK0021C070`, `EKK0251C050`, `EKU0011A010`, `EKK1021B003`, `EKK1021C010`, `EKK0771A010`, `EZM0121A010`, `EZM0121C010`, and their `CBSMsg1List` variants. If the value does not match any known template, the method returns `null`. |

No instance fields or external state are read by this method.

## 4. CRUD Operations / Called Services

### Pre-computed evidence from code analysis graph:

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `getContents` | (varies per template) | (varies per template) | Delegates to the `getContents()` method of each instantiated CBSMsg/CBSMsg1List class, which returns the field layout definitions (Object[][]) for the corresponding service interface template. |

This method performs only **Read** operations. It does not insert, update, or delete data. Each called `getContents()` method on the message classes simply returns static or pre-built field metadata arrays (column names, labels, types) — no database or external system interaction occurs at this layer.

## 5. Dependency Trace

### Direct callers (pre-computed from code analysis graph):

| # | Caller (Screen/Batch) | Call Chain (Full Path to Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|----------------------------------|-------------------------------|
| 1 | `JKKCancelSvcKeiMapperCC.editInMsg` | `editInMsg` → `getContents` | `getContents [R]` → each CBSMsg.getContents |
| 2 | `JKKCancelSvcKeiMapperCC.editResultRP` | `editResultRP` → `getContents` | `getContents [R]` → each CBSMsg.getContents |
| 3 | `JKKCancelSvcKeiMapperCC.getContents` | Self-recursive call (same class) | `getContents [R]` → each CBSMsg.getContents |
| 4 | `JKKCancelSvcKeiMapperCC.mappinECK0011A010SCInMsg` | `mappinECK0011A010SCInMsg` → `getContents` | `getContents [R]` → each CBSMsg.getContents |
| 5 | `JKKCancelSvcKeiMapperCC.mappinEKK0011B001SCInMsg` | `mappinEKK0011B001SCInMsg` → `getContents` | `getContents [R]` → each CBSMsg.getContents |
| 6 | `JKKCancelSvcKeiMapperCC.mappinEKK0011C060SCInMsg` | `mappinEKK0011C060SCInMsg` → `getContents` | `getContents [R]` → each CBSMsg.getContents |
| 7 | `JKKCancelSvcKeiMapperCC.mappinEKK0011D020SCInMsg` | `mappinEKK0011D020SCInMsg` → `getContents` | `getContents [R]` → each CBSMsg.getContents |
| 8 | `JKKCancelSvcKeiMapperCC.mappinEKK0021A010SCInMsg` | `mappinEKK0021A010SCInMsg` → `getContents` | `getContents [R]` → each CBSMsg.getContents |
| 9 | `JKKCancelSvcKeiMapperCC.mappinEKK0021C060SCInMsg` | `mappinEKK0021C060SCInMsg` → `getContents` | `getContents [R]` → each CBSMsg.getContents |
| 10 | `JKKCancelSvcKeiMapperCC.mappinEKK0081B013SCInMsg` | `mappinEKK0081B013SCInMsg` → `getContents` | `getContents [R]` → each CBSMsg.getContents |
| 11 | `JKKCancelSvcKeiMapperCC.mappinEKK0161C160SCInMsg` | `mappinEKK0161C160SCInMsg` → `getContents` | `getContents [R]` → each CBSMsg.getContents |
| 12 | `JKKCancelSvcKeiMapperCC.mappinEKK0251C050SCInMsg` | `mappinEKK0251C050SCInMsg` → `getContents` | `getContents [R]` → each CBSMsg.getContents |
| 13 | `JKKCancelSvcKeiMapperCC.mappinEKK0341B028SCInMsg` | `mappinEKK0341B028SCInMsg` → `getContents` | `getContents [R]` → each CBSMsg.getContents |
| 14 | `JKKCancelSvcKeiMapperCC.mappinEKK0351C220SCInMsg` | `mappinEKK0351C220SCInMsg` → `getContents` | `getContents [R]` → each CBSMsg.getContents |
| 15 | `JKKCancelSvcKeiMapperCC.mappinEKK0441C210SCInMsg` | `mappinEKK0441C210SCInMsg` → `getContents` | `getContents [R]` → each CBSMsg.getContents |

_Detected 47 total callers via code analysis graph. The majority are `mappin*` mapping methods within the same class, plus 3 reflection-based callers from parameter handling classes that invoke `getContents` dynamically via Java reflection (`getMethod`)._

### Reflection-based callers:
| # | Caller (Screen/Batch) | Call Chain (Full Path to Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|----------------------------------|-------------------------------|
| 16 | JSCTelSvcScParamHenshu | `JSCTelSvcScParamHenshu.java:212` via `getMethod` | `getContents [R]` → each CBSMsg.getContents |
| 17 | JSCTelSvcScParamHenshu | `JSCTelSvcScParamHenshu.java:223` via `getMethod` | `getContents [R]` → each CBSMsg.getContents |
| 18 | JCNDslScParamHenshu | `JCNDslScParamHenshu.java:349` via `getMethod` | `getContents [R]` → each CBSMsg.getContents |
| 19 | JCNDslScParamHenshu | `JCNDslScParamHenshu.java:361` via `getMethod` | `getContents [R]` → each CBSMsg.getContents |
| 20 | JCKPmpScParamHenshu | `JCKPmpScParamHenshu.java:348` via `getMethod` | `get_contents [R]` → each CBSMsg.getContents |

## 6. Per-Branch Detail Blocks

**Block 1** — IF `(templateId equals "EKK0011B020")` (L3971)
> Instantiate and invoke the EKK0011B020 CBS message class to retrieve field layout definitions.

| # | Type | Code |
|---|------|------|
| 1 | SET | `contents = new EKK0011B020CBSMsg().getContents()` |

**Block 2** — ELSE-IF `(templateId equals "EKK0011B020CBSMsg1List")` (L3975)
> Instantiate and invoke the EKK0011B020 list-type CBS message class.

| # | Type | Code |
|---|------|------|
| 1 | SET | `contents = new EKK0011B020CBSMsg1List().getContents()` |

**Block 3** — ELSE-IF `(templateId equals "EKK0011C060")` (L3979)
> Instantiate and invoke the EKK0011C060 CBS message class (service contract cancellation detail).

| # | Type | Code |
|---|------|------|
| 1 | SET | `contents = new EKK0011C060CBSMsg().getContents()` |

**Block 4** — ELSE-IF `(templateId equals "EKK0011C060CBSMsg1List")` (L3983)
> Instantiate and invoke the EKK0011C060 list-type CBS message class.

| # | Type | Code |
|---|------|------|
| 1 | SET | `contents = new EKK0011C060CBSMsg1List().getContents()` |

**Block 5** — ELSE-IF `(templateId equals "EKK0011D020")` (L3987)
> Instantiate and invoke the EKK0011D020 CBS message class.

| # | Type | Code |
|---|------|------|
| 1 | SET | `contents = new EKK0011D020CBSMsg().getContents()` |

**Block 6** — ELSE-IF `(templateId equals "EKK0011D020CBSMsg1List")` (L3991)
> Instantiate and invoke the EKK0011D020 list-type CBS message class.

| # | Type | Code |
|---|------|------|
| 1 | SET | `contents = new EKK0011D020CBSMsg1List().getContents()` |

**Block 7** — ELSE-IF `(templateId equals "EKK0021C060")` (L3995)
> Instantiate and invoke the EKK0021C060 CBS message class.

| # | Type | Code |
|---|------|------|
| 1 | SET | `contents = new EKK0021C060CBSMsg().getContents()` |

**Block 8** — ELSE-IF `(templateId equals "EKK0021C070")` (L3999)
> Instantiate and invoke the EKK0021C070 CBS message class.

| # | Type | Code |
|---|------|------|
| 1 | SET | `contents = new EKK0021C070CBSMsg().getContents()` |

**Block 9** — ELSE-IF `(templateId equals "EKK0251C050")` (L4003)
> Instantiate and invoke the EKK0251C050 CBS message class.

| # | Type | Code |
|---|------|------|
| 1 | SET | `contents = new EKK0251C050CBSMsg().getContents()` |

**Block 10** — ELSE-IF `(templateId equals "EKK0251C050CBSMsg1List")` (L4007)
> Instantiate and invoke the EKK0251C050 list-type CBS message class.

| # | Type | Code |
|---|------|------|
| 1 | SET | `contents = new EKK0251C050CBSMsg1List().getContents()` |

**Block 11** — ELSE-IF `(templateId equals "EKU0011A010")` (L4011)
> Instantiate and invoke the EKU0011A010 CBS message class (telephone service cancellation).

| # | Type | Code |
|---|------|------|
| 1 | SET | `contents = new EKU0011A010CBSMsg().getContents()` |

**Block 12** — ELSE-IF `(templateId equals "EKU0011A010CBSMsg1List")` (L4015)
> Instantiate and invoke the EKU0011A010 list-type CBS message class.

| # | Type | Code |
|---|------|------|
| 1 | SET | `contents = new EKU0011A010CBSMsg1List().getContents()` |

**Block 13** — ELSE-IF `(templateId equals "EKK1021B003")` (L4019)
> ANK-1306-00-00 (2013/01/24) Added branch. Instantiate and invoke the EKK1021B003 CBS message class.

| # | Type | Code |
|---|------|------|
| 1 | SET | `contents = new EKK1021B003CBSMsg().getContents()` |

**Block 14** — ELSE-IF `(templateId equals "EKK1021B003CBSMsg1List")` (L4023)
> ANK-1306-00-00 (2013/01/24) Added branch. Instantiate and invoke the EKK1021B003 list-type CBS message class.

| # | Type | Code |
|---|------|------|
| 1 | SET | `contents = new EKK1021B003CBSMsg1List().getContents()` |

**Block 15** — ELSE-IF `(templateId equals "EKK1021C010")` (L4027)
> ANK-1306-00-00 (2013/01/24) Added branch. Instantiate and invoke the EKK1021C010 CBS message class.

| # | Type | Code |
|---|------|------|
| 1 | SET | `contents = new EKK1021C010CBSMsg().getContents()` |

**Block 16** — ELSE-IF `(templateId equals "EKK0771A010")` (L4032)
> ANK-1421-00-00 (2013/02/07) Added branch. Instantiate and invoke the EKK0771A010 CBS message class.

| # | Type | Code |
|---|------|------|
| 1 | SET | `contents = new EKK0771A010CBSMsg().getContents()` |

**Block 17** — ELSE-IF `(templateId equals "EKK0771A010CBSMsg1List")` (L4036)
> ANK-1421-00-00 (2013/02/07) Added branch. Instantiate and invoke the EKK0771A010 list-type CBS message class.

| # | Type | Code |
|---|------|------|
| 1 | SET | `contents = new EKK0771A010CBSMsg1List().getContents()` |

**Block 18** — ELSE-IF `(templateId equals "EZM0121A010")` (L4040)
> ANK-4494-00-00 Step 2 quality improvement (2024/12/04, Hoshino) — Added branch. Instantiate and invoke the EZM0121A010 CBS message class (television/new codec service).

| # | Type | Code |
|---|------|------|
| 1 | SET | `contents = new EZM0121A010CBSMsg().getContents()` |

**Block 19** — ELSE-IF `(templateId equals "EZM0121A010CBSMsg1List")` (L4044)
> ANK-4494-00-00 Step 2 quality improvement (2024/12/04) — Added branch. Instantiate and invoke the EZM0121A010 list-type CBS message class.

| # | Type | Code |
|---|------|------|
| 1 | SET | `contents = new EZM0121A010CBSMsg1List().getContents()` |

**Block 20** — ELSE-IF `(templateId equals "EZM0121C010")` (L4048)
> ANK-4494-00-00 Step 2 quality improvement (2024/12/04) — Added branch. Instantiate and invoke the EZM0121C010 CBS message class (television service contract cancellation detail).

| # | Type | Code |
|---|------|------|
| 1 | SET | `contents = new EZM0121C010CBSMsg().getContents()` |

**Block 21** — RETURN (L4056)
> Return the resolved contents array. If no templateId matched any branch, `contents` remains `null`.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return contents;` // Returns the field layout Object[][] or null if templateId was unrecognized |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `templateId` | Parameter | Service interface ID (S/IF_ID) — uniquely identifies a CBS message template whose field layout should be returned |
| CBS | Acronym | Call Back Service — a framework pattern for service component data transfer objects in the K-Opticom system |
| S/IF | Acronym | Service Interface — the contract between the screen/presentation layer and the business logic layer |
| S/IF_ID | Acronym | Service Interface ID — the unique identifier for a specific service interface template |
| EKK | Prefix | General service contract cancellation — covers FTTH (fiber optic), telephone, and mail service line cancellations |
| EKU | Prefix | Telephone-related service contract cancellation — specific to telephone service contract operations |
| EZM | Prefix | Television/New Codec service — added in ANK-4494 Step 2 (Dec 2024) for two-way reverse phone support |
| CBSMsg | Suffix | Standard CBS message layout class — returns field definitions for a single-row/screen data structure |
| CBSMsg1List | Suffix | List-type CBS message layout class — returns field definitions for multi-row/table data structures |
| mappin* | Method pattern | Mapping methods that convert between CBS message objects and internal data structures (SC Code level) |
| editInMsg | Method | Edit incoming message — validates/transforms request data before processing |
| editResultRP | Method | Edit result response — transforms response data before returning to the caller |
| SC Code | Acronym | Service Component Code — identifies a specific business operation (e.g., `EKK0361A010SC`) |
| Object[][] | Return type | Two-dimensional array representing field metadata: each row is a column definition (key, label, type, constraints) |
| ANK | Prefix | Anki (ankō) — issue tracker prefix for K-Opticom change requests/bugs |
| ANK-4494 | Issue ID | Quality improvement initiative Step 2 for two-way reverse phone support (Dec 2024) |
| ANK-1306 | Issue ID | Change request from January 2013 — added EKK1021 service templates |
| ANK-1421 | Issue ID | Change request from February 2013 — added EKK0771 service templates |
| eo | Brand | "eo" — K-Opticom's broadband/fiber optic service brand |
| FTTH | Business term | Fiber To The Home — fiber-optic internet service |
| K-Opticom | Company | K-Opticom Co., Ltd. — Japanese telecommunications provider; the system owner |
