# Business Logic — FUW00954SFBean.storeModelData() [44 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.FUW00954SF.FUW00954SFBean` |
| Layer | Bean / Presentation (Webview) |
| Module | `FUW00954SF` (Package: `eo.web.webview.FUW00954SF`) |

## 1. Role

### FUW00954SFBean.storeModelData()

This method is the central **model data dispatch entry point** for the `FUW00954SF` screen's view bean. Its purpose is to receive incoming data — identified by a composite `key` string and an optional `subkey` — and route it to the appropriate setter so the bean's internal model state is updated. It implements a **routing/dispatch pattern**: first checking for null guards, then dispatching to a superclass handler for common-info data (identified by a `//` prefix), and finally extracting the top-level item name (`keyElement`) to branch into field-specific setters. Currently, only one business field is routed — **kakunin_shurui (確認の種類 — Confirmation Type)** — which has three sub-keys: `value`, `enable`, and `state`. The method's role in the larger system is to serve as a **unified data-binding sink** that the view layer calls when populating or updating the bean from screen requests or server-side initialization.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["storeModelData key, subkey, in_value, isSetAsString"])
    
    START --> A{key == null?}
    
    A -- true --> A_RET(["return / Early exit"])
    A -- false --> B{subkey == null?}
    
    B -- true --> B_SET["subkey = empty string"]
    B_SET --> C
    B -- false --> C["separaterPoint = indexOf double-slash"]
    
    C --> D{separaterPoint == 0?}
    
    D -- true --> DISPATCH_COMMON["super.storeCommonInfoData(key, in_value, isSetAsString)"]
    DISPATCH_COMMON --> END_NODE(["End"])
    
    D -- false --> FIND_SLASH["separaterPoint = indexOf single slash"]
    FIND_SLASH --> E{separaterPoint > 0?}
    
    E -- true --> KEY_ELEMENT_SUB["keyElement = key.substring(0, separaterPoint)"]
    E -- false --> KEY_ELEMENT_FULL["keyElement = key"]
    
    KEY_ELEMENT_SUB --> CHECK_KAKUNIN
    KEY_ELEMENT_FULL --> CHECK_KAKUNIN
    
    CHECK_KAKUNIN{keyElement equals 確認の種類?}
    
    CHECK_KAKUNIN -- true --> SUBKEY_CHECK{subkey equals value?}
    SUBKEY_CHECK -- true --> SET_VALUE["setKakunin_shurui_value(in_value)"]
    SUBKEY_CHECK -- false --> SUBKEY_ENABLE{subkey equals enable?}
    SUBKEY_ENABLE -- true --> SET_ENABLED["setKakunin_shurui_enabled(in_value)"]
    SUBKEY_ENABLE -- false --> SUBKEY_STATE{subkey equals state?}
    SUBKEY_STATE -- true --> SET_STATE["setKakunin_shurui_state(in_value)"]
    SUBKEY_STATE -- false --> END_NODE
    SET_VALUE --> END_NODE
    SET_ENABLED --> END_NODE
    SET_STATE --> END_NODE
    
    CHECK_KAKUNIN -- false --> END_NODE
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `key` | `String` | The composite field identifier that determines which bean property to update. It may take the form of a simple item name (e.g., `"確認の種類"`) or a nested path separated by slashes (e.g., `"確認の種類/0/value"`). If it starts with `"//"`, it is treated as a common-info-view reference and dispatched to the superclass. |
| 2 | `subkey` | `String` | The sub-property of the identified field. Common values are `"value"` (to set the data value), `"enable"` (to set the enabled/disabled flag), and `"state"` (to set the UI state, e.g., readonly, required). If null, it is coerced to an empty string. |
| 3 | `in_value` | `Object` | The data to store. Its actual type depends on the subkey: `String` for `value` and `state` subkeys, `Boolean` for the `enable` subkey. |
| 4 | `isSetAsString` | `boolean` | Flag indicating whether a String-type value should be set to a Long-type item's Value property. When true, the value is coerced to a string before storage. |

**Instance fields read:** None directly — this method delegates all writes to its own setters (`setKakunin_shurui_value`, `setKakunin_shurui_enabled`, `setKakunin_shurui_state`).

**Inherited method called:** `super.storeCommonInfoData(String key, Object in_value, boolean isSetAsString)` — handled by a parent class.

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `super.storeCommonInfoData` | (parent class) | - | Delegates to parent handler for common-info-view keys (key starting with `//`) |
| - | `FUW00954SFBean.setKakunin_shurui_value` | - | - | Sets the confirmation type value field on this bean |
| - | `FUW00954SFBean.setKakunin_shurui_enabled` | - | - | Sets the confirmation type enabled/disabled flag on this bean |
| - | `FUW00954SFBean.setKakunin_shurui_state` | - | - | Sets the confirmation type UI state field on this bean |
| - | `String.substring` | - | - | Extracts the top-level key element from a slash-separated path |
| - | `String.indexOf` | - | - | Locates delimiter positions (`//` or `/`) within the key string |
| - | `String.equalsIgnoreCase` | - | - | Case-insensitive subkey matching for value/enable/state dispatch |

This method is primarily a **presentation-layer data-binding utility**. It does not perform direct CRUD against database tables. All operations are setter calls on the bean itself, which will later be read/written by downstream business logic.

## 5. Dependency Trace

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

Direct callers of `storeModelData`: 2 methods.

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | `FUW00954SFBean.storeModelData()` (self-referential / internal dispatcher) | Caller -> `FUW00954SFBean.storeModelData` | `setKakunin_shurui_state`, `setKakunin_shurui_enabled`, `setKakunin_shurui_value` |
| 2 | `FUW00954SFBean` (internal dispatch) | Internal dispatcher -> `FUW00954SFBean.storeModelData` | `setKakunin_shurui_state`, `setKakunin_shurui_enabled`, `setKakunin_shurui_value` |

**Terminal operations from this method:** `setKakunin_shurui_state`, `setKakunin_shurui_enabled`, `setKakunin_shurui_value` (all bean field setters — no DB/SC reach from this method).

## 6. Per-Branch Detail Blocks

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

> Null guard for the key parameter. If key is null, the method aborts immediately (Japanese comment: 項目名がnullの場合、処理を中止 — "If the item name is null, abort processing").

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return;` // 項目名がnullの場合、処理を中止 |

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

> If subkey is null, coerce it to an empty string (Japanese comment: subkeyがnullの場合、空文字列に — "If subkey is null, set to empty string").

| # | Type | Code |
|---|------|------|
| 1 | SET | `subkey = new String("");` // subkeyがnullの場合、空文字列に |

**Block 3** — [ELSE → IF] `(separaterPoint == 0)` — Common info view dispatch (L211)

> Checks if key starts with `"//"` (Japanese comment: keyが共通情報ビューに関する指定か否かをチェック — "Check whether key is a specification related to the common info view"). If so, delegates to the parent class `storeCommonInfoData` method.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `int separaterPoint = key.indexOf("//");` // keyが共通情報ビューに関する指定か否かをチェック |
| 2 | IF | `if(separaterPoint == 0)` // 共通情報の場合 — "If it is common info" |
| 3 | CALL | `super.storeCommonInfoData(key, in_value, isSetAsString);` |

**Block 4** — [ELSE → Nested logic: key parsing] (L213–L222)

> When the key is NOT a common info view reference, parse the first-level item name by locating the first `/` delimiter. Japanese comment: keyがルート指定("項目a/0/項目b"のような)の場合を想定し、区切り符号(ここでは"/")を検索する — "Assuming key is a root specification (such as 'itema/0/itemb'), search for the delimiter (here '/')".

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `separaterPoint = key.indexOf("/");` // keyがルート指定の場合を想定し、区切り符号を検索する |
| 2 | IF | `if(separaterPoint > 0)` |
| 3 | SET | `keyElement = key.substring(0, separaterPoint);` // keyElement = first segment before "/" |
| 4 | ELSE | `else` |
| 5 | SET | `keyElement = key;` // No "/" found — use the full key as keyElement |

**Block 5** — [IF] `(keyElement.equals("確認の種類"))` — Confirmation type field routing (L224)

> The only business field currently handled. Japanese comment: 項目ごとに処理を入れる — "Insert processing for each item". The field `kakunin_shurui` (確認の種類) is the Confirmation Type field in this screen.

**Block 5.1** — [IF-ELSE-IF chain — subkey dispatch] (L225–L236)

> Three subkeys are recognized for the `kakunin_shurui` field:

| # | Type | Code |
|---|------|------|
| 1 | IF | `if(subkey.equalsIgnoreCase("value"))` |
| 2 | CALL | `setKakunin_shurui_value((String)in_value);` // 値を設定 — "Set the value" |
| 3 | ELSE-IF | `else if(subkey.equalsIgnoreCase("enable"))` // subkeyが"enable"の場合、項目ID_enableのsetterを実行する — "If subkey is 'enable', execute the itemId_enable setter" |
| 4 | CALL | `setKakunin_shurui_enabled((Boolean)in_value);` |
| 5 | ELSE-IF | `else if(subkey.equalsIgnoreCase("state"))` // subkeyが"state"の場合、in_valueをcastして項目ID_stateのsetterを実行する — "If subkey is 'state', cast in_value and execute the itemId_state setter" |
| 6 | CALL | `setKakunin_shurui_state((String)in_value);` |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `kakunin_shurui` | Field | Confirmation Type — a screen field that identifies the type of confirmation/verification action in the service workflow |
| 確認の種類 | Field (Japanese) | Confirmation Type — the Japanese-labeled item name used as the key identifier in the model data dispatch |
| `key` | Parameter | Item name (項目名) — composite field identifier used to route data to the correct bean property |
| `subkey` | Parameter | Sub-key (サブキー) — sub-property selector (e.g., value, enable, state) within a field |
| `in_value` | Parameter | Data (データ) — the payload to be stored in the target bean field |
| `isSetAsString` | Parameter | String-type setting flag — when true, a String value is set to a Long-type item's Value property |
| Common info view | Concept | A shared view section referenced by keys starting with `"//"`; handled by the parent class's `storeCommonInfoData` method |
| Key element (keyElement) | Concept | The top-level segment of a slash-delimited key path — e.g., in `"確認の種類/0/value"`, the keyElement is `"確認の種類"` |
| storeModelData | Method | Model data store — the bean's unified data-binding sink for incoming screen data |
