# Business Logic — FUW00928SF01DBean.loadModelData() [39 LOC]

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

## 1. Role

### FUW00928SF01DBean.loadModelData()

This method implements the core data-resolution dispatch mechanism for the **Provider Code** (`tsjgs_cd`) and **Provider Name** (`tsjgs_nm`) data type fields within the FUW00928SF web screen module. It serves as a **router/dispatcher** that receives a key/subkey pair and returns the appropriate piece of domain data — whether that is the actual value, an enabled/flag state, or a display state string — based on the field type being queried.

The method handles two data types:
- **通信事業者コード (Provider Code)** — the telecom provider identifier code (`tsjgs_cd`).
- **通信事業者名 (Provider Name)** — the telecom provider name string (`tsjgs_nm`).

For each data type, it supports three subkeys: `value` (the field's current value), `enable` (the enabled/disabled flag as a Boolean), and `state` (a state string for UI rendering). It delegates each request to the corresponding getter method (e.g., `getTsjgs_cd_value()`).

**Design pattern:** Routing/dispatch pattern — the key determines the domain entity, and the subkey determines which attribute to return. This is a standard pattern in Fujitsu X33/X31 web frameworks where data-type beans expose a uniform `loadModelData(key, subkey)` contract so that the framework can dynamically resolve any field attribute without hardcoding field-specific accessors in the calling code.

**Role in the larger system:** This method is called indirectly by the parent bean `FUW00928SFBean` during screen data initialization, specifically when iterating over lists of provider entries (e.g., the "通信事業者リスト" — provider list) to fetch individual row data. It acts as a shared utility bean that the X33 framework uses to populate form fields at render time.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["loadModelData(key, subkey)"])
    CHECK_NULL["key or subkey is null?"]
    RETURN_NULL_RETURN["Return null"]
    FIND_SLASH["Find '/' separator in key"]
    CHECK_TSJGS_CD["key == '通信事業者コード'
(Provider Code)?"]
    CHECK_TSJGS_CD_VALUE["subkey == 'value'?"]
    CALL_TSJGS_CD_VALUE["getTsjgs_cd_value()"]
    CHECK_TSJGS_CD_ENABLE["subkey == 'enable'?"]
    CALL_TSJGS_CD_ENABLE["getTsjgs_cd_enabled()"]
    CHECK_TSJGS_CD_STATE["subkey == 'state'?"]
    CALL_TSJGS_CD_STATE["getTsjgs_cd_state()"]
    CHECK_TSJGS_NM["key == '通信事業者名'
(Provider Name)?"]
    CHECK_TSJGS_NM_VALUE["subkey == 'value'?"]
    CALL_TSJGS_NM_VALUE["getTsjgs_nm_value()"]
    CHECK_TSJGS_NM_ENABLE["subkey == 'enable'?"]
    CALL_TSJGS_NM_ENABLE["getTsjgs_nm_enabled()"]
    CHECK_TSJGS_NM_STATE["subkey == 'state'?"]
    CALL_TSJGS_NM_STATE["getTsjgs_nm_state()"]
    RETURN_FALLTHROUGH["Return null"]

    START --> CHECK_NULL
    CHECK_NULL --> |"yes"| RETURN_NULL_RETURN
    CHECK_NULL --> |"no"| FIND_SLASH
    FIND_SLASH --> CHECK_TSJGS_CD
    CHECK_TSJGS_CD --> |"yes"| CHECK_TSJGS_CD_VALUE
    CHECK_TSJGS_CD_VALUE --> |"yes"| CALL_TSJGS_CD_VALUE
    CHECK_TSJGS_CD_VALUE --> |"no"| CHECK_TSJGS_CD_ENABLE
    CHECK_TSJGS_CD_ENABLE --> |"yes"| CALL_TSJGS_CD_ENABLE
    CHECK_TSJGS_CD_ENABLE --> |"no"| CHECK_TSJGS_CD_STATE
    CHECK_TSJGS_CD_STATE --> |"yes"| CALL_TSJGS_CD_STATE
    CHECK_TSJGS_CD_STATE --> |"no"| CHECK_TSJGS_NM
    CHECK_TSJGS_CD --> |"no"| CHECK_TSJGS_NM
    CHECK_TSJGS_NM --> |"yes"| CHECK_TSJGS_NM_VALUE
    CHECK_TSJGS_NM_VALUE --> |"yes"| CALL_TSJGS_NM_VALUE
    CHECK_TSJGS_NM_VALUE --> |"no"| CHECK_TSJGS_NM_ENABLE
    CHECK_TSJGS_NM_ENABLE --> |"yes"| CALL_TSJGS_NM_ENABLE
    CHECK_TSJGS_NM_ENABLE --> |"no"| CHECK_TSJGS_NM_STATE
    CHECK_TSJGS_NM_STATE --> |"yes"| CALL_TSJGS_NM_STATE
    CHECK_TSJGS_NM_STATE --> |"no"| RETURN_FALLTHROUGH
    CALL_TSJGS_CD_VALUE --> END_NODE(["Return / Next"])
    CALL_TSJGS_CD_ENABLE --> END_NODE
    CALL_TSJGS_CD_STATE --> END_NODE
    CALL_TSJGS_NM_VALUE --> END_NODE
    CALL_TSJGS_NM_ENABLE --> END_NODE
    CALL_TSJGS_NM_STATE --> END_NODE
    RETURN_NULL_RETURN --> END_NODE
    RETURN_FALLTHROUGH --> END_NODE
```

**Notes:**
- The `separaterPoint` variable is computed via `key.indexOf("/")` but is **not used** in this method. It appears to be reserved for future expansion (similar logic exists in the parent `FUW00928SFBean` that processes nested key paths like `"key/index/subkey"`).
- All subkey comparisons use `equalsIgnoreCase`, allowing case-insensitive matching.
- If no key or subkey branch matches, the method falls through to the end and returns `null`.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `key` | `String` | The **field name** (項目名) identifying which data type to retrieve. Two valid values exist: `"通信事業者コード"` (Provider Code — maps to `tsjgs_cd_*` fields) and `"通信事業者名"` (Provider Name — maps to `tsjgs_nm_*` fields). This parameter determines the domain entity being accessed. |
| 2 | `subkey` | `String` | The **sub-field attribute** (サブキー) specifying which property of the identified data type to return. Valid values (case-insensitive): `"value"` (the actual field value), `"enable"` (the enabled/disabled flag as `Boolean`), and `"state"` (a state string for UI display). |

**Instance fields read by this method:**

| No | Field Name | Type | Business Description |
|----|-----------|------|---------------------|
| 1 | `tsjgs_cd_value` | `String` | The current telecom provider code value (initialized to `""`). |
| 2 | `tsjgs_cd_enabled` | `Boolean` | Whether the provider code field is enabled for editing (default `false`). |
| 3 | `tsjgs_cd_state` | `String` | The display state of the provider code field (initialized to `""`). |
| 4 | `tsjgs_nm_value` | `String` | The current telecom provider name value (initialized to `""`). |
| 5 | `tsjgs_nm_enabled` | `Boolean` | Whether the provider name field is enabled for editing (default `false`). |
| 6 | `tsjgs_nm_state` | `String` | The display state of the provider name field (initialized to `""`). |

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `FUW00928SF01DBean.getTsjgs_cd_value` | FUW00928SF01DBean | - | Returns the `tsjgs_cd_value` field (provider code string) |
| R | `FUW00928SF01DBean.getTsjgs_cd_enabled` | FUW00928SF01DBean | - | Returns the `tsjgs_cd_enabled` field (provider code enabled flag) |
| R | `FUW00928SF01DBean.getTsjgs_cd_state` | FUW00928SF01DBean | - | Returns the `tsjgs_cd_state` field (provider code state string) |
| R | `FUW00928SF01DBean.getTsjgs_nm_value` | FUW00928SF01DBean | - | Returns the `tsjgs_nm_value` field (provider name string) |
| R | `FUW00928SF01DBean.getTsjgs_nm_enabled` | FUW00928SF01DBean | - | Returns the `tsjgs_nm_enabled` field (provider name enabled flag) |
| R | `FUW00928SF01DBean.getTsjgs_nm_state` | FUW00928SF01DBean | - | Returns the `tsjgs_nm_state` field (provider name state string) |

All operations are **Read** (R) — this method only reads instance fields via their getters. No SC (Service Component), CBS (Business Service), or direct DB access is involved.

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Module: FUW00928SFBean | `FUW00928SFBean` (iterates `tsjgs_list_list`) → `((X33VDataTypeBeanInterface) tsjgs_list_list.get(i)).loadModelData("通信事業者リスト", subkey)` | `getTsjgs_cd_value` [R], `getTsjgs_cd_enabled` [R], `getTsjgs_cd_state` [R], `getTsjgs_nm_value` [R], `getTsjgs_nm_enabled` [R], `getTsjgs_nm_state` [R] |
| 2 | Module: FUW00928SFBean | `FUW00928SFBean.loadModelData(key, subkey)` (overloaded 2-arg override) → `loadModelData(key, subkey)` (delegates to 3-arg version) → `FUW00928SF01DBean.loadModelData` | Same as above |
| 3 | Module: FUW00928SFBean | `FUW00928SFBean.loadModelData(gamenId, key, subkey)` (3-arg override) → `loadModelData(key, subkey)` | Same as above |

**Notes:**
- The primary caller is `FUW00928SFBean`, which manages the provider list screen area. During data population (e.g., at line 2154), it iterates over the `tsjgs_list_list` (provider list), casts each entry to `X33VDataTypeBeanInterface`, and invokes `loadModelData` to fetch row-level data.
- The `tsjgs_list_list` entries are instances of `FUW00928SF01DBean` (see line 8670: `new FUW00928SF01DBean()`).
- No other modules or screens outside the `FUW00928SF` module directly reference this bean.

## 6. Per-Branch Detail Blocks

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

> Null guard: if either parameter is null, return null immediately. This prevents null-pointer exceptions in subsequent string operations.

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

**Block 2** — [EXEC] Compute separator position (L152)

| # | Type | Code |
|---|------|------|
| 1 | SET | `separaterPoint = key.indexOf("/");` // Reserved for future nested-key-path support — not used in this method |

**Block 3** — [IF-ELSE-IF-ELSE] Branch on key type (L155–L179)

> Main routing logic. The key determines which domain entity (Provider Code or Provider Name) is being accessed. Each branch further dispatches on subkey.

**Block 3.1** — [IF] `key.equals("通信事業者コード")` `[通信事業者コード = "通信事業者コード" (Provider Code)]` (L155)

> The key matches the Provider Code field. Dispatch to one of three subkey handlers.

**Block 3.1.1** — [IF] `subkey.equalsIgnoreCase("value")` (L156)

> Return the actual provider code string value.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `getTsjgs_cd_value();` // Returns the tsjgs_cd_value field |

**Block 3.1.2** — [ELSE-IF] `subkey.equalsIgnoreCase("enable")` `[enable = "enable"]` (L158)

> Return the enabled/disabled flag for the provider code field. (コメント: subkeyが"enable"の場合、tsjgs_cd_enableのgetterの戻り値を返す。)

| # | Type | Code |
|---|------|------|
| 1 | CALL | `getTsjgs_cd_enabled();` // Returns the tsjgs_cd_enabled Boolean field |

**Block 3.1.3** — [ELSE-IF] `subkey.equalsIgnoreCase("state")` `[state = "state"]` (L160)

> Return the display state string for the provider code field. (コメント: subkeyが"state"の場合、ステータスを返す。)

| # | Type | Code |
|---|------|------|
| 1 | CALL | `getTsjgs_cd_state();` // Returns the tsjgs_cd_state String field |

**Block 3.2** — [ELSE-IF] `key.equals("通信事業者名")` `[通信事業者名 = "通信事業者名" (Provider Name)]` (L165)

> The key matches the Provider Name field. Dispatch to one of three subkey handlers.

**Block 3.2.1** — [IF] `subkey.equalsIgnoreCase("value")` (L166)

> Return the actual provider name string value.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `getTsjgs_nm_value();` // Returns the tsjgs_nm_value field |

**Block 3.2.2** — [ELSE-IF] `subkey.equalsIgnoreCase("enable")` `[enable = "enable"]` (L168)

> Return the enabled/disabled flag for the provider name field. (コメント: subkeyが"enable"の場合、tsjgs_nm_enableのgetterの戻り値を返す。)

| # | Type | Code |
|---|------|------|
| 1 | CALL | `getTsjgs_nm_enabled();` // Returns the tsjgs_nm_enabled Boolean field |

**Block 3.2.3** — [ELSE-IF] `subkey.equalsIgnoreCase("state")` `[state = "state"]` (L170)

> Return the display state string for the provider name field. (コメント: subkeyが"state"の場合、ステータスを返す。)

| # | Type | Code |
|---|------|------|
| 1 | CALL | `getTsjgs_nm_state();` // Returns the tsjgs_nm_state String field |

**Block 4** — [ELSE] No matching key or subkey (L175)

> Fall-through: no conditions matched. Return null to indicate no data found for the given key/subkey combination. (コメント: 条件に一致するプロパティが存在しない場合は、nullを返す。)

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

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `通信事業者コード` | Field (key) | Provider Code — the telecom service provider identifier. Maps to `tsjgs_cd` fields. |
| `通信事業者名` | Field (key) | Provider Name — the human-readable telecom service provider name. Maps to `tsjgs_nm` fields. |
| `tsjgs_cd` | Field (internal ID) | 通信事業者コード — Provider Code, an internal string field tracking which telecom provider is associated with a service order. |
| `tsjgs_nm` | Field (internal ID) | 通信事業者名 — Provider Name, an internal string field holding the display name of the telecom provider. |
| `tsjgs_cd_value` | Field | The current value of the Provider Code string field. |
| `tsjgs_cd_enabled` | Field | Boolean flag indicating whether the Provider Code field is enabled (editable) in the UI. |
| `tsjgs_cd_state` | Field | State string of the Provider Code field, used for UI rendering (e.g., "readonly", "hidden"). |
| `tsjgs_nm_value` | Field | The current value of the Provider Name string field. |
| `tsjgs_nm_enabled` | Field | Boolean flag indicating whether the Provider Name field is enabled (editable) in the UI. |
| `tsjgs_nm_state` | Field | State string of the Provider Name field, used for UI rendering. |
| `tsjgs_cd_update` | Field | Update timestamp/marker for the Provider Code field. |
| `tsjgs_nm_update` | Field | Update timestamp/marker for the Provider Name field. |
| `key` | Parameter | Field name — identifies which data type to access. Must match Japanese display names used in the UI. |
| `subkey` | Parameter | Sub-field attribute — specifies which property (`value`, `enable`, `state`) of the data type to return. |
| `X33VDataTypeBeanInterface` | Interface | Fujitsu X33 framework interface that data-type beans must implement to support dynamic data resolution via `loadModelData`. |
| `X33VListedBeanInterface` | Interface | X33 framework interface for beans that represent items in a listed/repeating data section (e.g., table rows). |
| X33/X31 | Acronym | Fujitsu Futurity Web Client framework — the enterprise Java EE web framework used for this application. |
| `separaterPoint` | Variable | Temporary variable holding the index of the "/" separator in the key. Reserved for future nested key-path support (e.g., `"key/index/subkey"`). |
| `index` | Field | The list index of the current row/item within a data-type bean list. |
| `FUW00928SF` | Module | The service module code. "FUW" typically denotes a web (UI) module, "00928" is the service number, "SF" likely denotes a specific screen or function area. |
| `DBean` | Acronym | Data Bean — a view-layer bean that holds UI-related data (display values, enabled flags, states) as opposed to business logic or DAO entities. |
