# Business Logic — FUW00156SF01DBean.storeModelData() [24 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.FUW00156SF.FUW00156SF01DBean` |
| Layer | Service Component / Data Bean (webview layer — DTO-like model data container) |
| Module | `FUW00156SF` (Package: `eo.web.webview.FUW00156SF`) |

## 1. Role

### FUW00156SF01DBean.storeModelData()

This method serves as a **unified data-dispatching hub** within the `FUW00156SF` survey questionnaire module. It routes incoming key-value pairs into the bean's typed setter methods based on a structured key/subkey convention, implementing a **routing/dispatch pattern** that consolidates multiple data assignments into a single method. The method is responsible for populating the bean's model data fields — specifically the **survey questionnaire number** (`enquete_no`) and its associated metadata (value, enabled state, display state). Its role in the larger system is that of a **shared utility** within the data bean: it allows external callers (likely screen controllers or data-binding layers) to set any of the bean's tracked attributes through a single, generic method, avoiding the need to know each setter individually. The method handles three subkey variants — `value` (the numeric value), `enable` (whether the field is editable), and `state` (the display/validation state) — for the single tracked item `アンケート番号` (Survey Questionnaire Number).

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["storeModelData(key, subkey, in_value, isSetAsString)"])
    CHECK_NULL["key == null or subkey == null?"]
    EARLY_RETURN(["Return (null guard)"])
    COMPUTE["int separaterPoint = key.indexOf('/')"]
    CHECK_KEY["key equals 'アンケート番号' (Survey Questionnaire Number)?"]
    NO_MATCH_RETURN(["Return (no matching key)"])
    CHECK_VALUE["subkey equalsIgnoreCase 'value'?"]
    SET_VALUE["setEnquete_no_value((String) in_value)"]
    CHECK_ENABLE["subkey equalsIgnoreCase 'enable'?"]
    SET_ENABLE["setEnquete_no_enabled((Boolean) in_value)"]
    CHECK_STATE["subkey equalsIgnoreCase 'state'?"]
    SET_STATE["setEnquete_no_state((String) in_value)"]
    END_NODE(["Return / Next"])

    START --> CHECK_NULL
    CHECK_NULL -->|true| EARLY_RETURN
    CHECK_NULL -->|false| COMPUTE
    COMPUTE --> CHECK_KEY
    CHECK_KEY -->|false| END_NODE
    CHECK_KEY -->|true| CHECK_VALUE
    CHECK_VALUE -->|true| SET_VALUE
    CHECK_VALUE -->|false| CHECK_ENABLE
    CHECK_ENABLE -->|true| SET_ENABLE
    CHECK_ENABLE -->|false| CHECK_STATE
    CHECK_STATE -->|true| SET_STATE
    CHECK_STATE -->|false| END_NODE
    SET_VALUE --> END_NODE
    SET_ENABLE --> END_NODE
    SET_STATE --> END_NODE
```

**Processing description:**
1. **Null guard**: If `key` or `subkey` is null, the method exits immediately — no processing occurs.
2. **Separator computation**: The method computes the position of the `/` character within `key` (stored but currently unused in logic).
3. **Key-based dispatch**: The method checks if `key` matches the hardcoded string `アンケート番号` (Survey Questionnaire Number / Item ID: `enquete_no`). If not, it exits without action.
4. **Subkey-based routing** (only reached when key matches):
   - **`value`**: Casts `in_value` to `String` and calls `setEnquete_no_value()` — sets the questionnaire number value.
   - **`enable`**: Casts `in_value` to `Boolean` and calls `setEnquete_no_enabled()` — toggles whether the field is enabled/editable.
   - **`state`**: Casts `in_value` to `String` and calls `setEnquete_no_state()` — sets the display/state attribute.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `key` | `String` | The item name to identify which field to populate. Currently only supports `アンケート番号` (Survey Questionnaire Number — the internal tracking ID for the survey questionnaire number field). If this contains a `/` separator, the position is computed but not yet used for hierarchical routing. |
| 2 | `subkey` | `String` | The sub-attribute of the item to set. Accepts: `value` (the actual questionnaire number value), `enable` (whether the field is editable), or `state` (display/validation state). Case-insensitive comparison. |
| 3 | `in_value` | `Object` | The data to be stored. Its type depends on the `subkey`: `String` for `value` and `state`, `Boolean` for `enable`. |
| 4 | `isSetAsString` | `boolean` | Flag indicating whether to set a String-type value to the Long-type item's Value property. Currently **unused** in the method body — the parameter is accepted but never referenced in any logic. |

**Instance fields read:** None — this method only writes to the bean's fields via setters.

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `FUW00156SF01DBean.setEnquete_no_value` | FUW00156SF01DBean | - | Calls `setEnquete_no_value` in `FUW00156SF01DBean` — sets the questionnaire number value |
| - | `FUW00156SF01DBean.setEnquete_no_enabled` | FUW00156SF01DBean | - | Calls `setEnquete_no_enabled` in `FUW00156SF01DBean` — sets editability flag |
| - | `FUW00156SF01DBean.setEnquete_no_state` | FUW00156SF01DBean | - | Calls `setEnquete_no_state` in `FUW00156SF01DBean` — sets display state |

All three called methods are **setter operations** (local U — Update) within the same data bean. No external SC/CBS, database, or entity interactions occur. This method performs pure in-memory model data assignment with no persistence operations.

## 5. Dependency Trace

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

No screen/batch entry points found within 8 hops. Direct callers found: 2 methods.
Terminal operations from this method: `setEnquete_no_state` [-], `setEnquete_no_enabled` [-], `setEnquete_no_value` [-]

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | `FUW00156SF01DBean.storeModelData` (self-call) | `FUW00156SF01DBean.storeModelData` | `setEnquete_no_state [U] -`, `setEnquete_no_enabled [U] -`, `setEnquete_no_value [U] -` |
| 2 | `FUW00156SF01DBean.storeModelData` (self-call) | `FUW00156SF01DBean.storeModelData` | `setEnquete_no_state [U] -`, `setEnquete_no_enabled [U] -`, `setEnquete_no_value [U] -` |

The pre-computed analysis found 2 direct callers, both within `FUW00156SF01DBean` itself. The method is a self-contained data-dispatch utility — it does not participate in any screen/batch entry point call chain and has no screen-level traceability.

## 6. Per-Branch Detail Blocks

**Block 1** — IF `(key == null || subkey == null)` (L173)

> Null guard: if either key or subkey is null, abort processing.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return;` // key,subkeyがnullの場合、処理を中止 — Abort processing when key or subkey is null |

**Block 2** — EXEC (L177)

> Computes the position of the "/" separator character in the key string. The variable is declared and assigned but not currently used in conditional logic.

| # | Type | Code |
|---|------|------|
| 1 | SET | `int separaterPoint = key.indexOf("/");` // Compute separator position |

**Block 3** — IF `(key.equals("アンケート番号"))` (L181)

> Route based on item name. The constant `アンケート番号` resolves to "Survey Questionnaire Number" (Item ID: `enquete_no`). Only items matching this exact string proceed to subkey dispatch.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `key.equals("アンケート番号")` // Compare against "アンケート番号" (Survey Questionnaire Number) — [-> FUW00156SFConst.KEY_ENQUETE_NO is defined but not used; literal is hardcoded] |

**Block 3.1** — IF-ELSE-IF chain — subkey dispatch (L182–L190)

> When key matches, dispatch to the appropriate setter based on the subkey value. All subkey comparisons are case-insensitive.

**Block 3.1.1** — IF-ELSE-IF `(subkey.equalsIgnoreCase("value"))` (L182)

> Sets the questionnaire number value.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `setEnquete_no_value((String)in_value);` // valueサブキーで値を設定 — Set value for "value" subkey |

**Block 3.1.2** — ELSE-IF `(subkey.equalsIgnoreCase("enable"))` (L185)

> Sets the enabled (editability) flag for the questionnaire number field.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `setEnquete_no_enabled((Boolean)in_value);` // subkeyが"enable"の場合、enquete_no_enabledのsetterを実行する — Execute setter for enquete_no_enabled when subkey is "enable" |

**Block 3.1.3** — ELSE-IF `(subkey.equalsIgnoreCase("state"))` (L188)

> Sets the state (display/validation state) for the questionnaire number field.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `setEnquete_no_state((String)in_value);` // subkeyが"state"の場合、ステータスを返す — Return/set status when subkey is "state" |

**Block 3.2** — ELSE (implicit, when key does not match `アンケート番号`)

> When the key does not match any tracked item name, the method exits without performing any action. The `separaterPoint` variable remains unused — indicating a planned but unimplemented hierarchical key routing feature.

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `enquete_no` | Field | Survey questionnaire number — an internal tracking ID assigned to survey/questionnaire records within the telecom service provisioning system |
| `アンケート番号` | Field (Japanese) | Survey Questionnaire Number — the display name for the item key in Japanese; maps to the `enquete_no` field ID |
| `setEnquete_no_value` | Method | Sets the string value of the questionnaire number field |
| `setEnquete_no_enabled` | Method | Sets the boolean flag indicating whether the questionnaire number field is enabled/editable |
| `setEnquete_no_state` | Method | Sets the display/state string attribute of the questionnaire number field (e.g., required, hidden, readonly) |
| `isSetAsString` | Parameter | Boolean flag for Long-type item Value property to String-type value conversion — currently accepted but unused in method body |
| `FUW00156SF` | Module | Survey questionnaire data module — handles survey/questionnaire number data in the webview layer |
| `KEY_ENQUETE_NO` | Constant | Data acquisition questionnaire number key — defined in `FUW00156SFConst` as `"データ取得用アンケート番号"` (Survey data acquisition key) |
| `separaterPoint` | Variable | Position index of "/" character in key — reserved for future hierarchical key routing (e.g., `item/subitem` nesting), not yet used |
