# Business Logic — KKW00816SF02DBean.storeModelData() [41 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.KKW00816SF.KKW00816SF02DBean` |
| Layer | View/DTO Bean (WebView data binding layer, implements `X33VDataTypeBeanInterface` and `X33VListedBeanInterface`) |
| Module | `KKW00816SF` (Package: `eo.web.webview.KKW00816SF`) |

## 1. Role

### KKW00816SF02DBean.storeModelData()

This method serves as a centralized setter dispatcher (routing/dispatch pattern) within the K-Opticom web client framework's data binding layer. It enables generic model data setting — that is, it allows a calling screen or framework component to set bean properties by passing human-readable Japanese field names (keys) and sub-key descriptors, rather than invoking individual setters directly. This decouples the view layer from the exact property names on the bean, a pattern common in dynamic form rendering systems where field metadata is driven from a list of item names.

Specifically, the method handles three **option service** business data types: (1) **Option Service Contract Number** (`オプションサービス契約番号`), (2) **Option Service Contract Status** (`オプションサービス契約ステータス`), and (3) **Option Service Code** (`オプションサービスコード`). Each of these can store either a `value` (the data itself) or a `state` (a status/metadata flag). The method dispatches based on the `key` parameter to select which property group to write into, then dispatches again based on the `subkey` to set either the value or the state field within that group.

This method is a shared utility data bean method called by the Futurity X33 view framework's generic load/store model infrastructure. It is the counterpart to `loadModelData`, together forming a key-value based get/set abstraction over a fixed set of business fields. The `isSetAsString` parameter exists but is currently unused — likely added for future extensibility to support Long-type property value properties as String values.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["storeModelData(key, subkey, in_value, isSetAsString)"])

    START --> COND_NULL["key == null || subkey == null"]
    COND_NULL -->|true| EARLY_RETURN(["return (no-op)"])
    COND_NULL -->|false| COMPUTE["separaterPoint = key.indexOf('/')"]

    COMPUTE --> COND_KEY1["key equals 'オプションサービス契約番号'"]
    COND_KEY1 -->|true| SUBKEY1["subkey.equalsIgnoreCase('value')"]
    COND_KEY1 -->|false| COND_KEY2["key equals 'オプションサービス契約ステータス'"]
    COND_KEY2 -->|true| SUBKEY2["subkey.equalsIgnoreCase('value')"]
    COND_KEY2 -->|false| COND_KEY3["key equals 'オプションサービスコード'"]
    COND_KEY3 -->|true| SUBKEY3["subkey.equalsIgnoreCase('value')"]
    COND_KEY3 -->|false| END_NODE(["return (no-op)"])

    SUBKEY1 -->|true| SET1["setOp_svc_kei_no_value(in_value cast to String)"]
    SUBKEY1 -->|false| SET1_STATE["setOp_svc_kei_no_state(in_value cast to String)"]
    SUBKEY2 -->|true| SET2["setOp_svc_kei_stat_value(in_value cast to String)"]
    SUBKEY2 -->|false| SET2_STATE["setOp_svc_kei_stat_state(in_value cast to String)"]
    SUBKEY3 -->|true| SET3["setOp_svc_cd_value(in_value cast to String)"]
    SUBKEY3 -->|false| SET3_STATE["setOp_svc_cd_state(in_value cast to String)"]

    SET1 --> END_NODE
    SET1_STATE --> END_NODE
    SET2 --> END_NODE
    SET2_STATE --> END_NODE
    SET3 --> END_NODE
    SET3_STATE --> END_NODE
```

**Processing flow summary:**

1. **Null guard** — If `key` or `subkey` is `null`, the method exits immediately (no-op). This prevents `NullPointerException` in downstream setter calls.
2. **Separator computation** — Computes `separaterPoint` by searching for the `/` character in `key`. This variable is computed but never used (dead code).
3. **Key dispatch — Branch 1:** If the key equals `"オプションサービス契約番号"` (Option Service Contract Number), check the subkey:
   - `subkey.equalsIgnoreCase("value")` → calls `setOp_svc_kei_no_value((String)in_value)`. Sets the contract number value.
   - Otherwise (subkey is `"state"` or anything else) → calls `setOp_svc_kei_no_state((String)in_value)`. Sets the contract number state.
4. **Key dispatch — Branch 2:** If the key equals `"オプションサービス契約ステータス"` (Option Service Contract Status), check the subkey:
   - `subkey.equalsIgnoreCase("value")` → calls `setOp_svc_kei_stat_value((String)in_value)`. Sets the contract status value.
   - Otherwise → calls `setOp_svc_kei_stat_state((String)in_value)`. Sets the contract status state.
5. **Key dispatch — Branch 3:** If the key equals `"オプションサービスコード"` (Option Service Code), check the subkey:
   - `subkey.equalsIgnoreCase("value")` → calls `setOp_svc_cd_value((String)in_value)`. Sets the service code value.
   - Otherwise → calls `setOp_svc_cd_state((String)in_value)`. Sets the service code state.
6. **No match** — If none of the keys match, the method exits with no action (no-op).

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `key` | `String` | The human-readable Japanese field name that identifies which option service property group to set. Must be one of: "オプションサービス契約番号" (Option Service Contract Number), "オプションサービス契約ステータス" (Option Service Contract Status), or "オプションサービスコード" (Option Service Code). Determines which setter chain is invoked. |
| 2 | `subkey` | `String` | The property descriptor within the selected key group. Accepts "value" (to set the data value) or "state" (to set a status/metadata flag). Case-insensitive comparison via `equalsIgnoreCase`. |
| 3 | `in_value` | `Object` | The data to be stored. Cast to `String` before assignment. Represents the actual business data — e.g., a contract number, a status code, or a service code string. |
| 4 | `isSetAsString` | `boolean` | Flag indicating whether to set a Long-type item's Value property as a String value (per Javadoc: "Long型項目ValueプロパティへString型値の設定を行う場合true"). Currently **unused** in the method body — likely a legacy parameter for future extensibility or inherited from a parent class contract. |

**Instance fields read by this method:** None directly — only setter methods are called.

**Instance fields written by this method:**

| Field | Setter | Property Group |
|-------|--------|---------------|
| `op_svc_kei_no_value` | `setOp_svc_kei_no_value` | Contract number value |
| `op_svc_kei_no_state` | `setOp_svc_kei_no_state` | Contract number state |
| `op_svc_kei_stat_value` | `setOp_svc_kei_stat_value` | Contract status value |
| `op_svc_kei_stat_state` | `setOp_svc_kei_stat_state` | Contract status state |
| `op_svc_cd_value` | `setOp_svc_cd_value` | Service code value |
| `op_svc_cd_state` | `setOp_svc_cd_state` | Service code state |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| U | `setOp_svc_kei_no_value` | KKW00816SF02DBean | - | Sets the Option Service Contract Number value on this bean instance |
| U | `setOp_svc_kei_no_state` | KKW00816SF02DBean | - | Sets the Option Service Contract Number state on this bean instance |
| U | `setOp_svc_kei_stat_value` | KKW00816SF02DBean | - | Sets the Option Service Contract Status value on this bean instance |
| U | `setOp_svc_kei_stat_state` | KKW00816SF02DBean | - | Sets the Option Service Contract Status state on this bean instance |
| U | `setOp_svc_cd_value` | KKW00816SF02DBean | - | Sets the Option Service Code value on this bean instance |
| U | `setOp_svc_cd_state` | KKW00816SF02DBean | - | Sets the Option Service Code state on this bean instance |

**Analysis:** This method performs **no database or external service operations**. All six called methods are intra-bean setter calls that update internal instance fields of the `KKW00816SF02DBean` data bean. This is a pure in-memory data mutation operation — a write (U) to bean state. There is no direct entity or database table involvement. Any database impact would occur later when the containing screen or CBS persists the bean to a backend system.

## 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: `setOp_svc_cd_state` [-], `setOp_svc_cd_value` [-], `setOp_svc_kei_stat_state` [-], `setOp_svc_kei_stat_value` [-], `setOp_svc_kei_no_state` [-], `setOp_svc_kei_no_value` [-]

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Method: `KKW00816SF02DBean.storeModelData(String, String, Object)` (overload) | `storeModelData(gamenId, key, subkey, in_value)` -> `storeModelData(key, subkey, in_value)` -> `storeModelData(key, subkey, in_value, false)` | `setOp_svc_kei_no_value [-]` / `setOp_svc_kei_no_state [-]` / `setOp_svc_kei_stat_value [-]` / `setOp_svc_kei_stat_state [-]` / `setOp_svc_cd_value [-]` / `setOp_svc_cd_state [-]` |
| 2 | Method: `KKW00816SF02DBean.storeModelData(String, String, Object, boolean)` (self — 4-arg variant with `isSetAsString`) | `storeModelData(key, subkey, in_value, isSetAsString)` | `setOp_svc_kei_no_value [-]` / `setOp_svc_kei_no_state [-]` / `setOp_svc_kei_stat_value [-]` / `setOp_svc_kei_stat_state [-]` / `setOp_svc_cd_value [-]` / `setOp_svc_cd_state [-]` |

**Notes:** Both callers are internal bean overloads. The 3-argument overload delegates to the 4-argument version with `isSetAsString=false`. The 4-argument overload is the primary entry point and may be called from the Futurity X33 view framework's generic model data binding infrastructure or from the companion `loadModelData` method's inverse operations. No direct screen entry points (e.g., `KKSV*` classes) were found within 8 hops.

## 6. Per-Branch Detail Blocks

**Block 1** — IF (null guard) `(key == null || subkey == null)` (L239)

Guard clause: prevents `NullPointerException` by exiting early when key or subkey is null.

| # | Type | Code |
|---|------|------|
| 1 | COND | `if(key == null || subkey == null)` |
| 2 | RETURN | `return;` // Processing abort if key or subkey is null (key,subkeyがnullの場合、処理を中止) |

**Block 2** — EXEC (separator computation) (L241)

Computes the index of the first `/` character in key. Note: this variable is never used — dead code.

| # | Type | Code |
|---|------|------|
| 1 | SET | `int separaterPoint = key.indexOf("/");` // Computes index of '/' separator in key (unused variable) |

**Block 3** — IF-ELSE-IF — Key dispatch for "オプションサービス契約番号" (Option Service Contract Number) (L244)

Dispatches setter calls for the Option Service Contract Number property group. The `value` subkey sets the contract number, while `state` sets its status.

| # | Type | Code |
|---|------|------|
| 1 | COND | `if(key.equals("オプションサービス契約番号"))` // key is Option Service Contract Number (オプションサービス契約番号) [項目ID: op_svc_kei_no] |
| 2 | IF | — See Block 3.1 below |
| 3 | ELSE-IF | — See Block 4 below (key equals "オプションサービス契約ステータス") |
| 4 | ELSE-IF | — See Block 5 below (key equals "オプションサービスコード") |
| 5 | ELSE | (implicit) — fall through to method end, no-op |

**Block 3.1** — IF-ELSE — Subkey dispatch within "オプションサービス契約番号" (L245)

| # | Type | Code |
|---|------|------|
| 1 | COND | `if(subkey.equalsIgnoreCase("value"))` // subkey is "value" (case-insensitive) |
| 2 | EXEC | `setOp_svc_kei_no_value((String)in_value);` // Sets the Option Service Contract Number value |
| 3 | ELSE-IF | — See Block 3.2 below |

**Block 3.2** — ELSE — Subkey "state" within "オプションサービス契約番号" (L248)

| # | Type | Code |
|---|------|------|
| 1 | COND | `else if(subkey.equalsIgnoreCase("state"))` // subkey is "state" (case-insensitive) |
| 2 | EXEC | `setOp_svc_kei_no_state((String)in_value);` // Returns status when subkey is "state" (subkeyが"state"の場合、ステータスを返す) |

**Block 4** — IF-ELSE-IF — Key dispatch for "オプションサービス契約ステータス" (Option Service Contract Status) (L251)

Dispatches setter calls for the Option Service Contract Status property group. This group holds the current status/metadata of the service contract.

| # | Type | Code |
|---|------|------|
| 1 | COND | `else if(key.equals("オプションサービス契約ステータス"))` // key is Option Service Contract Status (オプションサービス契約ステータス) [項目ID: op_svc_kei_stat] |
| 2 | IF | — See Block 4.1 below |
| 3 | ELSE-IF | — See Block 4.2 below |
| 4 | ELSE-IF | — See Block 5 below (key equals "オプションサービスコード") |
| 5 | ELSE | (implicit) — fall through to method end, no-op |

**Block 4.1** — IF-ELSE — Subkey dispatch within "オプションサービス契約ステータス" (L252)

| # | Type | Code |
|---|------|------|
| 1 | COND | `if(subkey.equalsIgnoreCase("value"))` // subkey is "value" (case-insensitive) |
| 2 | EXEC | `setOp_svc_kei_stat_value((String)in_value);` // Sets the Option Service Contract Status value |
| 3 | ELSE-IF | — See Block 4.2 below |

**Block 4.2** — ELSE — Subkey "state" within "オプションサービス契約ステータス" (L255)

| # | Type | Code |
|---|------|------|
| 1 | COND | `else if(subkey.equalsIgnoreCase("state"))` // subkey is "state" (case-insensitive) |
| 2 | EXEC | `setOp_svc_kei_stat_state((String)in_value);` // Returns status when subkey is "state" (subkeyが"state"の場合、ステータスを返す) |

**Block 5** — IF-ELSE-IF — Key dispatch for "オプションサービスコード" (Option Service Code) (L258)

Dispatches setter calls for the Option Service Code property group. This group identifies the specific option service being configured.

| # | Type | Code |
|---|------|------|
| 1 | COND | `else if(key.equals("オプションサービスコード"))` // key is Option Service Code (オプションサービスコード) [項目ID: op_svc_cd] |
| 2 | IF | — See Block 5.1 below |
| 3 | ELSE-IF | — See Block 5.2 below |
| 4 | ELSE | (implicit) — fall through to method end, no-op |

**Block 5.1** — IF-ELSE — Subkey dispatch within "オプションサービスコード" (L259)

| # | Type | Code |
|---|------|------|
| 1 | COND | `if(subkey.equalsIgnoreCase("value"))` // subkey is "value" (case-insensitive) |
| 2 | EXEC | `setOp_svc_cd_value((String)in_value);` // Sets the Option Service Code value |
| 3 | ELSE-IF | — See Block 5.2 below |

**Block 5.2** — ELSE — Subkey "state" within "オプションサービスコード" (L262)

| # | Type | Code |
|---|------|------|
| 1 | COND | `else if(subkey.equalsIgnoreCase("state"))` // subkey is "state" (case-insensitive) |
| 2 | EXEC | `setOp_svc_cd_state((String)in_value);` // Returns status when subkey is "state" (subkeyが"state"の場合、ステータスを返す) |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `オプションサービス契約番号` | Japanese literal | Option Service Contract Number — the identifier for an option service line item in a telecom contract. Maps to internal field `op_svc_kei_no`. |
| `オプションサービス契約ステータス` | Japanese literal | Option Service Contract Status — the current lifecycle/status state of an option service contract line item. Maps to internal field `op_svc_kei_stat`. |
| `オプションサービスコード` | Japanese literal | Option Service Code — the code identifying a specific option service (e.g., additional line, supplementary feature). Maps to internal field `op_svc_cd`. |
| `op_svc_kei_no` | Field | Option Service Contract Number — internal tracking ID for a service contract line item. Kei (契約) = contract, No (番号) = number. |
| `op_svc_kei_stat` | Field | Option Service Contract Status — status metadata for a service contract line item. Stat (ステータス) = status. |
| `op_svc_cd` | Field | Option Service Code — code identifying the type of option service. CD (コード) = code. |
| `op_svc_kei_no_value` | Field | The actual contract number string value for an option service line item. |
| `op_svc_kei_no_state` | Field | The state/metadata flag for an option service contract number. |
| `op_svc_kei_stat_value` | Field | The actual status string value for an option service contract. |
| `op_svc_kei_stat_state` | Field | The state/metadata flag for an option service contract status. |
| `op_svc_cd_value` | Field | The actual service code string value. |
| `op_svc_cd_state` | Field | The state/metadata flag for an option service code. |
| key | Parameter | Human-readable Japanese field name used as a routing dispatch key. |
| subkey | Parameter | Property descriptor within a key group: "value" for data, "state" for metadata. |
| isSetAsString | Parameter | Legacy/experimental flag for setting Long-type property values as String (currently unused). |
| `separaterPoint` | Variable | Index of the first '/' character in key. **Unused** — dead code, likely a remnant of a planned nested key syntax (e.g., "group/field"). |
| X33 | Technical term | Fujitsu Futurity X33 — Java web application framework used for building the web client. Provides the view bean infrastructure (`X33VViewBaseBean`, `X33VDataTypeBeanInterface`). |
| `X33VDataTypeBeanInterface` | Interface | Futurity interface marking a bean as capable of type-safe data binding with the view layer. |
| `X33VListedBeanInterface` | Interface | Futurity interface marking a bean as supporting list/row-based data binding. |
| KKW00816SF | Module | Internal module code — K-Opticom web screen module for option service management (SF likely = Screen Function). |
| `KKW00816SF02DBean` | Class | Data bean for screen KKW00816SF. The "02D" suffix typically denotes a data/detail-level bean in the K-Opticom naming convention. |
