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

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.KKW00127SF.KKW00127SF02DBean` |
| Layer | Data Bean (Web View Layer — DTO / presentation-layer data holder) |
| Module | `KKW00127SF` (Package: `eo.web.webview.KKW00127SF`) |

## 1. Role

### KKW00127SF02DBean.clearListDataInstance()

This method serves as a targeted list-clearing utility within the KKW00127SF screen's data bean, responsible for resetting specific list-based form fields on the web page. It implements a routing/dispatch pattern where the incoming `key` parameter — a human-readable label string representing a named list item — determines which internal `X33VDataTypeList` field should be cleared. The method supports two distinct display items on the service contract status screen: the "Service Contract Status List" (displayed as サービス契約ステータスリスト) and the "Referral Code List" (displayed as 紹介コードリスト). Its role in the larger system is as a shared data-management method within the X33 framework's data bean hierarchy; it is designed to be overridden by subclasses so that each screen variant can declare its own set of clearable list fields. This method is invoked when the page needs to reset a specific list's contents — for example, after a user navigates away from a repeated-item section or when re-initializing the screen state.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["clearListDataInstance(String key)"])
    CHECK_NULL{key != null?}
    BLOCK1["Clear: svc_kei_stat_lis_list"]
    BLOCK2["Clear: intr_cd_list_list"]
    END_NODE(["Return / Next"])

    START --> CHECK_NULL
    CHECK_NULL -->|true| CHECK_TYPE{key equals 'サービSC契約ステータスリスト'?}
    CHECK_TYPE -->|true| BLOCK1
    BLOCK1 --> CHECK_TYPE2{key equals '紹介コードリスト'?}
    CHECK_TYPE2 -->|true| BLOCK2
    BLOCK2 --> END_NODE
    CHECK_TYPE -->|false| CHECK_TYPE2
    CHECK_NULL -->|false| END_NODE
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `key` | `String` | The display name (item label) of the list field to clear. It is a human-readable Japanese string that identifies which list on the screen should have its elements reset. |

**Instance fields read by this method:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `svc_kei_stat_lis_list` | `X33VDataTypeList` | The Service Contract Status List — a list of status label strings displayed on the service contract agreement screen. |
| `intr_cd_list_list` | `X33VDataTypeList` | The Referral Code List — a list of referral/introduction code strings associated with the service contract. |

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `ArrayList.clear` | - | - | Clears all elements from the `svc_kei_stat_lis_list` list (in-memory collection, no DB interaction) |
| - | `ArrayList.clear` | - | - | Clears all elements from the `intr_cd_list_list` list (in-memory collection, no DB interaction) |

This method performs **no database operations**. It only clears in-memory list objects that serve as view-state containers for the web page's repeated-item display sections.

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Bean:KKW00127SFBean | `KKW00127SFBean.clearListDataInstance` -> `super.clearListDataInstance(key)` (parent chain may reach KKW00127SF02DBean) | No terminal (in-memory only) |
| 2 | Bean:KKW00127SF04DBean | `KKW00127SF04DBean.clearListDataInstance` (defines its own override, not a direct caller of the 02DBean version) | No terminal (in-memory only) |
| 3 | Bean:KKW00127SF01DBean | `KKW00127SF01DBean.clearListDataInstance` (defines its own override) | No terminal (in-memory only) |
| 4 | Bean:KKW00127SF07DBean | `KKW00127SF07DBean.clearListDataInstance` (defines its own override) | No terminal (in-memory only) |
| 5 | Bean:KKW00127SF12DBean | `KKW00127SF12DBean.clearListDataInstance` (defines its own override) | No terminal (in-memory only) |
| 6 | Bean:KKW00127SF22DBean | `KKW00127SF22DBean.clearListDataInstance` (defines its own override) | No terminal (in-memory only) |

**Note:** No direct invocations of `KKW00127SF02DBean.clearListDataInstance` were found in the call chain search. This method is part of the X33 framework's data bean interface and is typically invoked indirectly through polymorphic calls on the parent `KKW00127SFBean.clearListDataInstance` which delegates via `super.clearListDataInstance(key)` to the overridden subclass implementation.

## 6. Per-Branch Detail Blocks

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

> Guard clause: only process if a non-null key is provided. If null, the method returns immediately without any side effects.

| # | Type | Code |
|---|------|------|
| 1 | IF | `if (key != null)` |

**Block 1.1** — `[IF]` `(key.equals("サービス契約ステータスリスト"))` `[サービス契約ステータスリスト = "Service Contract Status List"]` (L977)

> Clears the Service Contract Status List when the key matches the display label for the service contract status list item (item ID: svc_kei_stat_lis).

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `svc_kei_stat_lis_list.clear();` // (配列項目 "サービス契約ステータスリスト" — Array item "Service Contract Status List") |

**Block 1.2** — `[ELSE-IF]` `(key.equals("紹介コードリスト"))` `[紹介コードリスト = "Referral Code List"]` (L981)

> Clears the Referral Code List when the key matches the display label for the referral code list item (item ID: intr_cd_list).

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `intr_cd_list_list.clear();` // (配列項目 "紹介コードリスト" — Array item "Referral Code List") |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `svc_kei_stat_lis` | Field | Service contract status list — the internal list-item identifier (itemID) for the service contract status display section |
| `intr_cd_list` | Field | Referral code list — the internal list-item identifier (itemID) for the referral/introduction code display section |
| `svc_kei_stat_lis_list` | Field | The actual `X33VDataTypeList` instance holding the service contract status strings on the screen |
| `intr_cd_list_list` | Field | The actual `X33VDataTypeList` instance holding the referral code strings on the screen |
| `X33VDataTypeList` | Technical | A Fujitsu Futurity X33 framework data type wrapper for list/collection fields in the web view bean |
| `KKW00127SF` | Module | The KKW00127SF screen module — a service contract agreement detail screen in the K-Opticom web application |
| DBean | Abbreviation | Data Bean — a presentation-layer bean that holds form field values between the web page and the business logic |
| X33 | Technical | Fujitsu Futurity X33 — the web application framework used for building the K-Opticom web client |
| サービス契約ステータスリスト | Japanese | Service Contract Status List — the display label for the list of service contract status entries |
| 紹介コードリスト | Japanese | Referral Code List — the display label for the list of referral/introduction codes |
