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

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.KKA15101SF.KKW01030SF01DBean` |
| Layer | View / Data Binding Bean (Web Layer — sits between the presentation tier and domain entities) |
| Module | `KKA15101SF` (Package: `eo.web.webview.KKA15101SF`) |

## 1. Role

### KKW01030SF01DBean.storeModelData()

This method serves as the central **model data binding dispatcher** for the KKA15101SF screen. Its responsibility is to accept an item key (a human-readable Japanese label such as "sysid" or "サービス契約番号") paired with a subkey ("value" or "state"), and route the incoming data to the correct JavaBean property setter. In business terms, it bridges the gap between the screen's data model (where fields are referenced by Japanese labels) and the internal typed properties of the bean (where the same fields use camelCase IDs like `sysid_value`, `svc_kei_no_state`, etc.).

The method implements a **routing/dispatch design pattern**: it evaluates the `key` parameter against a fixed set of known field identifiers, then branches based on whether the `subkey` is "value" (write the data) or "state" (write the state flag). For simple string-typed fields — `sysid`, `svc_kei_no`, `ido_div`, `ido_rsn_memo`, `mskm_no`, `mskm_dtl_no` — the method calls the corresponding setter directly. For the list-based `ido_rsn_cd` (異動理由コード / Disreason Reason Code) field, the method performs an additional step: it extracts an index from the key string, parses it as an integer, bounds-checks it against the `ido_rsn_cd_list`, and delegates to `storeModelData` on the specific `X33VDataTypeStringBean` element. This supports per-row data binding for a dynamic list of items.

The `isSetAsString` parameter is accepted but not used within this method — it is forwarded down to nested `storeModelData` calls, where downstream beans (such as `X33VDataTypeLongBean`) can use it to decide whether to coerce the input to a string representation.

The method is called internally by the same bean in multiple places (self-referencing calls), indicating it is used both for direct property binding and for recursive data population of nested bean structures (e.g., the list elements in `ido_rsn_cd_list`).

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["storeModelData(params)"])

    START --> CheckNull["key or subkey is null?"]
    CheckNull -->|Yes| EARLY_RETURN(["return"])

    CheckNull -->|No| FindSep["separaterPoint = key.indexOf('/')"]

    FindSep --> KeySysid["key equals 'sysid'?"]
    KeySysid -->|Yes| SubSysid["subkey check"]
    KeySysid -->|No| NextKey1["key equals 'サービス契約番号'?"]

    SubSysid --> SubSysidVal["subkey equals 'value'?"]
    SubSysidVal -->|Yes| SetSysidVal["setSysid_value(in_value)"]
    SubSysidVal -->|No| SubSysidState["subkey equals 'state'?"]
    SubSysidState -->|Yes| SetSysidState["setSysid_state(in_value)"]
    SubSysidState -->|No| FinalReturn(["Return / Next"])
    SetSysidVal --> NextKey1
    SetSysidState --> FinalReturn

    NextKey1 -->|Yes| SubSvc["subkey check"]
    NextKey1 -->|No| NextKey2["key equals '異動区分'?"]

    SubSvc --> SubSvcVal["subkey equals 'value'?"]
    SubSvcVal -->|Yes| SetSvcVal["setSvc_kei_no_value(in_value)"]
    SubSvcVal -->|No| SubSvcState["subkey equals 'state'?"]
    SubSvcState -->|Yes| SetSvcState["setSvc_kei_no_state(in_value)"]
    SubSvcState -->|No| FinalReturn
    SetSvcVal --> NextKey2
    SetSvcState --> FinalReturn

    NextKey2 -->|Yes| SubIdoDiv["subkey check"]
    NextKey2 -->|No| NextKey3["key equals '異動理由コード'?"]

    SubIdoDiv --> SubIdoDivVal["subkey equals 'value'?"]
    SubIdoDivVal -->|Yes| SetIdoDivVal["setIdo_div_value(in_value)"]
    SubIdoDivVal -->|No| SubIdoDivState["subkey equals 'state'?"]
    SubIdoDivState -->|Yes| SetIdoDivState["setIdo_div_state(in_value)"]
    SubIdoDivState -->|No| FinalReturn
    SetIdoDivVal --> NextKey3
    SetIdoDivState --> FinalReturn

    NextKey3 -->|Yes| KeySubstring["key = key.substring(separaterPoint + 1)"]
    NextKey3 -->|No| NextKey4["key equals '異動理由メモ'?"]

    KeySubstring --> TryParse["try: tmpIndexInt = Integer.valueOf(key)"]
    TryParse -->|Success| IdxValid["tmpIndex >= 0 and < ido_rsn_cd_list.size()?"]
    TryParse -->|NumberFormatException| NullIdx["tmpIndexInt = null"]

    NullIdx --> FinalReturn
    IdxValid -->|Yes| ListStore["storeModelData(subkey, in_value) on X33VDataTypeStringBean"]
    IdxValid -->|No| FinalReturn

    ListStore --> FinalReturn

    NextKey4 -->|Yes| SubIdoRsn["subkey check"]
    NextKey4 -->|No| NextKey5["key equals '申込番号'?"]

    SubIdoRsn --> SubIdoRsnVal["subkey equals 'value'?"]
    SubIdoRsnVal -->|Yes| SetIdoRsnVal["setIdo_rsn_memo_value(in_value)"]
    SubIdoRsnVal -->|No| SubIdoRsnState["subkey equals 'state'?"]
    SubIdoRsnState -->|Yes| SetIdoRsnState["setIdo_rsn_memo_state(in_value)"]
    SubIdoRsnState -->|No| FinalReturn
    SetIdoRsnVal --> NextKey5
    SetIdoRsnState --> FinalReturn

    NextKey5 -->|Yes| SubMskmNo["subkey check"]
    NextKey5 -->|No| NextKey6["key equals '申込明細番号'?"]

    SubMskmNo --> SubMskmNoVal["subkey equals 'value'?"]
    SubMskmNoVal -->|Yes| SetMskmNoVal["setMskm_no_value(in_value)"]
    SubMskmNoVal -->|No| SubMskmNoState["subkey equals 'state'?"]
    SubMskmNoState -->|Yes| SetMskmNoState["setMskm_no_state(in_value)"]
    SubMskmNoState -->|No| FinalReturn
    SetMskmNoVal --> NextKey6
    SetMskmNoState --> FinalReturn

    NextKey6 -->|Yes| SubMskmDtl["subkey check"]
    NextKey6 -->|No| FinalReturn

    SubMskmDtl --> SubMskmDtlVal["subkey equals 'value'?"]
    SubMskmDtlVal -->|Yes| SetMskmDtlVal["setMskm_dtl_no_value(in_value)"]
    SubMskmDtlVal -->|No| SubMskmDtlState["subkey equals 'state'?"]
    SubMskmDtlState -->|Yes| SetMskmDtlState["setMskm_dtl_no_state(in_value)"]
    SubMskmDtlState -->|No| FinalReturn
    SetMskmDtlVal --> FinalReturn
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `key` | `String` | The business item name in Japanese (e.g., "sysid" = System ID, "サービス契約番号" = Service Contract Number, "異動区分" = Change Classification, "異動理由コード" = Change Reason Code, "異動理由メモ" = Change Reason Memo, "申込番号" = Application Number, "申込明細番号" = Application Detail Number). For list-based fields (異動理由コード), the key contains a slash-delimited index suffix (e.g., "異動理由コード/0"). |
| 2 | `subkey` | `String` | The property modifier — either "value" (stores the actual business data) or "state" (stores a state/status flag for the field). Case-insensitive comparison (`equalsIgnoreCase`). |
| 3 | `in_value` | `Object` | The data to be stored. For simple fields, this is the actual value (cast to String internally). For list-based fields, this data is delegated to the nested bean's `storeModelData`. |
| 4 | `isSetAsString` | `boolean` | When `true`, downstream beans (e.g., `X33VDataTypeLongBean`) should set the value as a String representation. Not consumed at this level; forwarded to recursive calls. |

**Instance fields read by this method:**
| Field | Type | Business Meaning |
|-------|------|-----------------|
| `ido_rsn_cd_list` | `X33VDataTypeList` | List of change reason codes — a dynamic list where each entry is an `X33VDataTypeStringBean` representing a reason code for a service change/transfer. |

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| U | `JKKAdEditCC.substring` | JKKAdEditCC | - | Calls `substring` utility in `JKKAdEditCC` |
| U | `JKKAdEdit.substring` | JKKAdEdit | - | Calls `substring` utility in `JKKAdEdit` |
| U | `JKKTelnoInfoAddMapperCC.substring` | JKKTelnoInfoAddMapperCC | - | Calls `substring` utility in `JKKTelnoInfoAddMapperCC` |
| U | `JDKejbStringEdit.substring` | JDKejbStringEdit | - | Calls `substring` utility in `JDKejbStringEdit` |
| U | `KKW01030SF01DBean.setIdo_div_state` | KKW01030SF01DBean | - | Sets the state flag for Change Classification (異動区分) |
| U | `KKW01030SF01DBean.setIdo_div_value` | KKW01030SF01DBean | - | Sets the value for Change Classification (異動区分) |
| U | `KKW01030SF01DBean.setIdo_rsn_memo_state` | KKW01030SF01DBean | - | Sets the state flag for Change Reason Memo (異動理由メモ) |
| U | `KKW01030SF01DBean.setIdo_rsn_memo_value` | KKW01030SF01DBean | - | Sets the value for Change Reason Memo (異動理由メモ) |
| U | `KKW01030SF01DBean.setMskm_dtl_no_state` | KKW01030SF01DBean | - | Sets the state flag for Application Detail Number (申込明細番号) |
| U | `KKW01030SF01DBean.setMskm_dtl_no_value` | KKW01030SF01DBean | - | Sets the value for Application Detail Number (申込明細番号) |
| U | `KKW01030SF01DBean.setMskm_no_state` | KKW01030SF01DBean | - | Sets the state flag for Application Number (申込番号) |
| U | `KKW01030SF01DBean.setMskm_no_value` | KKW01030SF01DBean | - | Sets the value for Application Number (申込番号) |
| U | `KKW01030SF01DBean.setSvc_kei_no_state` | KKW01030SF01DBean | - | Sets the state flag for Service Contract Number (サービス契約番号) |
| U | `KKW01030SF01DBean.setSvc_kei_no_value` | KKW01030SF01DBean | - | Sets the value for Service Contract Number (サービス契約番号) |
| U | `KKW01030SF01DBean.setSysid_state` | KKW01030SF01DBean | - | Sets the state flag for System ID (sysid) |
| U | `KKW01030SF01DBean.setSysid_value` | KKW01030SF01DBean | - | Sets the value for System ID (sysid) |
| U | `KKW01030SF01DBean.storeModelData` | KKW01030SF01DBean | - | Recursively calls itself on a nested bean element for list-based data binding |
| U | `X33VDataTypeStringBean.storeModelData` | X33VDataTypeStringBean | - | Delegates to the nested bean's `storeModelData` for a specific reason code entry (index 0+) in `ido_rsn_cd_list` |

All operations in this method are **Update (U)** — this is a pure data-binding method with no Create/Read/Delete operations against entities or databases. It writes property values on the bean instance, and for the list-based reason code field, delegates updates to child beans.

## 5. Dependency Trace

### Caller Chain

No external screen or batch entry points were found within 8 hops of this method. The method is called internally by `KKW01030SF01DBean` itself (self-referencing calls), meaning it is used for recursive data binding within the same bean — specifically, to populate the `ido_rsn_cd_list` elements.

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | KKW01030SF01DBean (self-call) | `KKW01030SF01DBean.storeModelData(key, subkey, in_value, isSetAsString)` | `X33VDataTypeStringBean.storeModelData` [U] nested bean field |
| 2 | KKW01030SF01DBean (self-call) | `KKW01030SF01DBean.storeModelData(key, subkey, in_value, isSetAsString)` | `setSysid_value/state` [U] sysid field |

Terminal operations from this method (all Update operations on bean properties):
`setMskm_dtl_no_state` [-], `setMskm_dtl_no_value` [-], `setMskm_no_state` [-], `setMskm_no_value` [-], `setIdo_rsn_memo_state` [-], `setIdo_rsn_memo_value` [-], `storeModelData` (recursive) [-], `setSysid_state` [-], `setSysid_value` [-], `setSvc_kei_no_state` [-], `setSvc_kei_no_value` [-], `setIdo_div_state` [-], `setIdo_div_value` [-]

## 6. Per-Branch Detail Blocks

**Block 1** — [IF] Early return: null key or subkey (L393-396)

> If either the `key` or `subkey` parameter is `null`, the method aborts immediately without performing any processing. This is a guard clause to prevent `NullPointerException` on subsequent string operations.

| # | Type | Code |
|---|------|------|
| 1 | IF | `if (key == null || subkey == null)` // 項目名とサブキーがnullの場合、処理を中止 — if item name and subkey are null, abort processing |
| 2 | RETURN | `return` |

**Block 2** — [SET] Compute separator position (L398)

> Extracts the position of the first `/` character in the key. This is used later for the list-based `ido_rsn_cd` field to extract the index suffix.

| # | Type | Code |
|---|------|------|
| 1 | SET | `separaterPoint = key.indexOf('/')` // Find the position of the first '/' separator |

**Block 3** — [IF/ELSE-IF CHAIN: Key dispatch — "sysid" (L400-411)]

> Dispatches data for the System ID field (sysid). The key is the literal Japanese string "sysid". Subkey determines whether to set the value or the state flag.

| # | Type | Code |
|---|------|------|
| 1 | IF | `key.equals("sysid")` // データタイプがStringの項目"sysid"(項目ID:sysid) — Field of String data type "sysid" (Field ID: sysid) |
| 1.1 | IF | `subkey.equalsIgnoreCase("value")` |
| 1.1.1 | CALL | `setSysid_value((String)in_value)` |
| 1.1 | ELSE-IF | `subkey.equalsIgnoreCase("state")` // subkeyが"state"の場合、ステータスを返す — when subkey is "state", return status |
| 1.1.1 | CALL | `setSysid_state((String)in_value)` |

**Block 4** — [IF/ELSE-IF CHAIN: Key dispatch — "サービス契約番号" (L413-424)]

> Dispatches data for the Service Contract Number field (svc_kei_no). This is a core business identifier for the customer's service contract line.

| # | Type | Code |
|---|------|------|
| 1 | IF | `key.equals("サービス契約番号")` // データタイプがStringの項目"サービス契約番号"(項目ID:svc_kei_no) — Field of String data type "Service Contract Number" (Field ID: svc_kei_no) |
| 1.1 | IF | `subkey.equalsIgnoreCase("value")` |
| 1.1.1 | CALL | `setSvc_kei_no_value((String)in_value)` |
| 1.1 | ELSE-IF | `subkey.equalsIgnoreCase("state")` // subkeyが"state"の場合、ステータスを返す — when subkey is "state", return status |
| 1.1.1 | CALL | `setSvc_kei_no_state((String)in_value)` |

**Block 5** — [IF/ELSE-IF CHAIN: Key dispatch — "異動区分" (L426-437)]

> Dispatches data for the Change Classification field (ido_div). This field categorizes the type of service change/transfer (異動).

| # | Type | Code |
|---|------|------|
| 1 | IF | `key.equals("異動区分")` // データタイプがStringの項目"異動区分"(項目ID:ido_div) — Field of String data type "Change Classification" (Field ID: ido_div) |
| 1.1 | IF | `subkey.equalsIgnoreCase("value")` |
| 1.1.1 | CALL | `setIdo_div_value((String)in_value)` |
| 1.1 | ELSE-IF | `subkey.equalsIgnoreCase("state")` // subkeyが"state"の場合、ステータスを返す — when subkey is "state", return status |
| 1.1.1 | CALL | `setIdo_div_state((String)in_value)` |

**Block 6** — [IF/ELSE-IF CHAIN: Key dispatch — "異動理由コード" (L439-470)]

> Dispatches data for the Change Reason Code field (ido_rsn_cd). This is a **list-based field** — each list entry is itself a `X33VDataTypeStringBean` with its own `storeModelData` method. The key includes a `/`-delimited index (e.g., "異動理由コード/0") that identifies which list element to update.

| # | Type | Code |
|---|------|------|
| 1 | IF | `key.equals("異動理由コード")` // 配列項目 "異動理由コード"(String型、項目ID:ido_rsn_cd) — Array field "Change Reason Code" (String type, Field ID: ido_rsn_cd) |
| 1.1 | SET | `key = key.substring(separaterPoint + 1)` // keyの次の要素を取得 — Extract the next element after the first '/' (extracts index suffix, e.g., "0" from "異動理由コード/0") |
| 1.2 | SET | `tmpIndexInt = null` // Initialize temp index to null |
| 1.3 | TRY | `try { tmpIndexInt = Integer.valueOf(key) }` // Attempt to parse the key as an integer |
| 1.3.1 | CATCH | `catch (NumberFormatException e) { tmpIndexInt = null }` // イメージ値が数値文字列でない場合はnullを返す — if the image value is not a numeric string, return null |
| 1.4 | IF | `tmpIndexInt != null` // イメージ値が数値文字列の場合 — if the image value is a numeric string |
| 1.4.1 | SET | `tmpIndex = tmpIndexInt.intValue()` |
| 1.4.2 | IF | `tmpIndex >= 0 && tmpIndex < ido_rsn_cd_list.size()` // イメージ値がリスト個数-1以下の場合 — if image value is less than or equal to list size minus 1 |
| 1.4.2.1 | CALL | `((X33VDataTypeStringBean)ido_rsn_cd_list.get(tmpIndex)).storeModelData(subkey, in_value)` // キャスト部分は、項目定義型に応じてX33VDataTypeStringBean, X33VDataTypeLongBean, X33VDataTypeBooleanBeanのいずれかを指定 — cast section specifies one of X33VDataTypeStringBean, X33VDataTypeLongBean, or X33VDataTypeBooleanBean depending on field definition type |

**Block 7** — [IF/ELSE-IF CHAIN: Key dispatch — "異動理由メモ" (L472-483)]

> Dispatches data for the Change Reason Memo field (ido_rsn_memo). This stores a free-text memo explaining why a service change occurred.

| # | Type | Code |
|---|------|------|
| 1 | IF | `key.equals("異動理由メモ")` // データタイプがStringの項目"異動理由メモ"(項目ID:ido_rsn_memo) — Field of String data type "Change Reason Memo" (Field ID: ido_rsn_memo) |
| 1.1 | IF | `subkey.equalsIgnoreCase("value")` |
| 1.1.1 | CALL | `setIdo_rsn_memo_value((String)in_value)` |
| 1.1 | ELSE-IF | `subkey.equalsIgnoreCase("state")` // subkeyが"state"の場合、ステータスを返す — when subkey is "state", return status |
| 1.1.1 | CALL | `setIdo_rsn_memo_state((String)in_value)` |

**Block 8** — [IF/ELSE-IF CHAIN: Key dispatch — "申込番号" (L485-496)]

> Dispatches data for the Application Number field (mskm_no). This is the primary identifier for a service application/order.

| # | Type | Code |
|---|------|------|
| 1 | IF | `key.equals("申込番号")` // データタイプがStringの項目"申込番号"(項目ID:mskm_no) — Field of String data type "Application Number" (Field ID: mskm_no) |
| 1.1 | IF | `subkey.equalsIgnoreCase("value")` |
| 1.1.1 | CALL | `setMskm_no_value((String)in_value)` |
| 1.1 | ELSE-IF | `subkey.equalsIgnoreCase("state")` // subkeyが"state"の場合、ステータスを返す — when subkey is "state", return status |
| 1.1.1 | CALL | `setMskm_no_state((String)in_value)` |

**Block 9** — [IF/ELSE-IF CHAIN: Key dispatch — "申込明細番号" (L498-509)]

> Dispatches data for the Application Detail Number field (mskm_dtl_no). This is a secondary identifier for specific lines or items within a service application.

| # | Type | Code |
|---|------|------|
| 1 | IF | `key.equals("申込明細番号")` // データタイプがStringの項目"申込明細番号"(項目ID:mskm_dtl_no) — Field of String data type "Application Detail Number" (Field ID: mskm_dtl_no) |
| 1.1 | IF | `subkey.equalsIgnoreCase("value")` |
| 1.1.1 | CALL | `setMskm_dtl_no_value((String)in_value)` |
| 1.1 | ELSE-IF | `subkey.equalsIgnoreCase("state")` // subkeyが"state"の場合、ステータスを返す — when subkey is "state", return status |
| 1.1.1 | CALL | `setMskm_dtl_no_state((String)in_value)` |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `sysid` | Field | System ID — internal system identifier for the record |
| `svc_kei_no` | Field | Service Contract Number — the primary number identifying a service contract line item |
| `ido_div` | Field | Change Classification (異動区分) — categorizes the type of service change or transfer |
| `ido_rsn_cd` | Field | Change Reason Code (異動理由コード) — a list of codes explaining why a service change was made; each element is a `X33VDataTypeStringBean` |
| `ido_rsn_memo` | Field | Change Reason Memo (異動理由メモ) — free-text memo providing additional explanation for the service change |
| `mskm_no` | Field | Application Number (申込番号) — the primary identifier for a service application/order |
| `mskm_dtl_no` | Field | Application Detail Number (申込明細番号) — a secondary identifier for specific items within a service application |
| `ido_rsn_cd_list` | Field | List of change reason code beans — a dynamic collection where each entry represents one reason code for the current service change |
| `value` subkey | Parameter | Indicates the actual data value should be stored (as opposed to a state flag) |
| `state` subkey | Parameter | Indicates a state/status flag for the field should be stored |
| `isSetAsString` | Parameter | Flag forwarded to nested beans to indicate the value should be treated as a String representation (used by Long/Boolean typed beans) |
| `X33VDataTypeStringBean` | Class | A typed data bean representing a String-valued data type field; provides its own `storeModelData` for value/state property binding |
| `X33VDataTypeList` | Class | A list container holding typed data beans (String, Long, Boolean) |
| `X33VDataTypeLongBean` | Class | A typed data bean representing a Long-valued data type field; uses `isSetAsString` for type coercion |
| `X33VDataTypeBooleanBean` | Class | A typed data bean representing a Boolean-valued data type field; uses `isSetAsString` for type coercion |
| 異動 (Idou) | Japanese term | Change / Transfer — refers to any modification or reassignment of a service contract or line item |
| 申込 (Shoumu) | Japanese term | Application / Order — refers to a customer's request for a service |
| KKA15101SF | Screen module | The screen module handling service change/transfer (異動) operations — "SF" denotes a screen form |
