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

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.FUW00156SF.FUW00156SF01DBean` |
| Layer | Service / Common Component (Web-tier data binding utility) |
| Module | `FUW00156SF` (Package: `eo.web.webview.FUW00156SF`) |

## 1. Role

### FUW00156SF01DBean.storeModelData()

This method serves as a **data dispatcher** that routes incoming model values to the correct typed setter on the bean, based on a composite key (field name + subkey). It implements the **dispatch/routing pattern** to centralize data binding logic for the `enquete_no` (account number — アンケード番号) field, which is a survey/questionnaire-related item in the web view layer. The method accepts a polymorphic `Object` value and casts it to the appropriate type (`String` or `Boolean`) depending on which subkey is specified, effectively acting as a **generic setter factory** for a specific domain field. Within the larger system, this method allows screen-level code to push data into the DBean without needing to know the exact setter signature, decoupling the view layer from the bean's internal structure. Currently, it only handles the "アンケード番号" (Account Number / Survey Number) field, with three subkey branches: `value` (the data value), `enable` (editability flag), and `state` (display/state metadata).

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["storeModelData key subkey in_value isSetAsString"])

    START --> CHECK_NULL["Check key and subkey not null"]

    CHECK_NULL -->|No| RETURN["Return early"]
    CHECK_NULL -->|Yes| FIND_SEP["Extract separator position from key"]

    FIND_SEP --> CHECK_KEY["Check key matches account number"]

    CHECK_KEY -->|No| END_NODE(["End"])
    CHECK_KEY -->|Yes| CHECK_SUBVALUE["Check subkey is value"]

    CHECK_SUBVALUE -->|Yes| SET_VALUE["Call setEnquete_no_value String cast in_value"]
    CHECK_SUBVALUE -->|No| CHECK_SUBENABLE["Check subkey is enable"]

    CHECK_SUBENABLE -->|Yes| SET_ENABLED["Call setEnquete_no_enabled Boolean cast in_value"]
    CHECK_SUBENABLE -->|No| CHECK_SUBSTATE["Check subkey is state"]

    CHECK_SUBSTATE -->|Yes| SET_STATE["Call setEnquete_no_state String cast in_value"]
    CHECK_SUBSTATE -->|No| END_NODE

    SET_VALUE --> END_NODE
    SET_ENABLED --> END_NODE
    SET_STATE --> END_NODE
```

**CRITICAL — Constant Resolution:**

The method hard-codes a Japanese string literal instead of using a constant:

| Constant Reference | Actual Value | Business Meaning |
|---------------------|-------------|------------------|
| `key.equals("アンケード番号")` | `"アンケード番号"` | Account Number / Survey Number — the field ID for enquete_no (item ID: enquete_no) |

The `subkey` comparisons use `equalsIgnoreCase`, making them case-insensitive:

| Comparison | Expected Value | Business Meaning |
|-----------|---------------|------------------|
| `subkey.equalsIgnoreCase("value")` | `"value"` | The data value of the account number field |
| `subkey.equalsIgnoreCase("enable")` | `"enable"` | Editability flag (Boolean) for the account number field |
| `subkey.equalsIgnoreCase("state")` | `"state"` | State/metadata string for the account number field |

**Processing Flow Summary:**

1. **Null Guard**: If either `key` or `subkey` is null, the method returns immediately without any action. This is a defensive guard to prevent NullPointerExceptions on downstream operations.
2. **Separator Extraction**: The method computes `separaterPoint = key.indexOf("/")`, locating any slash separator in the key. This value is computed but **not used** in the current implementation — it appears to be preparation for future composite-key support where field names might be prefixed with a category.
3. **Field Routing**: The method checks if `key` equals `"アンケード番号"` (Account Number). If not, the method exits silently. If it matches, three subkey branches dispatch to the appropriate typed setter.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `key` | `String` | The field name (項目名) being set. Currently only `"アンケード番号"` (Account Number / Survey Number — the internal identifier `enquete_no`) is handled. This key identifies which domain field the incoming data belongs to. |
| 2 | `subkey` | `String` | The sub-key (サブキー) that disambiguates the property within the field. Accepts case-insensitive values: `"value"` (the actual data value), `"enable"` (whether the field is editable), or `"state"` (display/state metadata). Acts as a secondary routing dimension. |
| 3 | `in_value` | `Object` | The raw data payload to be stored. Its runtime type depends on the subkey: `String` for `value` and `state`, `Boolean` for `enable`. The method performs an unchecked cast to the expected type. |
| 4 | `isSetAsString` | `boolean` | According to the Javadoc, this flag controls whether a String value should be set into a Long-typed item's Value property. However, in the current method body, this parameter is **declared but not used** — it has no effect on processing. It may serve as a reserved parameter for future type-conversion logic. |

**Instance fields accessed:**

| Field | Access | Business Description |
|-------|--------|---------------------|
| `enquete_no_value` | Set via `setEnquete_no_value` | The String data value for the account number/survey number field |
| `enquete_no_enabled` | Set via `setEnquete_no_enabled` | Boolean editability flag for the account number/survey number field |
| `enquete_no_state` | Set via `setEnquete_no_state` | String state/metadata value for the account number/survey number field |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| U | `FUW00156SF01DBean.setEnquete_no_value` | FUW00156SF01DBean | - (in-memory bean state) | Sets the String value property of the enquete_no (account number) field on this DBean |
| U | `FUW00156SF01DBean.setEnquete_no_enabled` | FUW00156SF01DBean | - (in-memory bean state) | Sets the Boolean enabled/editable flag of the enquete_no field on this DBean |
| U | `FUW00156SF01DBean.setEnquete_no_state` | FUW00156SF01DBean | - (in-memory bean state) | Sets the String state metadata of the enquete_no field on this DBean |

**Classification Rationale:**
- All three called methods are **Update (U)** operations: they set internal bean properties (field assignments), not database mutations.
- No SC (Service Component) or CBS (Business Service) layer calls are invoked — this is a pure in-memory data-binding method.
- No Entity or DB table operations occur at this level.

## 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 | Caller within `FUW00156SF01DBean` | `FUW00156SF01DBean.storeModelData` | `setEnquete_no_value [U] -`, `setEnquete_no_enabled [U] -`, `setEnquete_no_state [U] -` |

**Notes:**
- Both direct callers are within the same class `FUW00156SF01DBean`. No external screen (KKSV*) or batch entry points trace to this method.
- The method is a leaf-level data binding utility — all its terminal operations are in-memory bean state updates with no SC/CBS/Entity propagation.
- This method acts as an internal helper, likely invoked during view model population or data refresh cycles within the same DBean's lifecycle.

## 6. Per-Branch Detail Blocks

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

> Null guard: if either the field name or subkey is missing, abort processing immediately. This prevents null pointer exceptions when the caller passes incomplete routing data.

| # | Type | Code |
|---|------|------|
| 1 | SET | `return;` // Exit method — no processing performed [-> early return on null input] |

---

**Block 2** — [SET] `(separator position extraction)` (L174)

> Computes the index of the "/" separator in the key. This prepares for potential composite-key routing (e.g., `"category/accountNumber"`), though the value is unused in the current implementation — it appears to be a placeholder for future extensibility.

| # | Type | Code |
|---|------|------|
| 1 | SET | `separaterPoint = key.indexOf("/")` // Find separator position in key [-> int; unused in current flow] |

---

**Block 3** — [IF] `(key.equals("アンケード番号"))` (L178)

> Field routing: checks if the incoming key matches the account number / survey number field (`enquete_no`). The string `"アンケード番号"` is the business field name; its internal item ID is `enquete_no`. If the key does not match, the method silently exits without setting anything.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `key.equals("アンケード番号")` // Compare key with account number field name ["アンケード番号" = Account Number/Survey Number] |
| 2 | CALL | `setEnquete_no_value((String)in_value);` [-> Block 3.1, only if subkey matches "value"] |
| 3 | CALL | `setEnquete_no_enabled((Boolean)in_value);` [-> Block 3.2, only if subkey matches "enable"] |
| 4 | CALL | `setEnquete_no_state((String)in_value);` [-> Block 3.3, only if subkey matches "state"] |

**Block 3.1** — [IF] `[subkey.equalsIgnoreCase("value")]` (L179)

> When the subkey is "value", cast the incoming Object to String and set it as the actual data value of the account number field. This is the primary data storage path — the field's business value.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `setEnquete_no_value((String)in_value);` // Cast in_value to String and store as the account number data value ["value" = the data value of enquete_no] |

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

> When the subkey is "enable", cast the incoming Object to Boolean and set it as the editability flag of the account number field. This controls whether the field is user-editable in the view.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `setEnquete_no_enabled((Boolean)in_value);` // Cast in_value to Boolean and store as the account number enabled flag [-> subkey "enable" = editability control for enquete_no] |

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

> When the subkey is "state", cast the incoming Object to String and set it as the state metadata of the account number field. This carries display/status information about the field.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `setEnquete_no_state((String)in_value);` // Cast in_value to String and store as the account number state metadata [-> subkey "state" = display/state information for enquete_no] |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `アンケード番号` | Field | Account Number / Survey Number — the Japanese field name for the `enquete_no` item; a survey/questionnaire identifier in the web view domain |
| `enquete_no` | Field | Survey number / Account number — internal item ID used in the bean for the アンケード番号 field; `enquete` is the Japanese romanization of アンケート (survey/questionnaire) |
| `key` | Parameter | Field name (項目名) — identifies which bean field the data belongs to |
| `subkey` | Parameter | Sub-key (サブキー) — secondary routing dimension that specifies which property within the field to set (value, enable, or state) |
| `in_value` | Parameter | Input data payload — the raw value to be stored, polymorphically typed as Object |
| `isSetAsString` | Parameter | String type set flag — reserved Boolean parameter for Long-typed item conversion (unused in current implementation) |
| `separaterPoint` | Variable | Separator position — computed index of "/" in the key (currently unused; preparation for composite-key support) |
| DBean | Acronym | Data Bean — the view-layer data carrier class that holds form data and state between screen request/response cycles |
| `setEnquete_no_value` | Method | Sets the String data value for the account number/survey number field |
| `setEnquete_no_enabled` | Method | Sets the Boolean editability flag for the account number/survey number field |
| `setEnquete_no_state` | Method | Sets the String state/metadata for the account number/survey number field |
| `listKoumokuIds` | Method | Static helper that returns a list of all item names (項目名) supported by this bean — currently only アンケード番号 |
| koumoku | Japanese | 項目 (item/field) — refers to a named data field in the form/view model |
