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

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

## 1. Role

### FUW00943SF01DBean.loadModelData()

This method serves as the **data retrieval dispatcher** for the questionnaire number (アンケート番号) field within a web view data binding framework. It implements the `X33VDataTypeBeanInterface` contract, allowing this bean to act as a data-type item within composite data lists (e.g., `X33VDataTypeList`) that are iterated and rendered by the X33 web framework.

The method performs a **key-subkey lookup pattern**: the `key` parameter identifies a business data field (such as the questionnaire number), and the `subkey` parameter specifies which **attribute** of that field should be returned. For the questionnaire number field, it supports three subkey variants — `value` (the actual data value), `enable` (whether the field is editable/active), and `state` (the current UI state of the field, such as display mode).

Its **role in the larger system** is as a shared data access utility within the questionnaire data entry screen (`FUW00943SF`). It enables the X33 framework's generic list iteration mechanism to dynamically retrieve field attributes without requiring hard-coded getter calls throughout the screen logic. When the key does not match a known field name, the method safely returns `null`, allowing the caller to handle the absence of data.

## 2. Processing Pattern (Detailed Business Logic)

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

    START --> CHECK_NULL["Check: key or subkey is null"]

    CHECK_NULL -- "Yes" --> RETURN_NULL_1["Return null"]

    CHECK_NULL -- "No" --> FIND_SLASH["Find '/' in key"]

    FIND_SLASH --> CHECK_KEY["Check: key equals 'アンケート番号' (Questionnaire Number)"]

    CHECK_KEY -- "Yes" --> CHECK_SUBKEY["Check: subkey case-insensitive"]

    CHECK_SUBKEY -- "value" --> RETURN_VALUE["Return getEnquete_no_value"]

    CHECK_SUBKEY -- "enable" --> RETURN_ENABLED["Return getEnquete_no_enabled"]

    CHECK_SUBKEY -- "state" --> RETURN_STATE["Return getEnquete_no_state"]

    CHECK_KEY -- "No" --> RETURN_NULL_2["Return null"]

    RETURN_VALUE --> END_NODE(["Return / Next"])
    RETURN_ENABLED --> END_NODE
    RETURN_STATE --> END_NODE
    RETURN_NULL_1 --> END_NODE
    RETURN_NULL_2 --> END_NODE
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `key` | `String` | Field identifier that specifies which business data field to retrieve. For this method, the recognized value is `"アンケート番号"` (Questionnaire Number), which identifies the questionnaire number field in the service contract data entry screen. The key can also contain a `/` separator (parsed via `indexOf`) though this method currently does not use it further — it may be part of a broader X33 framework convention for nested or hierarchical field names. |
| 2 | `subkey` | `String` | Attribute selector that determines which aspect of the identified field to return. Acceptable values (case-insensitive): `"value"` returns the actual questionnaire number string, `"enable"` returns whether the field is enabled for editing, and `"state"` returns the field's UI state string (e.g., display mode). |

**Instance Fields Read:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `enquete_no_value` | `String` | The actual questionnaire number value (initialized to `""` empty string) |
| `enquete_no_enabled` | `Boolean` | Whether the questionnaire number field is enabled for user input (initialized to `false`) |
| `enquete_no_state` | `String` | The current UI state of the questionnaire number field (e.g., display/edit mode, initialized to `""` empty string) |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `FUW00943SF01DBean.getEnquete_no_value` | FUW00943SF01DBean | - | Returns the `enquete_no_value` instance field (Questionnaire number data value) |
| R | `FUW00943SF01DBean.getEnquete_no_enabled` | FUW00943SF01DBean | - | Returns the `enquete_no_enabled` instance field (Whether questionnaire number field is editable) |
| R | `FUW00943SF01DBean.getEnquete_no_state` | FUW00943SF01DBean | - | Returns the `enquete_no_state` instance field (UI state of questionnaire number field) |

All three called methods are simple getter calls within the same bean class. They perform **Read** operations on internal instance fields — no database access, no CBS/SC invocation, no entity mapping. The data originates from values set earlier in the screen's request lifecycle (e.g., by incoming HTTP parameters, CBS responses, or default initialization).

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | `FUW00943SFBean` (Screen Data Bean) | `FUW00943SFBean.getJsflist_typelist_key_enquete_no()` iterates `key_enquete_no_list` and calls `loadModelData("データ取得用アンケート番号", "value")` on each item | `getEnquete_no_value [R] (instance field)` |
| 2 | `FUW00943SFBean` (Screen Data Bean) | `FUW00943SFBean.getJsflist_typelist_key_enquete_no()` iterates `key_enquete_no_list` and calls `loadModelData("データ取得用アンケート番号", "value")` on each item | `getEnquete_no_value [R] (instance field)` |

**Caller Details:**
- **Caller: `FUW00943SFBean`** (line 171) — The screen data bean iterates over a list of data-type beans (`key_enquete_no_list`) and calls `loadModelData` with key `"データ取得用アンケート番号"` (Data Retrieval Questionnaire Number) and subkey `"value"`. Note: this key does NOT match the literal `"アンケート番号"` that `loadModelData` checks against, so in practice this call will return `null`. This may indicate a configuration issue, a key remapping elsewhere, or that the list items are instances of a different DBean class that overrides `loadModelData`.

## 6. Per-Branch Detail Blocks

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

> Null guard: if either the field identifier or the subkey is null, return null immediately. This prevents null pointer exceptions during data binding lookups and aligns with the X33 framework's convention of returning null for unrecognized or missing data.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `key.equals("")` — null check on key parameter |
| 2 | EXEC | `subkey.equals("")` — null check on subkey parameter |
| 3 | RETURN | `return null;` // 項目名とサブキーからデータを取得します — returns null when either parameter is null |

**Block 2** — [IF] `key.equals("アンケート番号")` (L117)

> Main dispatch: checks if the key matches the questionnaire number field name (`"アンケート番号"`). The constant `ENQUETE_NO_01` (defined in `FUW00943SFConst`) resolves to this exact value. If the key matches, the method dispatches to one of three subkey-based branches.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `key.indexOf("/")` — searches for '/' separator in key [not used further in this method] |
| 2 | SET | `separaterPoint = key.indexOf("/")` // Line 112: finds position of slash separator (stored in local variable, not consumed) |

**Block 2.1** — [IF-ELSE] `subkey.equalsIgnoreCase("value")` (L118)

> Data value retrieval: when subkey is `"value"` (case-insensitive), returns the actual questionnaire number string stored in `enquete_no_value`.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `getEnquete_no_value()` — returns `enquete_no_value` instance field [R: instance field] |
| 2 | RETURN | `return getEnquete_no_value();` // returns the questionnaire number data |

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

> Field enablement check: when subkey is `"enable"` (case-insensitive), returns the enabled status of the questionnaire number field. The comment `//subkeyが"enable"の場合、enquete_no_enableのgetterの戻り値を返す。` translates to: "When subkey is 'enable', returns the return value of the getEnquete_no_enabled getter."

| # | Type | Code |
|---|------|------|
| 1 | CALL | `getEnquete_no_enabled()` — returns `enquete_no_enabled` instance field [R: instance field] |
| 2 | RETURN | `return getEnquete_no_enabled();` // returns whether the questionnaire number field is editable |

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

> UI state retrieval: when subkey is `"state"` (case-insensitive), returns the UI state string of the questionnaire number field. The comment `//subkeyが"state"の場合、ステータスを返す。` translates to: "When subkey is 'state', returns the status."

| # | Type | Code |
|---|------|------|
| 1 | CALL | `getEnquete_no_state()` — returns `enquete_no_state` instance field [R: instance field] |
| 2 | RETURN | `return getEnquete_no_state();` // returns the UI state of the questionnaire number field |

**Block 3** — [ELSE-FALLTHROUGH] no matching key found (L129)

> Fallback return: when the key does not match `"アンケート番号"` or the subkey is unrecognized, the method returns null. The comment `// 条件に合致するプロパティが存在しない場合は、nullを返す。` translates to: "If no property matches the condition, return null."

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return null;` // returns null when no matching property exists |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `enquete_no` | Field | Questionnaire Number — an internal identifier for the survey/questionnaire entry in the service contract data entry system. Used to track and reference specific questionnaire responses. |
| `enquete_no_value` | Field | The actual questionnaire number data value stored in the bean |
| `enquete_no_enabled` | Field | Boolean flag indicating whether the questionnaire number field is enabled (editable) or disabled (read-only) in the UI |
| `enquete_no_state` | Field | UI state string representing the display mode of the questionnaire number field (e.g., "display", "input", "disabled") |
| `enquete_no_update` | Field | Update flag or timestamp for the questionnaire number field, used to track modifications |
| `アンケート番号` | Field (Japanese) | Questionnaire Number — the field name used as the key in `loadModelData` to identify the questionnaire number data item |
| `データ取得用アンケート番号` | Field (Japanese) | Data Retrieval Questionnaire Number — a variant key name used by the parent bean when iterating list items |
| `X33VDataTypeBeanInterface` | Interface | X33 Framework interface that defines the contract for data-type beans in the view layer, including the `loadModelData` method signature |
| `X33VListedBeanInterface` | Interface | X33 Framework interface indicating the bean can be used in listed/repeated data structures (e.g., data tables, repeating form sections) |
| `X33VDataTypeList` | Class | X33 Framework list container holding data-type beans for iterative rendering in JSP/view pages |
| X33 | Acronym | Fujitsu's web application framework (Futurity X33) used for building enterprise web applications in this system |
| DBean | Abbreviation | Data Bean — a view-layer bean that holds data for display, implements data-type interfaces, and participates in the X33 framework's data binding mechanism |
| SF | Abbreviation | Screen Function — module designation in the `FUWxxxxSF` naming convention indicating a web screen module |
| CC | Abbreviation | Common Component — shared utility or business logic components in the system architecture |
| CBS | Abbreviation | Common Business Service — backend service component for business logic execution |
| SC | Abbreviation | Service Component — service-layer component, typically identified by pattern `[A-Z]{3}\d{4}[A-Z]\d{3}SC` |
