# Business Logic — KKW02516SF02DBean.typeModelData() [33 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.KKA16801SF.KKW02516SF02DBean` |
| Layer | Utility (DBean — Data Type Bean, part of the X33 Web Client Framework for runtime type resolution) |
| Module | `KKA16801SF` (Package: `eo.web.webview.KKA16801SF`) |

## 1. Role

### KKW02516SF02DBean.typeModelData()

This method is a **data type resolver** within the Fujitsu X33 Web Client Framework. It determines the Java runtime type (`Class<?>`) for individual fields within the "異動理由リスト" (Move Reason List) screen component. The "異動理由" (ido_rsn - move/change reason) refers to a repeatable list of reasons why a service contract line item was moved, changed, or had its status altered — a common concept in Japanese telecom order management systems where service changes, cancellations, or transfers are tracked with detailed reason codes and free-form memo fields.

The method implements the **X33VDataTypeBeanInterface** contract: when the X33 framework builds or validates the page model at runtime, it calls `typeModelData` to learn what Java type each list item field expects. This enables the framework's data binding engine to automatically create, populate, and validate form inputs without hardcoding type metadata. The method uses a **routing/dispatch design pattern**, branching on the `key` (field name) and `subkey` (field property) to return the appropriate type information.

Only two fields are supported: "異動理由コード" (Move Reason Code — `ido_rsn_cd`) and "異動理由メモ" (Move Reason Memo — `ido_rsn_memo`). Both fields support the same two subkeys: `value` (the actual field value) and `state` (the field's validation/display state, such as whether it's read-only, required, or has an error). Both subkeys resolve to `String.class`. For any unrecognized field or subkey combination, the method returns `null`, signaling the framework to skip type resolution for that field.

This is a **shared utility** called by the parent screen bean's type model dispatch mechanism, not a direct entry point for any screen flow. It operates entirely in the view layer with no business logic or data access.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["typeModelData key, subkey"])
    CHECK_NULL{"key or subkey is null"}
    FIND_SEP["separaterPoint = key.indexOf('/')"]
    CHECK_IDO_RSN_CD{"key equals '異動理由コード'"}
    CHECK_IDO_RSN_CD_VALUE{"subkey equals 'value'"}
    CHECK_IDO_RSN_CD_STATE{"subkey equals 'state'"}
    RETURN_STRING_1["return String.class"]
    CHECK_IDO_RSN_MEMO{"key equals '異動理由メモ'"}
    CHECK_IDO_RSN_MEMO_VALUE{"subkey equals 'value'"}
    CHECK_IDO_RSN_MEMO_STATE{"subkey equals 'state'"}
    RETURN_STRING_2["return String.class"]
    RETURN_NULL["return null"]
    END_NODE(["End"])
    START --> CHECK_NULL
    CHECK_NULL -->|Yes| RETURN_NULL
    CHECK_NULL -->|No| FIND_SEP
    FIND_SEP --> CHECK_IDO_RSN_CD
    CHECK_IDO_RSN_CD -->|Yes| CHECK_IDO_RSN_CD_VALUE
    CHECK_IDO_RSN_CD_VALUE -->|Yes| RETURN_STRING_1
    CHECK_IDO_RSN_CD_VALUE -->|No| CHECK_IDO_RSN_CD_STATE
    CHECK_IDO_RSN_CD_STATE -->|Yes| RETURN_STRING_2
    CHECK_IDO_RSN_CD_STATE -->|No| RETURN_NULL
    CHECK_IDO_RSN_CD -->|No| CHECK_IDO_RSN_MEMO
    CHECK_IDO_RSN_MEMO -->|Yes| CHECK_IDO_RSN_MEMO_VALUE
    CHECK_IDO_RSN_MEMO_VALUE -->|Yes| RETURN_STRING_2
    CHECK_IDO_RSN_MEMO_VALUE -->|No| CHECK_IDO_RSN_MEMO_STATE
    CHECK_IDO_RSN_MEMO_STATE -->|Yes| RETURN_STRING_2
    CHECK_IDO_RSN_MEMO_STATE -->|No| RETURN_NULL
    CHECK_IDO_RSN_MEMO -->|No| RETURN_NULL
    RETURN_NULL --> END_NODE
    RETURN_STRING_1 --> END_NODE
    RETURN_STRING_2 --> END_NODE
```

**Branch summary:**

| Branch | Condition | Result |
|--------|-----------|--------|
| Null-guard | `key == null || subkey == null` | `null` (early exit) |
| Move Reason Code — value | `key == "異動理由コード"` AND `subkey.equalsIgnoreCase("value")` | `String.class` |
| Move Reason Code — state | `key == "異動理由コード"` AND `subkey.equalsIgnoreCase("state")` | `String.class` |
| Move Reason Memo — value | `key == "異動理由メモ"` AND `subkey.equalsIgnoreCase("value")` | `String.class` |
| Move Reason Memo — state | `key == "異動理由メモ"` AND `subkey.equalsIgnoreCase("state")` | `String.class` |
| Fallback | No condition matched | `null` |

**Note:** The variable `separaterPoint` (computed as `key.indexOf("/")`) is declared but **never used** in subsequent logic. It appears to be a vestigial variable from an earlier implementation that once used the slash separator to route between fields, but was replaced by explicit string equality checks.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `key` | `String` | The **field name** (項目名) within the "異動理由リスト" (Move Reason List) repeated section. Identifies which field's type to resolve. Possible values: `"異動理由コード"` (Move Reason Code — the structured code for the change reason) or `"異動理由メモ"` (Move Reason Memo — free-text explanation of the change reason). Any other value results in `null` return. |
| 2 | `subkey` | `String` | The **field property** (サブキー) specifying which aspect of the field's data type to return. Possible values: `"value"` (the actual data value stored in the field) or `"state"` (the field's validation/display state — e.g., whether it is enabled, read-only, or has an error). Comparison is case-insensitive via `equalsIgnoreCase`. Any unrecognized value falls through to `null`. |

**Instance fields / external state:** None read by this method. The method is entirely stateless.

## 4. CRUD Operations / Called Services

This method performs **no CRUD operations**. It contains no method calls to services, CBS components, or data access layers. It performs only local field comparisons and returns a `Class<?>` type reference.

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| *(N/A)* | — | — | — | This method is a pure type-resolver with no data access or service calls. |

**Called method analysis:** No methods are called within this method body. The only operations are:
- `String.indexOf(String)` — local string operation (L247)
- `String.equals(String)` — local string comparison (L250, L258)
- `String.equalsIgnoreCase(String)` — case-insensitive local comparison (L251, L255, L260, L264)
- `return` — return type references (L243, L245, L252, L256, L261, L265, L268)

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Screen:KKA16801SF | `KKW02516SFBean.typeModelData(String key, String subkey)` → `KKW02516SF02DBean.typeModelData(key, subkey)` | *(none — type resolver only)* |
| 2 | Screen:KKA16801SF | `KKW02516SFBean.typeModelData(String gamenId, String key, String subkey)` → `KKW02516SFBean.typeModelData(key, subkey)` → `KKW02516SF02DBean.typeModelData(key, subkey)` | *(none — type resolver only)* |

**Note:** This method is **not directly called by any screen entry point**. It is invoked indirectly by the X33 framework's type introspection mechanism through the parent bean `KKW02516SFBean`. The `KKW02516SFBean` has its own `typeModelData` method (L2033–L2115) which dispatches to sub-beans like `KKW02516SF02DBean` when processing repeat-type list items. The framework calls the bean's type model during page model initialization for data binding validation.

## 6. Per-Branch Detail Blocks

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

> Null guard: If either parameter is null, return null immediately. This prevents NullPointerException on subsequent string operations.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return null;` // key or subkey is null — no type to resolve (null null null null) |

**Block 2** — [EXEC] `(key.indexOf("/"))` (L247)

> Computes the position of a slash character in the key. This value is stored but never used — likely a vestigial variable from an earlier routing implementation.

| # | Type | Code |
|---|------|------|
| 1 | SET | `int separaterPoint = key.indexOf("/");` // Find slash position (unused) |

**Block 3** — [IF — Field: "異動理由コード" (Move Reason Code)] `(key.equals("異動理由コード"))` (L250)

> Handles the structured move reason code field (`ido_rsn_cd`). This field holds a coded reason for a service contract line item change (e.g., customer request, system error, maintenance window).

| # | Type | Code |
|---|------|------|
| 1 | IF | `if(subkey.equalsIgnoreCase("value"))` // subkey is 'value' |
| 2 | RETURN | `return String.class;` // The field value is a String |
| 3 | ELSE-IF | `else if(subkey.equalsIgnoreCase("state"))` // subkey is 'state' — return field status (L255) |
| 4 | RETURN | `return String.class;` // The field state (enabled/error/etc.) is a String |

**Block 3.1** — [ELSE-IF] `(subkey.equalsIgnoreCase("value"))` (L251)

> When the subkey asks for the actual value of the Move Reason Code field, return String.class.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return String.class;` // Value of '異動理由コード' is a String |

**Block 3.2** — [ELSE-IF] `(subkey.equalsIgnoreCase("state"))` (L255)

> When the subkey asks for the validation/display state of the Move Reason Code field, return String.class.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return String.class;` // State of '異動理由コード' is a String — subkey that is 'state' (null null null null) |

**Block 4** — [ELSE-IF — Field: "異動理由メモ" (Move Reason Memo)] `(key.equals("異動理由メモ"))` (L258)

> Handles the free-text memo field (`ido_rsn_memo`) associated with the move reason. This field allows operators to enter a detailed explanation of why a service change occurred, complementing the structured code in "異動理由コード".

| # | Type | Code |
|---|------|------|
| 1 | IF | `if(subkey.equalsIgnoreCase("value"))` // subkey is 'value' |
| 2 | RETURN | `return String.class;` // The field value is a String |
| 3 | ELSE-IF | `else if(subkey.equalsIgnoreCase("state"))` // subkey is 'state' — return field status (L263) |
| 4 | RETURN | `return String.class;` // The field state (enabled/error/etc.) is a String |

**Block 4.1** — [ELSE-IF] `(subkey.equalsIgnoreCase("value"))` (L259)

> When the subkey asks for the actual value of the Move Reason Memo field, return String.class.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return String.class;` // Value of '異動理由メモ' is a String |

**Block 4.2** — [ELSE-IF] `(subkey.equalsIgnoreCase("state"))` (L263)

> When the subkey asks for the validation/display state of the Move Reason Memo field, return String.class.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return String.class;` // State of '異動理由メモ' is a String — subkey that is 'state' (null null null null) |

**Block 5** — [ELSE — No matching field] (L268)

> No condition matched — the key does not correspond to any supported field in this DBean. Return null to signal the framework that this field is not managed by this type bean.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return null;` // No matching property found — return null (null null null null) |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `異動理由コード` | Japanese field name | Move Reason Code — the display field name (項目名) for the structured reason code. Maps to the internal field ID `ido_rsn_cd`. Holds a coded value that classifies why a service contract line item was moved or changed. |
| `異動理由メモ` | Japanese field name | Move Reason Memo — the display field name (項目名) for free-text explanation of the reason. Maps to the internal field ID `ido_rsn_memo`. Operators enter detailed narrative explanations here. |
| `異動理由リスト` | Japanese field name | Move Reason List — the display name for the repeatable list item section containing the reason code and memo fields. Maps to the internal field ID `ido_rsn_list`. |
| `key` | Field | Field name (項目名) — identifies which field within the DBean's data model is being queried for its type information. |
| `subkey` | Field | Sub-key (サブキー) — identifies which property aspect of the field (e.g., the value itself vs. its validation state). |
| `value` | Subkey value | The actual data value stored in the field. |
| `state` | Subkey value | The field's validation/display state (e.g., enabled, read-only, error, required). Used by the X33 framework to control UI behavior. |
| X33 | Acronym | Futurity X33 — Fujitsu's enterprise web application framework (com.fujitsu.futurity.web.x33) providing page model, data binding, and validation infrastructure. |
| DBean | Acronym | Data Bean — an X33 framework class that manages data for a specific screen component, implementing interfaces like `X33VDataTypeBeanInterface` for type introspection. |
| KKW02516SF02DBean | Class | The second data-type sub-bean of screen KKA16801SF, responsible specifically for the "Move Reason List" (異動理由リスト) repeat section. |
| KKA16801SF | Screen ID | A web screen in the K-Opticom telecom order management system. SF suffix typically denotes "Service Form" — a data entry/view screen for service contract operations. |
| String.class | Java type | The Java `java.lang.String` class object, returned to tell the X33 framework that the field holds text data. |
| `ido_rsn_cd` | Internal field ID | Database/bean field ID for Move Reason Code. The `cd` suffix stands for "code." |
| `ido_rsn_memo` | Internal field ID | Database/bean field ID for Move Reason Memo. The `memo` suffix indicates free-text notes. |
| `ido_rsn_list` | Internal field ID | Database/bean field ID for the Move Reason List repeat section. |
| K-Opticom | Company name | NTT Group's wholesale fiber optic telecommunications provider in Japan. This system supports their service order management operations. |
| `separaterPoint` | Variable | Unused local variable holding the position of "/" in `key`. A vestigial artifact from a prior routing implementation. |
| X33VDataTypeBeanInterface | Interface | X33 framework interface that type beans implement to provide runtime type information for framework-driven data binding and validation. |
