# Business Logic — KKW00801SF02DBean.loadModelData() [39 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.KKW00801SF.KKW00801SF02DBean` |
| Layer | Web Model / Data Bean (Presentation Layer — webview bean for view-data binding) |
| Module | `KKW00801SF` (Package: `eo.web.webview.KKW00801SF`) |

## 1. Role

### KKW00801SF02DBean.loadModelData()

This method acts as a **view-model data accessor** within the KKW00801SF screen module. It provides a unified keyed lookup mechanism that retrieves data values for UI-bound properties, primarily supporting **reusable dropdown (pulldown) option components** in the enterprise's telecom service management screens.

The method implements the **routing/dispatch design pattern** — it receives a key (item identifier) and subkey (property accessor type), then dispatches to the appropriate getter based on the key's value. Specifically, it handles two data types: **"pulldown option values"** (プルダウンオプション値) which maps to the `pd_id` series of getters, and **"pulldown option names"** (プルダウンオプション名) which maps to the `pd_op_nm` series of getters.

Its **role in the larger system** is to serve as the read endpoint of the view-model binding contract. When a screen needs to render a dropdown list's option data (for items like "Mail MVNO Capacity Selection List" and "WirusCheck Selection List"), the screen's container bean (`KKW00801SF01DBean`) creates `KKW00801SF02DBean` instances as list elements, and then calls `loadModelData` on each instance to retrieve the option's display value, enabled state, or current state. The method is a shared utility pattern — the same bean class is instantiated per-list-item and queried by the parent screen.

If either parameter is null, the method returns null early (guard clause). If no matching property key is found, it also returns null.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["loadModelData key, subkey"])
    NULL_CHECK{"key or subkey is null?"}
    PD_ID_CHECK{"key equals
'プルダウンオプション値'?"}
    SUBVAL{"subkey equals
'value'?"}
    SUBENB{"subkey equals
'enable'?"}
    SUBST{"subkey equals
'state'?"}
    PD_OP_NM{"key equals
'プルダウンオプション名'?"}
    PD_ID_VAL["return getPd_id_value()"]
    PD_ID_ENB["return getPd_id_enabled()"]
    PD_ID_ST["return getPd_id_state()"]
    PD_OP_VAL["return getPd_op_nm_value()"]
    PD_OP_ENB["return getPd_op_nm_enabled()"]
    PD_OP_ST["return getPd_op_nm_state()"]
    MISS["return null"]

    START --> NULL_CHECK
    NULL_CHECK -->|Yes| MISS
    NULL_CHECK -->|No| PD_ID_CHECK
    PD_ID_CHECK -->|Yes| SUBVAL
    PD_ID_CHECK -->|No| PD_OP_NM
    SUBVAL -->|Yes| PD_ID_VAL
    SUBVAL -->|No| SUBENB
    SUBENB -->|Yes| PD_ID_ENB
    SUBENB -->|No| SUBST
    SUBST -->|Yes| PD_ID_ST
    SUBST -->|No| MISS
    PD_OP_NM -->|Yes| SUBVAL2["subkey equals 'value'?"]
    PD_OP_NM -->|No| MISS
    SUBVAL2 -->|Yes| PD_OP_VAL
    SUBVAL2 -->|No| SUBENB2["subkey equals 'enable'?"]
    SUBENB2 -->|Yes| PD_OP_ENB
    SUBENB2 -->|No| SUBST2["subkey equals 'state'?"]
    SUBST2 -->|Yes| PD_OP_ST
    SUBST2 -->|No| MISS
    PD_ID_VAL --> END(["Return"])
    PD_ID_ENB --> END
    PD_ID_ST --> END
    PD_OP_VAL --> END
    PD_OP_ENB --> END
    PD_OP_ST --> END
    MISS --> END
```

**Branch description:**
- **Null guard (L146-148):** If `key` or `subkey` is null, return null immediately. This is the Japanese comment's "key, subkey that are null, return null" (key,subkeyがnullの場合、nullを返す).
- **Sep lookup (L150):** Computes `separaterPoint = key.indexOf("/")` — though this result is stored and never used in this overridden method (it appears to be dead code or scaffolding for future extensibility).
- **Branch 1 — "pulldown option values" key (L153-166):** When key equals the constant `KKW00801SFConst.PD_ID_02 = "プルダウンオプション値"` (reusable dropdown option value), dispatch on subkey case-insensitively: `"value"` returns `getPd_id_value()`, `"enable"` returns `getPd_id_enabled()`, `"state"` returns `getPd_id_state()`.
- **Branch 2 — "pulldown option names" key (L169-180):** When key equals `KKW00801SFConst.PD_OP_NM_02 = "プルダウンオプション名"` (reusable dropdown option name), dispatch on subkey case-insensitively: `"value"` returns `getPd_op_nm_value()`, `"enable"` returns `getPd_op_nm_enabled()`, `"state"` returns `getPd_op_nm_state()`.
- **Fallback (L183):** If no key matches, return null — the Japanese comment: "no matching property found, return null" (条件に一致するプロパティが存在しない場合は、nullを返す).

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `key` | `String` | The business item identifier that specifies which data property to retrieve. Valid values are the Japanese strings `"プルダウンオプション値"` (PD_ID_02 — pulldown option value data type) and `"プルダウンオプション名"` (PD_OP_NM_02 — pulldown option name data type). If null, the method returns null immediately as a guard clause. In the parent `KKW00801SFBean.loadModelData`, keys can also contain "/" delimiters for index-based list navigation or "//" prefixes for common-info-view rendering, but this override in `KKW00801SF02DBean` only handles the two direct pulldown keys. |
| 2 | `subkey` | `String` | The property accessor specifier within a given data type. Case-insensitive matching is used. Valid values are `"value"` (returns the actual data value), `"enable"` (returns the enabled/disabled state of the item), and `"state"` (returns the current status/state of the item). If null, the parent class normalizes it to an empty string, but in this override a null `subkey` causes an early null return. |

**Instance fields read by this method:**

| Field | Type | Business Description |
|-------|------|---------------------|
| (none directly referenced) | — | `getPd_id_value()`, `getPd_id_enabled()`, `getPd_id_state()`, `getPd_op_nm_value()`, `getPd_op_nm_enabled()`, `getPd_op_nm_state()` are getter methods that access private fields defined in this class or its parent (`X33CBaseBean`). The specific backing fields (`pd_id_value`, `pd_id_enabled`, `pd_id_state`, `pd_op_nm_value`, `pd_op_nm_enabled`, `pd_op_nm_state`) hold the UI-bound pulldown option data per list item. |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `KKW00801SF02DBean.getPd_id_value` | KKW00801SF02DBean | - | Reads the pulldown option value — returns the actual data value stored in the `pd_id_value` field for the current list item |
| R | `KKW00801SF02DBean.getPd_id_enabled` | KKW00801SF02DBean | - | Reads the pulldown enabled flag — returns whether this option is currently enabled/disabled (`pd_id_enabled` field) |
| R | `KKW00801SF02DBean.getPd_id_state` | KKW00801SF02DBean | - | Reads the pulldown option state — returns the status/state indicator (`pd_id_state` field) |
| R | `KKW00801SF02DBean.getPd_op_nm_value` | KKW00801SF02DBean | - | Reads the pulldown option name value — returns the display name stored in `pd_op_nm_value` field |
| R | `KKW00801SF02DBean.getPd_op_nm_enabled` | KKW00801SF02DBean | - | Reads the pulldown option name enabled flag — returns whether this option name item is enabled (`pd_op_nm_enabled` field) |
| R | `KKW00801SF02DBean.getPd_op_nm_state` | KKW00801SF02DBean | - | Reads the pulldown option name state — returns the state of this option name item (`pd_op_nm_state` field) |

All operations are **Read (R)** — this method does not perform any Create, Update, or Delete operations. It is a pure accessor that retrieves UI-bound model data from instance fields.

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Screen:KKW00801SF | `KKW00801SF01DBean.makeElement` → `new KKW00801SF02DBean()` → `KKW00801SFBean.loadModelData` → `KKW00801SF02DBean.loadModelData` | `getPd_id_value [R] -`, `getPd_op_nm_value [R] -` |

**Caller details:**

- **`KKW00801SFBean` (L631-632, L642):** The parent screen bean has its own `loadModelData` methods that delegate to the sub-bean's `loadModelData(String, String)` when the key matches a data-type bean item. The parent's 3-arg version delegates to the 2-arg version: `return loadModelData(key, subkey)`.

- **`KKW00801SF01DBean` (L1310, L1321):** In `makeElement`, when the key is `"メールMVNO容量選択リスト"` (Mail MVNO Capacity Selection List) or `"ウィルスチェック選択リスト"` (WirusCheck Selection List), a new `KKW00801SF02DBean` instance is created and added to the respective `X33VDataTypeList`. Later, the screen reads data from these list items by calling `loadModelData` on each element via the parent bean's dispatch mechanism.

The call chain flows from the screen (`KKW00801SF01DBean`) through the container bean (`KKW00801SFBean`) to the data-type bean (`KKW00801SF02DBean.loadModelData`), which returns simple field values — no SC/CBS or database layer is involved.

## 6. Per-Branch Detail Blocks

**Block 1** — [IF] `(key == null || subkey == null)` (L146-148)

> Guard clause — if either parameter is null, return null. Japanese comment: "key, subkey that are null, return null" (key,subkeyがnullの場合、nullを返す).

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return null;` // early exit when key or subkey is null |

**Block 2** — [SET] (L150)

> Computes separator position — stores result but this is dead code (never used in this override). The result is assigned to `separaterPoint` but the value is not consumed.

| # | Type | Code |
|---|------|------|
| 1 | SET | `int separaterPoint = key.indexOf("/");` // find first '/' separator (unused in this method) |

**Block 3** — [IF] `(key.equals("プルダウンオプション値"))` [PD_ID_02="プルダウンオプション値"] (L153-166)

> Handles the "pulldown option value" data type. Dispatches to one of three getters based on subkey (case-insensitive). Japanese comment for value: "retrieve data" (データを取得). Enable comment: "when subkey is 'enable', return the getter value for pd_id_enable" (subkeyが"enable"の場合、pd_id_enableのgetterの戻り値を返す). State comment: "when subkey is 'state', return the status" (subkeyが"state"の場合、ステータスを返す).

| # | Type | Code |
|---|------|------|
| 1 | IF | `subkey.equalsIgnoreCase("value")` |
| 2 | RETURN | `return getPd_id_value();` // return the pulldown option data value |
| 3 | ELSE IF | `subkey.equalsIgnoreCase("enable")` |
| 4 | RETURN | `return getPd_id_enabled();` // return the pulldown option enabled flag |
| 5 | ELSE IF | `subkey.equalsIgnoreCase("state")` |
| 6 | RETURN | `return getPd_id_state();` // return the pulldown option status |

**Block 3.1** — [nested IF] `(subkey.equalsIgnoreCase("value"))` (L154-156)

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return getPd_id_value();` // retrieves the actual option value |

**Block 3.2** — [nested ELSE IF] `(subkey.equalsIgnoreCase("enable"))` [enable="enable"] (L157-159)

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return getPd_id_enabled();` // retrieves the enabled state flag |

**Block 3.3** — [nested ELSE IF] `(subkey.equalsIgnoreCase("state"))` [state="state"] (L160-162)

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return getPd_id_state();` // retrieves the status indicator |

**Block 4** — [ELSE IF] `(key.equals("プルダウンオプション名"))` [PD_OP_NM_02="プルダウンオプション名"] (L169-180)

> Handles the "pulldown option name" data type. Same dispatch pattern as Block 3 but for option name properties. Japanese comment for enable: "when subkey is 'enable', return the getter value for pd_op_nm_enable" (subkeyが"enable"の場合、pd_op_nm_enableのgetterの戻り値を返す). State comment: "when subkey is 'state', return the status" (subkeyが"state"の場合、ステータスを返す).

| # | Type | Code |
|---|------|------|
| 1 | IF | `subkey.equalsIgnoreCase("value")` |
| 2 | RETURN | `return getPd_op_nm_value();` // return the pulldown option name value |
| 3 | ELSE IF | `subkey.equalsIgnoreCase("enable")` |
| 4 | RETURN | `return getPd_op_nm_enabled();` // return the pulldown option name enabled flag |
| 5 | ELSE IF | `subkey.equalsIgnoreCase("state")` |
| 6 | RETURN | `return getPd_op_nm_state();` // return the pulldown option name status |

**Block 4.1** — [nested IF] `(subkey.equalsIgnoreCase("value"))` (L170-172)

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return getPd_op_nm_value();` // retrieves the display name value |

**Block 4.2** — [nested ELSE IF] `(subkey.equalsIgnoreCase("enable"))` [enable="enable"] (L173-175)

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return getPd_op_nm_enabled();` // retrieves the enabled flag |

**Block 4.3** — [nested ELSE IF] `(subkey.equalsIgnoreCase("state"))` [state="state"] (L176-178)

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return getPd_op_nm_state();` // retrieves the status |

**Block 5** — [ELSE/FALLBACK] (L183)

> Default return — no matching key found. Japanese comment: "no matching property exists, return null" (条件に一致するプロパティが存在しない場合は、nullを返す).

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return null;` // no matching key found |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `pd_id` | Field prefix | Pulldown option Identifier — internal field prefix for pulldown option data values (option value, enabled state, status) |
| `pd_op_nm` | Field prefix | Pulldown option Name — internal field prefix for pulldown option display names |
| `pd_id_value` | Field | Pulldown option value — stores the actual data value of a dropdown option in the list |
| `pd_id_enabled` | Field | Pulldown option enabled flag — indicates whether the option is currently active/enabled for selection |
| `pd_id_state` | Field | Pulldown option state — indicates the current status of the option item |
| `pd_op_nm_value` | Field | Pulldown option name value — stores the display label/name shown to users in the dropdown |
| `pd_op_nm_enabled` | Field | Pulldown option name enabled flag — indicates whether the option name entry is active |
| `pd_op_nm_state` | Field | Pulldown option name state — indicates the current state of the option name entry |
| `KKW00801SFConst.PD_ID_02` | Constant | `"プルダウンオプション値"` (Pulldown Option Value) — the key string used to identify the pulldown option data type in the dispatch logic |
| `KKW00801SFConst.PD_OP_NM_02` | Constant | `"プルダウンオプション名"` (Pulldown Option Name) — the key string used to identify the pulldown option name data type in the dispatch logic |
| プルダウンオプション値 | Japanese string | Pulldown Option Value — a data type key that routes to the `pd_id` series of getters (value, enable, state). Represents the raw data of a dropdown list item. |
| プルダウンオプション名 | Japanese string | Pulldown Option Name — a data type key that routes to the `pd_op_nm` series of getters (value, enable, state). Represents the display name of a dropdown list item. |
| X33VDataTypeBeanInterface | Interface | The base interface for data-type beans that can be placed inside a list for repeating view items. Each list element implements this interface and provides its own `loadModelData` dispatch. |
| X33VDataTypeList | Class | A typed list container for data-type bean elements, used to hold repeating view items (e.g., multiple dropdown options) on a screen. |
| Mail MVNO Capacity Selection List | Business term | 一覧表示用データ — a repeating dropdown list item where users select Mail MVNO (Mobile Virtual Network Operator) capacity options |
| WirusCheck Selection List | Business term | Anti-virus check selection — a repeating dropdown list item where users select whether to enable virus check services |
| subkey | Parameter | Property accessor specifier — case-insensitive key that determines which property of the data type to return (`"value"`, `"enable"`, or `"state"`) |
| key | Parameter | Item identifier — business-level key that determines which data type's properties to access |
