# Business Logic — KKW01030SF01DBean.loadModelData() [100 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.KKA15101SF.KKW01030SF01DBean` |
| Layer | View/Component (Web Data Bean — inherits from `X31CBaseBean`) |
| Module | `KKA15101SF` (Package: `eo.web.webview.KKA15101SF`) |

## 1. Role

### KKW01030SF01DBean.loadModelData()

This method serves as a **generic data retrieval router** for the `KKW01030SF01DBean` data model class. It implements the X33 view framework's load protocol by accepting a `key` (the field identifier) and a `subkey` (the attribute type — typically `"value"` or `"state"`) and returning the appropriate data object. The method supports **seven distinct field types** used across the migration/order management screen: System ID (`SYSID`), Service Contract Number (`サービス契約番号`), Move/Divergence Type (`異動区分`), Move Reason Code list (`異動理由コード`), Move Reason Memo (`異動理由メモ`), Application Number (`申込番号`), and Application Detail Number (`申込明細番号`).

It follows a **routing/dispatch design pattern**: each `else-if` branch checks the `key` against a hardcoded Japanese string literal representing a field category, then branches again on the `subkey` to return either the value or the state metadata. The move reason code field is treated specially as a **parameterized indexed collection** — when the key contains a `/` separator followed by a numeric index or `*`, the method resolves data from or returns the size of an internal `ido_rsn_cd_list`, which holds `X33VDataTypeStringBean` instances representing individual move reason code entries.

In the larger system, this method is the **primary read-side interface** for screen beans. It allows the view layer (JSF pages, controllers, or framework infrastructure) to retrieve field values through a single polymorphic method, decoupling screen logic from the internal bean field structure. It mirrors the counterpart `storeModelData()` for writes and `typeModelData()` for type introspection, forming the complete X33 data model access triad.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["loadModelData key subkey"])

    START --> CHECK_NULL{key or subkey<br/>is null?}
    CHECK_NULL -->|Yes| RET_NULL([return null])
    CHECK_NULL -->|No| FIND_SLASH[Find / in key<br/>key.indexOf('/')]

    FIND_SLASH --> SYSID{key == SYSID}
    SYSID -->|Yes| SYSID_SUB{subkey equals<br/>value or state}
    SYSID_SUB -->|value| RET_SYSID_VAL([return getSysid_value])
    SYSID_SUB -->|state| RET_SYSID_STATE([return getSysid_state])
    SYSID -->|No| SVC_KEY{key == サービス契約番号}
    SVC_KEY -->|Yes| SVC_SUB{subkey equals<br/>value or state}
    SVC_SUB -->|value| RET_SVC_VAL([return getSvc_kei_no_value])
    SVC_SUB -->|state| RET_SVC_STATE([return getSvc_kei_no_state])
    SVC_SUB -->|No| IDO_DIV{key == 異動区分}
    IDO_DIV -->|Yes| IDO_DIV_SUB{subkey equals<br/>value or state}
    IDO_DIV_SUB -->|value| RET_IDO_DIV_VAL([return getIdo_div_value])
    IDO_DIV_SUB -->|state| RET_IDO_DIV_STATE([return getIdo_div_state])
    IDO_DIV_SUB -->|No| ITR_KEY{key == 異動理由コード}
    ITR_KEY -->|Yes| ITR_SUB[Extract substring after /<br/>key.substring(separaterPoint + 1)]
    ITR_SUB --> ITR_STAR{key equals *<br/>list size request}
    ITR_STAR -->|Yes| RET_LIST_SIZE([return list.size])
    ITR_STAR -->|No| PARSE_IDX{Parse key as<br/>Integer index}
    PARSE_IDX -->|NumberFormatException| RET_NULL_IDX([return null])
    PARSE_IDX -->|Success| CHECK_IDX{index valid<br/>0 <= index < list.size}
    CHECK_IDX -->|No| RET_NULL_IDX
    CHECK_IDX -->|Yes| ITR_GET[Cast to X33VDataTypeStringBean<br/>loadModelData subkey]
    ITR_GET --> RET_ITR_DATA([return bean data])
    ITR_KEY -->|No| IDO_MEMO{key == 異動理由メモ}
    IDO_MEMO -->|Yes| IDO_MEMO_SUB{subkey equals<br/>value or state}
    IDO_MEMO_SUB -->|value| RET_IDO_MEMO_VAL([return getIdo_rsn_memo_value])
    IDO_MEMO_SUB -->|state| RET_IDO_MEMO_STATE([return getIdo_rsn_memo_state])
    IDO_MEMO_SUB -->|No| MSKM_NO{key == 申込番号}
    MSKM_NO -->|Yes| MSKM_SUB{subkey equals<br/>value or state}
    MSKM_SUB -->|value| RET_MSKM_VAL([return getMskm_no_value])
    MSKM_SUB -->|state| RET_MSKM_STATE([return getMskm_no_state])
    MSKM_SUB -->|No| MSKM_DTL{key == 申込明細番号}
    MSKM_DTL -->|Yes| MSKM_DTL_SUB{subkey equals<br/>value or state}
    MSKM_DTL_SUB -->|value| RET_MSKM_DTL_VAL([return getMskm_dtl_no_value])
    MSKM_DTL_SUB -->|state| RET_MSKM_DTL_STATE([return getMskm_dtl_no_state])
    MSKM_DTL_SUB -->|No| RET_DEFAULT([return null])
    MSKM_DTL -->|No| RET_DEFAULT
    RET_SYSID_VAL --> RET_DEFAULT
    RET_SYSID_STATE --> RET_DEFAULT
    RET_SVC_VAL --> RET_DEFAULT
    RET_SVC_STATE --> RET_DEFAULT
    RET_IDO_DIV_VAL --> RET_DEFAULT
    RET_IDO_DIV_STATE --> RET_DEFAULT
    RET_ITR_DATA --> RET_DEFAULT
    RET_LIST_SIZE --> RET_DEFAULT
    RET_IDO_MEMO_VAL --> RET_DEFAULT
    RET_IDO_MEMO_STATE --> RET_DEFAULT
    RET_MSKM_VAL --> RET_DEFAULT
    RET_MSKM_STATE --> RET_DEFAULT
    RET_MSKM_DTL_VAL --> RET_DEFAULT
    RET_MSKM_DTL_STATE --> RET_DEFAULT
    RET_NULL_IDX --> RET_DEFAULT
    RET_DEFAULT --> END([End])
```

**Branch Summary:**

| Branch | Condition | Business Description |
|--------|-----------|---------------------|
| Null Guard | `key == null || subkey == null` | Returns `null` when either parameter is missing. |
| SYSID | `key == "SYSID"` | Retrieves the system identifier value or state string. |
| Service Contract Number | `key == "サービス契約番号"` | Retrieves the service contract number (サービス契約番号) value or its validation state. |
| Move Type | `key == "異動区分"` | Retrieves the divergence/move type (異動区分) value or state. |
| Move Reason Code (list) | `key == "異動理由コード"` | Special indexed collection access. Subkey `/` + index or `*` resolves list data. |
| Move Reason Memo | `key == "異動理由メモ"` | Retrieves the move reason memo (異動理由メモ) value or state. |
| Application Number | `key == "申込番号"` | Retrieves the application number (申込番号) value or state. |
| Application Detail Number | `key == "申込明細番号"` | Retrieves the application detail number (申込明細番号) value or state. |
| Fallback | No match | Returns `null` when no key property matches. |

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `key` | `String` | The field identifier in Japanese that specifies which screen data field to retrieve. Valid values are: `"SYSID"` (System ID), `"サービス契約番号"` (Service Contract Number), `"異動区分"` (Move/Divergence Type), `"異動理由コード"` (Move Reason Code — supports indexed format like `"異動理由コード/0"`, `"異動理由コード/*"`), `"異動理由メモ"` (Move Reason Memo), `"申込番号"` (Application Number), `"申込明細番号"` (Application Detail Number). |
| 2 | `subkey` | `String` | The attribute type selector within a field. For scalar fields, accepts `"value"` to return the data value or `"state"` (case-insensitive) to return the validation/processing state string. For the indexed list field (`異動理由コード`), the subkey is passed through to the inner bean's `loadModelData()` to access nested data. |

**Instance fields read by this method:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `ido_rsn_cd_list` | `X33VDataTypeList` | The internal list of move reason code entries. Each element is an `X33VDataTypeStringBean` representing a single move/reason code record. Accessed for indexed retrieval in the `異動理由コード` branch. |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `KKW01030SF01DBean.getSysid_value` | KKW01030SF01DBean | - | Read system ID value from internal field `sysid_value` |
| R | `KKW01030SF01DBean.getSysid_state` | KKW01030SF01DBean | - | Read system ID state (validation/status) from `sysid_state` |
| R | `KKW01030SF01DBean.getSvc_kei_no_value` | KKW01030SF01DBean | - | Read service contract number from `svc_kei_no_value` |
| R | `KKW01030SF01DBean.getSvc_kei_no_state` | KKW01030SF01DBean | - | Read service contract number state from `svc_kei_no_state` |
| R | `KKW01030SF01DBean.getIdo_div_value` | KKW01030SF01DBean | - | Read move/divergence type from `ido_div_value` |
| R | `KKW01030SF01DBean.getIdo_div_state` | KKW01030SF01DBean | - | Read move type state from `ido_div_state` |
| R | `KKW01030SF01DBean.getIdo_rsn_memo_value` | KKW01030SF01DBean | - | Read move reason memo from `ido_rsn_memo_value` |
| R | `KKW01030SF01DBean.getIdo_rsn_memo_state` | KKW01030SF01DBean | - | Read move reason memo state from `ido_rsn_memo_state` |
| R | `KKW01030SF01DBean.getMskm_no_value` | KKW01030SF01DBean | - | Read application number from `mskm_no_value` |
| R | `KKW01030SF01DBean.getMskm_no_state` | KKW01030SF01DBean | - | Read application number state from `mskm_no_state` |
| R | `KKW01030SF01DBean.getMskm_dtl_no_value` | KKW01030SF01DBean | - | Read application detail number from `mskm_dtl_no_value` |
| R | `KKW01030SF01DBean.getMskm_dtl_no_state` | KKW01030SF01DBean | - | Read application detail number state from `mskm_dtl_no_state` |
| R | `KKW01030SF01DBean.loadModelData` | KKW01030SF01DBean | - | Delegated load: reads nested data from inner `X33VDataTypeStringBean` in the move reason code list |

**Classification Notes:**
- All operations are **Read (R)** — this method is a pure data accessor with no create, update, or delete side effects.
- No external SC Codes, CBS (call-back service), or DB tables are invoked. This method operates entirely on in-memory bean fields.
- The only external class referenced in the method body is `X33VDataTypeStringBean` (a type cast for indexed list access).

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Internal — `KKW01030SF01DBean.loadModelData()` | Same-class overloaded call (no-arg variant delegates to `loadModelData(key, subkey)`) | `getSysid_value [R]`, `getSvc_kei_no_value [R]`, `getIdo_div_value [R]`, `loadModelData [R]` (nested), `getIdo_rsn_memo_value [R]`, `getMskm_no_value [R]`, `getMskm_dtl_no_value [R]` |

**Notes:**
- The pre-computed caller table shows only one direct caller: the no-argument overload of `loadModelData()` within the same class.
- This method is intended to be called by the **X33 view framework infrastructure** (not directly by business code). The framework uses reflection or the `loadModelData` contract to populate screen fields from the bean during page initialization.
- No external screens (`KKSV*`) or batch jobs directly invoke this method; it is accessed through the X33 data binding layer.

## 6. Per-Branch Detail Blocks

### Block 1 — IF (null guard) `(key == null || subkey == null)` (L258)

Null parameter check — returns `null` if either input is missing.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return null;` // null check: key, subkey がnullの場合、nullを返す |

### Block 2 — SET (separator index calculation) (L260)

Finds the position of the `/` separator in `key` — needed for the indexed list field branch.

| # | Type | Code |
|---|------|------|
| 1 | SET | `int separaterPoint = key.indexOf("/");` // Finds position of '/' in key |

### Block 3 — ELSE-IF (SYSID branch) `(key.equals("SYSID"))` (L263)
**Key:** `SYSID = "SYSID"` (System ID — the system identifier field)

> データタイプがStringの項目"SYSID"（項目ID:sysid）— String-type field "SYSID" (field ID: sysid)

#### Block 3.1 — IF `(subkey.equalsIgnoreCase("value"))` (L264)

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return getSysid_value();` |

#### Block 3.2 — ELSE-IF `(subkey.equalsIgnoreCase("state"))` (L267)
**subkey:** `state = "state"` — state metadata retrieval

> subkeyが"state"の場合、ステータスを返す。 — If subkey is "state", return the status.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return getSysid_state();` |

### Block 4 — ELSE-IF (Service Contract Number branch) `(key.equals("サービス契約番号"))` (L273)
**Key:** `サービス契約番号 = "サービス契約番号"` (Service Contract Number — the contract number for the service line)

> データタイプがStringの項目"サービス契約番号"（項目ID:svc_kei_no） — String-type field "Service Contract Number" (field ID: svc_kei_no)

#### Block 4.1 — IF `(subkey.equalsIgnoreCase("value"))` (L274)

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return getSvc_kei_no_value();` |

#### Block 4.2 — ELSE-IF `(subkey.equalsIgnoreCase("state"))` (L277)

> subkeyが"state"の場合、ステータスを返す。 — If subkey is "state", return the status.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return getSvc_kei_no_state();` |

### Block 5 — ELSE-IF (Move Type branch) `(key.equals("異動区分"))` (L283)
**Key:** `異動区分 = "異動区分"` (Move/Divergence Type — classifies the type of move/divergence operation)

> データタイプがStringの項目"異動区分"（項目ID:ido_div） — String-type field "Move Type" (field ID: ido_div)

#### Block 5.1 — IF `(subkey.equalsIgnoreCase("value"))` (L284)

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return getIdo_div_value();` |

#### Block 5.2 — ELSE-IF `(subkey.equalsIgnoreCase("state"))` (L287)

> subkeyが"state"の場合、ステータスを返す。 — If subkey is "state", return the status.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return getIdo_div_state();` |

### Block 6 — ELSE-IF (Move Reason Code list branch) `(key.equals("異動理由コード"))` (L293)
**Key:** `異動理由コード = "異動理由コード"` (Move Reason Code — the reason code for a move/divergence, stored as an indexed list)

> 配列項目 "異動理由コード"(String型。項目ID:ido_rsn_cd) — Array field "Move Reason Code" (String type. Field ID: ido_rsn_cd)

#### Block 6.1 — SET (key extraction) (L295)

> keyの次の要素を取得 — Get the next element of key (substring after the '/')

| # | Type | Code |
|---|------|------|
| 1 | SET | `key = key.substring(separaterPoint + 1);` // Extracts part after '/' (e.g., "異動理由コード/0" → "0") |

#### Block 6.2 — IF `(key.equals("*"))` (L298)
**Subcondition:** `*` — list size request

> インデックス値の代わりに"*"が指定されていたら、リストの要素数を返す。 — If "*" is specified instead of an index value, return the number of list elements.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return Integer.valueOf(ido_rsn_cd_list.size());` // Returns list size |

#### Block 6.3 — TRY-CATCH (index parsing) (L302)

> インデックス値の数値文字列をチェック — Check the numeric string of the index value

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

##### Block 6.3.1 — IF `(tmpIndexInt == null)` (L309)

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return null;` |

#### Block 6.4 — SET (index extraction) (L311)

| # | Type | Code |
|---|------|------|
| 1 | SET | `int tmpIndex = tmpIndexInt.intValue();` |

#### Block 6.5 — IF `(tmpIndex < 0 || tmpIndex >= ido_rsn_cd_list.size())` (L312)
**Condition:** Out-of-bounds check for the move reason code list

> インデックス値がリスト個数-1を超える場合、ここでnullを返す。 — If the index value exceeds list size minus one, return null here.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return null;` |

#### Block 6.6 — RETURN (nested load) (L314)

> Casts the list element to X33VDataTypeStringBean and delegates to its loadModelData().

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return ((X33VDataTypeStringBean)ido_rsn_cd_list.get(tmpIndex)).loadModelData(subkey);` // Delegates to inner bean |

### Block 7 — ELSE-IF (Move Reason Memo branch) `(key.equals("異動理由メモ"))` (L319)
**Key:** `異動理由メモ = "異動理由メモ"` (Move Reason Memo — free-text memo field for the move/divergence reason)

> データタイプがStringの項目"異動理由メモ"（項目ID:ido_rsn_memo） — String-type field "Move Reason Memo" (field ID: ido_rsn_memo)

#### Block 7.1 — IF `(subkey.equalsIgnoreCase("value"))` (L320)

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return getIdo_rsn_memo_value();` |

#### Block 7.2 — ELSE-IF `(subkey.equalsIgnoreCase("state"))` (L323)

> subkeyが"state"の場合、ステータスを返す。 — If subkey is "state", return the status.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return getIdo_rsn_memo_state();` |

### Block 8 — ELSE-IF (Application Number branch) `(key.equals("申込番号"))` (L329)
**Key:** `申込番号 = "申込番号"` (Application Number — the unique identifier for the order application)

> データタイプがStringの項目"申込番号"（項目ID:mskm_no） — String-type field "Application Number" (field ID: mskm_no)

#### Block 8.1 — IF `(subkey.equalsIgnoreCase("value"))` (L330)

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return getMskm_no_value();` |

#### Block 8.2 — ELSE-IF `(subkey.equalsIgnoreCase("state"))` (L333)

> subkeyが"state"の場合、ステータスを返す。 — If subkey is "state", return the status.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return getMskm_no_state();` |

### Block 9 — ELSE-IF (Application Detail Number branch) `(key.equals("申込明細番号"))` (L339)
**Key:** `申込明細番号 = "申込明細番号"` (Application Detail Number — the detailed sub-number within an application)

> データタイプがStringの項目"申込明細番号"（項目ID:mskm_dtl_no） — String-type field "Application Detail Number" (field ID: mskm_dtl_no)

#### Block 9.1 — IF `(subkey.equalsIgnoreCase("value"))` (L340)

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return getMskm_dtl_no_value();` |

#### Block 9.2 — ELSE-IF `(subkey.equalsIgnoreCase("state"))` (L343)

> subkeyが"state"の場合、ステータスを返す。 — If subkey is "state", return the status.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return getMskm_dtl_no_state();` |

### Block 10 — ELSE (fallback) (L350)
**Condition:** No matching key property found

> 条件に合致するプロパティが存在しない場合は、nullを返す。 — If no property matches the condition, return null.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return null;` |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `sysid` | Field | System ID — the internal system identifier for the record, stored as `sysid_value` (value) and `sysid_state` (state) |
| `sysid_update` | Field | System ID update flag — indicates whether the system ID has been modified |
| `svc_kei_no` | Field | Service Contract Number (サービス契約番号) — the contract number identifying the service line item in the order |
| `svc_kei_no_value` | Field | Service contract number value |
| `svc_kei_no_state` | Field | Service contract number validation/processing state |
| `svc_kei_no_update` | Field | Service contract number update flag |
| `ido_div` | Field | Move/Divergence Type (異動区分) — classifies the type of move or divergence operation being performed |
| `ido_div_value` | Field | Move type value |
| `ido_div_state` | Field | Move type validation/processing state |
| `ido_div_update` | Field | Move type update flag |
| `ido_rsn_cd` | Field | Move Reason Code (異動理由コード) — the reason code for a move/divergence, stored as an indexed list (`X33VDataTypeList` of `X33VDataTypeStringBean`) |
| `ido_rsn_cd_list` | Field | The internal list of move reason code entries. Each element is a typed string bean representing a single move/reason code record |
| `ido_rsn_memo` | Field | Move Reason Memo (異動理由メモ) — free-text memo field providing additional context for the move/divergence reason |
| `ido_rsn_memo_value` | Field | Move reason memo value |
| `ido_rsn_memo_state` | Field | Move reason memo validation/processing state |
| `ido_rsn_memo_update` | Field | Move reason memo update flag |
| `mskm_no` | Field | Application Number (申込番号) — the unique identifier for an order application |
| `mskm_no_value` | Field | Application number value |
| `mskm_no_state` | Field | Application number validation/processing state |
| `mskm_no_update` | Field | Application number update flag |
| `mskm_dtl_no` | Field | Application Detail Number (申込明細番号) — the detailed sub-number within an application, used to identify specific line items |
| `mskm_dtl_no_value` | Field | Application detail number value |
| `mskm_dtl_no_state` | Field | Application detail number validation/processing state |
| `mskm_dtl_no_update` | Field | Application detail number update flag |
| `key` | Parameter | Field identifier in Japanese — selects which bean field to retrieve. Acts as a routing key for the dispatch logic |
| `subkey` | Parameter | Attribute selector — typically `"value"` for the data value or `"state"` for the validation state. Case-insensitive comparison |
| `X33VDataTypeStringBean` | Class | Typed data bean from the X33 framework representing a String field with value and state metadata |
| `X33VDataTypeList` | Class | X33 framework container for indexed list data. Supports add, remove, get, clear, and size operations |
| `X31CBaseBean` | Class | Base bean class providing core data model functionality (storeModelData, loadModelData) |
| `X33VDataTypeBeanInterface` | Interface | X33 framework interface requiring loadModelData, storeModelData, and typeModelData implementations |
| `X33VListedBeanInterface` | Interface | X33 framework interface for beans that support indexed list data (addListDataInstance, removeElementFromListData, clearListDataInstance) |
| X33 | Acronym | Fujitsu Futurity X33 — a web application development framework providing data binding, validation, and UI component infrastructure |
| X31 | Acronym | Fujitsu Futurity X31 — a lower-level framework providing base bean and web component classes |
| FTTH | Business term | Fiber To The Home — a broadband network technology (appears in related order content codes) |
