# Business Logic — KKW00810SF01DBean.storeModelData() [74 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.KKW00810SF.KKW00810SF01DBean` |
| Layer | Utility / Data Bean (Data Access Object tier — model data persistence) |
| Module | `KKW00810SF` (Package: `eo.web.webview.KKW00810SF`) |

## 1. Role

### KKW00810SF01DBean.storeModelData()

This method serves as the central **model data persistence and routing dispatcher** within the `KKW00810SF01DBean` data bean. Its primary business purpose is to receive arbitrary key-value pairs and store them into the internal model data structure, handling various service-related data fields that flow through the `KKW00810SF` screen. The method implements a **dispatch/routing design pattern**: when the incoming key corresponds to a known, strongly-typed field (such as `ido_div_state`, `ido_div_value`, `sysid_state`, `sysid_value`, `svc_kei_no_state`, `svc_kei_no_value`, `ido_rsn_memo_state`, `ido_rsn_memo_value`), it applies targeted preprocessing — notably extracting substrings via `JKKAdEditCC.substring` for certain fields — and sets the processed value and state flags using dedicated setter methods. For unrecognized keys (the default branch), it falls back to generic storage via `storeModelData` (recursive delegation). This method plays a **shared utility role**, called by multiple callers within the same class to ensure consistent data population across the service screen's model, and acts as the single point of entry for incoming form/data submissions before they are distributed to their respective fields.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["storeModelData(key, subkey, in_value, isSetAsString)"])
    Condition1{key != null}
    Condition2{key is known field?}
    SET_SUBKEY["subkey = key.substring(key.indexOf('_') + 1)"]
    ProcessIDO_DIV_STATE["process ido_div_state: value = substring(in_value) -> setIdo_div_state(value, subkey)"]
    ProcessIDO_DIV_VALUE["process ido_div_value: value = substring(in_value) -> setIdo_div_value(value, subkey)"]
    ProcessSYSID_STATE["process sysid_state: value = substring(in_value) -> setSysid_state(value, subkey)"]
    ProcessSYSID_VALUE["process sysid_value: value = substring(in_value) -> setSysid_value(value, subkey)"]
    ProcessSVC_KEI_NO_STATE["process svc_kei_no_state: value = substring(in_value) -> setSvc_kei_no_state(value, subkey)"]
    ProcessSVC_KEI_NO_VALUE["process svc_kei_no_value: value = substring(in_value) -> setSvc_kei_no_value(value, subkey)"]
    ProcessIDO_RSN_MEMO_STATE["process ido_rsn_memo_state: value = substring(in_value) -> setIdo_rsn_memo_state(value, subkey)"]
    ProcessIDO_RSN_MEMO_VALUE["process ido_rsn_memo_value: value = substring(in_value) -> setIdo_rsn_memo_value(value, subkey)"]
    Fallback["storeModelData(key, subkey, in_value, isSetAsString) // recursive"]
    End(["Return (void)"])

    START --> Condition1
    Condition1 -->|false| End
    Condition1 -->|true| Condition2
    Condition2 -->|"ido_div_state"| ProcessIDO_DIV_STATE
    Condition2 -->|"ido_div_value"| ProcessIDO_DIV_VALUE
    Condition2 -->|"sysid_state"| ProcessSYSID_STATE
    Condition2 -->|"sysid_value"| ProcessSYSID_VALUE
    Condition2 -->|"svc_kei_no_state"| ProcessSVC_KEI_NO_STATE
    Condition2 -->|"svc_kei_no_value"| ProcessSVC_KEI_NO_VALUE
    Condition2 -->|"ido_rsn_memo_state"| ProcessIDO_RSN_MEMO_STATE
    Condition2 -->|"ido_rsn_memo_value"| ProcessIDO_RSN_MEMO_VALUE
    Condition2 -->|"other / default"| Fallback
    ProcessIDO_DIV_STATE --> End
    ProcessIDO_DIV_VALUE --> End
    ProcessSYSID_STATE --> End
    ProcessSYSID_VALUE --> End
    ProcessSVC_KEI_NO_STATE --> End
    ProcessSVC_KEI_NO_VALUE --> End
    ProcessIDO_RSN_MEMO_STATE --> End
    ProcessIDO_RSN_MEMO_VALUE --> End
    Fallback --> End
```

**Processing description:**

1. **Null guard**: The method first checks whether the incoming `key` is non-null. If `key` is null, the method returns immediately without performing any processing (early-exit pattern).
2. **Subkey derivation**: When the key contains an underscore (`_`), the method extracts the subkey portion after the underscore by calling `key.substring(key.indexOf('_') + 1)`. This subkey is then used as the map key for storage.
3. **Field-specific dispatch (if/else-if chain)**: The method routes the incoming data to 8 specialized processing branches based on the key name. Each known field triggers a specific sequence:
   - Substring extraction via utility method (e.g., `JKKAdEditCC.substring`)
   - Setter invocation with the extracted value and derived subkey
4. **Generic fallback (default else)**: If the key does not match any known field, the method delegates to its own `storeModelData` method recursively (same class, different overload), storing the value generically.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `key` | `String` | The field identifier (item name) used to determine which model field to populate. Acts as a dispatch key — its value determines which processing branch is taken. Examples: `ido_div_state`, `sysid_value`, `svc_kei_no_state`. Can be `null`, in which case the method returns immediately. |
| 2 | `subkey` | `String` | The sub-key used as the map key when storing data. If the original `key` contains an underscore, this is derived automatically by extracting the portion after the underscore (e.g., `"state"` from `"ido_div_state"`). Passed through to setter methods. |
| 3 | `in_value` | `Object` | The raw data value to be stored. Its type determines whether the `isSetAsString` flag is relevant. For known fields, it is pre-processed via substring extraction before storage. |
| 4 | `isSetAsString` | `boolean` | Flag indicating whether to force the value into a String-type property for Long-type fields. Per Javadoc: `Long型項目ValueプロパティへString型値の設定を行う場合true` — "true when setting a String-type value to a Long-type item's Value property" (Long型項目ValueプロパティへString型値の設定を行う場合true). Affects type coercion during storage. |

**Instance fields / external state read:**
- No instance fields are directly read by this method. It writes to setter-based state/value fields via setter invocations.

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| U | `JKKAdEditCC.substring` | JKKAdEditCC | - | Calls `substring` in `JKKAdEditCC` — string preprocessing utility for field values |
| U | `JKKAdEdit.substring` | JKKAdEdit | - | Calls `substring` in `JKKAdEdit` — string preprocessing utility for field values |
| U | `JKKTelnoInfoAddMapperCC.substring` | JKKTelnoInfoAddMapperCC | - | Calls `substring` in `JKKTelnoInfoAddMapperCC` — string preprocessing utility for field values |
| U | `JDKejbStringEdit.substring` | JDKejbStringEdit | - | Calls `substring` in `JDKejbStringEdit` — string preprocessing utility for field values |
| U | `KKW00810SF01DBean.setIdo_div_state` | KKW00810SF01DBean | - | Sets the `ido_div_state` field — initializes division state for identification data |
| U | `KKW00810SF01DBean.setIdo_div_value` | KKW00810SF01DBean | - | Sets the `ido_div_value` field — stores division value for identification data |
| U | `KKW00810SF01DBean.setIdo_rsn_memo_state` | KKW00810SF01DBean | - | Sets the `ido_rsn_memo_state` field — initializes reason memo state for identification data |
| U | `KKW00810SF01DBean.setIdo_rsn_memo_value` | KKW00810SF01DBean | - | Sets the `ido_rsn_memo_value` field — stores reason memo value for identification data |
| U | `KKW00810SF01DBean.setSvc_kei_no_state` | KKW00810SF01DBean | - | Sets the `svc_kei_no_state` field — initializes service key number state |
| U | `KKW00810SF01DBean.setSvc_kei_no_value` | KKW00810SF01DBean | - | Sets the `svc_kei_no_value` field — stores service key number value |
| U | `KKW00810SF01DBean.setSysid_state` | KKW00810SF01DBean | - | Sets the `sysid_state` field — initializes system ID state |
| U | `KKW00810SF01DBean.setSysid_value` | KKW00810SF01DBean | - | Sets the `sysid_value` field — stores system ID value |
| U | `KKW00810SF01DBean.storeModelData` | KKW00810SF01DBean | - | Recursively delegates to overloaded `storeModelData` for generic storage |

**Classification rationale:** All operations are classified as **U** (Update) because the method exclusively writes data — either by setting field values via setter methods or by storing into an internal map/data structure. No database reads, creates, or deletes are performed. The substring utility calls are string preprocessing utilities used to sanitize/clean input values before storage.

## 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: `setIdo_rsn_memo_state` [-], `setIdo_rsn_memo_value` [-], `storeModelData` [-], `storeModelData` [-], `storeModelData` [-], `substring` [-], `substring` [-], `substring` [-], `substring` [-], `setIdo_div_state` [-], `setIdo_div_value` [-], `setSvc_kei_no_state` [-], `setSvc_kei_no_value` [-], `setSysid_state` [-], `setSysid_value` [-]

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | KKW00810SF01DBean | `KKW00810SF01DBean.storeModelData` -> `KKW00810SF01DBean.storeModelData` | `setIdo_div_state [U]`, `setIdo_div_value [U]`, `setSysid_state [U]`, `setSysid_value [U]`, `setSvc_kei_no_state [U]`, `setSvc_kei_no_value [U]`, `setIdo_rsn_memo_state [U]`, `setIdo_rsn_memo_value [U]` |
| 2 | KKW00810SF01DBean | `KKW00810SF01DBean.storeModelData` -> `KKW00810SF01DBean.storeModelData` | `setIdo_div_state [U]`, `setIdo_div_value [U]`, `setSysid_state [U]`, `setSysid_value [U]`, `setSvc_kei_no_state [U]`, `setSvc_kei_no_value [U]`, `setIdo_rsn_memo_state [U]`, `setIdo_rsn_memo_value [U]` |

**Notes:** The method is a data bean utility called internally by the same class (`KKW00810SF01DBean`). No screen or batch entry points are found within 8 hops of the call graph, suggesting this is a low-level utility method used as part of a larger data-population workflow. All terminal operations are setter calls (U — Update) with no database-level entities directly accessed.

## 6. Per-Branch Detail Blocks

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

> Null guard: early-exit if key is null. This prevents NullPointerException and skips all downstream processing when no field identifier is provided.

| # | Type | Code |
|---|------|------|
| 1 | SET | `subkey = key.substring(key.indexOf('_') + 1);` // Extract subkey portion after underscore — derived from the key name |
| 2 | IF | `if (key.equals("ido_div_state"))` [Condition: key equals `ido_div_state`] |
| 3 | CALL | `JKKAdEditCC.substring(in_value)` // Pre-process value via substring utility (JKKAdEditCC.substring) |
| 4 | CALL | `setIdo_div_state(processedValue, subkey)` // Set division state field |
| 5 | IF | `else if (key.equals("ido_div_value"))` [Condition: key equals `ido_div_value`] |
| 6 | CALL | `JKKAdEdit.substring(in_value)` // Pre-process value via substring utility (JKKAdEdit.substring) |
| 7 | CALL | `setIdo_div_value(processedValue, subkey)` // Set division value field |
| 8 | IF | `else if (key.equals("sysid_state"))` [Condition: key equals `sysid_state`] |
| 9 | CALL | `JKKTelnoInfoAddMapperCC.substring(in_value)` // Pre-process value via substring utility (JKKTelnoInfoAddMapperCC.substring) |
| 10 | CALL | `setSysid_state(processedValue, subkey)` // Set system ID state field |
| 11 | IF | `else if (key.equals("sysid_value"))` [Condition: key equals `sysid_value`] |
| 12 | CALL | `JDKejbStringEdit.substring(in_value)` // Pre-process value via substring utility (JDKejbStringEdit.substring) |
| 13 | CALL | `setSysid_value(processedValue, subkey)` // Set system ID value field |
| 14 | IF | `else if (key.equals("svc_kei_no_state"))` [Condition: key equals `svc_kei_no_state`] |
| 15 | CALL | `JKKAdEditCC.substring(in_value)` // Pre-process value via substring utility (JKKAdEditCC.substring) |
| 16 | CALL | `setSvc_kei_no_state(processedValue, subkey)` // Set service key number state field |
| 17 | IF | `else if (key.equals("svc_kei_no_value"))` [Condition: key equals `svc_kei_no_value`] |
| 18 | CALL | `JKKAdEdit.substring(in_value)` // Pre-process value via substring utility (JKKAdEdit.substring) |
| 19 | CALL | `setSvc_kei_no_value(processedValue, subkey)` // Set service key number value field |
| 20 | IF | `else if (key.equals("ido_rsn_memo_state"))` [Condition: key equals `ido_rsn_memo_state`] |
| 21 | CALL | `JKKAdEditCC.substring(in_value)` // Pre-process value via substring utility (JKKAdEditCC.substring) |
| 22 | CALL | `setIdo_rsn_memo_state(processedValue, subkey)` // Set reason memo state field |
| 23 | IF | `else if (key.equals("ido_rsn_memo_value"))` [Condition: key equals `ido_rsn_memo_value`] |
| 24 | CALL | `JKKAdEdit.substring(in_value)` // Pre-process value via substring utility (JKKAdEdit.substring) |
| 25 | CALL | `setIdo_rsn_memo_value(processedValue, subkey)` // Set reason memo value field |
| 26 | ELSE | `// default: unknown key, fall through to generic storage` |
| 27 | CALL | `storeModelData(key, subkey, in_value, isSetAsString)` // Recursive delegation to overloaded storeModelData |
| 28 | RETURN | `// void — return` |

**Block 1.1** — [nested: known field branch — `ido_div_state`] (L~315)

> When the key identifies the division state field (`ido_div_state`), the method processes the incoming value through the `JKKAdEditCC.substring` utility for string sanitization, then stores it using `setIdo_div_state` with the derived subkey.

| # | Type | Code |
|---|------|------|
| 1 | SET | `value = JKKAdEditCC.substring(in_value)` // Pre-process the raw value for safe storage [-> substring utility call] |
| 2 | CALL | `setIdo_div_state(value, subkey)` // Persist the division state into the model |

**Block 1.2** — [nested: known field branch — `ido_div_value`] (L~320)

> When the key identifies the division value field (`ido_div_value`), the method processes the value through `JKKAdEdit.substring` then stores via `setIdo_div_value`.

| # | Type | Code |
|---|------|------|
| 1 | SET | `value = JKKAdEdit.substring(in_value)` // Pre-process the raw value for safe storage [-> substring utility call] |
| 2 | CALL | `setIdo_div_value(value, subkey)` // Persist the division value into the model |

**Block 1.3** — [nested: known field branch — `sysid_state`] (L~325)

> When the key identifies the system ID state field (`sysid_state`), the method processes the value through `JKKTelnoInfoAddMapperCC.substring` then stores via `setSysid_state`.

| # | Type | Code |
|---|------|------|
| 1 | SET | `value = JKKTelnoInfoAddMapperCC.substring(in_value)` // Pre-process the raw value for safe storage [-> substring utility call] |
| 2 | CALL | `setSysid_state(value, subkey)` // Persist the system ID state into the model |

**Block 1.4** — [nested: known field branch — `sysid_value`] (L~330)

> When the key identifies the system ID value field (`sysid_value`), the method processes the value through `JDKejbStringEdit.substring` then stores via `setSysid_value`.

| # | Type | Code |
|---|------|------|
| 1 | SET | `value = JDKejbStringEdit.substring(in_value)` // Pre-process the raw value for safe storage [-> substring utility call] |
| 2 | CALL | `setSysid_value(value, subkey)` // Persist the system ID value into the model |

**Block 1.5** — [nested: known field branch — `svc_kei_no_state`] (L~335)

> When the key identifies the service key number state field (`svc_kei_no_state`), the method processes the value through `JKKAdEditCC.substring` then stores via `setSvc_kei_no_state`.

| # | Type | Code |
|---|------|------|
| 1 | SET | `value = JKKAdEditCC.substring(in_value)` // Pre-process the raw value for safe storage [-> substring utility call] |
| 2 | CALL | `setSvc_kei_no_state(value, subkey)` // Persist the service key number state into the model |

**Block 1.6** — [nested: known field branch — `svc_kei_no_value`] (L~340)

> When the key identifies the service key number value field (`svc_kei_no_value`), the method processes the value through `JKKAdEdit.substring` then stores via `setSvc_kei_no_value`.

| # | Type | Code |
|---|------|------|
| 1 | SET | `value = JKKAdEdit.substring(in_value)` // Pre-process the raw value for safe storage [-> substring utility call] |
| 2 | CALL | `setSvc_kei_no_value(value, subkey)` // Persist the service key number value into the model |

**Block 1.7** — [nested: known field branch — `ido_rsn_memo_state`] (L~345)

> When the key identifies the identification reason memo state field (`ido_rsn_memo_state`), the method processes the value through `JKKAdEditCC.substring` then stores via `setIdo_rsn_memo_state`.

| # | Type | Code |
|---|------|------|
| 1 | SET | `value = JKKAdEditCC.substring(in_value)` // Pre-process the raw value for safe storage [-> substring utility call] |
| 2 | CALL | `setIdo_rsn_memo_state(value, subkey)` // Persist the identification reason memo state into the model |

**Block 1.8** — [nested: known field branch — `ido_rsn_memo_value`] (L~350)

> When the key identifies the identification reason memo value field (`ido_rsn_memo_value`), the method processes the value through `JKKAdEdit.substring` then stores via `setIdo_rsn_memo_value`.

| # | Type | Code |
|---|------|------|
| 1 | SET | `value = JKKAdEdit.substring(in_value)` // Pre-process the raw value for safe storage [-> substring utility call] |
| 2 | CALL | `setIdo_rsn_memo_value(value, subkey)` // Persist the identification reason memo value into the model |

**Block 2** — [ELSE / DEFAULT] `(key not matching any known field)` (L~355)

> When the key does not match any of the 8 known field names, the method delegates to its own overloaded `storeModelData` method for generic map-based storage. This serves as a catch-all for dynamic or future fields that have not been explicitly handled.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `storeModelData(key, subkey, in_value, isSetAsString)` // Delegate to overloaded version for generic storage |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `ido_div_state` | Field | Identification division state — tracks the state/flag of the identification data division field |
| `ido_div_value` | Field | Identification division value — stores the actual value of the identification data division |
| `sysid_state` | Field | System ID state — tracks the state/flag of the system identifier field |
| `sysid_value` | Field | System ID value — stores the actual system identifier value |
| `svc_kei_no_state` | Field | Service key number state — tracks the state/flag of the service key number field |
| `svc_kei_no_value` | Field | Service key number value — stores the actual service key number (internal tracking number for service contract lines) |
| `ido_rsn_memo_state` | Field | Identification reason memo state — tracks the state/flag of the identification reason memo field |
| `ido_rsn_memo_value` | Field | Identification reason memo value — stores the memo/reason text for identification data |
| `key` | Parameter | Item name (項目名) — the field identifier used to route data to the correct model field |
| `subkey` | Parameter | Sub-key (サブキー) — the secondary identifier used as the map key for data storage |
| `in_value` | Parameter | Data (データ) — the raw data value to be stored in the model |
| `isSetAsString` | Parameter | Flag indicating whether to store a String-type value into a Long-type item's Value property (Long型項目ValueプロパティへString型値の設定を行う場合true) |
| `JKKAdEditCC` | Component | String editing / substring utility class — provides substring extraction for field values |
| `JKKAdEdit` | Component | String editing / substring utility class — alternative substring extractor used for certain fields |
| `JKKTelnoInfoAddMapperCC` | Component | Telephone number info add mapper component — provides substring utility for telephone-related fields |
| `JDKejbStringEdit` | Component | EJB string editing utility class — provides substring extraction for string fields |
| DBean | Abbreviation | Data Bean — a JavaBean component that holds and manages data for a screen or business process |
| SC | Abbreviation | Service Component — a component that encapsulates business logic and service operations |
| substring | Utility | String preprocessing utility — extracts a portion of the input string for safe storage in model fields |
