# Business Logic — KKW01027SF01DBean.storeModelData() [94 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.KKA15001SF.KKW01027SF01DBean` |
| Layer | Controller / View Data Binding (Web Layer - Bean Data Binding) |
| Module | `KKA15001SF` (Package: `eo.web.webview.KKA15001SF`) |

## 1. Role

### KKW01027SF01DBean.storeModelData()

This method is a **unified view data binding router** that dispatches incoming key/subkey pairs to the correct model property setter within the `KKW01027SF01DBean` data transfer object. It implements a **dispatch/routing pattern** based on a key string that identifies the business data domain (e.g., SYSID, service contract number, move classification, move reason code, move reason memo, application number, application detail number). For each key, it further dispatches on the subkey (`"value"` or `"state"`) to determine whether to store the actual data value or a UI state flag (e.g., display state, validation state) on the corresponding property.

The method supports a **recursive dispatch** mechanism for the "異動理由コード" (Move Reason Code) key: when this key is provided with an indexed suffix (e.g., `"異動理由コード/0"`), the method extracts the index, validates it against the `ido_rsn_cd_list` list boundary, and recursively delegates to the nested `X33VDataTypeStringBean.storeModelData()` method for the specific list element. This enables the bean to handle both flat scalar properties and nested collection-based properties through a single unified interface.

Its **role in the larger system** is that of a shared data-binding utility within the web presentation layer. Called by screen controllers during the request processing phase, it allows callers to populate bean properties dynamically using string-based key routing rather than explicit setter invocations, decoupling the screen logic from concrete property names.

## 2. Processing Pattern (Detailed Business Logic)

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

    START --> CHECK_NULL["key == null || subkey == null"]

    CHECK_NULL --> |true| EARLY_RETURN["return"]
    CHECK_NULL --> |false| FIND_SLASH["separaterPoint = key.indexOf('/')"]

    FIND_SLASH --> SYSID["key.equals('SYSID')"]

    SYSID --> |true| SYSID_VALUE["subkey.equalsIgnoreCase('value')"]
    SYSID_VALUE --> |true| SET_SYSID_VALUE["setSysid_value((String)in_value)"]
    SYSID_VALUE --> |false| SYSID_STATE["subkey.equalsIgnoreCase('state')"]
    SYSID_STATE --> |true| SET_SYSID_STATE["setSysid_state((String)in_value)"]

    SYSID --> |false| SVC_KENOU["key.equals('サービス契約番号')"]

    SVC_KENOU --> |true| SVC_KENOU_VALUE["subkey.equalsIgnoreCase('value')"]
    SVC_KENOU_VALUE --> |true| SET_SVC_KENOU_VALUE["setSvc_kei_no_value((String)in_value)"]
    SVC_KENOU_VALUE --> |false| SVC_KENOU_STATE["subkey.equalsIgnoreCase('state')"]
    SVC_KENOU_STATE --> |true| SET_SVC_KENOU_STATE["setSvc_kei_no_state((String)in_value)"]

    SVC_KENOU --> |false| IDO_KUBUN["key.equals('異動区分')"]

    IDO_KUBUN --> |true| IDO_KUBUN_VALUE["subkey.equalsIgnoreCase('value')"]
    IDO_KUBUN_VALUE --> |true| SET_IDO_KUBUN_VALUE["setIdo_div_value((String)in_value)"]
    IDO_KUBUN_VALUE --> |false| IDO_KUBUN_STATE["subkey.equalsIgnoreCase('state')"]
    IDO_KUBUN_STATE --> |true| SET_IDO_KUBUN_STATE["setIdo_div_state((String)in_value)"]

    IDO_KUBUN --> |false| IDO_RSN_CD["key.equals('異動理由コード')"]

    IDO_RSN_CD --> |true| SUBSTRING_KEY["key = key.substring(separaterPoint + 1)"]
    SUBSTRING_KEY --> INIT_INDEX["tmpIndexInt = null"]
    INIT_INDEX --> PARSE_INT["tmpIndexInt = Integer.valueOf(key)"]
    PARSE_INT --> |success| INDEX_CHECK["tmpIndexInt != null"]
    PARSE_INT --> |NumberFormatException| NULL_INDEX["tmpIndexInt = null"]
    NULL_INDEX --> INDEX_CHECK

    INDEX_CHECK --> |true| RANGE_CHECK["tmpIndex >= 0 && tmpIndex < ido_rsn_cd_list.size()"]
    RANGE_CHECK --> |true| RECURSIVE_CALL["((X33VDataTypeStringBean)ido_rsn_cd_list.get(tmpIndex)).storeModelData(subkey, in_value)"]
    RANGE_CHECK --> |false| END_BLOCK_3["end"]
    INDEX_CHECK --> |false| END_BLOCK_3

    IDO_RSN_CD --> |false| IDO_RSN_MEMO["key.equals('異動理由メモ')"]

    IDO_RSN_MEMO --> |true| MEMO_VALUE["subkey.equalsIgnoreCase('value')"]
    MEMO_VALUE --> |true| SET_MEMO_VALUE["setIdo_rsn_memo_value((String)in_value)"]
    MEMO_VALUE --> |false| MEMO_STATE["subkey.equalsIgnoreCase('state')"]
    MEMO_STATE --> |true| SET_MEMO_STATE["setIdo_rsn_memo_state((String)in_value)"]

    IDO_RSN_MEMO --> |false| MUSHIN_BANGO["key.equals('申込番号')"]

    MUSHIN_BANGO --> |true| MUSHIN_VALUE["subkey.equalsIgnoreCase('value')"]
    MUSHIN_VALUE --> |true| SET_MUSHIN_VALUE["setMskm_no_value((String)in_value)"]
    MUSHIN_VALUE --> |false| MUSHIN_STATE["subkey.equalsIgnoreCase('state')"]
    MUSHIN_STATE --> |true| SET_MUSHIN_STATE["setMskm_no_state((String)in_value)"]

    MUSHIN_BANGO --> |false| MUSHIN_SAI_DETAIL["key.equals('申込詳細番号')"]

    MUSHIN_SAI_DETAIL --> |true| DETAIL_VALUE["subkey.equalsIgnoreCase('value')"]
    DETAIL_VALUE --> |true| SET_DETAIL_VALUE["setMskm_dtl_no_value((String)in_value)"]
    DETAIL_VALUE --> |false| DETAIL_STATE["subkey.equalsIgnoreCase('state')"]
    DETAIL_STATE --> |true| SET_DETAIL_STATE["setMskm_dtl_no_state((String)in_value)"]

    DETAIL_STATE --> END_ALL(["Return / Next"])
    SET_DETAIL_STATE --> END_ALL
    SET_MUSHIN_STATE --> END_ALL
    SET_MUSHIN_VALUE --> END_ALL
    SET_MEMO_STATE --> END_ALL
    SET_MEMO_VALUE --> END_ALL
    RECURSIVE_CALL --> END_ALL
    END_BLOCK_3 --> END_ALL
    SET_IDO_KUBUN_STATE --> END_ALL
    SET_IDO_KUBUN_VALUE --> END_ALL
    SET_SVC_KENOU_STATE --> END_ALL
    SET_SVC_KENOU_VALUE --> END_ALL
    SET_SYSID_STATE --> END_ALL
    SET_SYSID_VALUE --> END_ALL
    EARLY_RETURN --> END_ALL
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `key` | `String` | The item name (field identifier) that selects which business property to populate. Recognized values include `"SYSID"` (system identifier), `"サービス契約番号"` (service contract number), `"異動区分"` (move classification), `"異動理由コード"` (move reason code), `"異動理由メモ"` (move reason memo), `"申込番号"` (application number), and `"申込詳細番号"` (application detail number). For `"異動理由コード"`, the key may contain an indexed suffix like `"異動理由コード/0"` to target a specific list element. |
| 2 | `subkey` | `String` | The sub-property selector within the identified item. Valid values are `"value"` (to store the actual data value) and `"state"` (to store a UI state flag, e.g., display state or validation state). The comparison is case-insensitive (`equalsIgnoreCase`). |
| 3 | `in_value` | `Object` | The data to be stored. Cast to `String` when assigned to the bean's scalar properties. For the recursive `"異動理由コード"` branch, this value is forwarded to the nested `X33VDataTypeStringBean.storeModelData()` method. |
| 4 | `isSetAsString` | `boolean` | Flag indicating whether to set the `Long`-type item value property as a `String`. Referenced in the Javadoc: "Long型項目ValueプロパティへString型値の設定を行う場合true" (true when setting a String-type value to a Long-type item Value property). |

**Instance fields read:**
| Field | Type | Usage |
|-------|------|-------|
| `ido_rsn_cd_list` | `ArrayList` | Used in the `"異動理由コード"` (Move Reason Code) branch to validate the list index and retrieve the nested bean for recursive data binding. |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| U | `JKKAdEditCC.substring` | JKKAdEditCC | - | Calls `substring` in `JKKAdEditCC` (used internally for string extraction in `"異動理由コード"` key processing) |
| U | `JKKAdEdit.substring` | JKKAdEdit | - | Calls `substring` in `JKKAdEdit` (used internally for string extraction) |
| U | `JKKTelnoInfoAddMapperCC.substring` | JKKTelnoInfoAddMapperCC | - | Calls `substring` in `JKKTelnoInfoAddMapperCC` (used internally for string extraction) |
| U | `JDKejbStringEdit.substring` | JDKejbStringEdit | - | Calls `substring` in `JDKejbStringEdit` (used internally for string extraction) |
| U | `KKW01027SF01DBean.setIdo_div_state` | KKW01027SF01DBean | - | Calls `setIdo_div_state` in `KKW01027SF01DBean` — sets the move classification state property |
| U | `KKW01027SF01DBean.setIdo_div_value` | KKW01027SF01DBean | - | Calls `setIdo_div_value` in `KKW01027SF01DBean` — sets the move classification value property |
| U | `KKW01027SF01DBean.setIdo_rsn_memo_state` | KKW01027SF01DBean | - | Calls `setIdo_rsn_memo_state` in `KKW01027SF01DBean` — sets the move reason memo state property |
| U | `KKW01027SF01DBean.setIdo_rsn_memo_value` | KKW01027SF01DBean | - | Calls `setIdo_rsn_memo_value` in `KKW01027SF01DBean` — sets the move reason memo value property |
| U | `KKW01027SF01DBean.setMskm_dtl_no_state` | KKW01027SF01DBean | - | Calls `setMskm_dtl_no_state` in `KKW01027SF01DBean` — sets the application detail number state property |
| U | `KKW01027SF01DBean.setMskm_dtl_no_value` | KKW01027SF01DBean | - | Calls `setMskm_dtl_no_value` in `KKW01027SF01DBean` — sets the application detail number value property |
| U | `KKW01027SF01DBean.setMskm_no_state` | KKW01027SF01DBean | - | Calls `setMskm_no_state` in `KKW01027SF01DBean` — sets the application number state property |
| U | `KKW01027SF01DBean.setMskm_no_value` | KKW01027SF01DBean | - | Calls `setMskm_no_value` in `KKW01027SF01DBean` — sets the application number value property |
| U | `KKW01027SF01DBean.setSvc_kei_no_state` | KKW01027SF01DBean | - | Calls `setSvc_kei_no_state` in `KKW01027SF01DBean` — sets the service contract number state property |
| U | `KKW01027SF01DBean.setSvc_kei_no_value` | KKW01027SF01DBean | - | Calls `setSvc_kei_no_value` in `KKW01027SF01DBean` — sets the service contract number value property |
| U | `KKW01027SF01DBean.setSysid_state` | KKW01027SF01DBean | - | Calls `setSysid_state` in `KKW01027SF01DBean` — sets the system identifier state property |
| U | `KKW01027SF01DBean.setSysid_value` | KKW01027SF01DBean | - | Calls `setSysid_value` in `KKW01027SF01DBean` — sets the system identifier value property |
| U | `KKW01027SF01DBean.storeModelData` | KKW01027SF01DBean | - | Calls `storeModelData` in `KKW01027SF01DBean` — recursive delegation for nested bean properties |

**Classification rationale:** All operations are **Update (U)** because this method exclusively invokes setter methods (`set*`) on the bean's own properties and delegates to nested beans' `storeModelData` methods. There are no database reads (R), creates (C), or deletes (D). The `substring` utility calls from various SC components are string processing operations that support the key parsing logic for the `"異動理由コード"` branch.

## 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: `setMskm_dtl_no_state` [-], `setMskm_dtl_no_value` [-], `setMskm_no_state` [-], `setMskm_no_value` [-], `setIdo_rsn_memo_state` [-], `setIdo_rsn_memo_value` [-], `storeModelData` [-], `storeModelData` [-], `storeModelData` [-], `substring` [-], `substring` [-], `substring` [-], `substring` [-], `setIdo_div_state` [-], `setIdo_div_value` [-], `setSvc_kei_no_state` [-], `setSvc_kei_no_value` [-], `setSysid_state` [-], `setSysid_value` [-]

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | (caller) | `callerMethod` -> `KKW01027SF01DBean.storeModelData` | `setSysid_value [U] -`, `setSysid_state [U] -`, `setSvc_kei_no_value [U] -`, `setSvc_kei_no_state [U] -`, `setIdo_div_value [U] -`, `setIdo_div_state [U] -`, `storeModelData (recursive) [U] -`, `setIdo_rsn_memo_value [U] -`, `setIdo_rsn_memo_state [U] -`, `setMskm_no_value [U] -`, `setMskm_no_state [U] -`, `setMskm_dtl_no_value [U] -`, `setMskm_dtl_no_state [U] -` |

**Note:** Direct callers were pre-extracted from the code graph. The terminal operations listed in the last column enumerate all state mutations that can result from any call to this method — each setter call (U) updates a bean property, and the recursive `storeModelData` call updates a nested bean's properties.

## 6. Per-Branch Detail Blocks

**Block 1** — IF (null guard) `(key == null || subkey == null)` (L389)

> Guard clause: if either the key or subkey is null, the method aborts immediately without processing.

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

**Block 2** — PROCESS (prepare for indexed key parsing) (L393)

> Before branching on key types, compute the slash index for potential substring extraction in the `"異動理由コード"` branch.

| # | Type | Code |
|---|------|------|
| 1 | SET | `separaterPoint = key.indexOf('/')` // find slash position in key |

**Block 3** — ELSE-IF (key = "SYSID") `(key.equals("SYSID"))` (L396)

> Data type: String item "SYSID" (Item ID: sysid). Dispatches on subkey to set the system identifier value or state.

| # | Type | Code |
|---|------|------|
| 1 | ELSE-IF | `subkey.equalsIgnoreCase("value")` // L397 — subkey is "value" |
| 1.1 | SET | `setSysid_value((String)in_value)` // cast in_value to String and set sysid value |
| 1.2 | ELSE-IF | `subkey.equalsIgnoreCase("state")` // L400 — subkey is "state" |
| 1.2.1 | SET | `setSysid_state((String)in_value)` // if subkey is "state", return state // subkeyが"state"の場合、ステータスを返す |

**Block 4** — ELSE-IF (key = "サービス契約番号") `(key.equals("サービス契約番号"))` (L405)

> Data type: String item "Service Contract Number" (Item ID: svc_kei_no). Dispatches on subkey to set the service contract number value or state.

| # | Type | Code |
|---|------|------|
| 1 | ELSE-IF | `subkey.equalsIgnoreCase("value")` // L406 — subkey is "value" |
| 1.1 | SET | `setSvc_kei_no_value((String)in_value)` // cast in_value to String and set svc_kei_no value |
| 1.2 | ELSE-IF | `subkey.equalsIgnoreCase("state")` // L409 — subkey is "state" |
| 1.2.1 | SET | `setSvc_kei_no_state((String)in_value)` // if subkey is "state", return state // subkeyが"state"の場合、ステータスを返す |

**Block 5** — ELSE-IF (key = "異動区分") `(key.equals("異動区分"))` (L414)

> Data type: String item "Move Classification" (Item ID: ido_div). Dispatches on subkey to set the move classification value or state.

| # | Type | Code |
|---|------|------|
| 1 | ELSE-IF | `subkey.equalsIgnoreCase("value")` // L415 — subkey is "value" |
| 1.1 | SET | `setIdo_div_value((String)in_value)` // cast in_value to String and set ido_div value |
| 1.2 | ELSE-IF | `subkey.equalsIgnoreCase("state")` // L418 — subkey is "state" |
| 1.2.1 | SET | `setIdo_div_state((String)in_value)` // if subkey is "state", return state // subkeyが"state"の場合、ステータスを返す |

**Block 6** — ELSE-IF (key = "異動理由コード") `(key.equals("異動理由コード"))` (L423)

> Arranged item "Move Reason Code" (String type, Item ID: ido_rsn_cd). This is the only branch that uses recursive delegation — it extracts an index from the key, validates it against the `ido_rsn_cd_list` list, and delegates to the nested bean's `storeModelData` method.

| # | Type | Code |
|---|------|------|
| 1 | SET | `key = key.substring(separaterPoint + 1)` // extract element after first '/' // keyの次の要素を取得 (from "ido_rsn_cd/0" take after the first '/') |
| 2 | SET | `tmpIndexInt = null` // next, see the index in the list // 次のリスト中のインデックスを見る |
| 3 | TRY | `tmpIndexInt = Integer.valueOf(key)` // L431 — attempt to parse key as integer |
| 3.1 | CATCH | `NumberFormatException e` // L435 |
| 3.1.1 | SET | `tmpIndexInt = null` // if index value is not a numeric string, return null here // インデックス値が数値文字列でない場合は、ここでnullを返す |
| 4 | IF | `tmpIndexInt != null` // L439 — if index value is a numeric string // インデックス値が数値文字列の場合 |
| 4.1 | SET | `tmpIndex = tmpIndexInt.intValue()` // unbox Integer to int // int tmpIndex = tmpIndexInt.intValue() |
| 4.2 | IF | `tmpIndex >= 0 && tmpIndex < ido_rsn_cd_list.size()` // L441 — index is within list bounds (less than list count - 1) // インデックス値がリスト個数-1以下の場合 |
| 4.2.1 | CALL | `((X33VDataTypeStringBean)ido_rsn_cd_list.get(tmpIndex)).storeModelData(subkey, in_value)` // recursive delegation to nested bean |

**Block 7** — ELSE-IF (key = "異動理由メモ") `(key.equals("異動理由メモ"))` (L450)

> Data type: String item "Move Reason Memo" (Item ID: ido_rsn_memo). Dispatches on subkey to set the memo value or state.

| # | Type | Code |
|---|------|------|
| 1 | ELSE-IF | `subkey.equalsIgnoreCase("value")` // L451 — subkey is "value" |
| 1.1 | SET | `setIdo_rsn_memo_value((String)in_value)` // cast in_value to String and set ido_rsn_memo value |
| 1.2 | ELSE-IF | `subkey.equalsIgnoreCase("state")` // L454 — subkey is "state" |
| 1.2.1 | SET | `setIdo_rsn_memo_state((String)in_value)` // if subkey is "state", return state // subkeyが"state"の場合、ステータスを返す |

**Block 8** — ELSE-IF (key = "申込番号") `(key.equals("申込番号"))` (L459)

> Data type: String item "Application Number" (Item ID: mskm_no). Dispatches on subkey to set the application number value or state.

| # | Type | Code |
|---|------|------|
| 1 | ELSE-IF | `subkey.equalsIgnoreCase("value")` // L460 — subkey is "value" |
| 1.1 | SET | `setMskm_no_value((String)in_value)` // cast in_value to String and set mskm_no value |
| 1.2 | ELSE-IF | `subkey.equalsIgnoreCase("state")` // L463 — subkey is "state" |
| 1.2.1 | SET | `setMskm_no_state((String)in_value)` // if subkey is "state", return state // subkeyが"state"の場合、ステータスを返す |

**Block 9** — ELSE-IF (key = "申込詳細番号") `(key.equals("申込詳細番号"))` (L468)

> Data type: String item "Application Detail Number" (Item ID: mskm_dtl_no). Dispatches on subkey to set the application detail number value or state.

| # | Type | Code |
|---|------|------|
| 1 | ELSE-IF | `subkey.equalsIgnoreCase("value")` // L469 — subkey is "value" |
| 1.1 | SET | `setMskm_dtl_no_value((String)in_value)` // cast in_value to String and set mskm_dtl_no value |
| 1.2 | ELSE-IF | `subkey.equalsIgnoreCase("state")` // L472 — subkey is "state" |
| 1.2.1 | SET | `setMskm_dtl_no_state((String)in_value)` // if subkey is "state", return state // subkeyが"state"の場合、ステータスを返す |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `SYSID` | Field | System Identifier — the internal system identifier for the request or session context. Stored as `sysid_value` / `sysid_state`. |
| `サービス契約番号` | Field | Service Contract Number — the unique identifier for a service contract line item. Stored as `svc_kei_no_value` / `svc_kei_no_state`. |
| `異動区分` | Field | Move Classification — indicates the type of change or migration applied to a service item. Stored as `ido_div_value` / `ido_div_state`. |
| `異動理由コード` | Field | Move Reason Code — the reason classification code for a service change, stored in a list of `X33VDataTypeStringBean` elements (`ido_rsn_cd_list`). Supports indexed access via key suffix (e.g., `"異動理由コード/0"`). |
| `異動理由メモ` | Field | Move Reason Memo — free-text memo field explaining the reason for a service change. Stored as `ido_rsn_memo_value` / `ido_rsn_memo_state`. |
| `申込番号` | Field | Application Number — the main application order number. Stored as `mskm_no_value` / `mskm_no_state`. |
| `申込詳細番号` | Field | Application Detail Number — the sub-item number within an application, for multi-line applications. Stored as `mskm_dtl_no_value` / `mskm_dtl_no_state`. |
| `value` (subkey) | Subkey | The actual data value to be stored in the bean property. |
| `state` (subkey) | Subkey | A UI state flag (e.g., display enabled/disabled, validation state) associated with a property. |
| `X33VDataTypeStringBean` | Class | A nested data type bean representing a String-type data element in the view bean hierarchy. Used for list-based properties like `ido_rsn_cd_list`. |
| `ido_rsn_cd_list` | Field | A list of `X33VDataTypeStringBean` objects, each representing a move reason code entry with its own value and state properties. |
| `isSetAsString` | Parameter | Flag indicating whether a `Long`-type item's value property should be set using a `String` value. |
| 項目 (koumoku) | Domain term | Item — a named data field within the bean's model. |
| ステータス (sutētasu) | Domain term | State — the UI presentation state (e.g., visible, editable, validated) of a field. |
