# Business Logic — KKW00844SFBean.removeElementFromListData() [25 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.KKW00844SF.KKW00844SFBean` |
| Layer | Utility (view bean data manipulation within the webview tier) |
| Module | `KKW00844SF` (Package: `eo.web.webview.KKW00844SF`) |

## 1. Role

### KKW00844SFBean.removeElementFromListData()

The `removeElementFromListData` method is a **list item removal utility** within the `KKW00844SFBean` view bean. It performs **conditional dispatch** based on the `key` parameter to remove an item from one of several domain-specific lists that back the screen's UI data binding. When the key begins with `"//"`, the method delegates to its superclass (`X33VViewBaseBean`) to handle standard shared information list removal — this is a convention for system-managed common information items that are processed at the base class level. For screen-specific lists, the method directly removes the element at the given index from either the **customer contract inheritance list** (`cust_kei_hktgi_list_list`) or the **transfer reason list** (`ido_rsn_list_list`), each guarded by a bounds check to prevent index-out-of-range errors. This method serves as a **shared dispatcher** for removal operations across multiple data types presented by the KKW00844SF screen, centralizing the list mutation logic and insulating callers from needing to know which list belongs to which screen data type. Its role in the larger system is a **UI state mutator**: when the user performs an action that requires removing a row from a multi-select or repeatable list on the screen, the caller invokes this method with the appropriate list identifier and the row index to remove.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["removeElementFromListData(key, index)"])
    CHECK_NULL["key is not null"]
    CHECK_PREFIX["key starts with two slashes"]
    SUPER_CALL["delegate to superclass removeElementFromListData"]
    CHECK_CUST["key equals Customer Contract List"]
    CHECK_CUST_BOUNDS["index within cust_kei_hktgi_list_list bounds"]
    CUST_REMOVE["remove item from cust_kei_hktgi_list_list"]
    CHECK_IDO["key equals Transfer Reason List"]
    CHECK_IDO_BOUNDS["index within ido_rsn_list_list bounds"]
    IDO_REMOVE["remove item from ido_rsn_list_list"]
    END_NODE(["Return void"])

    START --> CHECK_NULL
    CHECK_NULL -->|false| END_NODE
    CHECK_NULL -->|true| CHECK_PREFIX
    CHECK_PREFIX -->|true| SUPER_CALL
    SUPER_CALL --> CHECK_CUST
    CHECK_PREFIX -->|false| CHECK_CUST
    CHECK_CUST -->|true| CHECK_CUST_BOUNDS
    CHECK_CUST_BOUNDS -->|true| CUST_REMOVE
    CHECK_CUST_BOUNDS -->|false| END_NODE
    CUST_REMOVE --> END_NODE
    CHECK_CUST -->|false| CHECK_IDO
    CHECK_IDO -->|true| CHECK_IDO_BOUNDS
    CHECK_IDO_BOUNDS -->|true| IDO_REMOVE
    CHECK_IDO_BOUNDS -->|false| END_NODE
    IDO_REMOVE --> END_NODE
```

**CRITICAL — Constant Resolution:**
- `//` — The `"//"` string prefix is a **naming convention marker** in this codebase that indicates a shared/common information list item. Items whose key starts with `"//"` are delegated to the base class `X33VViewBaseBean.removeElementFromListData()` for handling, as stated in the comment: "共通情報ビューンのリストの場合" (For shared information view lists).
- `"顧客契約引継リスト"` (Customer Contract Inheritance List) — The screen-repeat designated item ID for `KKW00844SF01`, backed by the `cust_kei_hktgi_list_list` field of type `X33VDataTypeList`.
- `"異動理由リスト"` (Transfer Reason List) — The screen-repeat designated item ID for `KKW00844SF02`, backed by the `ido_rsn_list_list` field of type `X33VDataTypeList`.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `key` | `String` | The list item identifier that determines which backing list to remove an element from. Its value follows naming conventions: when it starts with `"//"` it refers to a shared/common information list managed by the superclass; otherwise it matches a domain-specific list key such as `"顧客契約引継リスト"` (Customer Contract Inheritance List) or `"異動理由リスト"` (Transfer Reason List). It can take any string value, and only specific recognized keys trigger list mutations. |
| 2 | `index` | `int` | The zero-based index of the element to remove from the target list. It must be within the range `[0, list.size() - 1]` for the removal to take effect; out-of-range values are silently ignored. |

**Instance fields read by this method:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `cust_kei_hktgi_list_list` | `X33VDataTypeList` | Customer contract inheritance list — stores the repeatable list items for the customer contract transfer section (KKW00844SF01 screen-repeat designated item). |
| `ido_rsn_list_list` | `X33VDataTypeList` | Transfer reason list — stores the repeatable list items for the transfer/relocation reason section (KKW00844SF02 screen-repeat designated item). |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| D | `KKW00844SFBean.removeElementFromListData` | KKW00844SFBean | - | Calls `removeElementFromListData` in `KKW00844SFBean` |

### Method call analysis:

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| D | `super.removeElementFromListData` | X33VViewBaseBean | - (framework-managed shared lists) | Delegates removal of shared/common information list elements to the superclass (`X33VViewBaseBean`) when the key prefix is `"//"` |
| D | `cust_kei_hktgi_list_list.remove(index)` | KKW00844SFBean (local) | - (in-memory list) | Removes the element at the specified index from the customer contract inheritance list in memory |
| D | `ido_rsn_list_list.remove(index)` | KKW00844SFBean (local) | - (in-memory list) | Removes the element at the specified index from the transfer reason list in memory |

**CRUD Classification Summary:** This method performs exclusively **Delete (D)** operations. It operates entirely in-memory on `X33VDataTypeList` collections and never writes to or reads from a database directly. No SC (Service Component) or CBS (Common Business Service) calls are made.

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Class: KKW00844SFBean | `KKW00844SFBean.removeElementFromListData(String key, int index)` | local list removal (D) |

**Notes:** The method `removeElementFromListData` is invoked within the `KKW00844SFBean` class itself (self-call pattern, as shown in the code graph). This is likely called from screen event handlers or other bean methods during the processing of user actions that modify the repeatable lists on the KKW00844SF screen.

## 6. Per-Branch Detail Blocks

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

> Null guard: if the key is null, the method does nothing and returns immediately (implicit void return).

| # | Type | Code |
|---|------|------|
| 1 | SET | `// (no assignment)` |
| 2 | EXEC | `// Early return path when key is null — method completes without side effects` |

**Block 1.1** — [IF-ELSE] `(key.startsWith("//"))` — `"//" prefix convention` (L1530)

> When the key starts with `"//"`, this is a shared/common information list item. The method delegates to the superclass to handle removal, as noted in the comment: "共通情報ビューンのリストの場合" (For shared information view lists). These items are managed by the base class framework.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `super.removeElementFromListData(key, index)` // Delegate to superclass for shared/common information list removal — comment: "共有情報ビューンは基底クラスで処理" (Shared info views are handled in the base class) |

**Block 1.2** — [ELSE-IF] `(key.equals("顧客契約引継リスト"))` — `Customer Contract Inheritance List (KKW00844SF01 screen-repeat designated item)` (L1534)

> Removes an item from the customer contract inheritance list (`cust_kei_hktgi_list_list`) when the key matches the screen-repeat designated item `"顧客契約引継リスト"` (Customer Contract Inheritance List). The comment states: "データタイプが KKW00844SF01 の繰り返し指定項目" (Data type is the KKW00844SF01 repeat designated item).

| # | Type | Code |
|---|------|------|
| 1 | SET | `// (no assignment)` |
| 2 | CALL | `cust_kei_hktgi_list_list.remove(index)` // Remove the element at the specified index from the customer contract inheritance list |

**Block 1.2.1** — [IF] `(index >= 0 && index < cust_kei_hktgi_list_list.size())` (L1535)

> Bounds check: ensures the index is within the valid range of the current customer contract inheritance list before attempting removal. The comment reads: "指定のインデックスが現在のリストの範囲内なら、そのインデックスの内容を削除する" (If the specified index is within the range of the current list, remove the contents at that index).

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `cust_kei_hktgi_list_list.remove(index)` // Remove the item at the given index from the list. No-op when the condition below fails. |

**Block 1.3** — [ELSE-IF] `(key.equals("異動理由リスト"))` — `Transfer Reason List (KKW00844SF02 screen-repeat designated item)` (L1540)

> Removes an item from the transfer reason list (`ido_rsn_list_list`) when the key matches the screen-repeat designated item `"異動理由リスト"` (Transfer Reason List). The comment states: "データタイプが KKW00844SF02 の繰り返し指定項目" (Data type is the KKW00844SF02 repeat designated item).

| # | Type | Code |
|---|------|------|
| 1 | SET | `// (no assignment)` |
| 2 | CALL | `ido_rsn_list_list.remove(index)` // Remove the element at the specified index from the transfer reason list |

**Block 1.3.1** — [IF] `(index >= 0 && index < ido_rsn_list_list.size())` (L1541)

> Bounds check: ensures the index is within the valid range of the current transfer reason list before attempting removal. The comment reads: "指定のインデックスが現在のリストの範囲内なら、そのインデックスの内容を削除する" (If the specified index is within the range of the current list, remove the contents at that index).

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `ido_rsn_list_list.remove(index)` // Remove the item at the given index from the list. No-op when the condition below fails. |

**Block 2** — [ELSE / IMPLICIT] `key != null` but no matching condition (L1551)

> If the key is not null but does not match any of the three conditions (no `"//"` prefix, not `"顧客契約引継リスト"`, not `"異動理由リスト"`), the method silently returns without performing any removal. This is an implicit no-op branch with no explicit code body.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `// (implicit void return)` // No matching branch — method exits without side effects |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `cust_kei_hktgi_list_list` | Field | Customer contract inheritance list — an in-memory list of `X33VDataTypeList` items representing the customer contract transfer/inheritance data section on the KKW00844SF screen |
| `ido_rsn_list_list` | Field | Transfer reason list — an in-memory list of `X33VDataTypeList` items representing the relocation/transfer reason data section on the KKW00844SF screen |
| `顧客契約引継リスト` | Japanese field | Customer Contract Inheritance List — the screen-repeat designated item ID for the customer contract transfer section (KKW00844SF01) |
| `異動理由リスト` | Japanese field | Transfer Reason List — the screen-repeat designated item ID for the transfer/relocation reason section (KKW00844SF02) |
| `X33VViewBaseBean` | Class | Framework base class for view beans — provides common list management functionality including `removeElementFromListData` for shared information items |
| `X33VDataTypeList` | Class | Framework list type for view data — a typed list container holding `X33VDataTypeBeanInterface` objects, used for screen-repeat data binding |
| `X33VListedBeanInterface` | Interface | Framework interface marking a bean as providing list-type data for screen display |
| `X31CBaseBean` | Interface | Framework base bean interface for common view bean functionality |
| `//` (prefix) | Convention | Naming convention marker indicating a shared/common information list item — these are handled by the superclass (`X33VViewBaseBean`) rather than the screen-specific bean |
| KK | Abbreviation | Fujitsu KPI system screen prefix — internal screen identification prefix in the KKW (Kaitou/Warranty) module family |
| SF | Abbreviation | Screen type suffix — indicates a screen (form) bean in the Fujuto application framework |
| KKW00844SF | Module | A screen module in the warranty/account transfer domain — handles customer contract inheritance and transfer reasons |
| screen-repeat designated item | Concept | A data binding field on the screen that supports repeating rows (multiple entries) — the `X33VDataTypeList` backing these items allows dynamic add/remove of rows |
