# Business Logic — KKW01023SF02DBean.storeModelData() [63 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.KKW01023SF.KKW01023SF02DBean` |
| Layer | Utility / Data Binding Bean (Web Presentation Layer) |
| Module | `KKW01023SF` (Package: `eo.web.webview.KKW01023SF`) |

## 1. Role

### KKW01023SF02DBean.storeModelData()

This method serves as a centralized **data binding router** for the KKW01023SF web screen's data model. It receives a key string representing a business field name and a subkey representing the property type (value, enable, or state), then dispatches to the appropriate setter method on the bean. This follows a **key-subkey dispatch pattern** where the method routes incoming data to the correct strongly-typed field without requiring callers to know the internal structure of the bean.

Four business field categories are supported: **"番号／件数"** (Number / Count, item ID: `no_cnt`), **"対象契約識別コード名称"** (Target Contract Identification Code Name, item ID: `tg_kei_skbt_cd_nm`), **"対象契約番号"** (Target Contract Number, item ID: `tgt_kei_no`), and **"対象サービス名称"** (Target Service Name, item ID: `tgt_svc_nm`). Each field supports three subkey types: `value` for data values, `enable` for UI enable/disable flags, and `state` for display state strings. The method also respects the `isSetAsString` flag, though the current implementation always casts value and state setters to String regardless — this parameter exists to support future Long-type property handling where string-to-long conversion may be required (Long型項目ValueプロパティへString型値の設定を行う場合true).

In the larger system, this method acts as a **shared utility bridge** between presentation-layer data maps and the typed bean model. It is the primary mechanism by which screen data (typically passed as key-value pairs from a view layer model map) is materialized into strongly-typed JavaBean properties, enabling clean separation between loosely-typed view data and the domain-specific bean contract.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["storeModelData key, subkey, in_value, isSetAsString"])
    NULL_CHECK{"key is null or subkey is null?"}
    SEP["int separaterPoint = key.indexOf
\
\"]
    KEY1{"key equals \\\"番号\\\""}
    SUBKEY1A{"subkey equals \\\"value\\\""}
    SET_NO_CNT_VAL["setNo_cnt_value"]
    SUBKEY1B{"subkey equals \\\"enable\\\""}
    SET_NO_CNT_ENB["setNo_cnt_enabled"]
    SUBKEY1C{"subkey equals \\\"state\\\""}
    SET_NO_CNT_ST["setNo_cnt_state"]
    KEY2{"key equals \\\"対象契約識別コード名称\\\""}
    SUBKEY2A{"subkey equals \\\"value\\\""}
    SET_TG_KEY_SKBT_CD_NM_VAL["setTg_kei_skbt_cd_nm_value"]
    SUBKEY2B{"subkey equals \\\"enable\\\""}
    SET_TG_KEY_SKBT_CD_NM_ENB["setTg_kei_skbt_cd_nm_enabled"]
    SUBKEY2C{"subkey equals \\\"state\\\""}
    SET_TG_KEY_SKBT_CD_NM_ST["setTg_kei_skbt_cd_nm_state"]
    KEY3{"key equals \\\"対象契約番号\\\""}
    SUBKEY3A{"subkey equals \\\"value\\\""}
    SET_TGT_KEY_NO_VAL["setTgt_kei_no_value"]
    SUBKEY3B{"subkey equals \\\"enable\\\""}
    SET_TGT_KEY_NO_ENB["setTgt_kei_no_enabled"]
    SUBKEY3C{"subkey equals \\\"state\\\""}
    SET_TGT_KEY_NO_ST["setTgt_kei_no_state"]
    KEY4{"key equals \\\"対象サービス名称\\\""}
    SUBKEY4A{"subkey equals \\\"value\\\""}
    SET_TGT_SVC_NM_VAL["setTgt_svc_nm_value"]
    SUBKEY4B{"subkey equals \\\"enable\\\""}
    SET_TGT_SVC_NM_ENB["setTgt_svc_nm_enabled"]
    SUBKEY4C{"subkey equals \\\"state\\\""}
    SET_TGT_SVC_NM_ST["setTgt_svc_nm_state"]
    END_NODE(["Return void"])

    START --> NULL_CHECK
    NULL_CHECK -->|true| END_NODE
    NULL_CHECK -->|false| SEP
    SEP --> KEY1
    KEY1 -->|true| SUBKEY1A
    KEY1 -->|false| KEY2
    SUBKEY1A -->|true| SET_NO_CNT_VAL --> END_NODE
    SUBKEY1A -->|false| SUBKEY1B
    SUBKEY1B -->|true| SET_NO_CNT_ENB --> END_NODE
    SUBKEY1B -->|false| SUBKEY1C
    SUBKEY1C -->|true| SET_NO_CNT_ST --> END_NODE
    SUBKEY1C -->|false| END_NODE
    KEY2 -->|true| SUBKEY2A
    KEY2 -->|false| KEY3
    SUBKEY2A -->|true| SET_TG_KEY_SKBT_CD_NM_VAL --> END_NODE
    SUBKEY2A -->|false| SUBKEY2B
    SUBKEY2B -->|true| SET_TG_KEY_SKBT_CD_NM_ENB --> END_NODE
    SUBKEY2B -->|false| SUBKEY2C
    SUBKEY2C -->|true| SET_TG_KEY_SKBT_CD_NM_ST --> END_NODE
    SUBKEY2C -->|false| END_NODE
    KEY3 -->|true| SUBKEY3A
    KEY3 -->|false| KEY4
    SUBKEY3A -->|true| SET_TGT_KEY_NO_VAL --> END_NODE
    SUBKEY3A -->|false| SUBKEY3B
    SUBKEY3B -->|true| SET_TGT_KEY_NO_ENB --> END_NODE
    SUBKEY3B -->|false| SUBKEY3C
    SUBKEY3C -->|true| SET_TGT_KEY_NO_ST --> END_NODE
    SUBKEY3C -->|false| END_NODE
    KEY4 -->|true| SUBKEY4A
    KEY4 -->|false| END_NODE
    SUBKEY4A -->|true| SET_TGT_SVC_NM_VAL --> END_NODE
    SUBKEY4A -->|false| SUBKEY4B
    SUBKEY4B -->|true| SET_TGT_SVC_NM_ENB --> END_NODE
    SUBKEY4B -->|false| SUBKEY4C
    SUBKEY4C -->|true| SET_TGT_SVC_NM_ST --> END_NODE
    SUBKEY4C -->|false| END_NODE
```

The method processes data in two stages. First, it performs a guard check: if either the `key` or `subkey` parameter is null, processing terminates immediately (early return). Second, it computes a separator index by locating the first `/` character in the key string, though this value is not used in any subsequent logic within the current implementation. The method then proceeds through a cascading `if-else if` chain that matches the `key` parameter against four hardcoded business field identifiers, and for each matched key, evaluates the `subkey` parameter case-insensitively to route to the corresponding setter method.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `key` | `String` | The business field identifier (項目名). Specifies which model property to set. Valid values are: `"番号／件数"` (Number/Count), `"対象契約識別コード名称"` (Target Contract ID Code Name), `"対象契約番号"` (Target Contract Number), and `"対象サービス名称"` (Target Service Name). Case-sensitive match against these Japanese literal strings. |
| 2 | `subkey` | `String` | The property type within the selected field (サブキー). Determines which attribute of the field is being set. Valid values (case-insensitive): `"value"` (data value), `"enable"` (UI enable/disable flag), `"state"` (display state). |
| 3 | `in_value` | `Object` | The data to assign. For `subkey="value"` and `subkey="state"`, this is cast to `String`. For `subkey="enable"`, this is cast to `Boolean`. The actual type depends on the subkey being set. |
| 4 | `isSetAsString` | `boolean` | Flag indicating whether the value should be set as a String even for Long-type properties. (Long型項目ValueプロパティへString型値の設定を行う場合true — true when setting a String value to a Long-type item's Value property). Currently unused in the implementation. |

**Instance fields read:** None. The method is stateless with respect to the bean's own fields — it only invokes setters.

## 4. CRUD Operations / Called Services

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

The method exclusively performs **U (Update)** operations on internal bean properties via setter delegation. No external SC/CBS calls, no database operations, no entity reads or writes.

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| U | `KKW01023SF02DBean.setNo_cnt_value` | - | Bean property `no_cnt_value` | Sets the number/count data value as String |
| U | `KKW01023SF02DBean.setNo_cnt_enabled` | - | Bean property `no_cnt_enabled` | Sets the number/count UI enable flag |
| U | `KKW01023SF02DBean.setNo_cnt_state` | - | Bean property `no_cnt_state` | Sets the number/count display state string |
| U | `KKW01023SF02DBean.setTg_kei_skbt_cd_nm_value` | - | Bean property `tg_kei_skbt_cd_nm_value` | Sets the target contract ID code name value |
| U | `KKW01023SF02DBean.setTg_kei_skbt_cd_nm_enabled` | - | Bean property `tg_kei_skbt_cd_nm_enabled` | Sets the target contract ID code name UI enable flag |
| U | `KKW01023SF02DBean.setTg_kei_skbt_cd_nm_state` | - | Bean property `tg_kei_skbt_cd_nm_state` | Sets the target contract ID code name display state string |
| U | `KKW01023SF02DBean.setTgt_kei_no_value` | - | Bean property `tgt_kei_no_value` | Sets the target contract number value |
| U | `KKW01023SF02DBean.setTgt_kei_no_enabled` | - | Bean property `tgt_kei_no_enabled` | Sets the target contract number UI enable flag |
| U | `KKW01023SF02DBean.setTgt_kei_no_state` | - | Bean property `tgt_kei_no_state` | Sets the target contract number display state string |
| U | `KKW01023SF02DBean.setTgt_svc_nm_value` | - | Bean property `tgt_svc_nm_value` | Sets the target service name value |
| U | `KKW01023SF02DBean.setTgt_svc_nm_enabled` | - | Bean property `tgt_svc_nm_enabled` | Sets the target service name UI enable flag |
| U | `KKW01023SF02DBean.setTgt_svc_nm_state` | - | Bean property `tgt_svc_nm_state` | Sets the target service name display state string |

All 12 setter calls modify internal in-memory bean properties only. No persistent storage, SC/CBS, or database interaction occurs within 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.

The pre-computed caller data indicates 2 direct callers within the same class (`KKW01023SF02DBean`), specifically through overloaded calls to `storeModelData()` (the no-string-mode variant that delegates with `isSetAsString=false`). This method does not appear to be a screen entry point itself — it is a utility method called internally by other bean methods to populate field data. No screen (`KKSV*`), batch, or CBS classes were found within 8 hops.

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | `KKW01023SF02DBean.storeModelData(key, subkey, in_value)` (overload) | `storeModelData(key, subkey, in_value)` → delegates to `storeModelData(key, subkey, in_value, false)` | `setTgt_svc_nm_state [U] tgt_svc_nm_state` |
| 2 | `KKW01023SF02DBean.storeModelData(key, subkey, in_value)` (overload) | `storeModelData(key, subkey, in_value)` → delegates to `storeModelData(key, subkey, in_value, false)` | `setTgt_svc_nm_enabled [U] tgt_svc_nm_enabled` |

The terminal operations chain from this method produces 12 bean property updates (4 fields × 3 subkey types), with no downstream persistence or remote calls.

## 6. Per-Branch Detail Blocks

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

Guard clause: abort processing if either the field name or subkey is null.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return;` // key,subkeyがnullの場合、処理を中止 — Abort if key or subkey is null |

**Block 2** — [EXEC] `(compute separator index)` (L316)

Calculates the position of the first `/` character in the key string. This value is stored but not used in any subsequent branch within the current implementation.

| # | Type | Code |
|---|------|------|
| 1 | SET | `separaterPoint = key.indexOf("/")` // Compute separator position (unused in current flow) |

**Block 3** — [ELSE-IF] `key.equals("番号／件数")` (L319) [項目ID:no_cnt]

Matches the key to the **Number/Count** field and dispatches based on subkey. This is the first of four field-matching branches.

> (Optional: Sets properties for the count/number field (no_cnt item ID). Supports value, enable, and state subkeys.)

| # | Type | Code |
|---|------|------|
| 1 | SET | `in_value` cast to `String` → `setNo_cnt_value(in_value)` // Sets count value |
| 2 | ELSE-IF — [subkey.equalsIgnoreCase("enable")] — `in_value` cast to `Boolean` → `setNo_cnt_enabled(in_value)` // subkeyが"enable"の場合、no_cnt_enabledのsetterを実行する — Execute setter for no_cnt_enabled when subkey is "enable" |
| 3 | ELSE-IF — [subkey.equalsIgnoreCase("state")] — `in_value` cast to `String` → `setNo_cnt_state(in_value)` // subkeyが"state"の場合、ステータスを返す — Return status when subkey is "state" |

**Block 3.1** — [nested IF] `subkey.equalsIgnoreCase("value")` (L320)

| # | Type | Code |
|---|------|------|
| 1 | CALL | `setNo_cnt_value((String)in_value)` // Set count value |

**Block 3.2** — [nested ELSE-IF] `subkey.equalsIgnoreCase("enable")` (L323)

| # | Type | Code |
|---|------|------|
| 1 | CALL | `setNo_cnt_enabled((Boolean)in_value)` // subkeyが"enable"の場合、no_cnt_enabledのsetterを実行する — Execute setter for no_cnt_enabled when subkey is "enable" |

**Block 3.3** — [nested ELSE-IF] `subkey.equalsIgnoreCase("state")` (L327)

| # | Type | Code |
|---|------|------|
| 1 | CALL | `setNo_cnt_state((String)in_value)` // subkeyが"state"の場合、ステータスを返す — Return status when subkey is "state" |

**Block 4** — [ELSE-IF] `key.equals("対象契約識別コード名称")` (L333) [項目ID:tg_kei_skbt_cd_nm]

Matches the key to the **Target Contract Identification Code Name** field and dispatches based on subkey.

> (Optional: Sets properties for the target contract identification code name field (tg_kei_skbt_cd_nm item ID). Supports value, enable, and state subkeys.)

| # | Type | Code |
|---|------|------|
| 1 | SET | `in_value` cast to `String` → `setTg_kei_skbt_cd_nm_value(in_value)` // Sets contract code name value |
| 2 | ELSE-IF — [subkey.equalsIgnoreCase("enable")] — `in_value` cast to `Boolean` → `setTg_kei_skbt_cd_nm_enabled(in_value)` // subkeyが"enable"の場合、tg_kei_skbt_cd_nm_enabledのsetterを実行する — Execute setter for tg_kei_skbt_cd_nm_enabled when subkey is "enable" |
| 3 | ELSE-IF — [subkey.equalsIgnoreCase("state")] — `in_value` cast to `String` → `setTg_kei_skbt_cd_nm_state(in_value)` // subkeyが"state"の場合、ステータスを返す — Return status when subkey is "state" |

**Block 4.1** — [nested IF] `subkey.equalsIgnoreCase("value")` (L334)

| # | Type | Code |
|---|------|------|
| 1 | CALL | `setTg_kei_skbt_cd_nm_value((String)in_value)` // Set contract code name value |

**Block 4.2** — [nested ELSE-IF] `subkey.equalsIgnoreCase("enable")` (L337)

| # | Type | Code |
|---|------|------|
| 1 | CALL | `setTg_kei_skbt_cd_nm_enabled((Boolean)in_value)` // subkeyが"enable"の場合、tg_kei_skbt_cd_nm_enabledのsetterを実行する — Execute setter for tg_kei_skbt_cd_nm_enabled when subkey is "enable" |

**Block 4.3** — [nested ELSE-IF] `subkey.equalsIgnoreCase("state")` (L341)

| # | Type | Code |
|---|------|------|
| 1 | CALL | `setTg_kei_skbt_cd_nm_state((String)in_value)` // subkeyが"state"の場合、ステータスを返す — Return status when subkey is "state" |

**Block 5** — [ELSE-IF] `key.equals("対象契約番号")` (L347) [項目ID:tgt_kei_no]

Matches the key to the **Target Contract Number** field and dispatches based on subkey.

> (Optional: Sets properties for the target contract number field (tgt_kei_no item ID). Supports value, enable, and state subkeys.)

| # | Type | Code |
|---|------|------|
| 1 | SET | `in_value` cast to `String` → `setTgt_kei_no_value(in_value)` // Sets contract number value |
| 2 | ELSE-IF — [subkey.equalsIgnoreCase("enable")] — `in_value` cast to `Boolean` → `setTgt_kei_no_enabled(in_value)` // subkeyが"enable"の場合、tgt_kei_no_enabledのsetterを実行する — Execute setter for tgt_kei_no_enabled when subkey is "enable" |
| 3 | ELSE-IF — [subkey.equalsIgnoreCase("state")] — `in_value` cast to `String` → `setTgt_kei_no_state(in_value)` // subkeyが"state"の場合、ステータスを返す — Return status when subkey is "state" |

**Block 5.1** — [nested IF] `subkey.equalsIgnoreCase("value")` (L348)

| # | Type | Code |
|---|------|------|
| 1 | CALL | `setTgt_kei_no_value((String)in_value)` // Set contract number value |

**Block 5.2** — [nested ELSE-IF] `subkey.equalsIgnoreCase("enable")` (L351)

| # | Type | Code |
|---|------|------|
| 1 | CALL | `setTgt_kei_no_enabled((Boolean)in_value)` // subkeyが"enable"の場合、tgt_kei_no_enabledのsetterを実行する — Execute setter for tgt_kei_no_enabled when subkey is "enable" |

**Block 5.3** — [nested ELSE-IF] `subkey.equalsIgnoreCase("state")` (L355)

| # | Type | Code |
|---|------|------|
| 1 | CALL | `setTgt_kei_no_state((String)in_value)` // subkeyが"state"の場合、ステータスを返す — Return status when subkey is "state" |

**Block 6** — [ELSE-IF] `key.equals("対象サービス名称")` (L361) [項目ID:tgt_svc_nm]

Matches the key to the **Target Service Name** field and dispatches based on subkey. This is the final field-matching branch.

> (Optional: Sets properties for the target service name field (tgt_svc_nm item ID). Supports value, enable, and state subkeys.)

| # | Type | Code |
|---|------|------|
| 1 | SET | `in_value` cast to `String` → `setTgt_svc_nm_value(in_value)` // Sets service name value |
| 2 | ELSE-IF — [subkey.equalsIgnoreCase("enable")] — `in_value` cast to `Boolean` → `setTgt_svc_nm_enabled(in_value)` // subkeyが"enable"の場合、tgt_svc_nm_enabledのsetterを実行する — Execute setter for tgt_svc_nm_enabled when subkey is "enable" |
| 3 | ELSE-IF — [subkey.equalsIgnoreCase("state")] — `in_value` cast to `String` → `setTgt_svc_nm_state(in_value)` // subkeyが"state"の場合、ステータスを返す — Return status when subkey is "state" |

**Block 6.1** — [nested IF] `subkey.equalsIgnoreCase("value")` (L362)

| # | Type | Code |
|---|------|------|
| 1 | CALL | `setTgt_svc_nm_value((String)in_value)` // Set service name value |

**Block 6.2** — [nested ELSE-IF] `subkey.equalsIgnoreCase("enable")` (L365)

| # | Type | Code |
|---|------|------|
| 1 | CALL | `setTgt_svc_nm_enabled((Boolean)in_value)` // subkeyが"enable"の場合、tgt_svc_nm_enabledのsetterを実行する — Execute setter for tgt_svc_nm_enabled when subkey is "enable" |

**Block 6.3** — [nested ELSE-IF] `subkey.equalsIgnoreCase("state")` (L369)

| # | Type | Code |
|---|------|------|
| 1 | CALL | `setTgt_svc_nm_state((String)in_value)` // subkeyが"state"の場合、ステータスを返す — Return status when subkey is "state" |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `番号／件数` | Field | Number/Count — the item name for the count/number field. Japanese literal used as a key to identify this field. |
| `対象契約識別コード名称` | Field | Target Contract Identification Code Name — the name/description of the identification code for a target contract. Used as a key to identify this field. |
| `対象契約番号` | Field | Target Contract Number — the contract number of the target contract. Used as a key to identify this field. |
| `対象サービス名称` | Field | Target Service Name — the name of the target service. Used as a key to identify this field. |
| `no_cnt` | Field ID | Internal item ID for the Number/Count field. Maps to `no_cnt_value`, `no_cnt_enabled`, `no_cnt_state` properties. |
| `tg_kei_skbt_cd_nm` | Field ID | Internal item ID for the Target Contract Identification Code Name field. Maps to `tg_kei_skbt_cd_nm_value`, `tg_kei_skbt_cd_nm_enabled`, `tg_kei_skbt_cd_nm_state` properties. |
| `tgt_kei_no` | Field ID | Internal item ID for the Target Contract Number field. Maps to `tgt_kei_no_value`, `tgt_kei_no_enabled`, `tgt_kei_no_state` properties. |
| `tgt_svc_nm` | Field ID | Internal item ID for the Target Service Name field. Maps to `tgt_svc_nm_value`, `tgt_svc_nm_enabled`, `tgt_svc_nm_state` properties. |
| `value` | Subkey | Property type — carries the actual data value for a field (type: String). |
| `enable` | Subkey | Property type — carries the UI enable/disable flag for a field (type: Boolean). |
| `state` | Subkey | Property type — carries the display state string for a field (type: String). |
| `KKW01023SF` | Module | Web screen module code. The "SF" suffix indicates a screen/form module. |
| `KKW01023SF02DBean` | Class | Data binding bean for the KKW01023SF screen. "DBean" indicates a Display/Detail Bean used in the presentation layer. |
| `isSetAsString` | Parameter | Flag for Long-type property handling — determines whether to set a String value to a Long-type item's Value property. (Long型項目ValueプロパティへString型値の設定を行う場合true) |
| `separaterPoint` | Variable | Temporary variable storing the index of the first "/" in the key string. Currently computed but unused in the implementation. Note: original source spelling is "separaterPoint" (typo for "separatorPoint"). |
