# Business Logic — KKW00801SF02DBean.storeModelData() [37 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.KKW00801SF.KKW00801SF02DBean` |
| Layer | Utility / Data Bean (Webview data transfer object) |
| Module | `KKW00801SF` (Package: `eo.web.webview.KKW00801SF`) |

## 1. Role

### KKW00801SF02DBean.storeModelData()

This method is a **unified setter dispatcher** for a webview data bean that models down option (planned down / プダウン) configuration in a telecom order fulfillment system. It accepts a pair of string keys (`key` and `subkey`) that together identify a specific property and type, then routes the incoming `in_value` to the appropriate field setter on the bean. It implements a **routing/dispatch pattern** — the `key` parameter selects one of two down option categories ("プダウンオプション値" = Down Option Value, "プダウンオプション名" = Down Option Name), and the `subkey` parameter selects one of three property facets within that category (`value`, `enable`, or `state`).

Its **role in the larger system** is as a shared utility within the `KKW00801SF` screen module. Data deserialized from request parameters, JSON payloads, or model mapping frameworks is funneled through this method rather than invoking individual setters directly. This centralizes the mapping logic and ensures consistent handling of boolean-enabled and state-tracked fields for down option items. The `isSetAsString` parameter exists but is unused in this method body — it is part of the method's public contract for future use when handling Long-type item value properties as String values (Long型項目ValueプロパティへString型値の設定を行う場合true).

The method has two conditional branches on the `key` parameter, each containing three sub-branches on the `subkey` parameter, yielding six total setter paths. A null guard at the top provides an early return if either key is null.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["storeModelData params"])
    CHECK_NULL(["key or subkey is null?"])
    NULL_RETURN(["Return early"])
    FIND_SEP(["Find separator index in key"])
    CHECK_KEY_1["key equals プダウンオプション値?"]
    CHECK_SUB_VALUE["subkey equals value?"]
    SET_PD_VALUE["setPd_id_value"]
    CHECK_SUB_ENABLE["subkey equals enable?"]
    SET_PD_ENABLED["setPd_id_enabled"]
    CHECK_SUB_STATE["subkey equals state?"]
    SET_PD_STATE["setPd_id_state"]
    CHECK_KEY_2["key equals プダウンオプション名?"]
    CHECK_SUB2_VALUE["subkey equals value?"]
    SET_PON_VALUE["setPd_op_nm_value"]
    CHECK_SUB2_ENABLE["subkey equals enable?"]
    SET_PON_ENABLED["setPd_op_nm_enabled"]
    CHECK_SUB2_STATE["subkey equals state?"]
    SET_PON_STATE["setPd_op_nm_state"]
    METHOD_END(["Return / Next"])

    START --> CHECK_NULL
    CHECK_NULL -->|true| NULL_RETURN
    CHECK_NULL -->|false| FIND_SEP
    FIND_SEP --> CHECK_KEY_1
    CHECK_KEY_1 -->|true| CHECK_SUB_VALUE
    CHECK_KEY_1 -->|false| CHECK_KEY_2
    CHECK_SUB_VALUE -->|true| SET_PD_VALUE
    CHECK_SUB_VALUE -->|false| CHECK_SUB_ENABLE
    CHECK_SUB_ENABLE -->|true| SET_PD_ENABLED
    CHECK_SUB_ENABLE -->|false| CHECK_SUB_STATE
    CHECK_SUB_STATE -->|true| SET_PD_STATE
    CHECK_SUB_STATE -->|false| METHOD_END
    CHECK_KEY_2 -->|true| CHECK_SUB2_VALUE
    CHECK_KEY_2 -->|false| METHOD_END
    CHECK_SUB2_VALUE -->|true| SET_PON_VALUE
    CHECK_SUB2_VALUE -->|false| CHECK_SUB2_ENABLE
    CHECK_SUB2_ENABLE -->|true| SET_PON_ENABLED
    CHECK_SUB2_ENABLE -->|false| CHECK_SUB2_STATE
    CHECK_SUB2_STATE -->|true| SET_PON_STATE
    CHECK_SUB2_STATE -->|false| METHOD_END
    SET_PD_VALUE --> METHOD_END
    SET_PD_ENABLED --> METHOD_END
    SET_PD_STATE --> METHOD_END
    SET_PON_VALUE --> METHOD_END
    SET_PON_ENABLED --> METHOD_END
    SET_PON_STATE --> METHOD_END
    NULL_RETURN --> METHOD_END
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `key` | `String` | The item name (項目名) that identifies which down option category to update. Valid values are `"プダウンオプション値"` (Down Option Value) and `"プダウンオプション名"` (Down Option Name). These correspond to two groups of bean fields: the `pd_id` group (value, enabled, state) and the `pd_op_nm` group (value, enabled, state). |
| 2 | `subkey` | `String` | The property sub-key (サブキー) that selects the specific facet within the chosen category. Valid values (case-insensitive) are `"value"` (the data value), `"enable"` (whether the field is enabled), and `"state"` (the state/tracking status). |
| 3 | `in_value` | `Object` | The data (データ) to be assigned to the target field. The actual type depends on the subkey: `String` for `value` and `state` setters, `Boolean` for the `enable` setter. |
| 4 | `isSetAsString` | `boolean` | When `true`, indicates that a String value should be set into a Long-type item Value property. This parameter exists in the method signature but is **not used** in the current implementation. Reserved for future use when handling Long-type property values as String inputs. |

**Instance fields / external state read:** None — this method is a pure writer that delegates to setters on `this` bean instance.

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| U | `KKW00801SF02DBean.setPd_id_value` | KKW00801SF02DBean | - | Sets the down option value field (pd_id_value) with a String data value |
| U | `KKW00801SF02DBean.setPd_id_enabled` | KKW00801SF02DBean | - | Sets the down option enabled flag (pd_id_enabled) with a Boolean |
| U | `KKW00801SF02DBean.setPd_id_state` | KKW00801SF02DBean | - | Sets the down option state field (pd_id_state) with a String status value |
| U | `KKW00801SF02DBean.setPd_op_nm_value` | KKW00801SF02DBean | - | Sets the down option name value field (pd_op_nm_value) with a String data value |
| U | `KKW00801SF02DBean.setPd_op_nm_enabled` | KKW00801SF02DBean | - | Sets the down option name enabled flag (pd_op_nm_enabled) with a Boolean |
| U | `KKW00801SF02DBean.setPd_op_nm_state` | KKW00801SF02DBean | - | Sets the down option name state field (pd_op_nm_state) with a String status value |

All operations are **U (Update)** — this method only sets bean properties and performs no database reads, creates, or deletes. It is a pure data-mapping utility with no external service or CBS calls.

## 5. Dependency Trace

No screen/batch entry points found within 8 hops. Direct callers found: 2 methods (both internal `storeModelData()` overloads within `KKW00801SF02DBean` itself, likely convenience wrappers).

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Internal overload | `KKW00801SF02DBean.storeModelData()` -> `KKW00801SF02DBean.storeModelData` | `setPd_op_nm_state [U] -`, `setPd_op_nm_enabled [U] -`, `setPd_op_nm_value [U] -`, `setPd_id_state [U] -`, `setPd_id_enabled [U] -`, `setPd_id_value [U] -` |
| 2 | Internal overload | `KKW00801SF02DBean.storeModelData()` -> `KKW00801SF02DBean.storeModelData` | `setPd_op_nm_state [U] -`, `setPd_op_nm_enabled [U] -`, `setPd_op_nm_value [U] -`, `setPd_id_state [U] -`, `setPd_id_enabled [U] -`, `setPd_id_value [U] -` |

Terminal operations from this method: `setPd_op_nm_state` [-], `setPd_op_nm_enabled` [-], `setPd_op_nm_value` [-], `setPd_id_state` [-], `setPd_id_enabled` [-], `setPd_id_value` [-]

## 6. Per-Branch Detail Blocks

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

> Null guard: If either the item name (key) or sub-key (subkey) is null, processing is terminated (key, subkey がnullの場合、処理を中止). This prevents NullPointerException and silently skips the operation.

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

**Block 2** — [SIMPLE STATEMENT] `(separator computation)` (L220)

> Computes the index of the "/" separator character within the key string. The result is stored but **not used** for any subsequent conditional logic — the value is effectively dead code.

| # | Type | Code |
|---|------|------|
| 1 | SET | `int separaterPoint = key.indexOf("/")` // Finds position of "/" separator in key (unused result) |

**Block 3** — [IF-ELSE-IF] `(key routing for down option categories)` (L224)

> Dispatches processing by item type (アイテムごとに処理を入れる). First checks if the key matches the "Down Option Value" category (データタイプがStringのアイテム"プダウンオプション値"(項目ID:pd_id).

**Block 3.1** — [IF] `(key.equals("プダウンオプション値"))` (L224) `[KEY="プダウンオプション値" (Down Option Value)]`

> Routes to the `pd_id` field group setters. This group represents the down option value properties (項目ID: pd_id).

| # | Type | Code |
|---|------|------|
| 1 | SET | `separaterPoint = key.indexOf("/")` |
| 2 | IF | `key.equals("プダウンオプション値")` |

**Block 3.1.1** — [IF] `(subkey.equalsIgnoreCase("value"))` (L225) `[SUBKEY="value"]`

> Sets the data value (データ) for the down option value field. The incoming object is cast to String.

| # | Type | Code |
|---|------|------|
| 1 | SET | `setPd_id_value((String)in_value)` // Calls setter for pd_id_value field |

**Block 3.1.2** — [ELSE-IF] `(subkey.equalsIgnoreCase("enable"))` (L228) `[SUBKEY="enable"]`

> When the subkey is "enable", executes the setter for pd_id_enabled (subkey が"enable"の場合、pd_id_enabled setterを実行する). The incoming object is cast to Boolean.

| # | Type | Code |
|---|------|------|
| 1 | SET | `setPd_id_enabled((Boolean)in_value)` // Calls setter for pd_id_enabled field (subkey が"enable"の場合、pd_id_enabled setterを実行する) |

**Block 3.1.3** — [ELSE-IF] `(subkey.equalsIgnoreCase("state"))` (L231) `[SUBKEY="state"]`

> When the subkey is "state", sets the state value (subkey が"state"の場合、ステータスを返す). The incoming object is cast to String.

| # | Type | Code |
|---|------|------|
| 1 | SET | `setPd_id_state((String)in_value)` // Calls setter for pd_id_state field (subkey が"state"の場合、ステータスを返す) |

**Block 3.2** — [ELSE-IF] `(key.equals("プダウンオプション名"))` (L236) `[KEY="プダウンオプション名" (Down Option Name)]`

> Routes to the `pd_op_nm` field group setters. This group represents the down option name properties (データタイプがStringのアイテム"プダウンオプション名"(項目ID:pd_op_nm).

| # | Type | Code |
|---|------|------|
| 1 | IF | `key.equals("プダウンオプション名")` |

**Block 3.2.1** — [IF] `(subkey.equalsIgnoreCase("value"))` (L237) `[SUBKEY="value"]`

> Sets the data value for the down option name field. The incoming object is cast to String.

| # | Type | Code |
|---|------|------|
| 1 | SET | `setPd_op_nm_value((String)in_value)` // Calls setter for pd_op_nm_value field |

**Block 3.2.2** — [ELSE-IF] `(subkey.equalsIgnoreCase("enable"))` (L240) `[SUBKEY="enable"]`

> When the subkey is "enable", executes the setter for pd_op_nm_enabled (subkey が"enable"の場合、pd_op_nm_enabled setterを実行する). The incoming object is cast to Boolean.

| # | Type | Code |
|---|------|------|
| 1 | SET | `setPd_op_nm_enabled((Boolean)in_value)` // Calls setter for pd_op_nm_enabled field (subkey が"enable"の場合、pd_op_nm_enabled setterを実行する) |

**Block 3.2.3** — [ELSE-IF] `(subkey.equalsIgnoreCase("state"))` (L243) `[SUBKEY="state"]`

> When the subkey is "state", sets the state value (subkey が"state"の場合、ステータスを返す). The incoming object is cast to String.

| # | Type | Code |
|---|------|------|
| 1 | SET | `setPd_op_nm_state((String)in_value)` // Calls setter for pd_op_nm_state field (subkey が"state"の場合、ステータスを返す) |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `key` | Parameter | Item name (項目名) — identifies the down option category to set. Values: `"プダウンオプション値"` (Down Option Value) or `"プダウンオプション名"` (Down Option Name). |
| `subkey` | Parameter | Sub-key (サブキー) — identifies the property facet within a category. Values: `"value"`, `"enable"`, `"state"`. |
| `in_value` | Parameter | Data (データ) — the value to assign. Type depends on subkey: String for value/state, Boolean for enable. |
| `isSetAsString` | Parameter | Flag to indicate String-to-Long type conversion is needed. Unused in current implementation. |
| `pd_id` | Field | Down Option Value item ID (項目ID: pd_id) — internal identifier for the down option value properties group. |
| `pd_id_value` | Field | Down option value data — the actual value of the down option. |
| `pd_id_enabled` | Field | Down option value enabled flag — whether the down option value field is active/enabled. |
| `pd_id_state` | Field | Down option value state — status/tracking information for the down option value field. |
| `pd_op_nm` | Field | Down Option Name item ID (項目ID: pd_op_nm) — internal identifier for the down option name properties group. |
| `pd_op_nm_value` | Field | Down option name data — the actual name/value of the down option. |
| `pd_op_nm_enabled` | Field | Down option name enabled flag — whether the down option name field is active/enabled. |
| `pd_op_nm_state` | Field | Down option name state — status/tracking information for the down option name field. |
| プダウンオプション値 | Business term | Down Option Value — the category of down option properties that hold the value data. |
| プダウンオプション名 | Business term | Down Option Name — the category of down option properties that hold the name data. |
| プダウン | Business term | Planned Down — a telecom service term referring to a downgrade or reduction of an existing service plan/subscription. |
| KKW00801SF | Module | A webview screen module in the telecom order fulfillment system that handles down option configuration. |
| DBean | Technical term | Data Bean — a JavaBean used as a data transfer object between the web layer and business logic, holding model data for a specific screen. |
