# Business Logic — CRW03407SF02DBean.storeModelData() [50 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.CRW03407SF.CRW03407SF02DBean` |
| Layer | Component / Data Bean (inferred from package `eo.web.webview.CRW03407SF` — web-tier data binding bean) |
| Module | `CRW03407SF` (Package: `eo.web.webview.CRW03407SF`) |

## 1. Role

### CRW03407SF02DBean.storeModelData()

This method serves as a **unified data-binding dispatcher** for setting model properties on the `CRW03407SF02DBean` data bean. It implements a **route-and-dispatch** pattern: given a business-level field name (`key`) and a property descriptor (`subkey`), the method routes the incoming value to the appropriate typed setter method on the bean. Specifically, it supports three primary business field categories — **tab code** (タブコード, L1_TAB_CD), **tab name** (タブ名称, L1_TAB_NM), and **screen ID** (画面ID, L1_PG_ID) — each of which accepts three sub-properties: `value` (the data value), `enable` (a boolean flag indicating whether the field is editable), and `state` (a string representing the field's display or validation state). This design allows screen controllers to update multiple bean properties through a single polymorphic invocation, decoupling callers from direct setter method knowledge. The method plays a central role in the screen model population flow: it is called during data retrieval and display rendering so that UI state (visibility, enabled status) and data values are synchronized into the bean before the view layer renders the page.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["storeModelData(key, subkey, in_value, isSetAsString)"])
    CHECK_NULL{"key == null
|| subkey == null?"}
    EARLY_EXIT(["Return early (no-op)"])
    FIND_SLASH["separaterPoint = key.indexOf('/')"]
    CHECK_TAB_CD{"key.equals('タブコード')"}
    TAB_CD_VALUE{"subkey.equalsIgnoreCase('value')"}
    SET_TAB_CD_VALUE["setL1_tab_cd_value(String in_value)"]
    TAB_CD_ENABLE{"subkey.equalsIgnoreCase('enable')"}
    SET_TAB_CD_ENABLED["setL1_tab_cd_enabled(Boolean in_value)"]
    TAB_CD_STATE{"subkey.equalsIgnoreCase('state')"}
    SET_TAB_CD_STATE["setL1_tab_cd_state(String in_value)"]
    CHECK_TAB_NM{"key.equals('タブ名称')"}
    TAB_NM_VALUE{"subkey.equalsIgnoreCase('value')"}
    SET_TAB_NM_VALUE["setL1_tab_nm_value(String in_value)"]
    TAB_NM_ENABLE{"subkey.equalsIgnoreCase('enable')"}
    SET_TAB_NM_ENABLED["setL1_tab_nm_enabled(Boolean in_value)"]
    TAB_NM_STATE{"subkey.equalsIgnoreCase('state')"}
    SET_TAB_NM_STATE["setL1_tab_nm_state(String in_value)"]
    CHECK_PG_ID{"key.equals('画面ID')"}
    PG_ID_VALUE{"subkey.equalsIgnoreCase('value')"}
    SET_PG_ID_VALUE["setL1_pg_id_value(String in_value)"]
    PG_ID_ENABLE{"subkey.equalsIgnoreCase('enable')"}
    SET_PG_ID_ENABLED["setL1_pg_id_enabled(Boolean in_value)"]
    PG_ID_STATE{"subkey.equalsIgnoreCase('state')"}
    SET_PG_ID_STATE["setL1_pg_id_state(String in_value)"]
    END_NODE(["Method End / Return"])

    START --> CHECK_NULL
    CHECK_NULL -->|Yes| EARLY_EXIT
    EARLY_EXIT --> END_NODE
    CHECK_NULL -->|No| FIND_SLASH
    FIND_SLASH --> CHECK_TAB_CD
    CHECK_TAB_CD -->|Yes| TAB_CD_VALUE
    CHECK_TAB_CD -->|No| CHECK_TAB_NM
    TAB_CD_VALUE -->|Yes| SET_TAB_CD_VALUE
    TAB_CD_VALUE -->|No| TAB_CD_ENABLE
    TAB_CD_ENABLE -->|Yes| SET_TAB_CD_ENABLED
    TAB_CD_ENABLE -->|No| TAB_CD_STATE
    TAB_CD_STATE -->|Yes| SET_TAB_CD_STATE
    TAB_CD_STATE -->|No| END_NODE
    SET_TAB_CD_VALUE --> END_NODE
    SET_TAB_CD_ENABLED --> END_NODE
    SET_TAB_CD_STATE --> END_NODE
    CHECK_TAB_NM -->|Yes| TAB_NM_VALUE
    CHECK_TAB_NM -->|No| CHECK_PG_ID
    TAB_NM_VALUE -->|Yes| SET_TAB_NM_VALUE
    TAB_NM_VALUE -->|No| TAB_NM_ENABLE
    TAB_NM_ENABLE -->|Yes| SET_TAB_NM_ENABLED
    TAB_NM_ENABLE -->|No| TAB_NM_STATE
    TAB_NM_STATE -->|Yes| SET_TAB_NM_STATE
    TAB_NM_STATE -->|No| END_NODE
    SET_TAB_NM_VALUE --> END_NODE
    SET_TAB_NM_ENABLED --> END_NODE
    SET_TAB_NM_STATE --> END_NODE
    CHECK_PG_ID -->|Yes| PG_ID_VALUE
    CHECK_PG_ID -->|No| END_NODE
    PG_ID_VALUE -->|Yes| SET_PG_ID_VALUE
    PG_ID_VALUE -->|No| PG_ID_ENABLE
    PG_ID_ENABLE -->|Yes| SET_PG_ID_ENABLED
    PG_ID_ENABLE -->|No| PG_ID_STATE
    PG_ID_STATE -->|Yes| SET_PG_ID_STATE
    PG_ID_STATE -->|No| END_NODE
    SET_PG_ID_VALUE --> END_NODE
    SET_PG_ID_ENABLED --> END_NODE
    SET_PG_ID_STATE --> END_NODE
```

**Processing flow summary:**

1. **Null guard**: If `key` or `subkey` is `null`, the method returns immediately (no-op). Comment: `key,subkeyがnullの場合、処理を中止` → "If key/subkey is null, abort processing."
2. **Separator detection**: `key.indexOf("/")` is computed but the result is **never used** — the variable `separaterPoint` is assigned but never referenced in subsequent logic. This may be legacy code or a future feature placeholder.
3. **Key dispatch**: The method dispatches on the exact value of `key` across three Japanese string literals (no constant resolution needed — these are hardcoded):
   - `"タブコード"` (Tab Code → L1_TAB_CD)
   - `"タブ名称"` (Tab Name → L1_TAB_NM)
   - `"画面ID"` (Screen ID → L1_PG_ID)
4. **Subkey dispatch**: For each key branch, three subkey branches are checked case-insensitively:
   - `"value"` → calls the `_value` setter with a `(String)` cast
   - `"enable"` → calls the `_enabled` setter with a `(Boolean)` cast. Comment: `subkeyが"enable"の場合、l1_tab_cd_enabledのsetterを実行する` → "When subkey is 'enable', execute the l1_tab_cd_enabled setter."
   - `"state"` → calls the `_state` setter with a `(String)` cast. Comment: `subkeyが"state"の場合、ステータスを返す` → "When subkey is 'state', return/set the state."
5. **Fall-through**: If `key` does not match any of the three known values, or `subkey` does not match any of the three known subproperties, the method returns without performing any action (implicit no-op).

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `key` | `String` | The business field identifier that determines which bean property category to update. Accepts Japanese literal values: `"タブコード"` (tab code — the internal identifier for a tab panel), `"タブ名称"` (tab name — the display label for a tab panel), or `"画面ID"` (screen ID — the unique identifier for the current screen/page). The value is compared via exact `equals()`, so case-sensitive matching applies. |
| 2 | `subkey` | `String` | The property descriptor within a field category, specifying which aspect of the field to set. Accepts case-insensitive values: `"value"` (the data content), `"enable"` (the enabled/disabled flag for UI interactivity), or `"state"` (the state string, typically used for display/validation state). |
| 3 | `in_value` | `Object` | The data to be stored into the bean property. Cast to `String` for `value` and `state` subkeys, or cast to `Boolean` for the `enable` subkey. |
| 4 | `isSetAsString` | `boolean` | Documented as: `Long型項目ValueプロパティへString型値の設定を行う場合true` → "true when setting a String-type value to a Long-type item Value property." However, this parameter is **not used** in the current method body — it is dead code. |

**Instance fields / external state read:** None. The method only invokes setters (write operations) on `this` bean instance. It does not read any instance fields.

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| U | `setL1_tab_cd_value` | - | - | Sets the L1 tab code value property on the bean (U — Update local model data) |
| U | `setL1_tab_cd_enabled` | - | - | Sets the L1 tab code enabled/lock flag on the bean (U — Update local model data) |
| U | `setL1_tab_cd_state` | - | - | Sets the L1 tab code state string on the bean (U — Update local model data) |
| U | `setL1_tab_nm_value` | - | - | Sets the L1 tab name value property on the bean (U — Update local model data) |
| U | `setL1_tab_nm_enabled` | - | - | Sets the L1 tab name enabled/lock flag on the bean (U — Update local model data) |
| U | `setL1_tab_nm_state` | - | - | Sets the L1 tab name state string on the bean (U — Update local model data) |
| U | `setL1_pg_id_value` | - | - | Sets the L1 screen ID value property on the bean (U — Update local model data) |
| U | `setL1_pg_id_enabled` | - | - | Sets the L1 screen ID enabled/lock flag on the bean (U — Update local model data) |
| U | `setL1_pg_id_state` | - | - | Sets the L1 screen ID state string on the bean (U — Update local model data) |

**CRUD classification notes:**
- All operations are **U (Update)** because each called method is a setter that updates the internal state of the bean — no database, entity, or remote service calls are involved.
- There is **no direct SC (Service Component) or CBS (CBS business logic) interaction** in this method. It operates entirely within the web-tier data bean, acting as a pure in-memory property router.
- There are **no database tables, entities, or external services** read or written by this method.

## 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: `setL1_pg_id_state`, `setL1_pg_id_enabled`, `setL1_pg_id_value`, `setL1_tab_nm_state`, `setL1_tab_nm_enabled`, `setL1_tab_nm_value`, `setL1_tab_cd_state`, `setL1_tab_cd_enabled`, `setL1_tab_cd_value`

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | `CRW03407SF02DBean.storeModelData()` (same class overload) | `CRW03407SF02DBean.storeModelData()` (overloaded call) | `setL1_tab_cd_value [U]`, `setL1_tab_cd_enabled [U]`, `setL1_tab_cd_state [U]`, `setL1_tab_nm_value [U]`, `setL1_tab_nm_enabled [U]`, `setL1_tab_nm_state [U]`, `setL1_pg_id_value [U]`, `setL1_pg_id_enabled [U]`, `setL1_pg_id_state [U]` |
| 2 | `CRW03407SF02DBean.storeModelData()` (same class overload) | `CRW03407SF02DBean.storeModelData()` (overloaded call) | `setL1_tab_cd_value [U]`, `setL1_tab_cd_enabled [U]`, `setL1_tab_cd_state [U]`, `setL1_tab_nm_value [U]`, `setL1_tab_nm_enabled [U]`, `setL1_tab_nm_state [U]`, `setL1_pg_id_value [U]`, `setL1_pg_id_enabled [U]`, `setL1_pg_id_state [U]` |

**Notes:**
- Both direct callers are overloaded `storeModelData()` methods within the same `CRW03407SF02DBean` class.
- No screen entry points (`KKSV*`), batch processes, or CBS callers were found in the dependency graph within 8 hops.
- The method is a leaf-level utility that delegates exclusively to its own bean setters — it does not propagate calls beyond the bean instance.

## 6. Per-Branch Detail Blocks

**Block 1** — [IF] `(key == null || subkey == null)` (L266-269)

> Null guard: if either key or subkey is null, abort processing early. Japanese comment: `key,subkeyがnullの場合、処理を中止` → "If key or subkey is null, stop processing."

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return;` |

---

**Block 2** — [SET] `(separator detection)` (L271)

> Computes the index of "/" in key. The result is stored but **never used** in subsequent logic — this is dead code / potential legacy artifact.

| # | Type | Code |
|---|------|------|
| 1 | SET | `int separaterPoint = key.indexOf("/");` // Unused variable (note: misspelled "separator" → "separaterPoint") |

---

**Block 3** — [IF-ELSE IF-ELSE IF] `(key dispatch)` (L273-311)

> Dispatches on the `key` value to determine which bean property category to update. Three key branches, each with three subkey sub-branches.

**Block 3.1** — [IF] `(key.equals("タブコード"))` (L274) [Key: `タブコード = "Tab Code"` → L1_TAB_CD field group]

> Sets tab code property. Japanese comment: `項目ごとに処理を入れる。データタイプがStringの項目"タブコード"(アイテムID:l1_tab_cd)` → "Processing is inserted for each item. Data type is String item 'Tab Code' (item ID: l1_tab_cd)."

**Block 3.1.1** — [IF] `(subkey.equalsIgnoreCase("value"))` (L275) [Subkey: `value`]

> Sets the tab code's data value by calling the typed setter.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `setL1_tab_cd_value((String)in_value);` |

---

**Block 3.1.2** — [ELSE IF] `(subkey.equalsIgnoreCase("enable"))` (L278) [Subkey: `enable`]

> Sets the tab code's enabled flag. Japanese comment: `subkeyが"enable"の場合、l1_tab_cd_enabledのsetterを実行する` → "When subkey is 'enable', execute the l1_tab_cd_enabled setter."

| # | Type | Code |
|---|------|------|
| 1 | CALL | `setL1_tab_cd_enabled((Boolean)in_value);` |

---

**Block 3.1.3** — [ELSE IF] `(subkey.equalsIgnoreCase("state"))` (L281) [Subkey: `state`]

> Sets the tab code's state string. Japanese comment: `subkeyが"state"の場合、ステータスを返す` → "When subkey is 'state', return the state."

| # | Type | Code |
|---|------|------|
| 1 | CALL | `setL1_tab_cd_state((String)in_value);` |

---

**Block 3.2** — [ELSE IF] `(key.equals("タブ名称"))` (L286) [Key: `タブ名称 = "Tab Name"` → L1_TAB_NM field group]

> Sets tab name property. Japanese comment: `データタイプがStringの項目"タブ名称"(アイテムID:l1_tab_nm)` → "Data type is String item 'Tab Name' (item ID: l1_tab_nm)."

**Block 3.2.1** — [IF] `(subkey.equalsIgnoreCase("value"))` (L287) [Subkey: `value`]

| # | Type | Code |
|---|------|------|
| 1 | CALL | `setL1_tab_nm_value((String)in_value);` |

---

**Block 3.2.2** — [ELSE IF] `(subkey.equalsIgnoreCase("enable"))` (L290) [Subkey: `enable`]

> Japanese comment: `subkeyが"enable"の場合、l1_tab_nm_enabledのsetterを実行する` → "When subkey is 'enable', execute the l1_tab_nm_enabled setter."

| # | Type | Code |
|---|------|------|
| 1 | CALL | `setL1_tab_nm_enabled((Boolean)in_value);` |

---

**Block 3.2.3** — [ELSE IF] `(subkey.equalsIgnoreCase("state"))` (L293) [Subkey: `state`]

> Japanese comment: `subkeyが"state"の場合、ステータスを返す` → "When subkey is 'state', return the state."

| # | Type | Code |
|---|------|------|
| 1 | CALL | `setL1_tab_nm_state((String)in_value);` |

---

**Block 3.3** — [ELSE IF] `(key.equals("画面ID"))` (L298) [Key: `画面ID = "Screen ID"` → L1_PG_ID field group]

> Sets screen ID property. Japanese comment: `データタイプがStringの項目"画面ID"(アイテムID:l1_pg_id)` → "Data type is String item 'Screen ID' (item ID: l1_pg_id)."

**Block 3.3.1** — [IF] `(subkey.equalsIgnoreCase("value"))` (L299) [Subkey: `value`]

| # | Type | Code |
|---|------|------|
| 1 | CALL | `setL1_pg_id_value((String)in_value);` |

---

**Block 3.3.2** — [ELSE IF] `(subkey.equalsIgnoreCase("enable"))` (L302) [Subkey: `enable`]

> Japanese comment: `subkeyが"enable"の場合、l1_pg_id_enabledのsetterを実行する` → "When subkey is 'enable', execute the l1_pg_id_enabled setter."

| # | Type | Code |
|---|------|------|
| 1 | CALL | `setL1_pg_id_enabled((Boolean)in_value);` |

---

**Block 3.3.3** — [ELSE IF] `(subkey.equalsIgnoreCase("state"))` (L305) [Subkey: `state`]

> Japanese comment: `subkeyが"state"の場合、ステータスを返す` → "When subkey is 'state', return the state."

| # | Type | Code |
|---|------|------|
| 1 | CALL | `setL1_pg_id_state((String)in_value);` |

---

**Block 4** — [EXPLICIT END] (L311)

> Method body closes. If `key` does not match any of the three recognized values, or `subkey` does not match `value`/`enable`/`state`, the method implicitly returns `void` with no action — a silent no-op for unrecognized keys or subkeys.

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `タブコード` | Japanese field literal | "Tab Code" — the internal identifier for a tab panel in the UI. Maps to bean property `l1_tab_cd`. |
| `タブ名称` | Japanese field literal | "Tab Name" — the display label shown to users for a tab panel. Maps to bean property `l1_tab_nm`. |
| `画面ID` | Japanese field literal | "Screen ID" — the unique identifier for the current web screen/page. Maps to bean property `l1_pg_id`. |
| `l1_tab_cd` | Field alias | Tab code item identifier — used in UI element ID naming conventions. |
| `l1_tab_nm` | Field alias | Tab name item identifier — used in UI element ID naming conventions. |
| `l1_pg_id` | Field alias | Screen ID item identifier — used in UI element ID naming conventions. |
| `subkey="value"` | Property descriptor | The data content value of a UI field. |
| `subkey="enable"` | Property descriptor | A boolean flag controlling whether the UI field is enabled (interactive) or disabled (read-only). |
| `subkey="state"` | Property descriptor | A string representing the display state or validation state of a UI field. |
| `DBean` | Acronym suffix | "Data Bean" — a JavaBean used to hold and transfer model data between the controller and the view layer in a web MVC architecture. |
| `CRW03407SF` | Module code | The screen/form module identifier. Likely represents a specific service screen (SF = Screen Form) within the KOP system. |
| `isSetAsString` | Parameter | Unused boolean parameter; documented as a flag for setting String values to Long-type item Value properties, but has no effect in this method. |
| `separaterPoint` | Variable | Dead-code variable: the index of "/" in key. The result is computed but never referenced, suggesting it was intended for future key-path parsing (e.g., nested keys like `"parent/child"`). |
