# Business Logic — KKW01601SF03DBean.clearListDataInstance() [18 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.KKA15301SF.KKW01601SF03DBean` |
| Layer | Web / View Data Bean (Data Transfer Layer) |
| Module | `KKA15301SF` (Package: `eo.web.webview.KKA15301SF`) |

## 1. Role

### KKW01601SF03DBean.clearListDataInstance()

This method is a **list data clearing utility** within a view data bean used by the K-Opticom telecommunications web platform. Its purpose is to selectively clear (empty) one of three internal `X33VDataTypeList` instance fields based on a human-readable Japanese key string passed as the parameter. It acts as a **dispatch/routing** mechanism: given a label identifying a list item (e.g., "Migration Reason Code", "Option Service Contract Number", or "Simultaneous Application Service Contract Number"), it clears the corresponding list in a single operation.

The method is part of the view-layer data binding infrastructure — specifically, it works with the `X33VDataTypeList` type from the X33 web framework, which manages tabular data for JSP-based screens. The Japanese key strings serve as the presentation-layer identifiers that map to backing bean properties. This pattern allows screen controllers to invoke `clearListDataInstance(key)` without needing to know the internal field name, decoupling the view layer from the bean's internal structure.

The three clearable lists represent data for: (1) migration/dispatch reason codes (`hktgi_ido_rsn_cd`), (2) option service contract numbers (`hktgi_op_svc_kei_no`), and (3) simultaneous application service contract numbers (`hktgi_mskm_svc_kei_no`). The method performs no I/O, no database access, and no business logic beyond selection and clearing.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["clearListDataInstance(String key)"])

    START --> COND1["Is key != null?"]

    COND1 -- Yes --> COND2["key == \"異動理由コード\"
(Migration Reason Code)"]
    COND1 -- No --> END_NODE(["Return / No-op"])

    COND2 -- Yes --> CLEAR1["hktgi_ido_rsn_cd_list.clear()"]
    COND2 -- No --> COND3["key == \"オプションサービス契約番号\"
(Option Service Contract Number)"]

    COND3 -- Yes --> CLEAR2["hktgi_op_svc_kei_no_list.clear()"]
    COND3 -- No --> COND4["key == \"同時申込サービス契約番号\"
(Simultaneous Application Service Contract Number)"]

    COND4 -- Yes --> CLEAR3["hktgi_mskm_svc_kei_no_list.clear()"]
    COND4 -- No --> END_NODE

    CLEAR1 --> END_NODE
    CLEAR2 --> END_NODE
    CLEAR3 --> END_NODE
```

**Note:** No pre-extracted constants are referenced in this method. The Japanese string literals used as comparison keys are hardcoded directly in the source. These represent presentation-layer item identifiers:

| Hardcoded Key | Japanese | English Meaning |
|---|---|---|
| `"異動理由コード"` | 異動理由コード | Migration Reason Code |
| `"オプションサービス契約番号"` | オプションサービス契約番号 | Option Service Contract Number |
| `"同時申込サービス契約番号"` | 同時申込サービス契約番号 | Simultaneous Application Service Contract Number |

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `key` | `String` | A human-readable Japanese label that identifies which list item's data should be cleared. This string corresponds to a presentation-layer field name used by the UI. It maps to one of three internal `X33VDataTypeList` fields: `"異動理由コード"` (Migration Reason Code), `"オプションサービス契約番号"` (Option Service Contract Number), or `"同時申込サービス契約番号"` (Simultaneous Application Service Contract Number). If the value does not match any of these three literals, the method performs no operation. |

**Instance fields read by this method:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `hktgi_ido_rsn_cd_list` | `X33VDataTypeList` | List of migration/reason codes — stores reason codes for service line item changes (異動 reasons) |
| `hktgi_op_svc_kei_no_list` | `X33VDataTypeList` | List of option service contract numbers — stores contract numbers for option services |
| `hktgi_mskm_svc_kei_no_list` | `X33VDataTypeList` | List of simultaneous application service contract numbers — stores contract numbers for services applied for simultaneously |

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `X33VDataTypeList.clear` | N/A | In-memory list data | Calls `clear()` on one of three `X33VDataTypeList` fields to empty its contents. No database or I/O involvement. |

**Analysis:** This method performs no Create, Read, Update, or Delete operations against a database or external service. It solely operates on in-memory data structures (`X33VDataTypeList`), which are view-layer data transfer objects managed by the X33 web framework. The `clear()` operation resets the list to an empty state, effectively clearing the UI-bound data for the specified item.

## 5. Dependency Trace

The `clearListDataInstance()` method is defined as `public` in the bean class, making it callable by any code that holds a reference to a `KKW01601SF03DBean` instance. A codebase-wide search for invocations of `clearListDataInstance()` found no direct callers referencing `KKW01601SF03DBean` specifically within the search scope. The method follows a pattern where other bean subclasses (e.g., `FUW009xxSFBean` classes) implement their own `clearListDataInstance` and call `super.clearListDataInstance(key)` to delegate the clearing to the parent bean's implementation.

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Screen:KKA15301SF (inferred) | `KKA15301SFBean` -> `KKW01601SF03DBean.clearListDataInstance(String key)` | `X33VDataTypeList.clear()` |

## 6. Per-Branch Detail Blocks

**Block 1** — IF `(key != null)` (L1535)

> Guard clause: only processes if the key parameter is not null.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `key.equals("異動理由コード")` // Check if key matches Migration Reason Code label |
| 2 | EXEC | `key.equals("オプションサービス契約番号")` // Check if key matches Option Service Contract Number label |
| 3 | EXEC | `key.equals("同時申込サービス契約番号")` // Check if key matches Simultaneous Application Service Contract Number label |

**Block 1.1** — IF-ELSE-IF `(key.equals("異動理由コード"))` [key = "異動理由コード"] (L1536)

> If the key matches the migration reason code label, clear the reason code list.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `hktgi_ido_rsn_cd_list.clear()` // Clear the migration reason code list (異動理由コード) |

**Block 1.2** — ELSE-IF `(key.equals("オプションサービス契約番号"))` [key = "オプションサービス契約番号"] (L1539)

> If the key matches the option service contract number label, clear the option service contract number list.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `hktgi_op_svc_kei_no_list.clear()` // Clear the option service contract number list (オプションサービス契約番号) |

**Block 1.3** — ELSE-IF `(key.equals("同時申込サービス契約番号"))` [key = "同時申込サービス契約番号"] (L1542)

> If the key matches the simultaneous application service contract number label, clear the simultaneous application list.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `hktgi_mskm_svc_kei_no_list.clear()` // Clear the simultaneous application service contract number list (同時申込サービス契約番号) |

**Block 1.4** — ELSE (implicit: key not null but no match) (L1528–1545)

> If key is not null but does not match any of the three known labels, no operation is performed. The method silently returns.

| # | Type | Code |
|---|------|------|
| 1 | — | (No operation — fall through to return) |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `hktgi` | Abbreviation | Holding — refers to "Holding Information" or service line item data in the K-Opticom billing/ordering system |
| `ido` | Field | 異動 (Idou) — Migration / Change; refers to changes or transfers in service records |
| `ido_rsn_cd` | Field | 異動理由コード — Migration/Change Reason Code; the code explaining why a service record was changed or transferred |
| `op_svc_kei_no` | Field | オプションサービス契約番号 — Option Service Contract Number; identifies a subscribed option service |
| `mskm` | Field | 同時申込 (Douji Mourou) — Simultaneous Application; services applied for together in a single transaction |
| `mskm_svc_kei_no` | Field | 同時申込サービス契約番号 — Simultaneous Application Service Contract Number; contract number for services bundled in a simultaneous application |
| `X33VDataTypeList` | Type | X33 Framework data type — a view-layer list data structure used for binding tabular data in JSP screens |
| `X33VDataTypeBeanInterface` | Interface | X33 Framework interface — marks a bean as supporting view data type operations |
| `X33VListedBeanInterface` | Interface | X33 Framework interface — marks a bean as supporting listed/tabular data operations |
| K-Opticom | Business term | K-Opticom — Japanese telecommunications provider offering fiber internet, phone, and other services |
| 異動理由コード | Japanese | Migration/Change Reason Code — the reason classification for a service record modification |
| オプションサービス | Japanese | Option Service — additional services subscribed alongside a primary service contract |
| 同時申込 | Japanese | Simultaneous Application — multiple service subscriptions processed in a single application transaction |
| `KKW01601SF03DBean` | Class | View data bean — a data transfer object in the KKA15301SF module for managing service line item data in the web UI |
