# Business Logic — KKW22501SFBean.listKoumokuIds() [55 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.KKW22501SF.KKW22501SFBean` |
| Layer | Controller / Web UI Bean |
| Module | `KKW22501SF` (Package: `eo.web.webview.KKW22501SF`) |

## 1. Role

### KKW22501SFBean.listKoumokuIds()

This method serves as the central item-name resolution dispatcher for the KKW22501SF screen, which handles data extraction/viewing operations (データ抽出照会). It provides a unified API that returns a list of item names (項目名) for display purposes — essentially mapping logical item identifiers to human-readable Japanese labels that the UI layer uses to render table columns, dropdown options, and search criteria panels.

The method implements the **routing/dispatch pattern**: when called with a null key, it returns the full set of service form fields for the main data extraction screen. When called with a key starting with "/" and length greater than 2, it delegates to the parent class's `listKoumokuIds` method, enabling shared/common view item resolution through inheritance. For specific data type view items, it dispatches to nested sub-beans (`KKW22501SF01DBean` and `KKW22501SF02DBean`) that manage the item lists for detailed sub-panels — such as data extraction condition settings, pre-change condition settings, and data list displays.

This is a **shared utility** called from multiple points within the same bean (as evidenced by the caller graph), and it plays a critical role in the screen's lifecycle: items returned by this method are used to populate search form fields, detail table columns, button enablement flags (search, registration, deletion), and validation error messages. Without this method, the UI cannot determine which fields to render or which beans to instantiate for nested data views.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["listKoumokuIds(key)"])
    COND_NULL{"key == null?"}
    COMMON_VIEW{"key starts with / AND length > 2?"}
    DISPATCH_1{"key == 'Data type view<br/>Condition list details'?"}
    DISPATCH_2{"key == 'Pre-change type view<br/>Condition list details'?"}
    DISPATCH_3{"key == 'Data list view<br/>Item details'?"}
    ELSE_EMPTY["return new ArrayList()"]

    START --> COND_NULL
    COND_NULL -->|true| BUILD_LIST["Build 15-field service form item list"]
    BUILD_LIST --> RETURN_LIST["return koumokuList"]
    COND_NULL -->|false| COMMON_VIEW
    COMMON_VIEW -->|true| SUPER_CALL["super.listKoumokuIds(key)"]
    SUPER_CALL --> RETURN_SUPER["return super result"]
    COMMON_VIEW -->|false| DISPATCH_1
    DISPATCH_1 -->|true| DELEGATE_1["KKW22501SF01DBean.listKoumokuIds()"]
    DELEGATE_1 --> RETURN_D1["return bean item list"]
    DISPATCH_1 -->|false| DISPATCH_2
    DISPATCH_2 -->|true| DELEGATE_2["KKW22501SF01DBean.listKoumokuIds()"]
    DELEGATE_2 --> RETURN_D2["return bean item list"]
    DISPATCH_2 -->|false| DISPATCH_3
    DISPATCH_3 -->|true| DELEGATE_3["KKW22501SF02DBean.listKoumokuIds()"]
    DELEGATE_3 --> RETURN_D3["return bean item list"]
    DISPATCH_3 -->|false| ELSE_EMPTY
```

**Processing branches summary:**

1. **Null key path** (L1225–1249): Returns a hardcoded list of 15 Japanese-labeled fields representing all items on the main data extraction service form. This is the default case that supplies the screen's core display items.
2. **Common view path** (L1252–1253): When the key starts with "/" and has length greater than 2, delegates to the parent class's `listKoumokuIds` method. This enables shared/common view resolution through the inheritance hierarchy.
3. **Data type view — condition list details** (L1258–1259): When the key matches the Japanese string for "Data extraction item setting condition one-list display (Event SP) details" (データ抽出項目設定条件一覧照会（イベントＳＰ）明細), dispatches to `KKW22501SF01DBean.listKoumokuIds()` to return the item list for the current extraction condition settings sub-panel.
4. **Data type view — pre-change condition details** (L1264–1265): When the key matches "Pre-change data extraction item setting condition one-list display (Event SP) details" (変更前データ抽出項目設定条件一覧照会（イベントＳＰ）明細), also dispatches to `KKW22501SF01DBean.listKoumokuIds()` — same sub-bean handles both current and pre-change condition views.
5. **Data type view — data list details** (L1270–1271): When the key matches "Data extraction item one-list display details" (データ抽出項目一覧照会明細), dispatches to `KKW22501SF02DBean.listKoumokuIds()` to return the item list for the data list display sub-panel.
6. **Fallback** (L1274): Returns an empty ArrayList for any unrecognized key, providing a safe no-op default.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `key` | `String` | Item name identifier that determines which set of display items to return. Acts as a routing key that selects between: (a) the main service form full item list (when null), (b) shared/common view items via parent class (when starts with "/" and length > 2), (c) specific data type view sub-panels (when matches a Japanese item name string), or (d) empty result (when unrecognized). |

**Instance fields / external state read:**
- `this` (implicit): Inherits from a parent bean class whose `listKoumokuIds(String)` method is called for common view keys. The parent class is not analyzed here but is part of the delegation chain.

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `KKW22501SFBean.listKoumokuIds` | KKW22501SFBean | - | Calls `listKoumokuIds` in `KKW22501SFBean` (self-reflection caller) |

### Method Call Analysis:

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `KKW22501SFBean.listKoumokuIds(String)` | KKW22501SFBean | - | Parent class — resolves shared/common view item names for keys prefixed with "/" |
| R | `KKW22501SF01DBean.listKoumokuIds()` | KKW22501SF01DBean | - | Returns item name list for data extraction condition settings sub-panel (current and pre-change views) |
| R | `KKW22501SF02DBean.listKoumokuIds()` | KKW22501SF02DBean | - | Returns item name list for data list display sub-panel |

**Classification rationale:** All three called methods are read (R) operations — they do not create, update, or delete any data. They are pure item-name enumeration methods used for UI rendering purposes. No database or entity interactions occur at this level.

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Screen:KKW22501SF | `KKW22501SFBean.listKoumokuIds()` (self-reflection caller) | `listKoumokuIds [R] KKW22501SFBean` |

**Notes:** The code graph identifies a single direct caller: `KKW22501SFBean.listKoumokuIds()` — a self-referential call within the same bean. This suggests the method is invoked by other methods within `KKW22501SFBean` to resolve item names for various screen sections. The full screen entry point class (`KKW22501SF`) is the controlling action/servlet that orchestrates the data extraction view page.

## 6. Per-Branch Detail Blocks

**Block 1** — IF `(key == null)` (L1225)

> When the key is null, this branch returns the complete set of 15 Japanese-labeled fields for the main data extraction service form. These represent all display items available on the primary screen.

| # | Type | Code |
|---|------|------|
| 1 | SET | `ArrayList<String> koumokuList = new ArrayList<String>();` // Create empty list for service form items |
| 2 | CALL | `koumokuList.add("代理店コード")` // Add "Agent code" (L1227) |
| 3 | CALL | `koumokuList.add("表示用データ抽出項目コード")` // Add "Display data extraction item code" (L1228) |
| 4 | CALL | `koumokuList.add("データ抽出項目コード（登録用）")` // Add "Data extraction item code (for registration)" (L1229) |
| 5 | CALL | `koumokuList.add("データ抽出項目名")` // Add "Data extraction item name" (L1230) |
| 6 | CALL | `koumokuList.add("受付開始年月日時分")` // Add "Reception start year/month/day/hour/minute" (L1231) |
| 7 | CALL | `koumokuList.add("受付終了年月日時分")` // Add "Reception end year/month/day/hour/minute" (L1232) |
| 8 | CALL | `koumokuList.add("データ抽出項目設定条件一覧照会（イベントＳＰ）明細")` // Add "Data extraction item setting condition one-list display (Event SP) details" (L1233) |
| 9 | CALL | `koumokuList.add("変更前データ抽出項目設定条件一覧照会（イベントＳＰ）明細")` // Add "Pre-change data extraction item setting condition one-list display (Event SP) details" (L1234) |
| 10 | CALL | `koumokuList.add("データ抽出項目一覧照会明細")` // Add "Data extraction item one-list display details" (L1235) |
| 11 | CALL | `koumokuList.add("検索フラグ")` // Add "Search flag" (L1236) |
| 12 | CALL | `koumokuList.add("削除フラグ")` // Add "Deletion flag" (L1237) |
| 13 | CALL | `koumokuList.add("リセットフラグ")` // Add "Reset flag" (L1238) |
| 14 | CALL | `koumokuList.add("明細表示フラグ")` // Add "Detail display flag" (L1239) |
| 15 | CALL | `koumokuList.add("検索エラーフラグ（０件）")` // Add "Search error flag (zero items)" (L1240) |
| 16 | CALL | `koumokuList.add("処理区分")` // Add "Processing classification" (L1241) |
| 17 | CALL | `koumokuList.add("検索ボタン使用可否")` // Add "Search button use eligibility" (L1242) |
| 18 | CALL | `koumokuList.add("登録ボタン使用可否")` // Add "Registration button use eligibility" (L1243) |
| 19 | CALL | `koumokuList.add("削除ボタン使用可否")` // Add "Deletion button use eligibility" (L1244) |
| 20 | RETURN | `return koumokuList;` // Return the 15-field item list (L1249) |

**Block 2** — ELSE IF `(key.indexOf("/") == 0 && key.length() > 2)` (L1252)

> When the key starts with "/" and has more than 2 characters, this is a common view key. The method delegates to the parent class's `listKoumokuIds` method to resolve the item list, enabling shared/inherited view handling.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `super.listKoumokuIds(key)` // Delegate to parent class for common view item resolution (L1253) |
| 2 | RETURN | `return super.listKoumokuIds(key);` // Return parent class result (L1253) |

**Block 3** — ELSE IF `(key.equals("データ抽出項目設定条件一覧照会（イベントＳＰ）明細"))` (L1258)

> When the key matches the item name for "Data extraction item setting condition one-list display (Event SP) details", the method dispatches to the nested sub-bean `KKW22501SF01DBean` to return the item list for the current extraction condition settings sub-panel. The item ID for this view is `dchskm_sete_jkn_list` (データ抽出項目設定条件一覧照会（イベントＳＰ）明細).

| # | Type | Code |
|---|------|------|
| 1 | CALL | `KKW22501SF01DBean.listKoumokuIds()` // Delegate to sub-bean for current condition settings view (L1259) |
| 2 | RETURN | `return KKW22501SF01DBean.listKoumokuIds();` // Return sub-bean item list (L1259) |

**Block 4** — ELSE IF `(key.equals("変更前データ抽出項目設定条件一覧照会（イベントＳＰ）明細"))` (L1264)

> When the key matches "Pre-change data extraction item setting condition one-list display (Event SP) details", the method also dispatches to `KKW22501SF01DBean.listKoumokuIds()`. Same sub-bean handles both current and pre-change condition views. The item ID for this view is `bf_dchskm_sete_jkn_list` (変更前データ抽出項目設定条件一覧照会（イベントＳＰ）明細).

| # | Type | Code |
|---|------|------|
| 1 | CALL | `KKW22501SF01DBean.listKoumokuIds()` // Delegate to sub-bean for pre-change condition settings view (L1265) |
| 2 | RETURN | `return KKW22501SF01DBean.listKoumokuIds();` // Return sub-bean item list (L1265) |

**Block 5** — ELSE IF `(key.equals("データ抽出項目一覧照会明細"))` (L1270)

> When the key matches "Data extraction item one-list display details", the method dispatches to `KKW22501SF02DBean.listKoumokuIds()` to return the item list for the data list display sub-panel. The item ID for this view is `dchskm_list` (データ抽出項目一覧照会明細).

| # | Type | Code |
|---|------|------|
| 1 | CALL | `KKW22501SF02DBean.listKoumokuIds()` // Delegate to sub-bean for data list display view (L1271) |
| 2 | RETURN | `return KKW22501SF02DBean.listKoumokuIds();` // Return sub-bean item list (L1271) |

**Block 6** — ELSE / FALLBACK (L1274)

> When none of the above conditions match, the method returns an empty ArrayList. This provides a safe no-op default for any unrecognized or unexpected key values.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return new ArrayList<String>();` // Return empty list for unrecognized key (L1274) |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| 代理店コード | Field | Agent code — the unique identifier for a sales agent or franchise partner in the service contract system |
| 表示用データ抽出項目コード | Field | Display data extraction item code — the item code used for display purposes in data extraction queries |
| データ抽出項目コード（登録用） | Field | Data extraction item code (for registration) — the item code used when registering new extraction criteria |
| データ抽出項目名 | Field | Data extraction item name — human-readable name of a data extraction field |
| 受付開始年月日時分 | Field | Reception start year/month/day/hour/minute — the start timestamp for accepting service orders or requests |
| 受付終了年月日時分 | Field | Reception end year/month/day/hour/minute — the end timestamp for accepting service orders or requests |
| データ抽出項目設定条件一覧照会（イベントＳＰ）明細 | Field | Data extraction item setting condition one-list display (Event SP) details — the item name for the sub-panel showing current extraction condition settings; item ID: `dchskm_sete_jkn_list` |
| 変更前データ抽出項目設定条件一覧照会（イベントＳＰ）明細 | Field | Pre-change data extraction item setting condition one-list display (Event SP) details — the item name for the sub-panel showing pre-change extraction condition settings; item ID: `bf_dchskm_sete_jkn_list` |
| データ抽出項目一覧照会明細 | Field | Data extraction item one-list display details — the item name for the data list display sub-panel; item ID: `dchskm_list` |
| 検索フラグ | Field | Search flag — a boolean indicator controlling whether search functionality is active |
| 削除フラグ | Field | Deletion flag — a boolean indicator controlling whether deletion functionality is active |
| リセットフラグ | Field | Reset flag — a boolean indicator controlling whether form reset functionality is active |
| 明細表示フラグ | Field | Detail display flag — a boolean indicator controlling whether detail row display is active |
| 検索エラーフラグ（０件） | Field | Search error flag (zero items) — a boolean indicator set when a search returns zero results, signaling a potential issue |
| 処理区分 | Field | Processing classification — a code indicating the type of processing operation (e.g., new registration, modification, deletion) |
| 検索ボタン使用可否 | Field | Search button use eligibility — whether the search button is enabled or disabled |
| 登録ボタン使用可否 | Field | Registration button use eligibility — whether the registration button is enabled or disabled |
| 削除ボタン使用可否 | Field | Deletion button use eligibility — whether the deletion button is enabled or disabled |
| KKW22501SF | Module | Data extraction/viewing screen module — the screen controller that manages the data extraction inquiry UI |
| KKW22501SFBean | Class | Screen bean for KKW22501SF — holds screen state and provides item name resolution for the data extraction view |
| KKW22501SF01DBean | Class | Detail sub-bean for current and pre-change condition settings — nested bean managing the extraction condition settings sub-panels |
| KKW22501SF02DBean | Class | Detail sub-bean for data list display — nested bean managing the data list view sub-panel |
| データ抽出照会 | Domain term | Data extraction inquiry — the business operation of querying and viewing extracted service/order data |
| 項目名 | Domain term | Item name — Japanese-labeled display names for fields used in the UI to render table columns, dropdowns, and form labels |
| 共通情報ビュー | Domain term | Common information view — a shared view category resolved through the parent class, indicated by keys starting with "/" |
