# Business Logic — FUW00954SFBean.loadModelData() [52 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.FUW00954SF.FUW00954SFBean` |
| Layer | Service / Web Controller Bean (Webview Bean in `eo.web.webview` package) |
| Module | `FUW00954SF` (Package: `eo.web.webview.FUW00954SF`) |

## 1. Role

### FUW00954SFBean.loadModelData()

This method serves as a unified data retrieval dispatcher for the **service area customer master screen** (`FUW00954SF`). It resolves a `key` / `subkey` identifier into a value using multiple routing strategies, implementing the **dispatch/routing pattern** to handle diverse data access needs through a single entry point.

The method supports three distinct business data retrieval modes:

1. **Common info data routing**: When the key starts with `//`, the method delegates to `super.loadCommonInfoData(key)` to retrieve shared information view data (e.g., common lookup lists, reference data shared across fields).

2. **Hierarchical key resolution**: When the key contains `/` separators (e.g., `itemA/0/itemB`), it extracts the root element and routes lookup based on the top-level key name, supporting nested repeating item access.

3. **Confirmation type (`確認の種類`) special handling**: This is the primary business-focused branch. It provides access to the "Confirmation Type" field's value, enabled state, and UI state by dispatching on the `subkey` — returning the actual data value, the enabled/disabled flag for the confirmation type dropdown, or the current UI state (e.g., display, edit, disabled).

This method acts as the **central data access facade** for the screen's UI bean, abstracting away the complexity of key-based routing and allowing screen controllers to request data uniformly regardless of the underlying data source (local bean state, common info lists, or field metadata).

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["loadModelData key, subkey"])
    COND_KEY_NULL["key is null?"]
    RETURN_NULL(["Return null"])
    COND_SUBKEY_NULL["subkey is null?"]
    SUBKEY_INIT["subkey = empty string"]
    CHECK_COMMON_INFO["Check // separator"]
    IS_COMMON_INFO["Is Common Info?"]
    CALL_SUPER["loadCommonInfoData key"]
    RETURN_SUPER(["Return super result"])
    FIND_SLASH["Has / separator?"]
    EXTRACT_KEY_ELEMENT["keyElement = substring"]
    SET_KEY_ELEMENT["keyElement = key"]
    CHECK_KAKUNIN["keyElement == 確認の種類?"]
    SUBKEY_VALUE_SUB["subkey equals value?"]
    GET_VALUE["getKakunin_shurui_value"]
    RETURN_VALUE(["Return value"])
    SUBKEY_ENABLE_SUB["subkey equals enable?"]
    GET_ENABLED["getKakunin_shurui_enabled"]
    RETURN_ENABLED(["Return enabled"])
    SUBKEY_STATE_SUB["subkey equals state?"]
    GET_STATE["getKakunin_shurui_state"]
    RETURN_STATE(["Return state"])
    RETURN_NULL2(["Return null"])

    START --> COND_KEY_NULL
    COND_KEY_NULL -->|true| RETURN_NULL
    COND_KEY_NULL -->|false| COND_SUBKEY_NULL
    COND_SUBKEY_NULL -->|true| SUBKEY_INIT
    COND_SUBKEY_NULL -->|false| CHECK_COMMON_INFO
    SUBKEY_INIT --> CHECK_COMMON_INFO
    CHECK_COMMON_INFO --> IS_COMMON_INFO
    IS_COMMON_INFO -->|true| CALL_SUPER
    CALL_SUPER --> RETURN_SUPER
    IS_COMMON_INFO -->|false| FIND_SLASH
    FIND_SLASH -->|true| EXTRACT_KEY_ELEMENT
    EXTRACT_KEY_ELEMENT --> SET_KEY_ELEMENT
    FIND_SLASH -->|false| SET_KEY_ELEMENT
    SET_KEY_ELEMENT --> CHECK_KAKUNIN
    CHECK_KAKUNIN -->|true| SUBKEY_VALUE_SUB
    CHECK_KAKUNIN -->|false| RETURN_NULL2
    SUBKEY_VALUE_SUB -->|true| GET_VALUE
    GET_VALUE --> RETURN_VALUE
    SUBKEY_VALUE_SUB -->|false| SUBKEY_ENABLE_SUB
    SUBKEY_ENABLE_SUB -->|true| GET_ENABLED
    GET_ENABLED --> RETURN_ENABLED
    SUBKEY_ENABLE_SUB -->|false| SUBKEY_STATE_SUB
    SUBKEY_STATE_SUB -->|true| GET_STATE
    GET_STATE --> RETURN_STATE
    SUBKEY_STATE_SUB -->|false| RETURN_NULL2
```

**Processing flow:**

1. **Null key guard (L124–125)**: If `key` is null, immediately return null.

2. **Null subkey normalization (L129–130)**: If `subkey` is null, replace with an empty string to avoid NPE in subsequent comparisons.

3. **Common info data delegation (L134–135)**: Check if `key` starts with `//` (the common info indicator). If so, delegate to `super.loadCommonInfoData(key)` — this handles shared information view fields such as common lookup lists.

4. **Key element extraction (L141–147)**: For non-common-info keys, check for `/` separator. If present, extract the root key element (first segment before `/`). Otherwise, use the entire `key` as the element name. This supports hierarchical key formats like `itemA/0/itemB`.

5. **Confirmation type dispatch (L150–162)**: The core business logic. When `keyElement` matches `確認の種類` (Confirmation Type), branch on `subkey`:
   - `value` → return the actual confirmation type value (`getKakunin_shurui_value`)
   - `enable` → return whether the field is enabled for user input (`getKakunin_shurui_enabled`)
   - `state` → return the UI state of the field (`getKakunin_shurui_state`)

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `key` | `String` | The item name identifier used to look up screen field data. Can be a simple field name (e.g., `確認の種類` for Confirmation Type), a hierarchical path with `/` separators for nested repeating items (e.g., `itemA/0/itemB`), or a special `//` prefixed path for shared information view data. |
| 2 | `subkey` | `String` | A secondary identifier that refines the lookup. When `key` points to the Confirmation Type (`確認の種類`), `subkey` determines whether to retrieve the field's data value (`value`), its enabled/disabled flag (`enable`), or its UI display state (`state`). For other key types, it may refer to repeating item indices or additional routing hints. |

**Instance fields / external state read:**

| No | Field | Source |
|----|-------|--------|
| 1 | `super.loadCommonInfoData(key)` | Parent class (X31CBaseBean) — provides access to shared/common info view data |
| 2 | `getKakunin_shurui_value()` | Local bean — returns the Confirmation Type data value |
| 3 | `getKakunin_shurui_enabled()` | Local bean — returns the Confirmation Type field's enabled/disabled flag |
| 4 | `getKakunin_shurui_state()` | Local bean — returns the Confirmation Type field's current UI state |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `FUW00954SFBean.loadCommonInfoData` | FUW00954SFBean | - | Delegates common info data lookup to parent class for shared information view fields |
| R | `FUW00954SFBean.getKakunin_shurui_value` | FUW00954SFBean | - | Reads the Confirmation Type (確認の種類) field's current data value from screen bean state |
| R | `FUW00954SFBean.getKakunin_shurui_enabled` | FUW00954SFBean | - | Reads the Confirmation Type field's enabled/disabled UI flag |
| R | `FUW00954SFBean.getKakunin_shurui_state` | FUW00954SFBean | - | Reads the Confirmation Type field's current UI state (display, edit, disabled) |
| - | `JKKAdEditCC.substring` | JKKAdEditCC | - | Calls `substring` in `JKKAdEditCC` |
| - | `JKKAdEdit.substring` | JKKAdEdit | - | Calls `substring` in `JKKAdEdit` |
| - | `JKKTelnoInfoAddMapperCC.substring` | JKKTelnoInfoAddMapperCC | - | Calls `substring` in `JKKTelnoInfoAddMapperCC` |
| - | `JDKejbStringEdit.substring` | JDKejbStringEdit | - | Calls `substring` in `JDKejbStringEdit` |

**Analysis:** This method is a **pure read/dispatch** method — it does not perform any create, update, or delete operations. All called methods are getter operations (`getKakunin_shurui_*`) that read screen field state from the bean. The method also delegates to `super.loadCommonInfoData()` for shared information view data, which itself performs reads from common info data stores.

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | FUW00954SFBean | `FUW00954SFBean.loadModelData` | `getKakunin_shurui_state [R]`, `getKakunin_shurui_enabled [R]`, `getKakunin_shurui_value [R]`, `loadCommonInfoData [-]` |

**Trace analysis:** This method is called by the `FUW00954SF` screen bean itself, likely from screen lifecycle methods (e.g., `initialize()`, `doAction()`, or event handlers) that need to resolve field data on demand. No external screen/batch entry points were found within 8 hops.

**Terminal operations reachable from this method:**
- `getKakunin_shurui_state [R]` — Reads Confirmation Type UI state
- `getKakunin_shurui_enabled [R]` — Reads Confirmation Type enabled flag
- `getKakunin_shurui_value [R]` — Reads Confirmation Type data value
- `loadCommonInfoData [-]` — Delegates to parent for common info view data (substring utilities)

## 6. Per-Branch Detail Blocks

**Block 1** — [IF] `key == null` (L124)

> Null key guard: returns null immediately if the key is null. This prevents NPE downstream.

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

**Block 2** — [ELSE-IF] `subkey == null` (L129)

> Null subkey normalization: if subkey is null, replace with an empty string to prevent NPE in subsequent string comparisons.

| # | Type | Code |
|---|------|------|
| 1 | SET | `subkey = new String("");` // Empty string initialization |

**Block 3** — [IF] `key.indexOf("//") == 0` — Common Info Data Check (L134)

> Checks if the key starts with `//` which indicates a shared information view field. If so, delegates to the parent class's `loadCommonInfoData` method.
> Common Info Data Processing — 共有情報ビュー処理

| # | Type | Code |
|---|------|------|
| 1 | SET | `keyElement` (declared) |
| 2 | SET | `separaterPoint = key.indexOf("//")` // Check if key is a common info view reference [-> "// separator check"] |
| 3 | RETURN | `return super.loadCommonInfoData(key);` // Delegate to parent for common info view data |

**Block 4** — [ELSE-IF / Implicit] `key.indexOf("/") > 0` — Hierarchical Key Resolution (L141–145)

> For non-common-info keys, check for `/` separator to support hierarchical key paths like `itemA/0/itemB`. Extracts the first segment as the key element.
> Root element acquisition — keyの値の最初の要素を取得

| # | Type | Code |
|---|------|------|
| 1 | SET | `separaterPoint = key.indexOf("/")` // Search for `/` separator [-> "/" separator search] |
| 2 | IF | `separaterPoint > 0` |

**Block 4.1** — [IF-BRANCH] `separaterPoint > 0` (L143)

> Key has a `/` separator — extract the substring before it as the root key element.

| # | Type | Code |
|---|------|------|
| 1 | SET | `keyElement = key.substring(0, separaterPoint)` // Extract root element from hierarchical key |

**Block 4.2** — [ELSE-BRANCH] `separaterPoint <= 0` (L145)

> No `/` separator — use the full key as the key element.

| # | Type | Code |
|---|------|------|
| 1 | SET | `keyElement = key` // Use entire key as element name |

**Block 5** — [IF] `keyElement.equals("確認の種類")` — Confirmation Type Dispatch (L150)

> The core business logic. Branches on the Confirmation Type (確認の種類) field's subkey to determine what aspect of the field to return.

| # | Type | Code |
|---|------|------|
| 1 | IF | `keyElement.equals("確認の種類")` [-> `keyElement == 確認の種類 (Confirmation Type)`] |

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

> Returns the actual data value of the Confirmation Type field.
> subkey is "value" — get the field's data value

| # | Type | Code |
|---|------|------|
| 1 | CALL | `getKakunin_shurui_value()` // Returns Confirmation Type data value |
| 2 | RETURN | `return getKakunin_shurui_value();` |

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

> Returns whether the Confirmation Type field is enabled for user input.
> subkey is "enable" — returns the getter value of `itemID_enable`

| # | Type | Code |
|---|------|------|
| 1 | CALL | `getKakunin_shurui_enabled()` // Returns Confirmation Type enabled flag |
| 2 | RETURN | `return getKakunin_shurui_enabled();` |

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

> Returns the UI state of the Confirmation Type field (e.g., display mode, edit mode, disabled).
> subkey is "state" — returns the state

| # | Type | Code |
|---|------|------|
| 1 | CALL | `getKakunin_shurui_state()` // Returns Confirmation Type UI state |
| 2 | RETURN | `return getKakunin_shurui_state();` |

**Block 6** — [DEFAULT FALL-THROUGH] (L162)

> Fallback: if none of the above conditions match, return null. This handles unrecognized key/subkey combinations gracefully.

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

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `確認の種類` | Field | Confirmation Type — the field name used to identify the Confirmation Type screen element; acts as the key for dispatching to value/enabled/state getters |
| `key` | Parameter | Item name — the business identifier for a screen field or data element |
| `subkey` | Parameter | Sub-key — a secondary identifier that refines the lookup, specifying which aspect of a field to return (value, enable, state) |
| `loadCommonInfoData` | Method | Common Info Data Loading — retrieves shared information view data (common lookup lists, reference data) from the parent bean |
| `getKakunin_shurui_value` | Method | Confirmation Type Value Getter — returns the current data value stored in the Confirmation Type field |
| `getKakunin_shurui_enabled` | Method | Confirmation Type Enabled Getter — returns whether the Confirmation Type field is enabled for user interaction |
| `getKakunin_shurui_state` | Method | Confirmation Type State Getter — returns the current UI state of the Confirmation Type field (e.g., display, edit, disabled) |
| `FUW00954SF` | Module | Service Area Customer Master Screen — the web screen module for managing service area customer master data |
| Common Info View | Concept | Shared information view — a screen pattern where multiple fields share common reference data (e.g., dropdown lookups) stored in a central list |
| `X31CBaseBean` | Class | Base bean class — the parent class that provides `loadCommonInfoData` for shared info view support |
| `X33VDataTypeList` | Class | Data type list — internal structure that holds the order of lists for each view in common info data |
| Hierarchical Key | Concept | A key format using `/` separators (e.g., `itemA/0/itemB`) to access nested or repeating item fields |
| Value | Subkey | The data value of a screen field |
| Enable | Subkey | The enabled/disabled flag for a screen field |
| State | Subkey | The UI display state of a screen field |

---
