# Business Logic — KKW00128SF01DBean.clearListDataInstance() [14 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.KKA16601SF.KKW00128SF01DBean` |
| Layer | Webview / Data Bean (View Layer — sits between screen controllers and business components) |
| Module | `KKA16601SF` (Package: `eo.web.webview.KKA16601SF`) |

## 1. Role

### KKW00128SF01DBean.clearListDataInstance()

This method performs selective data cleansing of list-bound fields on a screen data bean, clearing (removing all elements from) specific `X33VDataTypeList` collections based on a business-level key identifier. It implements a **dispatch-by-key** pattern: the incoming `key` string (which corresponds to a displayed field label in Japanese) is matched against known field identifiers, and the matching list is cleared. Its role in the larger system is that of a **shared utility** used by multiple screen form beans (subclasses of this bean) during screen reset, initialization, and data refresh operations — specifically when a screen needs to discard previously captured user input for certain data entry rows. The method is designed to be inherited by screen-specific bean subclasses (e.g., `FUW00912SFBean`, `FUW00964SFBean`, etc.), which call `super.clearListDataInstance(key)` as part of their own `clearListDataInstance` override chain. Only two list fields — the change reason code list and the option service contract number list — are cleared by this base implementation; other list data (such as customer contract history lists or item detail lists) are handled by subclasses or other methods.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["clearListDataInstance params"])
    CHECK_NULL{key is not null?}
    CHECK_RSN{key equals 異動理由コード}
    CLEAR_RSN["ido_rsn_cd_list.clear"]
    CHECK_SVC{key equals オプションサービス契約番号}
    CLEAR_SVC["op_svc_kei_no_list.clear"]
    SKIP(["Skip - no matching key"])
    END(["Return void"])

    START --> CHECK_NULL
    CHECK_NULL --> false --> SKIP
    CHECK_NULL --> true --> CHECK_RSN
    CHECK_RSN --> true --> CLEAR_RSN
    CHECK_RSN --> false --> CHECK_SVC
    CHECK_SVC --> true --> CLEAR_SVC
    CHECK_SVC --> false --> SKIP
    CLEAR_RSN --> END
    CLEAR_SVC --> END
    SKIP --> END
```

**Processing flow:**

1. **Null guard** — If `key` is `null`, the method returns immediately without any processing.
2. **Branch 1: Change Reason Code field** — If `key` equals the Japanese string `異動理由コード` (Change Reason Code, field ID: `ido_rsn_cd`), the method clears the `ido_rsn_cd_list` collection, removing all change reason code entries.
3. **Branch 2: Option Service Contract Number field** — If `key` equals the Japanese string `オプションサービス契約番号` (Option Service Contract Number, field ID: `op_svc_kei_no`), the method clears the `op_svc_kei_no_list` collection, removing all option service contract number entries.
4. **No match** — If `key` is not `null` but does not match any known field identifier, the method returns without clearing any list.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `key` | `String` | A Japanese-language field label that identifies which list data should be cleared. This key corresponds to a UI display label on the screen. Currently supports two values: `異動理由コード` (Change Reason Code — clears the list of reason codes for status changes/transfers) and `オプションサービス契約番号` (Option Service Contract Number — clears the list of option service contract numbers). Values are compared via exact `equals()` matching; any unrecognized key is silently ignored. |

**Instance fields read by this method:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `ido_rsn_cd_list` | `X33VDataTypeList` | Change reason code list — stores a list of `X33VDataTypeStringBean` elements, each representing a reason code for a change/movement (異動理由) in the customer service workflow. |
| `op_svc_kei_no_list` | `X33VDataTypeList` | Option service contract number list — stores a list of `X33VDataTypeStringBean` elements, each representing an option service contract number for optional add-on services. |

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `X33VDataTypeList.clear` | - | - | Calls `clear()` on `ido_rsn_cd_list` to remove all elements from the change reason code list |
| - | `X33VDataTypeList.clear` | - | - | Calls `clear()` on `op_svc_kei_no_list` to remove all elements from the option service contract number list |

**Analysis:** This method performs **no database or external service operations**. It only invokes the `clear()` method on in-memory `X33VDataTypeList` instances, which are collection-type data beans. The operation is purely client-side data reset with no persistence impact.

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Screen:FUW00901SF | `FUW00901SFBean.clearListDataInstance(key)` → `super.clearListDataInstance(key)` → `KKW00128SF01DBean.clearListDataInstance` | `X33VDataTypeList.clear` (in-memory only) |
| 2 | Screen:FUW00902SF | `FUW00902SFBean.clearListDataInstance(key)` → `super.clearListDataInstance(key)` → `KKW00128SF01DBean.clearListDataInstance` | `X33VDataTypeList.clear` (in-memory only) |
| 3 | Screen:FUW00903SF | `FUW00903SFBean.clearListDataInstance(key)` → `super.clearListDataInstance(key)` → `KKW00128SF01DBean.clearListDataInstance` | `X33VDataTypeList.clear` (in-memory only) |
| 4 | Screen:FUW00907SF | `FUW00907SFBean.clearListDataInstance(key)` → `super.clearListDataInstance(key)` → `KKW00128SF01DBean.clearListDataInstance` | `X33VDataTypeList.clear` (in-memory only) |
| 5 | Screen:FUW00908SF | `FUW00908SFBean.clearListDataInstance(key)` → `super.clearListDataInstance(key)` → `KKW00128SF01DBean.clearListDataInstance` | `X33VDataTypeList.clear` (in-memory only) |
| 6 | Screen:FUW00909SF | `FUW00909SFBean.clearListDataInstance(key)` → `super.clearListDataInstance(key)` → `KKW00128SF01DBean.clearListDataInstance` | `X33VDataTypeList.clear` (in-memory only) |
| 7 | Screen:FUW00912SF | `FUW00912SFBean.clearListDataInstance(key)` → `super.clearListDataInstance(key)` → `KKW00128SF01DBean.clearListDataInstance` | `X33VDataTypeList.clear` (in-memory only) |
| 8 | Screen:FUW00914SF | `FUW00914SFBean.clearListDataInstance(key)` → `super.clearListDataInstance(key)` → `KKW00128SF01DBean.clearListDataInstance` | `X33VDataTypeList.clear` (in-memory only) |
| 9 | Screen:FUW00916SF | `FUW00916SFBean.clearListDataInstance(key)` → `super.clearListDataInstance(key)` → `KKW00128SF01DBean.clearListDataInstance` | `X33VDataTypeList.clear` (in-memory only) |
| 10 | Screen:FUW00917SF | `FUW00917SFBean.clearListDataInstance(key)` → `super.clearListDataInstance(key)` → `KKW00128SF01DBean.clearListDataInstance` | `X33VDataTypeList.clear` (in-memory only) |
| 11 | Screen:FUW00918SF | `FUW00918SFBean.clearListDataInstance(key)` → `super.clearListDataInstance(key)` → `KKW00128SF01DBean.clearListDataInstance` | `X33VDataTypeList.clear` (in-memory only) |
| 12 | Screen:FUW00919SF | `FUW00919SFBean.clearListDataInstance(key)` → `super.clearListDataInstance(key)` → `KKW00128SF01DBean.clearListDataInstance` | `X33VDataTypeList.clear` (in-memory only) |
| 13 | Screen:FUW00921SF | `FUW00921SFBean.clearListDataInstance(key)` → `super.clearListDataInstance(key)` → `KKW00128SF01DBean.clearListDataInstance` | `X33VDataTypeList.clear` (in-memory only) |
| 14 | Screen:FUW00926SF | `FUW00926SFBean.clearListDataInstance(key)` → `super.clearListDataInstance(key)` → `KKW00128SF01DBean.clearListDataInstance` | `X33VDataTypeList.clear` (in-memory only) |
| 15 | Screen:FUW00927SF | `FUW00927SFBean.clearListDataInstance(key)` → `super.clearListDataInstance(key)` → `KKW00128SF01DBean.clearListDataInstance` | `X33VDataTypeList.clear` (in-memory only) |

**Additional callers (partial subclass delegation — `super.` calls in subclasses):**

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 16 | Screen:FUW00928SF | `FUW00928SFBean.clearListDataInstance(key)` → `super.clearListDataInstance(key)` → `KKW00128SF01DBean.clearListDataInstance` | `X33VDataTypeList.clear` (in-memory only) |
| 17 | Screen:FUW00931SF | `FUW00931SFBean.clearListDataInstance(key)` → `super.clearListDataInstance(key)` → `KKW00128SF01DBean.clearListDataInstance` | `X33VDataTypeList.clear` (in-memory only) |
| 18 | Screen:FUW00932SF | `FUW00932SFBean.clearListDataInstance(key)` → `super.clearListDataInstance(key)` → `KKW00128SF01DBean.clearListDataInstance` | `X33VDataTypeList.clear` (in-memory only) |
| 19 | Screen:FUW00942SF | `FUW00942SFBean.clearListDataInstance(key)` → `super.clearListDataInstance(key)` → `KKW00128SF01DBean.clearListDataInstance` | `X33VDataTypeList.clear` (in-memory only) |
| 20 | Screen:FUW00946SF | `FUW00946SFBean.clearListDataInstance(key)` → `super.clearListDataInstance(key)` → `KKW00128SF01DBean.clearListDataInstance` | `X33VDataTypeList.clear` (in-memory only) |
| 21 | Screen:FUW00947SF | `FUW00947SFBean.clearListDataInstance(key)` → `super.clearListDataInstance(key)` → `KKW00128SF01DBean.clearListDataInstance` | `X33VDataTypeList.clear` (in-memory only) |
| 22 | Screen:FUW00957SF | `FUW00957SFBean.clearListDataInstance(key)` → `super.clearListDataInstance(key)` → `KKW00128SF01DBean.clearListDataInstance` | `X33VDataTypeList.clear` (in-memory only) |
| 23 | Screen:FUW00959SF | `FUW00959SFBean.clearListDataInstance(key)` → `super.clearListDataInstance(key)` → `KKW00128SF01DBean.clearListDataInstance` | `X33VDataTypeList.clear` (in-memory only) |
| 24 | Screen:FUW00961SF | `FUW00961SFBean.clearListDataInstance(key)` → `super.clearListDataInstance(key)` → `KKW00128SF01DBean.clearListDataInstance` | `X33VDataTypeList.clear` (in-memory only) |
| 25 | Screen:FUW00964SF | `FUW00964SFBean.clearListDataInstance(key)` → `super.clearListDataInstance(key)` → `KKW00128SF01DBean.clearListDataInstance` | `X33VDataTypeList.clear` (in-memory only) |
| 26 | Screen:FUW00965SF | `FUW00965SFBean.clearListDataInstance(key)` → `super.clearListDataInstance(key)` → `KKW00128SF01DBean.clearListDataInstance` | `X33VDataTypeList.clear` (in-memory only) |

**Note:** Many subclasses also override `clearListDataInstance` with their own logic before calling `super.clearListDataInstance(key)`. These include: `FUW00907SF01DBean`, `FUW00909SF02DBean`, `FUW00912SF01DBean`, `FUW00914SF01DBean`, `FUW00916SF05DBean`, `FUW00916SF06DBean`, `FUW00917SF01DBean`, `FUW00918SF01DBean`, `FUW00921SF02DBean`, `FUW00921SF03DBean`, `FUW00921SF04DBean`, `FUW00921SF06DBean`, `FUW00942SF03DBean`, `FUW00942SF05DBean`, `FUW00942SF07DBean`, `FUW00946SFBean`, `FUW00947SF01DBean`, `FUW00957SF01DBean`, `FUW00957SF04DBean`, `FUW00957SF05DBean`, `FUW00964SF01DBean`, `FUW00964SF10DBean`, `FUW00964SF04DBean`, `FUW00964SF07DBean`.

## 6. Per-Branch Detail Blocks

**Block 1** — [IF] `(key != null)` (L1654)

> Null guard: If the key parameter is null, skip all processing.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `if(key != null)` // Check if key is provided — guards against null input |
| 2 | RETURN | (implicit void return when condition is false) |

**Block 1.1** — [IF] `(key.equals("異動理由コード"))` [異動理由コード="Change Reason Code"] (L1656)

> Clears the change reason code list when the key identifies the change reason code display item. The Japanese label `異動理由コード` corresponds to the field ID `ido_rsn_cd` used in the UI layer.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `key.equals("異動理由コード")` // Compares key against the display label for change reason code (field ID: ido_rsn_cd) |
| 2 | SET | `ido_rsn_cd_list.clear()` // Clears all elements from the change reason code list (X33VDataTypeList) |

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

> Clears the option service contract number list when the key identifies the option service contract number display item. The Japanese label `オプションサービス契約番号` corresponds to the field ID `op_svc_kei_no` used in the UI layer.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `key.equals("オプションサービス契約番号")` // Compares key against the display label for option service contract number (field ID: op_svc_kei_no) |
| 2 | SET | `op_svc_kei_no_list.clear()` // Clears all elements from the option service contract number list (X33VDataTypeList) |

**Block 1.3** — [ELSE] (implicit no-match, end of if/else chain) (L1654–L1667)

> When key is non-null but does not match any known field label, no action is taken. The method falls through to the implicit void return.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | (implicit void return — no list cleared for unrecognized keys) |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `ido_rsn_cd` | Field | Change reason code — a code identifying the reason for a status change or transfer (異動) in the customer service workflow. Stored in `ido_rsn_cd_list` as a list of `X33VDataTypeStringBean` entries. |
| `op_svc_kei_no` | Field | Option service contract number — the contract number assigned to an optional add-on service (オプションサービス) subscription. Stored in `op_svc_kei_no_list` as a list of `X33VDataTypeStringBean` entries. |
| `異動理由コード` | Display label | Japanese UI label for the Change Reason Code field — displayed in the screen UI to indicate the reason code for a service change or transfer. |
| `オプションサービス契約番号` | Display label | Japanese UI label for the Option Service Contract Number field — displayed in the screen UI to show the contract number for optional services. |
| `X33VDataTypeList` | Type | A typed list collection class in the framework that stores `X33VDataTypeBean` elements. Used to hold multi-value (repeating) UI data such as list rows. |
| `X33VDataTypeStringBean` | Type | A value type within `X33VDataTypeList` that holds a single string value. Each element in `ido_rsn_cd_list` and `op_svc_kei_no_list` is of this type. |
| `KKW00128SF01DBean` | Class | Screen data bean class for the KKA16601SF screen module. Defines list fields and clearing logic for screen state management. The "D" in the class name indicates it is a data-focused bean. |
| `clearListDataInstance` | Method | A framework-standard method name pattern used by screen beans to reset/clear list-bound data for a specific display field identified by a key. |
| K-Opticom | Business term | KDDI's fiber-to-the-home (FTTH) and telecom services brand — the business domain in which this system operates. |
