---
title: "Business Logic — KKW00816SF02DBean.loadModelData() [43 LOC]"
date: 2026-07-27
---

# Business Logic — KKW00816SF02DBean.loadModelData() [43 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.KKW00816SF.KKW00816SF02DBean` |
| Layer | UI / Data Bean (Webview — part of the X31C/X33V front-end framework layer) |
| Module | `KKW00816SF` (Package: `eo.web.webview.KKW00816SF`) |

## 1. Role

### KKW00816SF02DBean.loadModelData()

This method is the X33V data-type bean dispatcher responsible for loading model data for option service contract fields. In the enterprise UI framework, data-type beans implement `X33VDataTypeBeanInterface`, which requires this `loadModelData(String key, String subkey)` method. The method receives a `key` identifying the business item (option service contract number, status, or code) and a `subkey` specifying whether to return the current value or the processing state, then delegates to the appropriate getter.

The business domain is telecom service contract management: this bean specifically handles optional/add-on services (オプションサービス) attached to a primary service contract. It manages three data facets — the contract number, the contract status, and the service code — each exposed as value and state properties. The "state" properties are populated by the preceding CBS (Controller Back Service) layer during screen initialization, while the "value" properties hold the displayable data bound to the UI components.

The method implements the **routing/dispatch** design pattern, branching on the `key` string to determine the data category and then on the `subkey` to determine the property accessor. It is a **shared utility** within the KKW00816SF module — instantiated by the parent `KKW00816SFBean` for each row of the "Option Service Contract List" (オプションサービス契約リスト) data-type list item, allowing the framework to dynamically resolve field values during screen rendering.

Four branches are supported:
- **Contract number** (`オプションサービス契約番号`): returns value or state
- **Contract status** (`オプションサービス契約ステータス`): returns value or state
- **Service code** (`オプションサービスコード`): returns value or state
- **Unknown key**: returns `null` as a graceful fallback

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["loadModelData key, subkey"])
    
    COND1{"key == null || subkey == null"}
    START --> COND1
    COND1 -->|true| RET_NULL1["Return null"]
    
    SET_SEP["int separaterPoint = key.indexOf('/')"]
    COND1 -->|false| SET_SEP
    
    COND_KEY1{"key equals 'オプションサービス契約番号' (Option Service Contract Number)"}
    SET_SEP --> COND_KEY1
    COND_KEY1 -->|true| SUBKEY1{"subkey equalsIgnoreCase 'value'"}
    COND_KEY1 -->|false| COND_KEY2{"key equals 'オプションサービス契約ステータス' (Option Service Contract Status)"}
    
    SUBKEY1 -->|true| RET_VAL1["Return getOp_svc_kei_no_value()"]
    SUBKEY1 -->|false| RET_STATE1["Return getOp_svc_kei_no_state()"]
    
    COND_KEY2 -->|true| SUBKEY2{"subkey equalsIgnoreCase 'value'"}
    COND_KEY2 -->|false| COND_KEY3{"key equals 'オプションサービスコード' (Option Service Code)"}
    
    SUBKEY2 -->|true| RET_VAL2["Return getOp_svc_kei_stat_value()"]
    SUBKEY2 -->|false| RET_STATE2["Return getOp_svc_kei_stat_state()"]
    
    COND_KEY3 -->|true| SUBKEY3{"subkey equalsIgnoreCase 'value'"}
    COND_KEY3 -->|false| RET_NULL2["Return null"]
    
    SUBKEY3 -->|true| RET_VAL3["Return getOp_svc_cd_value()"]
    SUBKEY3 -->|false| RET_STATE3["Return getOp_svc_cd_state()"]
    
    RET_NULL1 --> END(["End"])
    RET_VAL1 --> END
    RET_STATE1 --> END
    RET_VAL2 --> END
    RET_STATE2 --> END
    RET_VAL3 --> END
    RET_STATE3 --> END
    RET_NULL2 --> END
```

**Processing flow:**

1. **Null guard** — If `key` or `subkey` is `null`, return `null` immediately. This is a defensive check to prevent `NullPointerException` in the calling framework.
2. **Separator detection** — Compute `separaterPoint = key.indexOf("/")`. This value is assigned but never used within this method; it appears to be reserved for future feature support where `key` might include a nested path segment separated by a forward slash.
3. **Branch 1 — Contract number** — If `key` equals the Japanese literal `"オプションサービス契約番号"` (Option Service Contract Number), check the `subkey`: `"value"` (case-insensitive) returns the contract number value; `"state"` returns the processing state.
4. **Branch 2 — Contract status** — If `key` equals `"オプションサービス契約ステータス"` (Option Service Contract Status), check the `subkey`: `"value"` returns the status value; `"state"` returns the processing state.
5. **Branch 3 — Service code** — If `key` equals `"オプションサービスコード"` (Option Service Code), check the `subkey`: `"value"` returns the code value; `"state"` returns the processing state.
6. **Fallback** — If none of the keys match, return `null`.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `key` | `String` | The item name (日本語: 項目名) identifying which data facet to retrieve. Determines the routing branch. Expected values are Japanese UI display labels: `"オプションサービス契約番号"` (Option Service Contract Number), `"オプションサービス契約ステータス"` (Option Service Contract Status), or `"オプションサービスコード"` (Option Service Code). The method also computes `key.indexOf("/")` (unused), suggesting future support for composite key paths. |
| 2 | `subkey` | `String` | The sub-property name (日本語: サブキー) specifying which attribute of the data facet to return. Valid values are `"value"` (the current data value) or `"state"` (the processing state — typically set by CBS layer to indicate success/failure/warning). The comparison is case-insensitive via `equalsIgnoreCase`. |

**Instance fields read:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `op_svc_kei_no_value` | `String` | Option service contract number value — the actual contract number for the optional service line item |
| `op_svc_kei_no_state` | `String` | Option service contract number state — processing state flag set by CBS (e.g., success, error, warning) |
| `op_svc_kei_stat_value` | `String` | Option service contract status value — the current status of the optional service contract |
| `op_svc_kei_stat_state` | `String` | Option service contract status state — processing state flag for the contract status field |
| `op_svc_cd_value` | `String` | Option service code value — the service code identifying which optional service type this is |
| `op_svc_cd_state` | `String` | Option service code state — processing state flag for the service code field |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `KKW00816SF02DBean.getOp_svc_kei_no_state` | KKW00816SF02DBean | - | Returns `op_svc_kei_no_state` — the processing state of the option service contract number (set by CBS during screen init) |
| R | `KKW00816SF02DBean.getOp_svc_kei_no_value` | KKW00816SF02DBean | - | Returns `op_svc_kei_no_value` — the option service contract number value |
| R | `KKW00816SF02DBean.getOp_svc_kei_stat_state` | KKW00816SF02DBean | - | Returns `op_svc_kei_stat_state` — the processing state of the option service contract status (set by CBS during screen init) |
| R | `KKW00816SF02DBean.getOp_svc_kei_stat_value` | KKW00816SF02DBean | - | Returns `op_svc_kei_stat_value` — the option service contract status value |
| R | `KKW00816SF02DBean.getOp_svc_cd_state` | KKW00816SF02DBean | - | Returns `op_svc_cd_state` — the processing state of the option service code (set by CBS during screen init) |
| R | `KKW00816SF02DBean.getOp_svc_cd_value` | KKW00816SF02DBean | - | Returns `op_svc_cd_value` — the option service code value |

**Classification rationale:**

All six called methods are simple getter methods within the same bean class. They perform **Read (R)** operations on instance fields that are populated externally — either by the CBS (Controller Back Service) layer during screen initialization, or by the framework during data binding. There are no database accesses, SC calls, or create/update/delete operations within this method. The `state` fields specifically carry processing outcome indicators (e.g., "error", "warning", "success") from the CBS layer, which are used by the UI to display field-level validation feedback.

## 5. Dependency Trace

### Callers (who calls this method)

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Screen:KKW00816SF | `KKW00816SFBean.addListDataInstance("オプションサービス契約リスト")` → `new KKW00816SF02DBean()` → (framework invokes `loadModelData(key, subkey)` via `X33VDataTypeBeanInterface`) | `getOp_svc_kei_no_value [R] instance field`<br/>`getOp_svc_kei_no_state [R] instance field`<br/>`getOp_svc_kei_stat_value [R] instance field`<br/>`getOp_svc_kei_stat_state [R] instance field`<br/>`getOp_svc_cd_value [R] instance field`<br/>`getOp_svc_cd_state [R] instance field` |

**Notes:**
- This method is called by the **X33V data-type bean framework** at runtime. The parent `KKW00816SFBean` instantiates `KKW00816SF02DBean` for each row of the "オプションサービス契約リスト" (Option Service Contract List) data-type list.
- When the framework renders the UI, it calls `loadModelData(key, subkey)` through the `X33VDataTypeBeanInterface` contract to resolve field values for display.
- The actual CBS (business logic layer) calls that populate the `state` and `value` fields happen separately during screen initialization (outside this method), via CBS methods that query the service contract database and set the bean fields.
- The framework calls `loadModelData` with keys like `"オプションサービス契約番号/value"`, `"オプションサービス契約ステータス/state"`, etc., generated from the data-type bean metadata.

## 6. Per-Branch Detail Blocks

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

> Null guard: if either parameter is null, return null immediately to prevent NullPointerException. This is defensive programming for the framework caller.

| # | Type | Code |
|---|------|------|
| 1 | COND | `key == null || subkey == null` // Check if either parameter is null |
| 2 | RETURN | `return null;` // Return null if guard condition is true |

---

**Block 2** — EXEC `(key.indexOf("/"))` (L155)

> Compute the separator position in the key. The result is stored but never used — appears to be reserved for future composite key support.

| # | Type | Code |
|---|------|------|
| 1 | SET | `int separaterPoint = key.indexOf("/")` // Reserved for future nested key path support |

---

**Block 3** — IF `(key.equals("オプションサービス契約番号"))` (L158)
> Branch: Option Service Contract Number — the contract number for the optional service line item

**Block 3.1** — IF-ELSEIF-ELSE `(subkey.equalsIgnoreCase("value"))` (L159)

> Inner branch: determine whether to return the value or the state for the contract number.

| # | Type | Code |
|---|------|------|
| 1 | COND | `subkey.equalsIgnoreCase("value")` // Case-insensitive check for value subkey |
| 2 | CALL | `return getOp_svc_kei_no_value()` // Read: contract number value |
| 3 | ELSE-IF | `subkey.equalsIgnoreCase("state")` // (日本語: subkeyが"state"の場合) // Case-insensitive check for state subkey |
| 4 | CALL | `return getOp_svc_kei_no_state()` // Read: contract number processing state |

---

**Block 4** — ELSE-IF `(key.equals("オプションサービス契約ステータス"))` (L168)
> Branch: Option Service Contract Status — the current status of the optional service contract

**Block 4.1** — IF-ELSEIF-ELSE `(subkey.equalsIgnoreCase("value"))` (L169)

> Inner branch: determine whether to return the value or the state for the contract status.

| # | Type | Code |
|---|------|------|
| 1 | COND | `subkey.equalsIgnoreCase("value")` // Case-insensitive check for value subkey |
| 2 | CALL | `return getOp_svc_kei_stat_value()` // Read: contract status value |
| 3 | ELSE-IF | `subkey.equalsIgnoreCase("state")` // (日本語: subkeyが"state"の場合) // Case-insensitive check for state subkey |
| 4 | CALL | `return getOp_svc_kei_stat_state()` // Read: contract status processing state |

---

**Block 5** — ELSE-IF `(key.equals("オプションサービスコード"))` (L178)
> Branch: Option Service Code — the service code identifying the optional service type

**Block 5.1** — IF-ELSEIF-ELSE `(subkey.equalsIgnoreCase("value"))` (L179)

> Inner branch: determine whether to return the value or the state for the service code.

| # | Type | Code |
|---|------|------|
| 1 | COND | `subkey.equalsIgnoreCase("value")` // Case-insensitive check for value subkey |
| 2 | CALL | `return getOp_svc_cd_value()` // Read: service code value |
| 3 | ELSE-IF | `subkey.equalsIgnoreCase("state")` // (日本語: subkeyが"state"の場合) // Case-insensitive check for state subkey |
| 4 | CALL | `return getOp_svc_cd_state()` // Read: service code processing state |

---

**Block 6** — ELSE (fallback) (L186)
> None of the expected keys matched — return null as a safe fallback.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return null;` // (日本語: 条件に合致するプロパティが存在しない場合は、nullを返す。) // No matching key found — return null |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `オプションサービス契約番号` | Field (Japanese) | Option Service Contract Number — the unique contract number assigned to an optional/add-on service line item |
| `オプションサービス契約ステータス` | Field (Japanese) | Option Service Contract Status — the current lifecycle status of an optional service contract (e.g., active, suspended, cancelled) |
| `オプションサービスコード` | Field (Japanese) | Option Service Code — a code identifying the type of optional service (e.g., FTTH add-on, mail forwarding, security service) |
| `key` | Parameter | Item name — the business identifier used to route to the correct data facet (contract number, status, or code) |
| `subkey` | Parameter | Sub-key — specifies which attribute of the data facet to retrieve (`"value"` for the data, `"state"` for the processing state) |
| `op_svc_kei_no` | Field | Option Service Keiyaku Number — database/internal field prefix for the contract number (op_svc = option service, kei = keiyaku/contract, no = number) |
| `op_svc_kei_stat` | Field | Option Service Keiyaku Status — database/internal field prefix for the contract status (stat = status) |
| `op_svc_cd` | Field | Option Service Code — database/internal field prefix for the service code (cd = code) |
| `_value` | Field suffix | The actual data value stored in the field — displayed in the UI |
| `_state` | Field suffix | The processing state indicator set by the CBS layer — used for field-level validation feedback (e.g., "error", "warning", "success") |
| `_update` | Field suffix | An update flag field — indicates whether this field has been modified by the user on the current screen |
| X33VDataTypeBeanInterface | Framework | Fujitsu SOTERANET X31C/X33V framework interface for data-type beans — defines `loadModelData(String, String)` for framework-driven data loading |
| X31CWebComponent | Framework | Base class in the X31C web framework providing common web component functionality |
| KKW00816SF | Module | Option service contract management screen module — handles creation and display of optional service contracts |
| KKW00816SF02DBean | Class | Data bean for the "Option Service Contract List" data-type item — provides per-row data access for option service contract fields |
| KKW00816SFBean | Class | Parent bean for screen KKW00816SF — manages all screen-level data including the list of option service contract rows |
| CBS | Acronym | Controller Back Service — the business logic layer that handles database operations and business rules |
| SC | Acronym | Service Component — the service layer class that implements business operations |
| UI | Acronym | User Interface — the screen layer where end users interact with the system |
