# Business Logic — FUW07101SF03DBean.storeModelData() [21 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.FUW07101SF.FUW07101SF03DBean` |
| Layer | Service (Data Bean / D-Bean — Web layer data transfer object) |
| Module | `FUW07101SF` (Package: `eo.web.webview.FUW07101SF`) |

## 1. Role

### FUW07101SF03DBean.storeModelData()

This method is a **unified data routing and storage mechanism** within the `FUW07101SF03DBean` data bean class. It serves as the central entry point for populating the bean's internal state machine from external data sources (typically HTTP request parameters or screen input data) in a type-safe manner.

The method implements a **key-based dispatch pattern** (also known as a property router). The `key` parameter acts as a property selector — currently only one property is supported: `"送信先メールアドレス"` (Send-To Email Address). The `subkey` parameter then further disambiguates which specific property of that key's value object to set: `"value"` populates the email string value, while `"state"` sets an associated state string.

The method also supports a boolean flag `isSetAsString` which, if set to `true`, controls whether a Long-typed item's value property receives a String-type value. This enables type coercion for fields where the data transfer type differs from the display type.

In the larger system, this method is a **shared utility** used across multiple screens in the `FUW07101SF` service flow. Its role is to bridge the gap between loosely-typed web input (always `Object`) and the strongly-typed bean fields (`mlad_value`, `mlad_state`), ensuring type-safe assignment while centralizing null-safety checks.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["storeModelData(key, subkey, in_value, isSetAsString)"])
    NULL_CHECK{"key == null or subkey == null?"}
    SEPARATOR["Compute separator position in key"]
    KEY_CHECK{"key equals '送信先メールアドレス'?"}
    SUBVAL{"subkey.equalsIgnoreCase('value')?"}
    SET_VAL["setMlad_value((String)in_value)"]
    SUBST{"subkey.equalsIgnoreCase('state')?"}
    SET_ST["setMlad_state((String)in_value)"]
    RETURN(["return"])
    END_NODE(["End - no operation"])
    START --> NULL_CHECK
    NULL_CHECK -->|true| RETURN
    NULL_CHECK -->|false| SEPARATOR
    SEPARATOR --> KEY_CHECK
    KEY_CHECK -->|true| SUBVAL
    KEY_CHECK -->|false| END_NODE
    SUBVAL -->|true| SET_VAL
    SUBVAL -->|false| SUBST
    SET_VAL --> SUBST
    SUBST -->|true| SET_ST
    SUBST -->|false| END_NODE
    SET_ST --> END_NODE
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `key` | `String` | Property name identifier — selects which data item to populate. Currently only `"送信先メールアドレス"` (Send-To Email Address / Mlad item ID `mlad`) is supported. Controls the routing decision in the first conditional branch. |
| 2 | `subkey` | `String` | Sub-property selector — disambiguates which attribute of the selected item to set. Valid values are `"value"` (sets the actual email string) and `"state"` (sets the associated state string). Comparison is case-insensitive (`equalsIgnoreCase`). |
| 3 | `in_value` | `Object` | The data to be stored — a loosely-typed object (typically a `String` representing an email address or state value). Cast to `String` before assignment to `mlad_value` or `mlad_state`. |
| 4 | `isSetAsString` | `boolean` | Type coercion flag — when `true`, indicates that a Long-typed item's Value property should receive a String-type value. Not actively used in the current implementation body but present in the method signature for potential future type coercion logic. |

**Instance fields read:** None — this method does not read any instance fields; it only writes via setter methods.

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| U | `setMlad_value` | FUW07101SF03DBean | - | Calls `setMlad_value` in `FUW07101SF03DBean` |
| U | `setMlad_state` | FUW07101SF03DBean | - | Calls `setMlad_state` in `FUW07101SF03DBean` |

**Classification rationale:**
- **U** (Update): Both `setMlad_value` and `setMlad_state` are setter methods that update the bean's internal state. They do not perform any database I/O — this is an in-memory operation within the D-Bean.

## 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: `setMlad_state` [-], `setMlad_value` [-]

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | FUW07101SF03DBean | `FUW07101SF03DBean.storeModelData` | `setMlad_state` [U] N/A (in-memory), `setMlad_value` [U] N/A (in-memory) |
| 2 | FUW07101SF03DBean | `FUW07101SF03DBean.storeModelData` | `setMlad_state` [U] N/A (in-memory), `setMlad_value` [U] N/A (in-memory) |

Note: The 2 direct callers are both within `FUW07101SF03DBean` itself (self-referential calls, likely for internal data consolidation). This method does not appear to be called from screen entry points or CBS layers within the 8-hop search range.

## 6. Per-Branch Detail Blocks

**Block 1** — IF `(null safety check)` (L158)

> Guard clause: if either the key or subkey parameter is `null`, processing is aborted early. This prevents NullPointerExceptions on subsequent string operations.

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

**Block 1.1** — IF `(key match)` `(key.equals("送信先メールアドレス"))` (L164)

> This is the main routing branch. The key `"送信先メールアドレス"` (Send-To Email Address) corresponds to the Mlad data item ID `mlad`. When matched, processing continues into sub-key disambiguation.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `if(subkey.equalsIgnoreCase("value"))` // Check if subkey is "value" (L165) |

**Block 1.1.1** — IF `(subkey == "value")` (L165)

> Sets the actual email address string value into the bean's `mlad_value` field. The incoming Object is cast to `String`.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `setMlad_value((String)in_value);` // Sets the email address value (L166) |

**Block 1.1.2** — ELSE-IF `(subkey == "state")` `(subkey.equalsIgnoreCase("state"))` (L168)

> Sets the associated state string. As per the Japanese comment: `subkeyが"state"の場合、ステータスを返す。` (When subkey is "state", returns/sets the status.)

| # | Type | Code |
|---|------|------|
| 1 | CALL | `setMlad_state((String)in_value);` // Sets the email status field (L170) |

**Block 1.2** — ELSE `(key != "送信先メールアドレス")` (implicit, L164)

> When the key does not match any known property name, no operation is performed. The method simply exits without error.

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `mlad` | Field | Mlad — internal data item ID for the "Send-To Email Address" property, derived from the Japanese property name `"送信先メールアドレス"` |
| `送信先メールアドレス` | Field | Send-To Email Address — the Japanese property name for the recipient email address field; serves as the routing key in this method |
| `mlad_value` | Field | The actual email address string value stored in the Mlad item |
| `mlad_state` | Field | The status/state string associated with the Mlad email item — used to track processing state of the email entry |
| D-Bean | Acronym | Data Bean — a JavaBean used in the web layer to transfer and store screen-related data between layers (also known as DBean) |
| `isSetAsString` | Field | Type coercion flag — when true, indicates that a Long-typed item's Value property should receive a String-type value |
| Key | Term | Property name identifier — acts as the primary routing key in the dispatch mechanism |
| Subkey | Term | Sub-property selector — further disambiguates which attribute of a keyed property to set |
