# Business Logic — CRW03407SF01DBean.storeModelData() [93 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.CRW03407SF.CRW03407SF01DBean` |
| Layer | Component — Data Bean / DTO (WebView domain bean) |
| Module | `CRW03407SF` (Package: `eo.web.webview.CRW03407SF`) |

## 1. Role

### CRW03407SF01DBean.storeModelData()

This method is the **data-population entry point** for a WebView data bean in the telecom order history system (CRW03407SF). It receives a logical item name (`key`), a sub-key identifying which property within that item should be set, and the raw value (`in_value`). Based on the `key` value, it dispatches to one of four property-setter paths: (1) a single-index external-connection-URL-number item (`対応履歴外部接続URL番号インデックス` — "Response History External Connection URL Number Index"), (2) an external-connection-URL-number list (`対応履歴外部接続URL番号リスト` — "Response History External Connection URL Number List"), (3) an external-connection-URL list (`対応履歴外部接続URLリスト` — "Response History External Connection URL List"), or (4) an external-connection-URL-name list (`対応履歴外部接続URL名リスト` — "Response History External Connection URL Name List").

The method implements a **routing/dispatch pattern**: it matches the `key` string to determine which domain data structure the value belongs to, then either calls a direct property setter (for the index item) or delegates into a child bean's `storeModelData` (for list items). This design allows the same entry point to serve both single-value fields and array-based list fields, providing a uniform API for screen-binding code to populate bean properties.

Its **role in the larger system** is as a shared utility within the data bean layer — called by many screen handlers, model loaders, and re-entrant data-binding cycles to push incoming form/model data back into the bean's internal fields and nested child beans. The method supports bidirectional data flow: screen code can call it to push values into the bean, and the bean's own nested children recursively invoke the same method for their sub-properties.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["storeModelData(key, subkey, in_value, isSetAsString)"])

    START --> NULL_CHECK["Check: key == null OR subkey == null"]
    NULL_CHECK --> |"Yes"| EARLY_RETURN["Early return (no processing)"]
    NULL_CHECK --> |"No"| FIND_SEP["Find separator '/' in key"]

    FIND_SEP --> CHECK_IDX["key = '対応履歴外部接続URL番号インデックス'"]
    CHECK_IDX --> |"Yes"| SUBKEY_CHECK["Check subkey"]
    SUBKEY_CHECK --> |"value"| SET_VALUE["setL0_taiorrk_out_url_no_idx_value((String)in_value)"]
    SUBKEY_CHECK --> |"enable"| SET_ENABLED["setL0_taiorrk_out_url_no_idx_enabled((Boolean)in_value)"]
    SUBKEY_CHECK --> |"state"| SET_STATE["setL0_taiorrk_out_url_no_idx_state((String)in_value)"]
    SUBKEY_CHECK --> |"other"| NOOP1["No operation"]

    CHECK_IDX --> |"No"| CHECK_LIST_NO["key = '対応履歴外部接続URL番号リスト'"]
    CHECK_LIST_NO --> |"Yes"| PARSE_IDX_NO["Parse index from key (substring after '/')"]
    PARSE_IDX_NO --> TRY_IDX_NO["Try Integer.valueOf(key)"]
    TRY_IDX_NO --> |"Success"| RANGE_CHECK_NO["tmpIndex >= 0 AND tmpIndex < l0_taiorrk_out_url_no_list.size()"]
    TRY_IDX_NO --> |"NumberFormatException"| NOOP_IDX_NO["tmpIndexInt = null"]
    RANGE_CHECK_NO --> |"Yes"| DELEGATE_NO["Cast to X33VDataTypeStringBean, call storeModelData(subkey, in_value)"]
    RANGE_CHECK_NO --> |"No"| NOOP2["No operation"]
    NOOP_IDX_NO --> END_NO(["End"])
    DELEGATE_NO --> END_NO
    NOOP2 --> END_NO

    CHECK_LIST_NO --> |"No"| CHECK_LIST_URL["key = '対応履歴外部接続URLリスト'"]
    CHECK_LIST_URL --> |"Yes"| PARSE_IDX_URL["Parse index from key (substring after '/')"]
    PARSE_IDX_URL --> TRY_IDX_URL["Try Integer.valueOf(key)"]
    TRY_IDX_URL --> |"Success"| RANGE_CHECK_URL["tmpIndex >= 0 AND tmpIndex < l0_taiorrk_out_url_list.size()"]
    TRY_IDX_URL --> |"NumberFormatException"| NOOP_IDX_URL["tmpIndexInt = null"]
    RANGE_CHECK_URL --> |"Yes"| DELEGATE_URL["Cast to X33VDataTypeStringBean, call storeModelData(subkey, in_value)"]
    RANGE_CHECK_URL --> |"No"| NOOP3["No operation"]
    NOOP_IDX_URL --> END_URL(["End"])
    DELEGATE_URL --> END_URL
    NOOP3 --> END_URL

    CHECK_LIST_URL --> |"No"| CHECK_LIST_NM["key = '対応履歴外部接続URL名リスト'"]
    CHECK_LIST_NM --> |"Yes"| PARSE_IDX_NM["Parse index from key (substring after '/')"]
    PARSE_IDX_NM --> TRY_IDX_NM["Try Integer.valueOf(key)"]
    TRY_IDX_NM --> |"Success"| RANGE_CHECK_NM["tmpIndex >= 0 AND tmpIndex < l0_taiorrk_out_url_nm_list.size()"]
    TRY_IDX_NM --> |"NumberFormatException"| NOOP_IDX_NM["tmpIndexInt = null"]
    RANGE_CHECK_NM --> |"Yes"| DELEGATE_NM["Cast to X33VDataTypeStringBean, call storeModelData(subkey, in_value)"]
    RANGE_CHECK_NM --> |"No"| NOOP4["No operation"]
    NOOP_IDX_NM --> END_NM(["End"])
    DELEGATE_NM --> END_NM
    NOOP4 --> END_NM

    CHECK_IDX --> |"No"| DEFAULT["No matching key — no operation"]
    CHECK_LIST_NO --> |"No"| DEFAULT
    CHECK_LIST_URL --> |"No"| DEFAULT
    CHECK_LIST_NM --> |"No"| DEFAULT
    DEFAULT --> END_DEFAULT(["End"])
    SET_VALUE --> END_DEFAULT
    SET_ENABLED --> END_DEFAULT
    SET_STATE --> END_DEFAULT
    NOOP1 --> END_DEFAULT
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `key` | `String` | The logical item name that identifies which property group to populate. Acts as a routing discriminator — determines whether the value belongs to a single-value index field or one of three list-based fields. Possible values: the Japanese-string item names `対応履歴外部接続URL番号インデックス`, `対応履歴外部接続URL番号リスト`, `対応履歴外部接続URLリスト`, `対応履歴外部接続URL名リスト`, or list-item keys with an appended `"/<index>"` suffix (e.g., `l0_taiorrk_out_url_no/0`). |
| 2 | `subkey` | `String` | A sub-property identifier within the matched item. For the index item, valid values are `"value"`, `"enable"`, or `"state"` (case-insensitive), corresponding to the URL number value, its enabled flag, and its UI state string. For list items, it is forwarded to the child bean's `storeModelData` to identify which child property to set. |
| 3 | `in_value` | `Object` | The raw data value to store. Its actual type depends on the `key`/`subkey` combination: `String` for index `value`, `Boolean` for index `enable`, `String` for index `state`, and `Object` forwarded to the child bean for list items. |
| 4 | `isSetAsString` | `boolean` | A flag indicating whether a `Long`-type item's `Value` property should be set with a `String` value. Forwarded to child bean `storeModelData` calls for list items; not used for the index item's direct setters. |

**Instance fields read by this method:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `l0_taiorrk_out_url_no_list` | `X33VDataTypeList` | List of external-connection-URL-number beans (each item is an `X33VDataTypeStringBean`). Used when `key` matches the URL number list item name. |
| `l0_taiorrk_out_url_list` | `X33VDataTypeList` | List of external-connection-URL beans (each item is an `X33VDataTypeStringBean`). Used when `key` matches the URL list item name. |
| `l0_taiorrk_out_url_nm_list` | `X33VDataTypeList` | List of external-connection-URL-name beans (each item is an `X33VDataTypeStringBean`). Used when `key` matches the URL name list item name. |

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `JKKAdEditCC.substring` | JKKAdEditCC | - | Calls `substring` in `JKKAdEditCC` — extracts substring from string |
| - | `JKKAdEdit.substring` | JKKAdEdit | - | Calls `substring` in `JKKAdEdit` — extracts substring from string |
| - | `JKKTelnoInfoAddMapperCC.substring` | JKKTelnoInfoAddMapperCC | - | Calls `substring` in `JKKTelnoInfoAddMapperCC` — extracts substring from string |
| - | `JDKejbStringEdit.substring` | JDKejbStringEdit | - | Calls `substring` in `JDKejbStringEdit` — extracts substring from string |
| - | `CRW03407SF01DBean.setL0_taiorrk_out_url_no_idx_enabled` | CRW03407SF01DBean | - | Sets the enabled flag for the URL number index field |
| - | `CRW03407SF01DBean.setL0_taiorrk_out_url_no_idx_state` | CRW03407SF01DBean | - | Sets the UI state string for the URL number index field |
| - | `CRW03407SF01DBean.setL0_taiorrk_out_url_no_idx_value` | CRW03407SF01DBean | - | Sets the URL number value for the URL number index field |
| - | `CRW03407SF01DBean.storeModelData` | CRW03407SF01DBean | - | Recursively delegates to child bean's storeModelData for list items |

**Note:** This method is a **pure data-setting (U)** operation — it does not perform database reads or writes, nor does it invoke any SC/CBS service components. All calls are to local field setters (direct property assignment) or recursive `storeModelData` delegation to child beans in the list.

## 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` [-], `storeModelData` [-], `storeModelData` [-], `storeModelData` [-], `substring` [-], `substring` [-], `substring` [-]

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | (Self-recursion) | `CRW03407SF01DBean.storeModelData` -> `storeModelData` (recursive) | `storeModelData` [U] - (child bean delegation) |
| 2 | (Screen model binding) | Screen/Batch entry -> `CRW03407SF01DBean.storeModelData` | `storeModelData` [U] -, `setL0_taiorrk_out_url_no_idx_*` [U] - |

**Notes:**
- The pre-computed caller data shows only self-recursions and internal bean binding — no external screen or CBS entry points were identified in the caller graph.
- The method is called during **model-to-bean data binding cycles**, where screen handlers push form data into the bean and the bean recursively populates its child list items.
- The terminal operations are all **local setters** (U = Update) or **recursive delegations** — no external SC/CBS calls, no database operations.

## 6. Per-Branch Detail Blocks

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

Early exit guard: if either the item name or sub-key is null, the method returns immediately without any processing. This prevents `NullPointerException` on subsequent operations and is a standard null-safety pattern for data-binding entry points.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `return;` // key, subkey that are null, stop processing. (`key,subkeyがnullの場合、処理を中止`) |

---

**Block 2** — [EXEC] (L316)

Computes the separator position in the key string. This is used by list-item branches to extract the index portion from compound keys like `"l0_taiorrk_out_url_no/0"`.

| # | Type | Code |
|---|------|------|
| 1 | SET | `separaterPoint = key.indexOf("/")` |

---

**Block 3** — [IF/ELSE-IF/ELSE-IF/ELSE-IF] (L319–L332)

Branch on the single-value index item. Handles three sub-properties (`value`, `enable`, `state`) of the URL number index field. Each sub-key triggers a different setter on the bean. The Japanese item name `対応履歴外部接続URL番号インデックス` translates to "Response History External Connection URL Number Index" — a single-value field that holds the URL number, its enabled/disabled state, and its UI state.

| # | Type | Code |
|---|------|------|
| 1 | IF | `key.equals("対応履歴外部接続URL番号インデックス")` // Process by item. Data type String item "Response History External Connection URL Number Index" (Item ID: l0_taiorrk_out_url_no_idx) (`項目ごとに処理を入れる。データタイプがStringの項目"対応履歴外部接続URL番号インデックス"(項目ID:l0_taiorrk_out_url_no_idx)`) |

  **Block 3.1** — [ELSE-IF] `(subkey.equalsIgnoreCase("value"))` (L320)

  Sets the URL number value from the incoming string data.

  | # | Type | Code |
  |---|------|------|
  | 1 | CALL | `setL0_taiorrk_out_url_no_idx_value((String)in_value)` |

  **Block 3.2** — [ELSE-IF] `(subkey.equalsIgnoreCase("enable"))` (L323)

  Sets the enabled flag. When the sub-key is "enable", runs the `l0_taiorrk_out_url_no_idx_enabled` setter. (`subkeyが"enable"の場合、l0_taiorrk_out_url_no_idx_enabledのsetterを実行する。`)

  | # | Type | Code |
  |---|------|------|
  | 1 | CALL | `setL0_taiorrk_out_url_no_idx_enabled((Boolean)in_value)` |

  **Block 3.3** — [ELSE-IF] `(subkey.equalsIgnoreCase("state"))` (L326)

  Sets the UI state string. When the sub-key is "state", sets the state. (`subkeyが"state"の場合、ステータスを返す。`)

  | # | Type | Code |
  |---|------|------|
  | 1 | CALL | `setL0_taiorrk_out_url_no_idx_state((String)in_value)` |

  **Block 3.4** — [ELSE-IF] (implicit default)

  If none of the three known sub-keys match, no operation is performed.

---

**Block 4** — [ELSE-IF] `(key.equals("対応履歴外部接続URL番号リスト"))` (L335–L364)

Handles the URL number list item. The Japanese item name `対応履歴外部接続URL番号リスト` translates to "Response History External Connection URL Number List" — a String-type list whose item ID is `l0_taiorrk_out_url_no`. It parses an index from the key, validates the index range, and delegates to the child bean's `storeModelData` at that index.

| # | Type | Code |
|---|------|------|
| 1 | SET | `key = key.substring(separaterPoint + 1)` // Obtain next element of key. (`keyの次の要素を取得`) |
| 2 | SET | `tmpIndexInt = null` // Look up index in the list next. (`次にリスト中のインデックスを見る`) |

  **Block 4.1** — [TRY-CATCH] (L339–L345)

  Attempts to parse the remaining key as an integer index.

  | # | Type | Code |
  |---|------|------|
  | 1 | EXEC | `tmpIndexInt = Integer.valueOf(key)` |
  | 2 | CATCH | `catch(NumberFormatException e)` // If index value is not a numeric string, return null here. (`インデックス値が数値文字列でない場合は、ここでnullを返す。`) |
  | 3 | SET | `tmpIndexInt = null` |

  **Block 4.2** — [IF] `(tmpIndexInt != null)` — Index value is a numeric string. (`インデックス値が数値文字列の場合`) (L346)

    **Block 4.2.1** — [IF] `(tmpIndex >= 0 && tmpIndex < l0_taiorrk_out_url_no_list.size())` — Index is within list bounds. (`インデックス値がリスト個数-1以下の場合`) (L347)

    Delegates to the child bean at the parsed index. The cast target part: according to the item definition type, specifies one of `X33VDataTypeStringBean`, `X33VDataTypeLongBean`, or `X33VDataTypeBooleanBean`. (`キャスト部分は、項目定義型に合わせてX33VDataTypeStringBean, X33VDataTypeLongBean, X33VDataTypeBooleanBeanのうち1つを指定。`) For `X33VDataTypeLongBean`, specifies `subkey`, input value, and `isSetAsString` flag as arguments. (`X33VDataTypeLongBeanではsubkeyと入力値およびisSetAsStringフラグを引数に指定`)

    | # | Type | Code |
    |---|------|------|
    | 1 | SET | `tmpIndex = tmpIndexInt.intValue()` |
    | 2 | CALL | `((X33VDataTypeStringBean)l0_taiorrk_out_url_no_list.get(tmpIndex)).storeModelData(subkey, in_value)` |

    **Block 4.2.2** — [ELSE-IF] (implicit: index out of bounds)

    No operation — the index is valid as an integer but exceeds the list size.

---

**Block 5** — [ELSE-IF] `(key.equals("対応履歴外部接続URLリスト"))` (L367–L396)

Handles the URL list item. The Japanese item name `対応履歴外部接続URLリスト` translates to "Response History External Connection URL List" — a String-type list whose item ID is `l0_taiorrk_out_url`. Identical logic to Block 4 but operates on `l0_taiorrk_out_url_list`.

| # | Type | Code |
|---|------|------|
| 1 | SET | `key = key.substring(separaterPoint + 1)` // Obtain next element of key. (`keyの次の要素を取得`) |
| 2 | SET | `tmpIndexInt = null` // Look up index in the list next. (`次にリスト中のインデックスを見る`) |

  **Block 5.1** — [TRY-CATCH] (L373–L379)

  Attempts to parse the remaining key as an integer index.

  | # | Type | Code |
  |---|------|------|
  | 1 | EXEC | `tmpIndexInt = Integer.valueOf(key)` |
  | 2 | CATCH | `catch(NumberFormatException e)` // If index value is not a numeric string, return null here. (`インデックス値が数値文字列でない場合は、ここでnullを返す。`) |
  | 3 | SET | `tmpIndexInt = null` |

  **Block 5.2** — [IF] `(tmpIndexInt != null)` — Index value is a numeric string. (`インデックス値が数値文字列の場合`) (L380)

    **Block 5.2.1** — [IF] `(tmpIndex >= 0 && tmpIndex < l0_taiorrk_out_url_list.size())` — Index is within list bounds. (`インデックス値がリスト個数-1以下の場合`) (L381)

    Delegates to the child bean at the parsed index. The cast target is `X33VDataTypeStringBean` (as noted in the cast comment above).

    | # | Type | Code |
    |---|------|------|
    | 1 | SET | `tmpIndex = tmpIndexInt.intValue()` |
    | 2 | CALL | `((X33VDataTypeStringBean)l0_taiorrk_out_url_list.get(tmpIndex)).storeModelData(subkey, in_value)` |

    **Block 5.2.2** — [ELSE-IF] (implicit: index out of bounds)

    No operation.

---

**Block 6** — [ELSE-IF] `(key.equals("対応履歴外部接続URL名リスト"))` (L399–end)

Handles the URL name list item. The Japanese item name `対応履歴外部接続URL名リスト` translates to "Response History External Connection URL Name List" — a String-type list whose item ID is `l0_taiorrk_out_url_nm`. Identical logic to Blocks 4 and 5 but operates on `l0_taiorrk_out_url_nm_list`.

| # | Type | Code |
|---|------|------|
| 1 | SET | `key = key.substring(separaterPoint + 1)` // Obtain next element of key. (`keyの次の要素を取得`) |
| 2 | SET | `tmpIndexInt = null` // Look up index in the list next. (`次にリスト中のインデックスを見る`) |

  **Block 6.1** — [TRY-CATCH] (L405–L411)

  Attempts to parse the remaining key as an integer index.

  | # | Type | Code |
  |---|------|------|
  | 1 | EXEC | `tmpIndexInt = Integer.valueOf(key)` |
  | 2 | CATCH | `catch(NumberFormatException e)` // If index value is not a numeric string, return null here. (`インデックス値が数値文字列でない場合は、ここでnullを返す。`) |
  | 3 | SET | `tmpIndexInt = null` |

  **Block 6.2** — [IF] `(tmpIndexInt != null)` — Index value is a numeric string. (`インデックス値が数値文字列の場合`) (L412)

    **Block 6.2.1** — [IF] `(tmpIndex >= 0 && tmpIndex < l0_taiorrk_out_url_nm_list.size())` — Index is within list bounds. (`インデックス値がリスト個数-1以下の場合`) (L413)

    Delegates to the child bean at the parsed index.

    | # | Type | Code |
    |---|------|------|
    | 1 | SET | `tmpIndex = tmpIndexInt.intValue()` |
    | 2 | CALL | `((X33VDataTypeStringBean)l0_taiorrk_out_url_nm_list.get(tmpIndex)).storeModelData(subkey, in_value)` |

    **Block 6.2.2** — [ELSE-IF] (implicit: index out of bounds)

    No operation.

---

**Block 7** — [ELSE-IF] (implicit default)

If the `key` matches none of the four known item names, the method silently falls through without any operation. This is an implicit no-op — unknown keys are simply ignored.

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `対応履歴外部接続URL番号インデックス` | Field (Japanese) | Response History External Connection URL Number Index — a single-value item holding the URL number, its enabled flag, and its UI state. Internal item ID: `l0_taiorrk_out_url_no_idx`. |
| `対応履歴外部接続URL番号リスト` | Field (Japanese) | Response History External Connection URL Number List — a list of URL number items. Internal item ID: `l0_taiorrk_out_url_no`. Each list item is an `X33VDataTypeStringBean`. |
| `対応履歴外部接続URLリスト` | Field (Japanese) | Response History External Connection URL List — a list of URL items. Internal item ID: `l0_taiorrk_out_url`. Each list item is an `X33VDataTypeStringBean`. |
| `対応履歴外部接続URL名リスト` | Field (Japanese) | Response History External Connection URL Name List — a list of URL name items. Internal item ID: `l0_taiorrk_out_url_nm`. Each list item is an `X33VDataTypeStringBean`. |
| `l0_taiorrk_out_url_no_idx_value` | Field | URL number value — the actual URL number string for the index item. |
| `l0_taiorrk_out_url_no_idx_enabled` | Field | URL number enabled flag — whether this URL number is active/enabled. Default: `false`. |
| `l0_taiorrk_out_url_no_idx_state` | Field | URL number UI state — a string representing the current UI state of this item. |
| `l0_taiorrk_out_url_no_list` | Field | List container for URL number items — an `X33VDataTypeList` of child `X33VDataTypeStringBean` objects. |
| `l0_taiorrk_out_url_list` | Field | List container for URL items — an `X33VDataTypeList` of child `X33VDataTypeStringBean` objects. |
| `l0_taiorrk_out_url_nm_list` | Field | List container for URL name items — an `X33VDataTypeList` of child `X33VDataTypeStringBean` objects. |
| `storeModelData` | Method | Data-population method — pushes incoming model/screen data into the bean's properties and child beans. Part of the X33V data-binding framework. |
| `X33VDataTypeStringBean` | Class | X33V framework data type bean for String-valued properties — the child bean type used in all three list fields. |
| `X33VDataTypeList` | Class | X33V framework list container — a typed list supporting indexed access and iteration, used to hold child data beans. |
| `X33VDataTypeBeanInterface` | Interface | X33V framework interface for data beans that support property-level model loading (i.e., `storeModelData`). |
| `X33VListedBeanInterface` | Interface | X33V framework interface for beans that participate in listed (array/collection) data binding. |
| CRW03407SF | Module | Telecom order history screen module — handles display of service contract order history with external connection URL information. |
| DBean | Class suffix | Data Bean — a DTO (Data Transfer Object) that carries data between the presentation layer (JSF/Facelets) and the business logic layer in the X33 web framework. |
| subkey | Concept | A sub-property identifier within a data item. Used to distinguish between multiple properties of a single item (e.g., `value`, `enable`, `state`). |
| isSetAsString | Parameter | A boolean flag that, when true, indicates a String value should be set into a Long-type property's `Value` field. Commonly used in X33 for numeric fields that accept string input during form binding. |
