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

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.KKA16801SF.KKW02516SF01DBean` |
| Layer | Web View (Bean / UI Data Holder) |
| Module | `KKA16801SF` (Package: `eo.web.webview.KKA16801SF`) |

## 1. Role

### KKW02516SF01DBean.clearListDataInstance()

This method provides targeted clearing of specific list-type data fields within the `KKW02516SF01DBean` UI data holder. It implements a **dispatch/routing pattern** — given a string key that identifies a list item, the method routes to the appropriate instance field and clears its contents. This is a shared utility method used by screen beans in the K-Opticom web application to reset list data on the client side, for example when the user navigates away from a screen or needs to refresh a list component. The method handles two specific list items: the **Transfer Reason Code** list (`ido_rsn_cd_list`) and the **Option Service Contract Number** list (`op_svc_kei_no_list`). It serves as part of the screen bean's lifecycle management, ensuring stale list data does not persist across operations. The Javadoc states in Japanese: "リスト項目の要素をクリアします。" (Clears the elements of list items.)

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["clearListDataInstance key"])
    COND1{"key != null?"}
    COND2{"key equals \"異動理由コード\""}
    COND3{"key equals \"オプションサービス契約番号\""}
    CLEAR1["Clear ido_rsn_cd_list<br/>(異動理由コード / Transfer Reason Code)"]
    CLEAR2["Clear op_svc_kei_no_list<br/>(オプションサービス契約番号 / Option Service Contract No.)"]
    END_NODE(["Return / Next"])

    START --> COND1
    COND1 -->|true| COND2
    COND1 -->|false| END_NODE
    COND2 -->|true| CLEAR1
    COND2 -->|false| COND3
    COND3 -->|true| CLEAR2
    COND3 -->|false| END_NODE
    CLEAR1 --> END_NODE
    CLEAR2 --> END_NODE
```

**Branch Summary:**

- **Branch 1:** If `key` is `null`, the method does nothing and returns immediately (null-safe guard).
- **Branch 2:** If `key` equals `"異動理由コード"` (Transfer Reason Code), the `ido_rsn_cd_list` instance field (an `X33VDataTypeList`) is cleared.
- **Branch 3:** If `key` equals `"オプションサービス契約番号"` (Option Service Contract Number), the `op_svc_kei_no_list` instance field (an `X33VDataTypeList`) is cleared.
- **Default:** If `key` is not null but does not match any known item, the method does nothing (silent no-op).

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `key` | `String` | The display label of the list item to clear. This string acts as a dispatch key that identifies which list-type field should be reset. It carries a human-readable Japanese label such as `"異動理由コード"` (Transfer Reason Code) or `"オプションサービス契約番号"` (Option Service Contract Number). |

**Instance fields read:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `ido_rsn_cd_list` | `X33VDataTypeList` | Transfer Reason Code list — holds the list of reason codes for service transfers/movements |
| `op_svc_kei_no_list` | `X33VDataTypeList` | Option Service Contract Number list — holds the list of option service contract numbers |

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `X33VDataTypeList.clear` | - | - | Calls `clear()` on the target list data instance field (no database interaction — purely in-memory data reset) |

**Note:** This method performs no database operations, no SC (Service Component) calls, and no CRUD operations. It is purely an in-memory list clearing operation on UI-bound data holder fields.

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Bean:KKW02516SFBean (koptWebA) | `KKW02516SFBean` creates `KKW02516SF01DBean` instance and invokes `clearListDataInstance(key)` | `X33VDataTypeList.clear()` (in-memory) |
| 2 | Bean:KKW02516SFBean (koptWebB) | `KKW02516SFBean` creates `KKW02516SF01DBean` instance and invokes `clearListDataInstance(key)` | `X33VDataTypeList.clear()` (in-memory) |

**Callers Found:**
- `KKW02516SFBean` in `koptWebA` module (source/koptWebA/src/eo/web/webview/KKW02516SF/)
- `KKW02516SFBean` in `koptWebB` module (source/koptWebB/src/eo/web/webview/KKW02516SF/)

Both callers instantiate `KKW02516SF01DBean` and invoke `clearListDataInstance(key)` as part of screen bean data lifecycle management. No intermediate CBS or screen entry points were found that chain through other methods — callers invoke this method directly on the bean instance.

## 6. Per-Branch Detail Blocks

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

> Null-safety guard: if `key` is null, skip all processing and return immediately.

| # | Type | Code |
|---|------|------|
| 1 | COND | `if(key != null)` // Null check — prevents NPE |

**Block 1.1** — [IF-ELSE IF-ELSE] `(key dispatch)` (L840)

> Routes to the appropriate list field based on the key's value and clears it.

| # | Type | Code |
|---|------|------|
| 1 | IF | `if(key.equals("異動理由コード"))` // Transfer Reason Code [-> "異動理由コード" = Transfer Reason Code] |
| 2 | EXEC | `ido_rsn_cd_list.clear();` // Clears the transfer reason code list |
| 3 | ELSE-IF | `else if(key.equals("オプションサービス契約番号"))` // Option Service Contract Number [-> "オプションサービス契約番号" = Option Service Contract Number] |
| 4 | EXEC | `op_svc_kei_no_list.clear();` // Clears the option service contract number list |
| 5 | ELSE | // No else branch — silent no-op for unrecognized keys |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `ido_rsn_cd_list` | Field | Transfer Reason Code List — a list-type UI data field holding reason codes for service transfers/movements |
| `op_svc_kei_no_list` | Field | Option Service Contract Number List — a list-type UI data field holding option service contract numbers |
| `X33VDataTypeList` | Class | Fujitsu X33 framework list data type — a typed list wrapper for UI view beans |
| `KKW02516SF01DBean` | Class | UI Data Bean for screen KKW02516SF — holds form data and list data for the screen |
| `KKA16801SF` | Module | Screen module identifier — the web application module containing this bean |
| 異動理由コード | Japanese Label | Transfer Reason Code — human-readable label identifying the reason for a service transfer/movement |
| オプションサービス契約番号 | Japanese Label | Option Service Contract Number — human-readable label for an optional service's contract number |
| X33 Framework | Technology | Fujitsu's Web Client Definition Tool (Web Client tool V01/L01) — a Java EE-based web application framework for building enterprise screens |
| Bean (UI) | Pattern | A Java class implementing `X33VDataTypeBeanInterface` and `X33VListedBeanInterface` — serves as the data container between the web view and the business logic layer |
