# Business Logic — KKW00121SF01DBean.removeElementFromListData() [62 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.KKW00121SF.KKW00121SF01DBean` |
| Layer | Utility (Data Bean / DBean — web presentation layer) |
| Module | `KKW00121SF` (Package: `eo.web.webview.KKW00121SF`) |

## 1. Role

### KKW00121SF01DBean.removeElementFromListData()

This method is a **routing/delegation utility** that removes an element from one of eight synchronized list data structures (member fields) within a web bean, based on a string key discriminator. It implements a **discriminated routing pattern** — the `key` parameter acts as a lookup selector that determines which of the eight internal `X33VDataTypeList` collections the `index` applies to. This method is shared across the entire screen module `KKW00121SF` and is **inherited** by the main bean `KKW00121SFBean` via `super.removeElementFromListData(key, index)`, making it a reusable base-class utility for all screens in this module.

The method operates on eight distinct list data categories: **Template ID** (`template_id_list`), **Status** (`status_list`), **Item Check Error** (`item_check_err_list`), **Item ID** (`item_id_list`), **Screen ID** (`gamen_id_list`), **Message ID** (`message_id_list`), **Replace String** (`replace_str_list`), and **Screen Item ID** (`screen_item_id_list`). These lists are part of an X33 framework data bean model — each list represents a column of data displayed or edited on a screen page. When a user performs a row-deletion action on a screen, the caller passes the column name (key) and the row index to this method, which removes the element from the matching list. The method also validates that the index is within bounds before removing; out-of-range indices are silently ignored (no exception thrown).

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["removeElementFromListData key, index"])
    CHECK_KEY["key != null?"]
    BRANCH["Branch on key value"]

    BTPL["Template ID"]
    BSTS["Status"]
    BICE["Item Check Error"]
    BITE["Item ID"]
    BGAM["Screen ID"]
    BMES["Message ID"]
    BREP["Replace String"]
    BSII["Screen Item ID"]
    NO_MATCH["key not recognized"]

    CHECKTPL["index >= 0 AND index < template_id_list.size()"]
    STTPL["template_id_list.remove(index)"]

    CHECKSTS["index >= 0 AND index < status_list.size()"]
    STSTS["status_list.remove(index)"]

    CHECKICE["index >= 0 AND index < item_check_err_list.size()"]
    STICE["item_check_err_list.remove(index)"]

    CHECKITE["index >= 0 AND index < item_id_list.size()"]
    STITE["item_id_list.remove(index)"]

    CHECKGAM["index >= 0 AND index < gamen_id_list.size()"]
    STGAM["gamen_id_list.remove(index)"]

    CHECKMES["index >= 0 AND index < message_id_list.size()"]
    STMES["message_id_list.remove(index)"]

    CHECKREP["index >= 0 AND index < replace_str_list.size()"]
    STREP["replace_str_list.remove(index)"]

    CHECKSII["index >= 0 AND index < screen_item_id_list.size()"]
    STSII["screen_item_id_list.remove(index)"]

    END_NODE(["Return / Next"])

    START --> CHECK_KEY
    CHECK_KEY -- "true" --> BRANCH
    CHECK_KEY -- "false" --> END_NODE

    BRANCH --> BTPL
    BRANCH --> BSTS
    BRANCH --> BICE
    BRANCH --> BITE
    BRANCH --> BGAM
    BRANCH --> BMES
    BRANCH --> BREP
    BRANCH --> BSII
    BRANCH --> NO_MATCH

    BTPL --> CHECKTPL
    BSTS --> CHECKSTS
    BICE --> CHECKICE
    BITE --> CHECKITE
    BGAM --> CHECKGAM
    BMES --> CHECKMES
    BREP --> CHECKREP
    BSII --> CHECKSII
    NO_MATCH --> END_NODE

    CHECKTPL -- "true" --> STTPL
    CHECKTPL -- "false" --> END_NODE
    CHECKSTS -- "true" --> STSTS
    CHECKSTS -- "false" --> END_NODE
    CHECKICE -- "true" --> STICE
    CHECKICE -- "false" --> END_NODE
    CHECKITE -- "true" --> STITE
    CHECKITE -- "false" --> END_NODE
    CHECKGAM -- "true" --> STGAM
    CHECKGAM -- "false" --> END_NODE
    CHECKMES -- "true" --> STMES
    CHECKMES -- "false" --> END_NODE
    CHECKREP -- "true" --> STREP
    CHECKREP -- "false" --> END_NODE
    CHECKSII -- "true" --> STSII
    CHECKSII -- "false" --> END_NODE
    STTPL --> END_NODE
    STSTS --> END_NODE
    STICE --> END_NODE
    STITE --> END_NODE
    STGAM --> END_NODE
    STMES --> END_NODE
    STREP --> END_NODE
    STSII --> END_NODE
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `key` | `String` | The column/list category selector. A Japanese string literal that determines which of the eight internal `X33VDataTypeList` collections to operate on. Valid values map to screen data columns: "テンプレートID" (Template ID), "ステータス" (Status), "項目チェックエラー" (Item Check Error), "項目ID" (Item ID), "画面ID" (Screen ID), "メッセージID" (Message ID), "埋め込み文字列" (Replace String), "画面項目ID" (Screen Item ID). If `null`, the method returns immediately without any effect. |
| 2 | `index` | `int` | The zero-based row index within the target list to remove. If the index is negative or exceeds the current list size, the removal is silently skipped — the method does not throw an `IndexOutOfBoundsException` despite the underlying `ArrayList.remove()` doing so; the bounds check acts as a guard. |

**Instance fields read:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `template_id_list` | `X33VDataTypeList` | Collection of template ID values displayed on the screen |
| `status_list` | `X33VDataTypeList` | Collection of status values displayed on the screen |
| `item_check_err_list` | `X33VDataTypeList` | Collection of item-level validation error flags |
| `item_id_list` | `X33VDataTypeList` | Collection of item identifiers displayed on the screen |
| `gamen_id_list` | `X33VDataTypeList` | Collection of screen identifiers displayed on the screen |
| `message_id_list` | `X33VDataTypeList` | Collection of message identifiers displayed on the screen |
| `replace_str_list` | `X33VDataTypeList` | Collection of embedded/replaceable string templates |
| `screen_item_id_list` | `X33VDataTypeList` | Collection of screen item identifiers displayed on the screen |

## 4. CRUD Operations / Called Services

This method performs **no external service calls**, no SC (Service Component) invocations, and no direct database operations. It is a pure in-memory data bean mutation.

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| D (local) | — | — | In-memory lists (`template_id_list`, `status_list`, etc.) | Removes one element from the target `X33VDataTypeList` collection at the specified index. This is an in-memory list mutation only — it does not persist to any database. |

## 5. Dependency Trace

The `removeElementFromListData` method is defined in the base class `KKW00121SF01DBean` and is **inherited** by the main bean `KKW00121SFBean` via `super.removeElementFromListData(key, index)`. No direct callers (i.e., invocations of `.removeElementFromListData(...)`) were found within the `KKW00121SF` module. It exists as a reusable utility method intended to be called by screens within this module, but no call sites were identified in the searched codebase (the method may be invoked dynamically through the X33 framework or the callers may reside in other modules not present in the current source tree).

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | (none found in KKW00121SF module) | `KKW00121SFBean.removeElementFromListData(key, index)` -> `KKW00121SF01DBean.removeElementFromListData(key, index)` (via super) | In-memory list D (no SC / no DB) |

**Note:** The method also has an identical overriding definition in several FUW*-module beans (e.g., `FUW00912SFBean`, `FUW00926SFBean`, `FUW00959SFBean`, `FUW00964SFBean`, `FUW00927SFBean`) which call `super.removeElementFromListData(key, index)`, confirming it is a **shared base-class utility** across multiple screen modules in the system.

## 6. Per-Branch Detail Blocks

**Block 1** — IF `(key != null)` (L1062)

> Guard clause: if the key parameter is null, return immediately without performing any operation.

| # | Type | Code |
|---|------|------|
| 1 | IF | `if (key != null)` // null guard; exit early if key is null [-> No constant] |

**Block 1.1** — ELSE-IF `"テンプレートID" (Template ID)` (L1065-1072)

> The key matches the Japanese string "テンプレートID" (Template ID). If the index is within bounds, remove the element at that index from `template_id_list`.

| # | Type | Code |
|---|------|------|
| 1 | ELSE-IF | `key.equals("テンプレートID")` // key equals "Template ID" [-> "テンプレートID" = "テンプレートID"] |
| 2 | IF | `if (index >= 0 && index < template_id_list.size())` // index within current list bounds [-> No constant] |
| 3 | EXEC | `template_id_list.remove(index);` // remove element at index from template ID list |

**Block 1.2** — ELSE-IF `"ステータス" (Status)` (L1075-1082)

> The key matches the Japanese string "ステータス" (Status). If the index is within bounds, remove the element from `status_list`.

| # | Type | Code |
|---|------|------|
| 1 | ELSE-IF | `else if (key.equals("ステータス"))` // key equals "Status" [-> "ステータス" = "ステータス"] |
| 2 | IF | `if (index >= 0 && index < status_list.size())` // index within bounds [-> No constant] |
| 3 | EXEC | `status_list.remove(index);` // remove element at index from status list |

**Block 1.3** — ELSE-IF `"項目チェックエラー" (Item Check Error)` (L1085-1092)

> The key matches the Japanese string "項目チェックエラー" (Item Check Error). If the index is within bounds, remove the element from `item_check_err_list`.

| # | Type | Code |
|---|------|------|
| 1 | ELSE-IF | `else if (key.equals("項目チェックエラー"))` // key equals "Item Check Error" [-> "項目チェックエラー" = "項目チェックエラー"] |
| 2 | IF | `if (index >= 0 && index < item_check_err_list.size())` // index within bounds [-> No constant] |
| 3 | EXEC | `item_check_err_list.remove(index);` // remove element at index from item check error list |

**Block 1.4** — ELSE-IF `"項目ID" (Item ID)` (L1095-1102)

> The key matches the Japanese string "項目ID" (Item ID). If the index is within bounds, remove the element from `item_id_list`.

| # | Type | Code |
|---|------|------|
| 1 | ELSE-IF | `else if (key.equals("項目ID"))` // key equals "Item ID" [-> "項目ID" = "項目ID"] |
| 2 | IF | `if (index >= 0 && index < item_id_list.size())` // index within bounds [-> No constant] |
| 3 | EXEC | `item_id_list.remove(index);` // remove element at index from item ID list |

**Block 1.5** — ELSE-IF `"画面ID" (Screen ID)` (L1105-1112)

> The key matches the Japanese string "画面ID" (Screen ID). If the index is within bounds, remove the element from `gamen_id_list`.

| # | Type | Code |
|---|------|------|
| 1 | ELSE-IF | `else if (key.equals("画面ID"))` // key equals "Screen ID" [-> "画面ID" = "画面ID"] |
| 2 | IF | `if (index >= 0 && index < gamen_id_list.size())` // index within bounds [-> No constant] |
| 3 | EXEC | `gamen_id_list.remove(index);` // remove element at index from screen ID list |

**Block 1.6** — ELSE-IF `"メッセージID" (Message ID)` (L1115-1122)

> The key matches the Japanese string "メッセージID" (Message ID). If the index is within bounds, remove the element from `message_id_list`.

| # | Type | Code |
|---|------|------|
| 1 | ELSE-IF | `else if (key.equals("メッセージID"))` // key equals "Message ID" [-> "メッセージID" = "メッセージID"] |
| 2 | IF | `if (index >= 0 && index < message_id_list.size())` // index within bounds [-> No constant] |
| 3 | EXEC | `message_id_list.remove(index);` // remove element at index from message ID list |

**Block 1.7** — ELSE-IF `"埋め込み文字列" (Replace String)` (L1125-1132)

> The key matches the Japanese string "埋め込み文字列" (Replace String / Embedded String). If the index is within bounds, remove the element from `replace_str_list`.

| # | Type | Code |
|---|------|------|
| 1 | ELSE-IF | `else if (key.equals("埋め込み文字列"))` // key equals "Replace String" [-> "埋め込み文字列" = "埋め込み文字列"] |
| 2 | IF | `if (index >= 0 && index < replace_str_list.size())` // index within bounds [-> No constant] |
| 3 | EXEC | `replace_str_list.remove(index);` // remove element at index from replace string list |

**Block 1.8** — ELSE-IF `"画面項目ID" (Screen Item ID)` (L1135-1142)

> The key matches the Japanese string "画面項目ID" (Screen Item ID). If the index is within bounds, remove the element from `screen_item_id_list`.

| # | Type | Code |
|---|------|------|
| 1 | ELSE-IF | `else if (key.equals("画面項目ID"))` // key equals "Screen Item ID" [-> "画面項目ID" = "画面項目ID"] |
| 2 | IF | `if (index >= 0 && index < screen_item_id_list.size())` // index within bounds [-> No constant] |
| 3 | EXEC | `screen_item_id_list.remove(index);` // remove element at index from screen item ID list |

**Block 2** — ELSE-IF `(key not recognized)` (L1145-1149)

> If the key does not match any of the eight recognized string literals, no action is taken. The method simply falls through to the end of the outer if-block and returns.

| # | Type | Code |
|---|------|------|
| 1 | implicit | No else branch defined; unrecognized keys are silently ignored (no action, no exception) |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `template_id_list` | Field | Template ID list — collection of template identifiers for screen data rows |
| `status_list` | Field | Status list — collection of status values associated with screen data rows |
| `item_check_err_list` | Field | Item check error list — collection of validation error flags per item |
| `item_id_list` | Field | Item ID list — collection of item identifiers for screen data rows |
| `gamen_id_list` | Field | Screen ID list — collection of screen identifiers (画面ID = "gamen ID") |
| `message_id_list` | Field | Message ID list — collection of message identifiers for screen data rows |
| `replace_str_list` | Field | Replace string list — collection of embedded/replaceable text templates |
| `screen_item_id_list` | Field | Screen item ID list — collection of screen-level item identifiers |
| `X33VDataTypeList` | Type | X33 framework typed list — a data structure from the Fujitsu Futurity X33 web framework that wraps a list with type information for JSF/facelets rendering |
| `X33VDataTypeBeanInterface` | Interface | X33 data bean interface — contract for classes that hold screen data fields |
| `X33VListedBeanInterface` | Interface | X33 listed bean interface — contract for beans that manage list/collection data displayed in tables |
| DBean | Abbreviation | Data Bean — a presentation-layer bean holding form/screen data (as opposed to logic or persistence) |
| キー (key) | Japanese | Key — column/category discriminator used to select which data list to operate on |
| インデックス番号 (index) | Japanese | Index number — zero-based position of the element to remove from the target list |
| 項目名 (key field) | Japanese | Item name — the column/category name used to identify which list to modify |
| 削除対象のインデックス番号 (index param) | Japanese | Index number of the removal target — the position in the list of the element to be deleted |
| 配列項目 (array item) | Japanese | Array item — refers to the list data columns managed by the bean |
| 画面項目ID (screen_item_id) | Japanese | Screen item ID — identifier for items displayed on a specific screen page |
| 埋め込み文字列 (replace_str) | Japanese | Embedded/replaceable string — text templates that can be substituted or replaced within the UI |
| X33SException | Type | X33 framework exception — checked exception thrown by X33 framework operations |
