# Business Logic — KKW00844SFBean.clearListDataInstance() [21 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.KKW00844SF.KKW00844SFBean` |
| Layer | View (Web Bean — extends `X33VViewBaseBean`, part of the X33 web framework) |
| Module | `KKW00844SF` (Package: `eo.web.webview.KKW00844SF`) |

## 1. Role

### KKW00844SFBean.clearListDataInstance()

This method is a **list data clearing utility** within the KKW00844SF screen bean, responsible for resetting specific `X33VDataTypeList` model instances based on a caller-provided business key. It serves as the bean's implementation of the X33 framework's listed-bean interface contract — when the framework needs to reset screen state (e.g., before re-displaying a screen, on navigation, or when clearing user input), it invokes this method with a key identifying which list should be cleared.

The method implements a **conditional dispatch pattern** with three branches: a **delegate branch** for common/shared view lists (identified by keys starting with `//`), and two **screen-specific branches** that directly clear the "Customer Contract Handover List" (`顧客契約引継リスト`) and the "Change Reason List" (`異動理由リスト`). Its role in the larger system is that of a shared utility within the screen bean — it is overridden by subclass beans (e.g., `KKW00844SF01DBean`) to extend clearing behavior for their own additional lists, maintaining a consistent pattern across the screen family.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["clearListDataInstance_key"])

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

    CHECK_NULL -- false --> END_RETURN(["Return"])

    CHECK_NULL -- true --> STARTS_DOUBLE_SLASH["key.startsWith_//_"]

    STARTS_DOUBLE_SLASH -- true --> SUPER_CALL["super.clearListDataInstance_key_"]
    SUPER_CALL --> END_RETURN

    STARTS_DOUBLE_SLASH -- false --> CUSTOMER_CONTRACT["key_equals_顧客契約引継リスト"]

    CUSTOMER_CONTRACT -- true --> CLEAR_CUSTOMER["cust_kei_hktgi_list_list.clear"]
    CLEAR_CUSTOMER --> END_RETURN

    CUSTOMER_CONTRACT -- false --> MOVE_REASON["key_equals_異動理由リスト"]

    MOVE_REASON -- true --> CLEAR_MOVE["ido_rsn_list_list.clear"]
    CLEAR_MOVE --> END_RETURN

    MOVE_REASON -- false --> END_RETURN
```

**Processing flow:**

1. **Null guard**: If `key` is `null`, the method returns immediately — no list is cleared.
2. **Common info view list (delegate)**: If the key starts with `//`, the key identifies a shared/common view list maintained by the base class. The method delegates to `super.clearListDataInstance(key)` to handle it using the base framework's logic. (Japanese comment: 共通情報ビューンのリストの場合 — "When this is a common info view list")
3. **Customer contract handover list (direct clear)**: If the key equals `顧客契約引継リスト` (Customer Contract Handover List), the method directly calls `cust_kei_hktgi_list_list.clear()` to clear the list data. This list corresponds to a repeat designation item in screen type KKW00844SF01, identified internally by the item ID `cust_kei_hktgi_list`. (Japanese comment: データタイプが KKW00844SF01 の繰り返し指定項目"顧客契約引継リスト"(項目ID:cust_kei_hktgi_list) — "When the data type is the repeat designation item 'Customer Contract Handover List' (item ID: cust_kei_hktgi_list) of KKW00844SF01")
4. **Change reason list (direct clear)**: If the key equals `異動理由リスト` (Change Reason List), the method directly calls `ido_rsn_list_list.clear()` to clear the list data. This list corresponds to a repeat designation item in screen type KKW00844SF02, identified internally by the item ID `ido_rsn_list`. (Japanese comment: データタイプが KKW00844SF02 の繰り返し指定項目"異動理由リスト"(項目ID:ido_rsn_list) — "When the data type is the repeat designation item 'Change Reason List' (item ID: ido_rsn_list) of KKW00844SF02")
5. **Unmatched key**: If the key does not match any of the above conditions, the method returns without performing any action.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `key` | `String` | The business identifier of the list item to clear. It determines which `X33VDataTypeList` model instance will be reset. Possible values include `//`-prefixed strings for common/shared view lists, `顧客契約引継リスト` (Customer Contract Handover List) for KKW00844SF01 screen data, or `異動理由リスト` (Change Reason List) for KKW00844SF02 screen data. A `null` value causes immediate return with no effect. |

**Instance fields read:**
| Field | Type | Usage |
|-------|------|-------|
| `cust_kei_hktgi_list_list` | `X33VDataTypeList` | The data-list model for the Customer Contract Handover List; cleared when key matches |
| `ido_rsn_list_list` | `X33VDataTypeList` | The data-list model for the Change Reason List; cleared when key matches |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| U | `JCCcomFileSearchUtil.clear` | JCCcomFileSearch | - | Utility method that clears internal search result collections (called via the pre-computed call chain, not directly by this method) |
| U | `JZMAdEdit.clear` | JZMAdEdit | - | Utility method that clears internal edit state (called via the pre-computed call chain, not directly by this method) |
| U | `KKA17101SFLogic.clear` | KKA17101SFLogic | - | Screen logic clear method for batch processing (called via the pre-computed call chain, not directly by this method) |
| U | `KKA17401SFLogic.clear` | KKA17401SFLogic | - | Screen logic clear method for batch processing (called via the pre-computed call chain, not directly by this method) |
| U | `KKA17601SFLogic.clear` | KKA17601SFLogic | - | Screen logic clear method for batch processing (called via the pre-computed call chain, not directly by this method) |
| U | `KKW00844SFBean.clearListDataInstance` | KKW00844SFBean | - | Calls `clearListDataInstance` in `KKW00844SFBean` (self-call via overridden method pattern) |

### Direct method calls within this method:

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| U | `X33VViewBaseBean.clearListDataInstance(key)` | (framework) | (framework internal) | Delegates to the parent framework class to clear the common info view list. Invoked when `key.startsWith("//")`. This is a setter-type clear operation on the base bean's internal data structures. |
| U | `cust_kei_hktgi_list_list.clear()` | (framework) | (framework internal) | Clears the Customer Contract Handover List data model instance. No database operation — this is in-memory model state reset. |
| U | `ido_rsn_list_list.clear()` | (framework) | (framework internal) | Clears the Change Reason List data model instance. No database operation — this is in-memory model state reset. |

**Classification:** All operations are **U** (Update/Set) — they modify in-memory model state by clearing list contents. No database CRUD operations are performed directly by this method.

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Bean:KKW00844SFBean (self-call) | `KKW00844SFBean.clearListDataInstance()` -> `KKW00844SFBean.clearListDataInstance(String key)` | `clearListDataInstance [U] cust_kei_hktgi_list_list, ido_rsn_list_list` |
| 2 | Screen:KKW00844SF (via X33 framework) | `X33VViewBaseBean.listDataHandler()` -> `KKW00844SFBean.clearListDataInstance(key)` | `clearListDataInstance [U] cust_kei_hktgi_list_list, ido_rsn_list_list` |
| 3 | Bean:KKW00844SF01DBean (override) | `KKW00844SF01DBean.clearListDataInstance(key)` -> `KKW00844SFBean.clearListDataInstance(key)` | `clearListDataInstance [U] cust_kei_hktgi_list_list, ido_rsn_list_list` |

**Notes:**
- The `KKW00844SFBean` class implements `X33VListedBeanInterface`, which defines the `clearListDataInstance(String key)` contract. The X33 framework invokes this method during list data lifecycle management (e.g., screen initialization, refresh, or clearing).
- The no-param `clearListDataInstance()` method (referenced in the caller data) is likely a framework-defined entry point that delegates to the keyed version for all registered lists.
- The subclass `KKW00844SF01DBean` overrides this method and may call `super.clearListDataInstance(key)` to preserve parent clearing behavior.
- No database entity interactions occur through this method.

## 6. Per-Branch Detail Blocks

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

> Null guard: verify the key parameter is non-null before proceeding. If null, skip all clearing logic.

| # | Type | Code |
|---|------|------|
| 1 | SET | `key` = parameter value — the business list identifier string |

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

> Common info view list delegation: when the key starts with `//`, it identifies a shared/common view list managed by the base framework class. The actual clearing logic is delegated to the superclass. (Japanese comment: 共通情報ビューンのリストの場合 — "When this is a common info view list")

| # | Type | Code |
|---|------|------|
| 1 | CALL | `super.clearListDataInstance(key)` — delegates to parent class `X33VViewBaseBean` to handle the common info view list clearing |

**Block 1.2** — [ELSE-IF] `(key.equals("顧客契約引継リスト"))` (L1570)

> Customer Contract Handover List clear: the key matches the repeat designation item for screen type KKW00844SF01. Directly clears the `cust_kei_hktgi_list_list` in-memory data model. (Japanese comment: データタイプが KKW00844SF01 の繰り返し指定項目"顧客契約引継リスト"(項目ID:cust_kei_hktgi_list) — "When the data type is the repeat designation item 'Customer Contract Handover List' (item ID: cust_kei_hktgi_list) of KKW00844SF01")

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `cust_kei_hktgi_list_list.clear()` — clears all elements in the Customer Contract Handover List model instance |

**Block 1.3** — [ELSE-IF] `(key.equals("異動理由リスト"))` (L1574)

> Change Reason List clear: the key matches the repeat designation item for screen type KKW00844SF02. Directly clears the `ido_rsn_list_list` in-memory data model. (Japanese comment: データタイプが KKW00844SF02 の繰り返し指定項目"異動理由リスト"(項目ID:ido_rsn_list) — "When the data type is the repeat designation item 'Change Reason List' (item ID: ido_rsn_list) of KKW00844SF02")

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `ido_rsn_list_list.clear()` — clears all elements in the Change Reason List model instance |

**Block 1.4** — [ELSE (implicit fall-through)] `(key not matched)` (L1576)

> Unmatched key: the provided key does not correspond to any known list. No action is taken and the method returns.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | (implicit) — void method, returns without side effect |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `cust_kei_hktgi_list_list` | Field | Customer Contract Handover List — the X33 data-list model holding customer contract handover/transfer line items for screen KKW00844SF01 |
| `ido_rsn_list_list` | Field | Change Reason List — the X33 data-list model holding reason codes for changes/alterations for screen KKW00844SF02 |
| X33VViewBaseBean | Class | Fujitsu Futurity X33 web framework base bean — the parent class providing common view-bean infrastructure including list data management and serialization support |
| X33VListedBeanInterface | Interface | X33 framework interface for beans that manage listed/repeated data items (e.g., repeating table rows on a screen) |
| `X33VDataTypeList` | Class | X33 framework data type wrapper for list/collection model data — holds the structured data for each screen list component |
| X33SException | Class | X33 framework exception class thrown for service-layer errors within the web framework |
| `//` (key prefix) | Convention | Key naming convention indicating a shared/common info view list managed by the base framework rather than screen-specific code |
| `顧客契約引継リスト` | Field | Customer Contract Handover List — business entity representing transferred/handed-over customer contracts |
| `異動理由リスト` | Field | Change Reason List — business entity representing reasons for customer status changes/movements |
| KKW00844SF | Module | Screen module identifier — telecom customer contract service screen family (KKW prefix indicates a web-based screen) |
| KKW00844SF01 | Screen ID | Specific screen variant within the module handling customer contract handover operations |
| KKW00844SF02 | Screen ID | Specific screen variant within the module handling change reason operations |
