# Business Logic — KKW22501SFBean.clearListDataInstance() [26 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.KKW22501SF.KKW22501SFBean` |
| Layer | Controller / View Bean (webview) |
| Module | `KKW22501SF` (Package: `eo.web.webview.KKW22501SF`) |

## 1. Role

### KKW22501SFBean.clearListDataInstance()

This method is responsible for clearing (emptying) list data instances managed by the `KKW22501SFBean` view bean, which is part of the K-Opticom telecom service configuration screen module. It serves as a **list reset/dispatch utility** that selectively clears one or more of several display lists based on the business meaning of the incoming `key` parameter. The `key` identifies which type of data extraction item list should be reset. The method implements a **dispatch pattern**: if the key starts with the common-info marker (`//`), it delegates to the base class implementation (since common info screens are handled at the base class level); otherwise, it matches the key against specific hard-coded list identifiers (such as "Data Extraction Item Setting Condition List Details (Event SP)" or "Data Extraction Item List Details") and calls `clear()` on the corresponding `List` field. Its role in the larger system is to reset screen list state — typically invoked when a user navigates away from a data-extraction configuration screen, resets search/filter criteria, or re-initializes the screen state during repeated execution cycles.

## 2. Processing Pattern (Detailed Business Logic)

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

    START --> CHECK_KEY["key != null"]

    CHECK_KEY -->|true| STARTS_EMPTY["key starts with \"//\""]
    CHECK_KEY -->|false| END_NODE(["Return"])

    STARTS_EMPTY --> CALL_SUPER["super.clearListDataInstance(key)"]
    CALL_SUPER --> ELSE_IF_1["key equals<br/>\"データ抽出項目設定条件一覧照会<br/>（イベントＳＰ）詳細\""]

    ELSE_IF_1 -->|true| CLEAR_LIST1["dchskm_sete_jkn_list_list.clear()"]
    ELSE_IF_1 -->|false| ELSE_IF_2["key equals<br/>\"変更前データ抽出項目設定条件一覧照会<br/>（イベントＳＰ）詳細\""]

    ELSE_IF_2 -->|true| CLEAR_LIST2["bf_dchskm_sete_jkn_list_list.clear()"]
    ELSE_IF_2 -->|false| ELSE_IF_3["key equals<br/>\"データ抽出項目一覧照会詳細\""]

    ELSE_IF_3 -->|true| CLEAR_LIST3["dchskm_list_list.clear()"]
    ELSE_IF_3 -->|false| ELSE_END["No matching key — no-op"]

    CLEAR_LIST1 --> END_NODE
    CLEAR_LIST2 --> END_NODE
    CLEAR_LIST3 --> END_NODE
    ELSE_END --> END_NODE
```

**Description of processing flow:**

1. **Null check** — If `key` is `null`, the method returns immediately without performing any operation.
2. **Common info branch** — If `key` starts with `//` (the Japanese double quotation mark, used as a prefix marker for common info screen list items), the method delegates to the parent class `super.clearListDataInstance(key)` to handle the clearing at the base class level.
3. **Data extraction item setting condition list branch** — If `key` exactly matches `データ抽出項目設定条件一覧照会（イベントＳＰ）詳細` (Data Extraction Item Setting Condition List Details (Event SP)), the `dchskm_sete_jkn_list_list` field is cleared.
4. **Pre-modification data extraction branch** — If `key` exactly matches `変更前データ抽出項目設定条件一覧照会（イベントＳＰ）詳細` (Pre-Modification Data Extraction Item Setting Condition List Details (Event SP)), the `bf_dchskm_sete_jkn_list_list` field is cleared.
5. **Data extraction item list branch** — If `key` exactly matches `データ抽出項目一覧照会詳細` (Data Extraction Item List Details), the `dchskm_list_list` field is cleared.
6. **Fallback** — If the key does not match any known identifier, the method performs no action (no-op) and returns.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `key` | `String` | The identifier/name of the list data instance to clear. It represents a screen list item descriptor. Values and their effects: (a) Starts with `//` → indicates a common information screen list; the method delegates clearing to the base class. (b) Equals `データ抽出項目設定条件一覧照会（イベントＳＰ）詳細` → clears the "Data Extraction Item Setting Condition List (Event SP) Details" list (`dchskm_sete_jkn_list_list`). (c) Equals `変更前データ抽出項目設定条件一覧照会（イベントＳＰ）詳細` → clears the "Pre-Modification Data Extraction Item Setting Condition List (Event SP) Details" list (`bf_dchskm_sete_jkn_list_list`). (d) Equals `データ抽出項目一覧照会詳細` → clears the "Data Extraction Item List Details" list (`dchskm_list_list`). (e) Any other value or `null` → no-op, no list is modified. |
| | `this.dchskm_sete_jkn_list_list` | `List` | Instance field — stores the list of data extraction item setting condition display objects for Event SP screens. Cleared when key matches the corresponding identifier. |
| | `this.bf_dchskm_sete_jkn_list_list` | `List` | Instance field — stores the list of pre-modification (before change) data extraction item setting condition display objects for Event SP screens. Cleared when key matches the corresponding identifier. |
| | `this.dchskm_list_list` | `List` | Instance field — stores the list of data extraction item display objects for KKW22501SF02 repeated execution items. Cleared when key matches the corresponding identifier. |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `JCCcomFileSearchUtil.clear` | JCCcomFileSearch | - | Calls `clear` in `JCCcomFileSearchUtil` (invoked via base class delegation for common info screens) |
| - | `JZMAdEdit.clear` | JZMAdEdit | - | Calls `clear` in `JZMAdEdit` (invoked via base class delegation for common info screens) |
| - | `KKA17101SFLogic.clear` | KKA17101SFLogic | - | Calls `clear` in `KKA17101SFLogic` (invoked via base class delegation for common info screens) |
| - | `KKA17401SFLogic.clear` | KKA17401SFLogic | - | Calls `clear` in `KKA17401SFLogic` (invoked via base class delegation for common info screens) |
| - | `KKA17601SFLogic.clear` | KKA17601SFLogic | - | Calls `clear` in `KKA17601SFLogic` (invoked via base class delegation for common info screens) |
| - | `KKW22501SFBean.clearListDataInstance` | KKW22501SFBean | - | Calls `clearListDataInstance` in `KKW22501SFBean` (recursive/self-recursive through super delegation) |

**Internal clearing operations performed directly by this method:**

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| U | `dchskm_sete_jkn_list_list.clear()` | (in-memory) | `dchskm_sete_jkn_list_list` (List display items) | Clears the data extraction item setting condition list in memory |
| U | `bf_dchskm_sete_jkn_list_list.clear()` | (in-memory) | `bf_dchskm_sete_jkn_list_list` (List display items) | Clears the pre-modification data extraction item setting condition list in memory |
| U | `dchskm_list_list.clear()` | (in-memory) | `dchskm_list_list` (List display items) | Clears the data extraction item list in memory |

> **Note:** This method performs no database operations (C/R/U/D) directly. All operations are in-memory list manipulations (`List.clear()`). When the key starts with `//`, it delegates to the parent class which may perform broader clearing through shared components.

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Class: `KKW22501SFBean` | `KKW22501SFBean.clearListDataInstance(String key)` -> `KKW22501SFBean.clearListDataInstance` | `clear() [U] in-memory List` |

> The pre-computed caller analysis shows one direct caller: `KKW22501SFBean.clearListDataInstance()` (the no-argument overload, which internally iterates over known keys and delegates to this `clearListDataInstance(String key)` method for each). No external screens (KKSV*) or batch jobs were identified as direct callers in the provided data.

## 6. Per-Branch Detail Blocks

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

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

| # | Type | Code |
|---|------|------|
| 1 | CHECK | `if (key != null)` // Guard clause — skip if key is null |

**Block 1.1** — [IF] `(key.startsWith("//"))` (L1380)

> Common information screen branch — the key starts with `//` (Japanese full-width double quotation mark), indicating a common info screen list item. The method delegates to the parent class to handle clearing at the base level.

| # | Type | Code |
|---|------|------|
| 1 | COMMENT | `// 共通情報ビューンのリストの場合` // [English: If this is a common info screen list] |
| 2 | COMMENT | `// 共通情報ビューンリストは基底クラスで処理` // [English: Common info screen list is processed in the base class] |
| 3 | CALL | `super.clearListDataInstance(key)` // Delegate to parent class implementation |

**Block 1.2** — [ELSE-IF] `(key.equals("データ抽出項目設定条件一覧照会（イベントＳＰ）詳細"))` (L1384)

> Clears the "Data Extraction Item Setting Condition List (Event SP) Details" list for KKW22501SF01 repeated execution items. The item ID is `dchskm_sete_jkn_list`.

| # | Type | Code |
|---|------|------|
| 1 | COMMENT | `// データタイプが KKW22501SF01 の繰り返し指定項目"データ抽出項目設定条件一覧照会（イベントＳＰ）詳細"(項目ID:dchskm_sete_jkn_list)` // [English: If the data type is the KKW22501SF01 repeated execution item "Data Extraction Item Setting Condition List Details (Event SP)" (item ID: dchskm_sete_jkn_list)] |
| 2 | EXEC | `dchskm_sete_jkn_list_list.clear()` // Clear the in-memory list of display objects |

**Block 1.3** — [ELSE-IF] `(key.equals("変更前データ抽出項目設定条件一覧照会（イベントＳＰ）詳細"))` (L1388)

> Clears the "Pre-Modification Data Extraction Item Setting Condition List (Event SP) Details" list. This stores the state of data extraction settings before a modification is applied. The item ID is `bf_dchskm_sete_jkn_list`.

| # | Type | Code |
|---|------|------|
| 1 | COMMENT | `// データタイプが KKW22501SF01 の繰り返し指定項目"変更前データ抽出項目設定条件一覧照会（イベントＳＰ）詳細"(項目ID:bf_dchskm_sete_jkn_list)` // [English: If the data type is the KKW22501SF01 repeated execution item "Pre-Modification Data Extraction Item Setting Condition List Details (Event SP)" (item ID: bf_dchskm_sete_jkn_list)] |
| 2 | EXEC | `bf_dchskm_sete_jkn_list_list.clear()` // Clear the pre-modification in-memory list of display objects |

**Block 1.4** — [ELSE-IF] `(key.equals("データ抽出項目一覧照会詳細"))` (L1392)

> Clears the "Data Extraction Item List Details" list for KKW22501SF02 repeated execution items. The item ID is `dchskm_list`.

| # | Type | Code |
|---|------|------|
| 1 | COMMENT | `// データタイプが KKW22501SF02 の繰り返し指定項目"データ抽出項目一覧照会詳細"(項目ID:dchskm_list)` // [English: If the data type is the KKW22501SF02 repeated execution item "Data Extraction Item List Details" (item ID: dchskm_list)] |
| 2 | EXEC | `dchskm_list_list.clear()` // Clear the in-memory list of display objects |

**Block 1.5** — [ELSE] (implicit, L1396)

> No matching key was found — no list is cleared. This is a no-op fallthrough.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return;` // Implicit return after the if-else chain completes without action |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `dchskm_sete_jkn_list_list` | Field | Data Extraction Item Setting Condition List — in-memory list storing display objects for the data extraction item setting condition screen (Event SP) |
| `bf_dchskm_sete_jkn_list_list` | Field | Before-change Data Extraction Item Setting Condition List — in-memory list storing the pre-modification snapshot of data extraction settings for rollback or comparison purposes |
| `dchskm_list_list` | Field | Data Extraction Item List — in-memory list storing display objects for data extraction items on the KKW22501SF02 screen |
| `dchskm` | Acronym | Data CHeck SKManage — internal module naming convention for data extraction/checking screen components |
| `bf_` | Prefix | Before (Modification) — prefix used for storing pre-change state snapshots of data extraction settings |
| `イベントＳＰ` | Japanese term | Event SP — Event Special; a type of special event or promotional data extraction screen configuration |
| `データ抽出項目` | Japanese term | Data Extraction Item — a configurable field/parameter used in data extraction queries |
| `設定条件` | Japanese term | Setting Condition — the criteria/filters applied when configuring data extraction items |
| `一覧照会` | Japanese term | List Inquiry — a screen operation that displays a list of records for review |
| `詳細` | Japanese term | Details — indicates the screen shows detailed information about a specific item |
| `KKW22501SF01` | Module | Screen module code for KKW22501SF01 — data extraction item setting condition configuration screen (Event SP variant) |
| `KKW22501SF02` | Module | Screen module code for KKW22501SF02 — data extraction item list configuration screen |
| `//` | Marker | Japanese full-width double quotation mark (／／) used as a prefix to identify common information screen list items in the dispatch key system |
| X33SException | Exception | Application-specific checked exception thrown by view bean methods on processing errors |
