# Business Logic — FUW00156SF01DBean.loadModelData() [26 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.FUW00156SF.FUW00156SF01DBean` |
| Layer | Webview Data Bean (View Layer — part of the X33 web framework's data-binding subsystem) |
| Module | `FUW00156SF` (Package: `eo.web.webview.FUW00156SF`) |

## 1. Role

### FUW00156SF01DBean.loadModelData()

This method implements the X33 framework's `X33VDataTypeBeanInterface.loadModelData()` contract, serving as a **data dispatch router** for the survey number (enquete_no) data type. In the K-Opticom web application, this bean represents a single-row "data-type bean" used by the X33 listed-bean framework to manage dynamic form fields. The method receives a key (item name) and subkey (data accessor) and routes to the appropriate getter — returning the survey number's value, its enabled/active state, or its visual state string. It implements the **routing/dispatch pattern**: the incoming key string `"アンケート番号"` (Survey Number) identifies which domain entity to service, and the subkey determines which facet (value, enabled, state) of that entity to return. The method plays the role of a **shared data-provider** within the X33 framework — it is not called directly by business logic but is invoked by the framework's listed-bean infrastructure during view rendering, enabling reactive data-binding for survey-number-related form components. The method has one conditional branch: if key matches `"アンケート番号"`, it further branches on subkey into three accessor paths (value/enable/state); otherwise it returns null (the key is unrecognized).

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["loadModelData(String key, String subkey)"])
    COND_NULL(["key == null || subkey == null"])
    RETURN_NULL(["Return null"])
    CALC_INDEX["int separaterPoint = key.indexOf('/')"]
    COND_KEY["key.equals('アンケート番号')"]
    COND_VALUE["subkey.equalsIgnoreCase('value')"]
    RETURN_VALUE["Return getEnquete_no_value()"]
    COND_ENABLE["subkey.equalsIgnoreCase('enable')"]
    RETURN_ENABLE["Return getEnquete_no_enabled()"]
    COND_STATE["subkey.equalsIgnoreCase('state')"]
    RETURN_STATE["Return getEnquete_no_state()"]
    RETURN_DEFAULT(["Return null — fallback"])

    START --> COND_NULL
    COND_NULL -->|true| RETURN_NULL
    COND_NULL -->|false| CALC_INDEX
    RETURN_NULL --> RETURN_DEFAULT
    CALC_INDEX --> COND_KEY
    COND_KEY -->|true| COND_VALUE
    COND_KEY -->|false| RETURN_DEFAULT
    COND_VALUE -->|true| RETURN_VALUE
    COND_VALUE -->|false| COND_ENABLE
    RETURN_VALUE --> RETURN_DEFAULT
    COND_ENABLE -->|true| RETURN_ENABLE
    COND_ENABLE -->|false| COND_STATE
    RETURN_ENABLE --> RETURN_DEFAULT
    COND_STATE -->|true| RETURN_STATE
    COND_STATE -->|false| RETURN_DEFAULT
    RETURN_STATE --> RETURN_DEFAULT
```

**Note:** The variable `separaterPoint` (a typo in the source; should be "separator") is assigned but never used — it is dead code that computes the position of the first '/' character in the key. The method does not branch on it.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `key` | `String` | The **item name** (項目名) that identifies which data entity to retrieve. In this method's implementation, the only recognized value is `"アンケート番号"` (Survey Number / Questionnaire Number), which corresponds to the internal field `enquete_no`. This key determines which domain object's data will be serviced. |
| 2 | `subkey` | `String` | The **data accessor facet** — specifies which property of the identified entity to return. Recognized subkey values are `"value"` (the actual survey number string), `"enable"` (whether the survey number field is active/enabled in the UI), and `"state"` (the visual state string for UI rendering). The comparison is case-insensitive (`equalsIgnoreCase`). |

**Instance fields read by the method:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `enquete_no_value` | `String` | The survey number value — the actual questionnaire/survey identifier string (default: empty string `""`) |
| `enquete_no_enabled` | `Boolean` | Whether the survey number field is enabled in the UI (default: `false`) |
| `enquete_no_state` | `String` | The visual state of the survey number field — a state string used for UI rendering (default: empty string `""`) |

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `FUW00156SF01DBean.getEnquete_no_value` | FUW00156SF01DBean | - | Returns the `enquete_no_value` instance field (the survey number string) |
| R | `FUW00156SF01DBean.getEnquete_no_enabled` | FUW00156SF01DBean | - | Returns the `enquete_no_enabled` instance field (whether the survey number is enabled) |
| R | `FUW00156SF01DBean.getEnquete_no_state` | FUW00156SF01DBean | - | Returns the `enquete_no_state` instance field (the visual state string) |

**Classification rationale:** All three called methods are pure **Read** operations — they are simple getter methods on the same bean that return the values of instance fields. No database queries, service component calls, CBS invocations, or entity manipulations occur. This method is a pure **data-dispatching utility** that reads from local bean state and returns it to the X33 framework for view binding.

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Screen: FUW00156SFBean | `FUW00156SFBean.addListDataInstance("データ取得用アンケート番号")` → creates `FUW00156SF01DBean` instance → `FUW00156SF01DBean.loadModelData(key, subkey)` | `getEnquete_no_value [R] enquete_no_value field`<br>`getEnquete_no_enabled [R] enquete_no_enabled field`<br>`getEnquete_no_state [R] enquete_no_state field` |

**Notes on caller analysis:**
- The primary caller is `FUW00156SFBean`, which uses the listed-bean framework to manage survey number form items. When `addListDataInstance()` is called with key `"データ取得用アンケート番号"` (Survey Number for Data Retrieval), it creates a new `FUW00156SF01DBean` instance and registers it in the `key_enquete_no_list`.
- The X33 framework's data-binding layer then invokes `loadModelData()` on this bean instance during view rendering to populate the survey number field with its value, enabled state, or state string.
- The `FUW00156SFLogic` class creates and manages the overall screen logic flow for `FUW00156SF` (line 648: "SIF→DataBean item receive routing (FUSV018001SC→FUW00156SF01DBean)"), but does not directly call `loadModelData`.
- Other modules (`FUW00912SF`, `FUW00926SF`, `FUW00959SF`, `FUW00964SF`) reference their own `loadModelData` methods but do not call `FUW00156SF01DBean.loadModelData`.

## 6. Per-Branch Detail Blocks

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

> Null guard: returns null immediately if either parameter is null, preventing NullPointerException.

| # | Type | Code |
|---|------|------|
| 1 | SET | `separaterPoint = key.indexOf("/")` // Stores position of first '/' in key — dead code, never used [-> never referenced] |
| 2 | COND | `key.equals("アンケート番号")` // Check if key matches the survey number item [-> key equals "アンケート番号" (Survey Number)] |

**Block 1.1** — [nested IF] `(subkey.equalsIgnoreCase("value"))` (L119)

> When subkey is "value", return the actual survey number string value.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `getEnquete_no_value()` // Returns the enquete_no_value field [enquete_no_value: the survey number string] |

**Block 1.2** — [nested ELSE-IF] `(subkey.equalsIgnoreCase("enable"))` (L121)

> When subkey is "enable" (case-insensitive), return whether the survey number field is enabled in the UI. // subkeyが"enable"の場合、enquete_no_enableのgetterの戻り値を返す (English: When subkey is "enable", returns the getter value of enquete_no_enable)

| # | Type | Code |
|---|------|------|
| 1 | CALL | `getEnquete_no_enabled()` // Returns the enquete_no_enabled field [enquete_no_enabled: Boolean — whether the survey number is enabled] |

**Block 1.3** — [nested ELSE-IF] `(subkey.equalsIgnoreCase("state"))` (L124)

> When subkey is "state" (case-insensitive), return the visual state string for UI rendering. // subkeyが"state"の場合、ステータスを返す (English: When subkey is "state", returns the status)

| # | Type | Code |
|---|------|------|
| 1 | CALL | `getEnquete_no_state()` // Returns the enquete_no_state field [enquete_no_state: the visual state string for the survey number] |

**Block 2** — [ELSE-FALLBACK] (L129)

> No matching key or subkey was found — return null. // 条件に合致するプロパティが存在しない場合は、nullを返す (English: If no matching property exists, return null)

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `null` // No matching property found; default return value |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `enquete_no` | Field | Survey Number / Questionnaire Number — an internal tracking identifier for survey/questionnaire items in the telecom service ordering system |
| `enquete_no_value` | Field | Survey number value — the actual string identifier of the survey number |
| `enquete_no_enabled` | Field | Survey number enabled flag — a Boolean indicating whether the survey number field is active/enabled in the UI |
| `enquete_no_state` | Field | Survey number state — a string representing the visual state of the survey number field (e.g., "enabled", "disabled", "readonly") |
| アンケート番号 | Field | Japanese field name — "Survey Number" or "Questionnaire Number"; the key used to identify survey number data in this method |
| データ取得用アンケート番号 | Field | Japanese field name — "Survey Number for Data Retrieval"; the list-item key used by FUW00156SFBean to create FUW00156SF01DBean instances |
| X33 | Acronym | Fujitsu's Web Client definition tool version 3.3 — the Java EE framework providing data-binding, view, and bean infrastructure |
| X33VDataTypeBeanInterface | Interface | X33 framework interface for data-type beans; defines `loadModelData()` for dynamic property access |
| X33VListedBeanInterface | Interface | X33 framework interface for listed (repeating) beans; enables dynamic list item creation via `addListDataInstance()` |
| X31CBaseBean | Class | Base bean class in the X31 component framework; provides common methods like `addListDataInstance` with `//` prefix handling |
| Data-type Bean | Pattern | A bean implementing X33VDataTypeBeanInterface that acts as a single-row data holder with property-based access via `loadModelData()` |
| Listed Bean | Pattern | A bean implementing X33VListedBeanInterface that manages dynamic lists of child items (including data-type beans) via `addListDataInstance()` |
| X33 framework | Technical | The X33 web framework's listed-bean infrastructure — automatically invokes `loadModelData()` during view rendering to populate form fields |
