# Business Logic — FUW00116SF02DBean.storeModelData() [21 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.FUW00116SF.FUW00116SF02DBean` |
| Layer | Web View Bean (Controller / Presentation tier — `eo.web.webview` package) |
| Module | `FUW00116SF` (Package: `eo.web.webview.FUW00116SF`) |

## 1. Role

### FUW00116SF02DBean.storeModelData()

This method is a **data model routing and dispatching utility** within the X33 web framework's data-binding infrastructure. Its business purpose is to set textual free-form replacement content data onto bean fields based on the incoming key/subkey identification pair. Specifically, it resolves the key `本文非定型置換文字` ("Original Free-form Replacement Text") and routes the `in_value` payload to the correct typed setter method depending on whether the subkey identifies the data value itself (`value`) or the display state indicator (`state`). This follows a **routing/dispatch design pattern** where a unified entry point (`storeModelData`) delegates to type-specific setters (`setText_htk_ckam_moji_value`, `setText_htk_ckam_moji_state`) based on string-matched metadata keys.

The method serves as a **shared framework utility** — it is part of `X33VDataTypeBeanInterface` / `X31CBaseBean` contract, enabling the X33 web framework's generic model-loading mechanism to push HTTP/request data into typed bean properties without requiring the screen-layer code to know about individual field names. The method has two processing branches: if both `key` and `subkey` are null, it performs a no-op early return; otherwise, it matches the key string to dispatch to the appropriate setter for the free-form replacement text field.

## 2. Processing Pattern (Detailed Business Logic)

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

    START --> CHECK_NULL{"key == null or subkey == null"}

    CHECK_NULL -->|Yes| EARLY_RETURN["Early return no-op"]
    CHECK_NULL -->|No| FIND_SLASH["Find separator index in key"]

    FIND_SLASH --> CHECK_KEY{"key equals 本文非定型置換文字"}

    CHECK_KEY -->|No| END_NODE(["End no processing"])
    CHECK_KEY -->|Yes| CHECK_SUBVALUE{"subkey equals value"}

    CHECK_SUBVALUE -->|Yes| SET_VALUE["setText_htk_ckam_moji_value cast in_value"]
    CHECK_SUBVALUE -->|No| CHECK_SUBSTATE{"subkey equals state"}

    CHECK_SUBSTATE -->|Yes| SET_STATE["setText_htk_ckam_moji_state cast in_value"]
    CHECK_SUBSTATE -->|No| END_NODE

    SET_VALUE --> END_NODE
    SET_STATE --> END_NODE
    END_NODE --> DONE(["Return void"])
```

**Processing flow summary:**

1. **Null-guard**: If `key` or `subkey` is null, the method exits immediately (no-op). This protects downstream operations from `NullPointerException` and allows the framework to silently skip unset fields.
2. **Separator scan**: The method scans `key` for a `/` character separator (`indexOf`). This separator is used by the X33 framework for scoped model keys but is not used to branch processing within this particular override — the key is matched as a whole string literal.
3. **Key dispatch**: If `key` equals the Japanese string literal `本文非定型置換文字` ("Original Free-form Replacement Text"), the method enters the data-setting branch.
4. **Subkey routing**: Within the matching key branch, a case-insensitive comparison on `subkey` determines which setter to invoke:
   - `value` (case-insensitive) → sets the replacement text content via `setText_htk_ckam_moji_value`
   - `state` (case-insensitive) → sets the display state via `setText_htk_ckam_moji_state`
5. **Fallback**: If neither subkey matches, the method completes without setting any data (the else branch falls through to end).

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `key` | `String` | Item name (項目名) — the business field identifier used to route data to the correct bean property. When equal to `本文非定型置換文字` ("Original Free-form Replacement Text"), it triggers the free-form text replacement data routing. Can also carry scoped keys with `/` separators (handled by framework conventions). |
| 2 | `subkey` | `String` | Sub-key (サブキー) — a qualifier that narrows which attribute of the identified field to set. Typically `"value"` (to set the actual text content) or `"state"` (to set the display/validity state). Case-insensitive comparison is used, so `"VALUE"`, `"Value"`, and `"value"` are all treated equivalently. |
| 3 | `in_value` | `Object` | Data payload (データ) — the actual data value to be assigned to the bean field. Cast to `String` at the call site of the setter methods. Represents the replacement text content or state string. |
| 4 | `isSetAsString` | `boolean` | Flag indicating whether to set the value as a String type on Long-type item Value properties. `true` means the value should be stored as a string even if the target property is of Long type. This parameter is accepted for API compatibility with the base class but is not used in the method body. |

**Instance fields read:** None directly within this method. The method operates on the `this` bean instance through its setter methods (`setText_htk_ckam_moji_value`, `setText_htk_ckam_moji_state`), which write to private backing fields defined in the class (specifically `htk_ckam_moji_value` and `htk_ckam_moji_state`).

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| U | `setText_htk_ckam_moji_value(String)` | FUW00116SF02DBean | — | Sets the free-form replacement text content (本文非定型置換文字) on the bean — Update bean property |
| U | `setText_htk_ckam_moji_state(String)` | FUW00116SF02DBean | — | Sets the display state flag for the free-form replacement text item — Update bean property |

**Classification rationale:**

Both called methods are **Update (U)** operations because they set (write) values onto bean properties. They are **not** database or entity operations — they are in-memory bean state mutations performed as part of the X33 framework's model-loading contract. No SC (Service Component) or CBS (Business Service) codes are involved; this method operates purely at the presentation-layer bean level.

## 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: `setText_htk_ckam_moji_state` [-], `setText_htk_ckam_moji_value` [-]

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Method: `FUW00116SF02DBean.storeModelData(gamenId, key, subkey, in_value)` | Direct overload → `storeModelData(key, subkey, in_value, isSetAsString)` | `setText_htk_ckam_moji_value [U] htk_ckam_moji_value`, `setText_htk_ckam_moji_state [U] htk_ckam_moji_state` |

**Notes:**
- The `FUW00116SF02DBean` class contains an overloaded variant of `storeModelData` that accepts an additional `gamenId` (画面ID, screen ID) parameter and delegates to the 4-parameter version. This is a legacy X31CBaseBean compatibility overload.
- No screen (KKSV*) or batch entry points were found calling this method directly within the analysis depth. The method is part of the X33 framework contract and is invoked through the generic model-loading mechanism (`X33VLoadModel`), not through explicit business-layer call chains.

## 6. Per-Branch Detail Blocks

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

> Null guard: abort processing if either the item name or sub-key is null. This prevents null pointer exceptions and allows the framework to safely call this method for unset form fields.

| # | Type | Code |
|---|------|------|
| 1 | SET | `return` — Early exit; no data is set when key or subkey is null | [コメント: key, subkey がnullの場合、処理を中止 — "If key/subkey are null, abort processing"] |

---

**Block 2** — [EXEC] `(separator index scan)` (L163)

> Scan the key string for a `/` separator character. This is part of the X33 framework's scoped key convention but the result is not used to branch logic in this method.

| # | Type | Code |
|---|------|------|
| 1 | SET | `int separaterPoint = key.indexOf("/")` | [コメントなし — no inline comment] |

---

**Block 3** — [IF] `(key equals "本文非定型置換文字")` (L167) [CONSTANT: `本文非定型置換文字` = "Original Free-form Replacement Text"]

> The core routing block. When the item key matches the Japanese string literal for the free-form replacement text item name, dispatch to the appropriate setter based on the subkey.

| # | Type | Code |
|---|------|------|
| 1 | IF | `key.equals("本文非定型置換文字")` — Branch into Blocks 3.1 and 3.2 [コメント: 項目ごとに処理を入れる — "Process per item"; コメント: データタイプがStringの項目"本文非定型置換文字"(項目ID:text_htk_ckam_moji) — "The data type is a String field 'Original Free-form Replacement Text' (item ID: text_htk_ckam_moji)"] |

---

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

> Set the replacement text content. Cast the incoming Object payload to String and pass it to the typed setter.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `setText_htk_ckam_moji_value((String)in_value)` — Sets the free-form replacement text value [コメントなし — no inline comment] |

---

**Block 3.2** — [ELSE-IF] `(subkey.equalsIgnoreCase("state"))` (L170) [CONSTANT: `state` = "state" (case-insensitive)]

> Set the display state of the free-form replacement text item. When the subkey is `"state"`, the state string is stored.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `setText_htk_ckam_moji_state((String)in_value)` — Sets the display state [コメント: subkey が"state"の場合、ステータスを返す。 — "If subkey is 'state', return/set the state."] |

---

**Block 3.2 (else branch)** — [ELSE] (implicit fall-through L172)

> If the key matches but neither "value" nor "state" subkey is provided, the method silently completes without action. No setter is invoked and no data is set.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | Fall-through — no processing for unrecognized subkey values |

---

**Block 4** — [ELSE-IF / ELSE] `(key does not match "本文非定型置換文字")` (implicit, post-Block 3)

> When the key does not match the expected item name, no processing occurs. The method completes as a no-op. This is the default path for any unrecognized key values.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | Fall-through — no processing for unrecognized key |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `本文非定型置換文字` | Field (Japanese) | Original Free-form Replacement Text — a free-form text field used for custom/unstructured text substitution in the business process. The item ID mapped internally is `text_htk_ckam_moji`. |
| `text_htk_ckam_moji` | Field (internal ID) | Internal item identifier for the free-form replacement text field. Used in constant lists and data model definitions across the application. |
| `htk_ckam_moji_value` | Field (internal) | Backing field for the replacement text content value. |
| `htk_ckam_moji_state` | Field (internal) | Backing field for the display state flag of the replacement text item. |
| `gamenId` | Field (Japanese) | Screen ID (画面ID) — reserved parameter in the overloaded version of `storeModelData`. Currently unused (備予). |
| X33 Framework | Technical | Fujitsu Futurity X33 web application framework providing data-binding, model loading, and view bean infrastructure (`X33VViewBaseBean`, `X33VDataTypeBeanInterface`). |
| X31CBaseBean | Technical | Base class (`com.fujitsu.futurity.web.x31.X31CBaseBean`) providing generic model data storage and retrieval methods that `FUW00116SF02DBean` overrides. |
| `storeModelData` | Method | Framework model-loading callback — invoked by X33's `X33VLoadModel` to push request/form data into bean fields by key name. |
| `listKoumokuIds` | Method | Returns the list of valid item names (項目名のリスト) supported by this bean. Currently returns only `本文非定型置換文字`. |
| case-insensitive | Technical | String comparison using `equalsIgnoreCase()` rather than `equals()`, allowing subkey values like `"VALUE"`, `"Value"`, or `"value"` to all match. |
