# Business Logic — FUW07101SF02DBean.storeModelData() [67 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.FUW07101SF.FUW07101SF02DBean` |
| Layer | Service / Common Component (Web view data bean — part of the X33 framework's view-layer data binding) |
| Module | `FUW07101SF` (Package: `eo.web.webview.FUW07101SF`) |

## 1. Role

### FUW07101SF02DBean.storeModelData()

This method serves as a **central dispatch router** for propagating inbound model data into the appropriate nested bean properties within the `FUW07101SF02DBean` view-layer data object. In the K-Opticom web framework (X33), screen data is managed through a hierarchy of typed beans. This method receives raw key/subkey pairs along with an object value and routes the data to the correct target — either the top-level select-code properties (`select_cd_value`, `select_cd_state`), or into indexed entries of the `nm_list_list` (application count **name** list) or `val_list_list` (application count **value** list).

The method implements the **dispatcher/dispatch pattern** (also known as a routing or branching dispatcher): it inspects the `key` parameter to determine the data category, then delegates to the appropriate setter or recursively calls `storeModelData` on a child bean. For list-type keys, it extracts an index from the key string (e.g., `"nm_list/0"` → index `0`), bounds-checks it, casts the list element to the correct type, and recursively delegates storage to the child bean. This enables a single entry point to handle flat properties, structured select-code properties, and indexed list structures uniformly.

Its role in the larger system is as the **data hydration entry point** for this bean during form/model loading. When screen data flows back from a user interface (or is loaded from a stored model), this method is invoked to reconstruct the bean's internal state from serialized key-value pairs.

**Branch summary:**
- **Branch 1** — Key matches `"申込台数リスト選択値"` (Application count list selection values): routes to `setSelect_cd_value` or `setSelect_cd_state` based on `subkey`.
- **Branch 2** — Key matches `"申込台数名リスト"` (Application count name list): extracts index, validates bounds, and delegates to the `X33VDataTypeStringBean` child at that index.
- **Branch 3** — Key matches `"申込台数値リスト"` (Application count value list): extracts index, validates bounds, and delegates to the `X33VDataTypeStringBean` child at that index.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["storeModelData params"])
    CHECK_NULL["key == null or subkey == null"]
    EARLY_RETURN(["Return early"])
    FIND_SEP["int separaterPoint = key.indexOf('/')"]
    BRANCH_SELECT["key == '申込台数リスト選択値' (Application count list selection values)"]
    SUBVALUE_CHECK["subkey.equalsIgnoreCase('value')"]
    SET_VALUE["setSelect_cd_value"]
    SUBSTATE_CHECK["subkey.equalsIgnoreCase('state')"]
    SET_STATE["setSelect_cd_state"]
    BRANCH_NM["key == '申込台数名リスト' (Application count name list)"]
    NM_SUBSTR["key = key.substring(separaterPoint + 1)"]
    NM_TRY_PARSE["Integer.valueOf(key)"]
    NM_INDEX_NULL["tmpIndexInt != null"]
    NM_BOUNDS["tmpIndex >= 0 && tmpIndex < nm_list_list.size()"]
    NM_DELEGATE("nm_list_list.get(tmpIndex).storeModelData")
    BRANCH_VAL["key == '申込台数値リスト' (Application count value list)"]
    VAL_SUBSTR["key = key.substring(separaterPoint + 1)"]
    VAL_TRY_PARSE["Integer.valueOf(key)"]
    VAL_INDEX_NULL["tmpIndexInt != null"]
    VAL_BOUNDS["tmpIndex >= 0 && tmpIndex < val_list_list.size()"]
    VAL_DELEGATE("val_list_list.get(tmpIndex).storeModelData")
    END_NODE(["Method ends"])

    START --> CHECK_NULL
    CHECK_NULL -->|true| EARLY_RETURN
    CHECK_NULL -->|false| FIND_SEP
    FIND_SEP --> BRANCH_SELECT
    BRANCH_SELECT -->|true| SUBVALUE_CHECK
    SUBVALUE_CHECK -->|true| SET_VALUE
    SUBVALUE_CHECK -->|false| SUBSTATE_CHECK
    SUBSTATE_CHECK -->|true| SET_STATE
    SUBSTATE_CHECK -->|false| BRANCH_NM
    BRANCH_SELECT -->|false| BRANCH_NM
    BRANCH_NM -->|true| NM_SUBSTR
    NM_SUBSTR --> NM_TRY_PARSE
    NM_TRY_PARSE --> NM_INDEX_NULL
    NM_INDEX_NULL -->|true| NM_BOUNDS
    NM_INDEX_NULL -->|false| END_NODE
    NM_BOUNDS -->|true| NM_DELEGATE
    NM_BOUNDS -->|false| END_NODE
    NM_DELEGATE --> END_NODE
    BRANCH_NM -->|false| BRANCH_VAL
    BRANCH_VAL -->|true| VAL_SUBSTR
    VAL_SUBSTR --> VAL_TRY_PARSE
    VAL_TRY_PARSE --> VAL_INDEX_NULL
    VAL_INDEX_NULL -->|true| VAL_BOUNDS
    VAL_INDEX_NULL -->|false| END_NODE
    VAL_BOUNDS -->|true| VAL_DELEGATE
    VAL_BOUNDS -->|false| END_NODE
    VAL_DELEGATE --> END_NODE
    BRANCH_VAL -->|false| END_NODE
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `key` | `String` | The **item name** that identifies which data category to store into. Determines the dispatch branch: `"申込台数リスト選択値"` (application count list selection values — the select-code bean), `"申込台数名リスト"` (application count name list — names of services ordered), or `"申込台数値リスト"` (application count value list — numeric values of services ordered). For list keys, it carries an index suffix like `"nm_list/0"` or `"val_list/3"`. |
| 2 | `subkey` | `String` | The **sub-key** that further disambiguates the target property within the category. For the selection-values branch, it is `"value"` or `"state"` (case-insensitive), mapping to the display value and state flag of the select code respectively. For list branches, it is forwarded to the child bean's `storeModelData` to target the child's own property. |
| 3 | `in_value` | `Object` | The **data value** to be stored. Its actual type depends on the context: for select-code it is a `String`; for list entries it is forwarded to the child bean's `storeModelData`. The caller casts appropriately before passing. |
| 4 | `isSetAsString` | `boolean` | When `true`, forces the value to be stored as a `String` type even if the target field is a `Long`-type property. This ensures format consistency for Long-typed fields that need to receive string-formatted values (e.g., database strings parsed as Long). |

**Instance fields read by this method:**

| Field | Type | Usage |
|-------|------|-------|
| `nm_list_list` | `X33VDataTypeList` | The list of name-type child beans. Bound-checked before access. |
| `val_list_list` | `X33VDataTypeList` | The list of value-type child beans. Bound-checked before access. |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `JKKAdEditCC.substring` | JKKAdEditCC | - | Calls `substring` in `JKKAdEditCC` |
| - | `JKKAdEdit.substring` | JKKAdEdit | - | Calls `substring` in `JKKAdEdit` |
| - | `JKKTelnoInfoAddMapperCC.substring` | JKKTelnoInfoAddMapperCC | - | Calls `substring` in `JKKTelnoInfoAddMapperCC` |
| - | `JDKejbStringEdit.substring` | JDKejbStringEdit | - | Calls `substring` in `JDKejbStringEdit` |
| - | `FUW07101SF02DBean.setSelect_cd_state` | FUW07101SF02DBean | - | Calls `setSelect_cd_state` in `FUW07101SF02DBean` |
| - | `FUW07101SF02DBean.setSelect_cd_value` | FUW07101SF02DBean | - | Calls `setSelect_cd_value` in `FUW07101SF02DBean` |
| - | `FUW07101SF02DBean.storeModelData` | FUW07101SF02DBean | - | Calls `storeModelData` in `FUW07101SF02DBean` |

This method performs **no direct database or entity operations**. It is a pure in-memory data routing method that delegates to child beans and invokes setter methods on its own class.

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| U | `setSelect_cd_value` | FUW07101SF02DBean | - | Sets the `select_cd_value` field with the string display value for the select-code item (Update in-memory state) |
| U | `setSelect_cd_state` | FUW07101SF02DBean | - | Sets the `select_cd_state` field with the state string for the select-code item (Update in-memory state) |
| U | `nm_list_list.get().storeModelData` | FUW07101SF02DBean | - | Recursively delegates model storage to the name-list child bean at the resolved index (Update in-memory state) |
| U | `val_list_list.get().storeModelData` | FUW07101SF02DBean | - | Recursively delegates model storage to the value-list child bean at the resolved index (Update in-memory state) |

## 5. Dependency Trace

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

No screen/batch entry points found within 8 hops. Direct callers found: 2 methods.
Terminal operations from this method: `storeModelData` [-], `storeModelData` [-], `storeModelData` [-], `substring` [-], `substring` [-], `substring` [-], `substring` [-], `storeModelData` [-], `storeModelData` [-], `storeModelData` [-], `substring` [-], `substring` [-], `substring` [-], `substring` [-], `setSelect_cd_state` [-], `setSelect_cd_value` [-]

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | `FUW07101SF02DBean` | `FUW07101SF02DBean.storeModelData` | `storeModelData [-]` |
| 2 | `FUW07101SF02DBean` | `FUW07101SF02DBean.storeModelData` | `setSelect_cd_value [-]` |
| 3 | `FUW07101SF02DBean` | `FUW07101SF02DBean.storeModelData` | `setSelect_cd_state [-]` |

**Note:** This method is invoked internally (self-referential recursion through child beans). No external screen or batch entry point is found within 8 hops in the code graph. The method operates purely within the view bean layer of the `FUW07101SF` module.

## 6. Per-Branch Detail Blocks

**Block 1** — [IF] `(key == null || subkey == null)` (L257)

> Early exit guard: if either the item name key or the sub-key is null, return immediately. This prevents null pointer exceptions during dispatch.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `key.indexOf("/")` — searches for the first separator in key [-> no constant] |
| 2 | RETURN | `return;` // If key or subkey is null, halt processing [-> null guard] |

**Block 2** — [IF] `(key.equals("申込台数リスト選択値"))` — Key: Application count list selection values (L262)

> Dispatches select-code data: if `subkey` is `"value"` (case-insensitive), sets the display value; if `"state"` (case-insensitive), sets the state flag. This branch handles the select-code type items where both a display value and an internal state must be tracked.

| # | Type | Code |
|---|------|------|
| 1 | IF | `subkey.equalsIgnoreCase("value")` — checks subkey is "value" [-> no constant] |
| 2 | EXEC | `setSelect_cd_value((String)in_value)` // Casts and stores the string value for the select code [-> no constant] |
| 3 | ELSE-IF | `subkey.equalsIgnoreCase("state")` // subkeyが"state"の場合、ステータスを返す [-> no constant] |
| 4 | EXEC | `setSelect_cd_state((String)in_value)` // Casts and stores the state string for the select code [-> no constant] |

**Block 3** — [ELSE-IF] `(key.equals("申込台数名リスト"))` — Key: Application count name list (L270)

> Handles the name list: extracts the index from the key (e.g., `"nm_list/0"` → `"0"`), parses it as an integer, validates it is a valid non-negative index within the list bounds, then casts the list element to `X33VDataTypeStringBean` and recursively delegates storage via its `storeModelData` method. The child bean is one of `X33VDataTypeStringBean`, `X33VDataTypeLongBean`, or `X33VDataTypeBooleanBean` depending on the item definition type.

| # | Type | Code |
|---|------|------|
| 1 | SET | `key = key.substring(separaterPoint + 1)` // Extracts the part after the first "/" from key [-> no constant] |
| 2 | SET | `Integer tmpIndexInt = null;` // Initialize index holder |
| 3 | TRY | `tmpIndexInt = Integer.valueOf(key);` // Attempt to parse index from remaining key string [-> no constant] |
| 4 | CATCH | `catch (NumberFormatException e) { tmpIndexInt = null; }` // Index value is not a numeric string — return null [-> no constant] |
| 5 | IF | `tmpIndexInt != null` — index value is a numeric string (L287) |
| 6 | SET | `int tmpIndex = tmpIndexInt.intValue();` // Unbox Integer to int [-> no constant] |
| 7 | IF | `tmpIndex >= 0 && tmpIndex < nm_list_list.size()` — index is within list bounds (L289) |
| 8 | CAST + CALL | `((X33VDataTypeStringBean)nm_list_list.get(tmpIndex)).storeModelData(subkey, in_value);` // Casts and delegates [-> no constant] |

> キャスト部分は、項目定義型にあわせ X33VDataTypeStringBean, X33VDataTypeLongBean, X33VDataTypeBooleanBean のうち1つを指定。X33VDataTypeLongBean ではsubkeyと入力値およびisSetAsStringフラグを引数に指定.

**Block 4** — [ELSE-IF] `(key.equals("申込台数値リスト"))` — Key: Application count value list (L296)

> Handles the value list with the same pattern as the name list: extracts the index from the key string, parses it as an integer, validates bounds, casts the list element to `X33VDataTypeStringBean`, and recursively delegates. This branch manages numeric value entries of services ordered, as opposed to the name list which manages display names.

| # | Type | Code |
|---|------|------|
| 1 | SET | `key = key.substring(separaterPoint + 1)` // Extracts the part after the first "/" from key [-> no constant] |
| 2 | SET | `Integer tmpIndexInt = null;` // Initialize index holder |
| 3 | TRY | `tmpIndexInt = Integer.valueOf(key);` // Attempt to parse index from remaining key string [-> no constant] |
| 4 | CATCH | `catch (NumberFormatException e) { tmpIndexInt = null; }` // Index value is not a numeric string — return null [-> no constant] |
| 5 | IF | `tmpIndexInt != null` — index value is a numeric string (L310) |
| 6 | SET | `int tmpIndex = tmpIndexInt.intValue();` // Unbox Integer to int [-> no constant] |
| 7 | IF | `tmpIndex >= 0 && tmpIndex < val_list_list.size()` — index is within list bounds (L312) |
| 8 | CAST + CALL | `((X33VDataTypeStringBean)val_list_list.get(tmpIndex)).storeModelData(subkey, in_value);` // Casts and delegates [-> no constant] |

> キャスト部分は、項目定義型にあわせ X33VDataTypeStringBean, X33VDataTypeLongBean, X33VDataTypeBooleanBean のうち1つを指定。X33VDataTypeLongBean ではsubkeyと入力値およびisSetAsStringフラグを引数に指定.

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `申込台数リスト選択値` (shinmu taisuu risento sentaku-chi) | Field — Japanese key | Application count list selection values — the display value and state for select-code items used to configure how many services (lines) the customer is ordering |
| `申込台数名リスト` (shinmu taisuu mei risuto) | Field — Japanese key | Application count name list — a list of display names for each service line item (e.g., "FTTH Basic Plan", "Mail Premium") |
| `申込台数値リスト` (shinmu taisuu chi risuto) | Field — Japanese key | Application count value list — a list of numeric/configuration values for each service line item (e.g., speed tier, plan ID) |
| `select_cd_value` | Field | Select code display value — the human-readable string shown in the UI for a select-code item |
| `select_cd_state` | Field | Select code internal state — the internal state identifier for a select-code item, used for server-side validation and processing |
| `nm_list_list` | Field | Name list list — an `X33VDataTypeList` containing child beans that hold the name-type data for each service line |
| `val_list_list` | Field | Value list list — an `X33VDataTypeList` containing child beans that hold the value-type data for each service line |
| `isSetAsString` | Parameter | Set-as-string flag — when true, forces the value to be stored as a String type even for Long-type fields, ensuring format consistency |
| X33 | Acronym | Fujitsu Futurity Web Client Framework V3.3 — the enterprise web application framework used for screen definition and data binding |
| X33VDataTypeList | Class | A framework-provided generic list data type that holds typed child bean objects |
| X33VDataTypeStringBean | Class | A framework-provided bean for String-typed data fields with `storeModelData` and setter methods |
| X33VDataTypeLongBean | Class | A framework-provided bean for Long-typed data fields |
| X33VDataTypeBooleanBean | Class | A framework-provided bean for Boolean-typed data fields |
| dispatcher pattern | Design pattern | A routing pattern where a single entry point inspects a key/flag to determine which handler to invoke |
| model data | Domain term | Serialized form data received from the UI layer, stored as key-value pairs that reconstruct the bean's state |
