# Business Logic — KKW00816SF01DBean.storeModelData() [74 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.KKW00816SF.KKW00816SF01DBean` |
| Layer | Utility / Data Bean (Web view data holder) |
| Module | `KKW00816SF` (Package: `eo.web.webview.KKW00816SF`) |

## 1. Role

### KKW00816SF01DBean.storeModelData()

This method serves as a **data dispatching and assignment hub** within the `KKW00816SF` web view data bean. It receives incoming data identified by a key (project name) and subkey (property type: "value" or "state"), and routes it to the correct bean setter method based on the business field being targeted. The method handles five distinct data field types: SYSID (item ID), Service Contract Number (サービス契約番号), Move Classification (異動区分), Change Reason Code (異動理由コード), and Change Reason Memo (異動理由メモ). For simple scalar fields, it delegates directly to typed setter methods on the bean itself. For the list-type "Change Reason Code" field, it performs index-based list element resolution and recursively delegates to a child bean's `storeModelData` method, implementing a composite dispatch pattern. This method is the primary data ingestion entry point for populating this screen's data bean from incoming request parameters, acting as a shared utility called by the screen controller to bind form data into strongly typed bean properties.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["storeModelData(key, subkey, in_value, isSetAsString)"])
    NULL_CHECK["Check: key == null or subkey == null"]
    EARLY_RETURN["Early return - null guard"]
    EXTRACT_SEP["Extract: separaterPoint = key.indexOf('/')"]

    COND_SYSID["key equals 'SYSID'"]
    SYSID_VALUE["subkey equals 'value' (case-insensitive)"]
    SYSID_STATE["subkey equals 'state' (case-insensitive)"]
    SET_SYSID_VALUE["setSysid_value(in_value)"]
    SET_SYSID_STATE["setSysid_state(in_value)"]

    COND_SVC["key equals 'Service Contract Number'"]
    SVC_VALUE["subkey equals 'value'"]
    SVC_STATE["subkey equals 'state'"]
    SET_SVC_VALUE["setSvc_kei_no_value(in_value)"]
    SET_SVC_STATE["setSvc_kei_no_state(in_value)"]

    COND_IDO_DIV["key equals 'Move Classification'"]
    IDO_DIV_VALUE["subkey equals 'value'"]
    IDO_DIV_STATE["subkey equals 'state'"]
    SET_IDO_DIV_VALUE["setIdo_div_value(in_value)"]
    SET_IDO_DIV_STATE["setIdo_div_state(in_value)"]

    COND_RSN_CD["key equals 'Change Reason Code'"]
    EXTRACT_SUB["Extract index from key via substring"]
    PARSE_IDX["Try parse: tmpIndexInt = Integer.valueOf(key)"]
    CATCH_IDX["catch NumberFormatException"]
    IDX_VALID["tmpIndexInt != null"]
    IDX_BOUNDS["tmpIndex >= 0 and tmpIndex < ido_rsn_cd_list.size()"]
    DELEGATE["Delegate to child bean storeModelData"]
    NO_INDEX_OP["No op - index out of range"]
    NO_PARSE_OP["No op - parse failed"]

    COND_RSN_MEMO["key equals 'Change Reason Memo'"]
    MEMO_VALUE["subkey equals 'value'"]
    MEMO_STATE["subkey equals 'state'"]
    SET_MEMO_VALUE["setIdo_rsn_memo_value(in_value)"]
    SET_MEMO_STATE["setIdo_rsn_memo_state(in_value)"]

    NO_FIELD["No matching field"]
    END_RETURN(["End / Return"])

    START --> NULL_CHECK
    NULL_CHECK -->|"true"| EARLY_RETURN
    NULL_CHECK -->|"false"| EXTRACT_SEP
    EXTRACT_SEP --> COND_SYSID
    COND_SYSID -->|"true"| SYSID_VALUE
    COND_SYSID -->|"false"| COND_SVC
    SYSID_VALUE -->|"true"| SET_SYSID_VALUE
    SYSID_VALUE -->|"false"| SYSID_STATE
    SYSID_STATE -->|"true"| SET_SYSID_STATE
    SYSID_STATE -->|"false"| COND_SVC
    SET_SYSID_VALUE --> END_RETURN
    SET_SYSID_STATE --> END_RETURN
    COND_SVC -->|"true"| SVC_VALUE
    COND_SVC -->|"false"| COND_IDO_DIV
    SVC_VALUE -->|"true"| SET_SVC_VALUE
    SVC_VALUE -->|"false"| SVC_STATE
    SVC_STATE -->|"true"| SET_SVC_STATE
    SVC_STATE -->|"false"| COND_IDO_DIV
    SET_SVC_VALUE --> END_RETURN
    SET_SVC_STATE --> END_RETURN
    COND_IDO_DIV -->|"true"| IDO_DIV_VALUE
    COND_IDO_DIV -->|"false"| COND_RSN_CD
    IDO_DIV_VALUE -->|"true"| SET_IDO_DIV_VALUE
    IDO_DIV_VALUE -->|"false"| IDO_DIV_STATE
    IDO_DIV_STATE -->|"true"| SET_IDO_DIV_STATE
    IDO_DIV_STATE -->|"false"| COND_RSN_CD
    SET_IDO_DIV_VALUE --> END_RETURN
    SET_IDO_DIV_STATE --> END_RETURN
    COND_RSN_CD -->|"true"| EXTRACT_SUB
    COND_RSN_CD -->|"false"| COND_RSN_MEMO
    EXTRACT_SUB --> PARSE_IDX
    PARSE_IDX -->|"success"| IDX_VALID
    PARSE_IDX -->|"NumberFormatException"| CATCH_IDX
    CATCH_IDX --> IDX_VALID
    IDX_VALID -->|"true"| IDX_BOUNDS
    IDX_VALID -->|"false"| NO_PARSE_OP
    IDX_BOUNDS -->|"true"| DELEGATE
    IDX_BOUNDS -->|"false"| NO_INDEX_OP
    DELEGATE --> END_RETURN
    NO_INDEX_OP --> END_RETURN
    NO_PARSE_OP --> END_RETURN
    COND_RSN_MEMO -->|"true"| MEMO_VALUE
    COND_RSN_MEMO -->|"false"| NO_FIELD
    MEMO_VALUE -->|"true"| SET_MEMO_VALUE
    MEMO_VALUE -->|"false"| MEMO_STATE
    MEMO_STATE -->|"true"| SET_MEMO_STATE
    MEMO_STATE -->|"false"| NO_FIELD
    SET_MEMO_VALUE --> END_RETURN
    SET_MEMO_STATE --> END_RETURN
    NO_FIELD --> END_RETURN
    EARLY_RETURN --> END_RETURN
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `key` | `String` | The business field identifier (project name). Determines which data property to populate. Possible values: `"SYSID"` (item ID), `"サービス契約番号"` (Service Contract Number), `"異動区分"` (Move Classification), `"異動理由コード"` (Change Reason Code — may include a slash-separated index like `"異動理由コード/0"` for list elements), `"異動理由メモ"` (Change Reason Memo). |
| 2 | `subkey` | `String` | The property type specifier within a field. Distinguishes between `"value"` (the actual data value to store) and `"state"` (the display/edit state flag for UI rendering). Case-insensitive matching is used. |
| 3 | `in_value` | `Object` | The data to be assigned to the target bean property. Cast to `String` for scalar fields. For the Change Reason Code list element branch, this becomes the subkey argument passed to the child bean's `storeModelData`. |
| 4 | `isSetAsString` | `boolean` | Flag indicating whether a Long-type item's Value property should receive a String-typed value. Passed through to scalar setters. Note: not forwarded to the Change Reason Code list element delegation. |

**Instance fields read:**
| Field | Type | Description |
|-------|------|-------------|
| `ido_rsn_cd_list` | `ArrayList` | List of change reason code entries. Used to resolve list-based indices for the "Change Reason Code" field. Elements are cast to `X33VDataTypeStringBean`. |

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `JKKAdEditCC.substring` | JKKAdEditCC | - | Calls `substring` in `JKKAdEditCC` — extracts substring from key for index parsing |
| - | `JKKAdEdit.substring` | JKKAdEdit | - | Calls `substring` in `JKKAdEdit` — used for string slicing in key processing |
| - | `JKKTelnoInfoAddMapperCC.substring` | JKKTelnoInfoAddMapperCC | - | Calls `substring` in `JKKTelnoInfoAddMapperCC` — utility string extraction |
| - | `JDKejbStringEdit.substring` | JDKejbStringEdit | - | Calls `substring` in `JDKejbStringEdit` — utility string slicing |
| - | `KKW00816SF01DBean.setIdo_div_state` | KKW00816SF01DBean | - | Sets the state flag for Move Classification (異動区分) |
| - | `KKW00816SF01DBean.setIdo_div_value` | KKW00816SF01DBean | - | Sets the value for Move Classification (異動区分) |
| - | `KKW00816SF01DBean.setIdo_rsn_memo_state` | KKW00816SF01DBean | - | Sets the state flag for Change Reason Memo (異動理由メモ) |
| - | `KKW00816SF01DBean.setIdo_rsn_memo_value` | KKW00816SF01DBean | - | Sets the value for Change Reason Memo (異動理由メモ) |
| - | `KKW00816SF01DBean.setSvc_kei_no_state` | KKW00816SF01DBean | - | Sets the state flag for Service Contract Number (サービス契約番号) |
| - | `KKW00816SF01DBean.setSvc_kei_no_value` | KKW00816SF01DBean | - | Sets the value for Service Contract Number (サービス契約番号) |
| - | `KKW00816SF01DBean.setSysid_state` | KKW00816SF01DBean | - | Sets the state flag for SYSID (item identifier) |
| - | `KKW00816SF01DBean.setSysid_value` | KKW00816SF01DBean | - | Sets the value for SYSID (item identifier) |
| - | `KKW00816SF01DBean.storeModelData` | KKW00816SF01DBean | - | Recursive/self-delegating call on child X33VDataTypeStringBean element |

**Classification note:** All operations in this method are **U (Update)** — property assignments via setters. No database CRUD operations are performed; this is a pure in-memory bean population utility.

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | KKW00816SF01DBean | `KKW00816SF01DBean.storeModelData` (self-overload) | `setIdo_rsn_memo_state [U]`, `setIdo_rsn_memo_value [U]`, `storeModelData [U]`, `substring [U]`, `setIdo_div_state [U]`, `setIdo_div_value [U]`, `setSvc_kei_no_state [U]`, `setSvc_kei_no_value [U]`, `setSysid_state [U]`, `setSysid_value [U]` |
| 2 | KKW00816SF01DBean | `KKW00816SF01DBean.storeModelData` (self-overload) | `setIdo_rsn_memo_state [U]`, `setIdo_rsn_memo_value [U]`, `storeModelData [U]`, `substring [U]`, `setIdo_div_state [U]`, `setIdo_div_value [U]`, `setSvc_kei_no_state [U]`, `setSvc_kei_no_value [U]`, `setSysid_state [U]`, `setSysid_value [U]` |

**Terminal operations summary:** All terminal operations are in-memory property setters (Update type). No external SC, CBS, or database operations are reached from this method.

## 6. Per-Branch Detail Blocks

### Block 1 — IF (null guard) (L318-322)

> nullの場合は処理を中止 // "Abort processing if key or subkey is null"

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return;` // key,subkeyがnullの場合、処理を中止 // "If key or subkey is null, abort processing" |

### Block 2 — EXEC (separator extraction) (L324)

| # | Type | Code |
|---|------|------|
| 1 | SET | `separaterPoint = key.indexOf("/")` // Extracts position of first slash in key for later substring operations |

### Block 3 — ELSE-IF ["SYSID"] (condition) `"SYSID"` (L327)

> データタイプがStringの項目"SYSID"(項目ID:sysid) // "Data type is String field 'SYSID' (Item ID: sysid)"

#### Block 3.1 — ELSE-IF (subkey value check) (L328)

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `subkey.equalsIgnoreCase("value")` // Checks if subkey is "value" (case-insensitive) |
| 2 | CALL | `setSysid_value((String)in_value)` // Sets the SYSID value property |

#### Block 3.2 — ELSE-IF (subkey state check) (L330-332)

> subkeyが"state"の場合、ステータスを返す。 // "When subkey is 'state', return/set the state flag."

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `subkey.equalsIgnoreCase("state")` // Checks if subkey is "state" (case-insensitive) |
| 2 | CALL | `setSysid_state((String)in_value)` // Sets the SYSID state property |

### Block 4 — ELSE-IF ["サービス契約番号"] (condition) `"サービス契約番号"` (Service Contract Number) (L335)

> データタイプがStringの項目"サービス契約番号"(項目ID:svc_kei_no) // "Data type is String field 'Service Contract Number' (Item ID: svc_kei_no)"

#### Block 4.1 — ELSE-IF (subkey value check) (L336)

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `subkey.equalsIgnoreCase("value")` |
| 2 | CALL | `setSvc_kei_no_value((String)in_value)` // Sets the service contract number value |

#### Block 4.2 — ELSE-IF (subkey state check) (L338-340)

> subkeyが"state"の場合、ステータスを返す。 // "When subkey is 'state', return/set the state flag."

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `subkey.equalsIgnoreCase("state")` |
| 2 | CALL | `setSvc_kei_no_state((String)in_value)` // Sets the service contract number state |

### Block 5 — ELSE-IF ["異動区分"] (condition) `"異動区分"` (Move Classification) (L343)

> データタイプがStringの項目"異動区分"(項目ID:ido_div) // "Data type is String field 'Move Classification' (Item ID: ido_div)"

#### Block 5.1 — ELSE-IF (subkey value check) (L344)

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `subkey.equalsIgnoreCase("value")` |
| 2 | CALL | `setIdo_div_value((String)in_value)` // Sets the move classification value |

#### Block 5.2 — ELSE-IF (subkey state check) (L346-348)

> subkeyが"state"の場合、ステータスを返す。 // "When subkey is 'state', return/set the state flag."

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `subkey.equalsIgnoreCase("state")` |
| 2 | CALL | `setIdo_div_state((String)in_value)` // Sets the move classification state |

### Block 6 — ELSE-IF ["異動理由コード"] (condition) `"異動理由コード"` (Change Reason Code) (L351)

> 配列項目"異動理由コード"(String型、項目ID:ido_rsn_cd) // "Array field 'Change Reason Code' (String type, item ID: ido_rsn_cd)"

#### Block 6.1 — EXEC (key substring extraction) (L354)

> keyの次の要素を取得 // "Get the next element of key"
> ("ido_rsn_cd/0"から最初の"/"より後を取出す) // "Extract substring after the first '/' from 'ido_rsn_cd/0'"

| # | Type | Code |
|---|------|------|
| 1 | SET | `key = key.substring(separaterPoint + 1)` // Extracts the index portion from key (e.g. "0" from "異動理由コード/0") |

#### Block 6.2 — TRY-CATCH (index parsing) (L357-366)

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

#### Block 6.3 — IF (null check) (L366)

> インデックス値が数値文字列の場合 // "When the index value is a numeric string"

| # | Type | Code |
|---|------|------|
| 1 | SET | `tmpIndex = tmpIndexInt.intValue()` // Extracts int from Integer wrapper |

##### Block 6.3.1 — IF (bounds check) `tmpIndex >= 0 && tmpIndex < ido_rsn_cd_list.size()` (L367)

> インデックス値がリスト個数-1以下の場合 // "When the index value is less than or equal to list count minus one"

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `ido_rsn_cd_list.get(tmpIndex)` // Gets list element at the validated index |
| 2 | CAST | `(X33VDataTypeStringBean)` // Casts list element to child data type bean |
| 3 | CALL | `storeModelData(subkey, in_value)` // Delegates to child bean — キャスト部分は、項目定義型に合わせてX33VDataTypeStringBean, X33VDataTypeLongBean, X33VDataTypeBooleanBeanのうち1つを指定。 // "Depending on item definition type, specifies one of X33VDataTypeStringBean, X33VDataTypeLongBean, X33VDataTypeBooleanBean" |
| 4 | NOTE | X33VDataTypeLongBeanではsubkeyと入力値およびisSetAsStringフラグを引数に指定 // "For X33VDataTypeLongBean: subkey, input value, and isSetAsString flag are passed as arguments" |

##### Block 6.3.2 — ELSE (index out of range or null) (L369)

> No operation when index is null or out of bounds.

| # | Type | Code |
|---|------|------|
| 1 | NOOP | (silent exit — no operation performed) |

### Block 7 — ELSE-IF ["異動理由メモ"] (condition) `"異動理由メモ"` (Change Reason Memo) (L373)

> データタイプがStringの項目"異動理由メモ"(項目ID:ido_rsn_memo) // "Data type is String field 'Change Reason Memo' (Item ID: ido_rsn_memo)"

#### Block 7.1 — ELSE-IF (subkey value check) (L374)

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `subkey.equalsIgnoreCase("value")` |
| 2 | CALL | `setIdo_rsn_memo_value((String)in_value)` // Sets the change reason memo value |

#### Block 7.2 — ELSE-IF (subkey state check) (L376-378)

> subkeyが"state"の場合、ステータスを返す。 // "When subkey is 'state', return/set the state flag."

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `subkey.equalsIgnoreCase("state")` |
| 2 | CALL | `setIdo_rsn_memo_state((String)in_value)` // Sets the change reason memo state |

### Block 8 — ELSE (no match) (L380-382)

> If none of the five field types match, the method falls through to its end with no operation performed. This acts as a silent no-op for unrecognized field identifiers.

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `sysid` | Field | SYSID (項目ID) — Item/System ID, unique identifier for a service item |
| `svc_kei_no` | Field | Service Contract Number (サービス契約番号) — The contract line item number identifying a specific service subscription |
| `ido_div` | Field | Move Classification (異動区分) — Classification of service contract line movement/change type |
| `ido_rsn_cd` | Field | Change Reason Code (異動理由コード) — The reason code for a service contract line change, stored as a list of items |
| `ido_rsn_memo` | Field | Change Reason Memo (異動理由メモ) — Free-text memo explaining the reason for a service contract line change |
| `"SYSID"` | Key Value | Item identifier field name (English ASCII) |
| `"サービス契約番号"` | Key Value | Service Contract Number — business field for contract line identification |
| `"異動区分"` | Key Value | Move Classification — indicates the type of service line movement (e.g., add, modify, cancel) |
| `"異動理由コード"` | Key Value | Change Reason Code — list-type field containing individual reason code entries with numeric indices |
| `"異動理由メモ"` | Key Value | Change Reason Memo — free-text field for additional context on service line changes |
| `"value"` | Subkey Value | Data value property — the actual business data to store |
| `"state"` | Subkey Value | State property — UI state flag for display/edit mode of the field |
| `X33VDataTypeStringBean` | Class | String data type bean — child element type for list-based string fields |
| `X33VDataTypeLongBean` | Class | Long data type bean — child element type for list-based long/integer fields |
| `X33VDataTypeBooleanBean` | Class | Boolean data type bean — child element type for list-based boolean fields |
| `storeModelData` | Pattern | Composite dispatch pattern — parent bean routes data to child beans based on key/subkey |
| `ido_rsn_cd_list` | Field | List of change reason code entries (異動理由コードリスト), each a data type bean |
| `isSetAsString` | Parameter | Flag — when true, stores a String value into a Long-type item's Value property |
| `separaterPoint` | Local Var | Index of the first "/" character in the key, used to extract the list element index from compound keys |
