# Business Logic — CRW03407SF03DBean.loadModelData() [85 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.CRW03407SF.CRW03407SF03DBean` |
| Layer | Controller / Web Bean (View data binding) |
| Module | `CRW03407SF` (Package: `eo.web.webview.CRW03407SF`) |

## 1. Role

### CRW03407SF03DBean.loadModelData()

This method serves as a **data router and dispatcher** for the campaign information detail section of the K-Opticom telecom service order screen. It provides a unified entry point that the web view layer uses to retrieve structured data for six UI model fields, each supporting three access modes: value, enable (read-only flag), and state (display status). The method implements a **routing/dispatch pattern** — it evaluates the `key` parameter against predefined Japanese field names, then further narrows by the `subkey` parameter to route to the appropriate getter method. Within this class, it delegates exclusively to internal getter methods (`getL2_*`), which in turn read from the bean's own instance fields (no external service or database calls). This method's role in the larger system is to **bridge the UI data-binding framework** (X33VDataType*) with the concrete L2 (second-level) data fields, enabling dynamic form rendering where rows can be individually enabled, disabled, or shown in various states. It is a shared utility called by the parent form bean's list-item processing chain when iterating over campaign information rows.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["loadModelData key, subkey"])
    COND_NULL["key == null or subkey == null"]
    RETURN_NULL(["return null"])
    FIND_SLASH["key.indexOf / -- separaterPoint"]

    KEY1["key = 明細インデックス"]
    SUB1_VALUE["subkey = value (case-insensitive)"]
    CALL1["getL2_detail_index_value()"]
    SUB1_ENABLE["subkey = enable (case-insensitive)"]
    CALL2["getL2_detail_index_enabled()"]
    SUB1_STATE["subkey = state (case-insensitive)"]
    CALL3["getL2_detail_index_state()"]

    KEY2["key = キャンペーンコード"]
    SUB2_VALUE["subkey = value (case-insensitive)"]
    CALL4["getL2_dsp_campaign_cd_value()"]
    SUB2_ENABLE["subkey = enable (case-insensitive)"]
    CALL5["getL2_dsp_campaign_cd_enabled()"]
    SUB2_STATE["subkey = state (case-insensitive)"]
    CALL6["getL2_dsp_campaign_cd_state()"]

    KEY3["key = キャンペーン名"]
    SUB3_VALUE["subkey = value (case-insensitive)"]
    CALL7["getL2_wrib_svc_nm_value()"]
    SUB3_ENABLE["subkey = enable (case-insensitive)"]
    CALL8["getL2_wrib_svc_nm_enabled()"]
    SUB3_STATE["subkey = state (case-insensitive)"]
    CALL9["getL2_wrib_svc_nm_state()"]

    KEY4["key = 適用月"]
    SUB4_VALUE["subkey = value (case-insensitive)"]
    CALL10["getL2_wrib_svc_tstaymd_value()"]
    SUB4_ENABLE["subkey = enable (case-insensitive)"]
    CALL11["getL2_wrib_svc_tstaymd_enabled()"]
    SUB4_STATE["subkey = state (case-insensitive)"]
    CALL12["getL2_wrib_svc_tstaymd_state()"]

    KEY5["key = 行スタイルクラス"]
    SUB5_VALUE["subkey = value (case-insensitive)"]
    CALL13["getL2_line_style_class_value()"]
    SUB5_STATE["subkey = state (case-insensitive)"]
    CALL14["getL2_line_style_class_state()"]

    KEY6["key = 行スタイルID"]
    SUB6_VALUE["subkey = value (case-insensitive)"]
    CALL15["getL2_line_style_id_value()"]
    SUB6_STATE["subkey = state (case-insensitive)"]
    CALL16["getL2_line_style_id_state()"]

    NO_MATCH["no matching key"]
    END_NODE(["return null / Next"])

    START --> COND_NULL
    COND_NULL -- true --> RETURN_NULL
    COND_NULL -- false --> FIND_SLASH
    FIND_SLASH --> KEY1

    KEY1 -- true --> SUB1_VALUE
    SUB1_VALUE -- true --> CALL1 --> END_NODE
    SUB1_VALUE -- false --> SUB1_ENABLE
    SUB1_ENABLE -- true --> CALL2 --> END_NODE
    SUB1_ENABLE -- false --> SUB1_STATE
    SUB1_STATE -- true --> CALL3 --> END_NODE
    SUB1_STATE -- false --> KEY2

    KEY2 -- true --> SUB2_VALUE
    SUB2_VALUE -- true --> CALL4 --> END_NODE
    SUB2_VALUE -- false --> SUB2_ENABLE
    SUB2_ENABLE -- true --> CALL5 --> END_NODE
    SUB2_ENABLE -- false --> SUB2_STATE
    SUB2_STATE -- true --> CALL6 --> END_NODE
    SUB2_STATE -- false --> KEY3

    KEY3 -- true --> SUB3_VALUE
    SUB3_VALUE -- true --> CALL7 --> END_NODE
    SUB3_VALUE -- false --> SUB3_ENABLE
    SUB3_ENABLE -- true --> CALL8 --> END_NODE
    SUB3_ENABLE -- false --> SUB3_STATE
    SUB3_STATE -- true --> CALL9 --> END_NODE
    SUB3_STATE -- false --> KEY4

    KEY4 -- true --> SUB4_VALUE
    SUB4_VALUE -- true --> CALL10 --> END_NODE
    SUB4_VALUE -- false --> SUB4_ENABLE
    SUB4_ENABLE -- true --> CALL11 --> END_NODE
    SUB4_ENABLE -- false --> SUB4_STATE
    SUB4_STATE -- true --> CALL12 --> END_NODE
    SUB4_STATE -- false --> KEY5

    KEY5 -- true --> SUB5_VALUE
    SUB5_VALUE -- true --> CALL13 --> END_NODE
    SUB5_VALUE -- false --> SUB5_STATE
    SUB5_STATE -- true --> CALL14 --> END_NODE
    SUB5_STATE -- false --> KEY6

    KEY6 -- true --> SUB6_VALUE
    SUB6_VALUE -- true --> CALL15 --> END_NODE
    SUB6_VALUE -- false --> SUB6_STATE
    SUB6_STATE -- true --> CALL16 --> END_NODE
    SUB6_STATE -- false --> NO_MATCH --> END_NODE
```

**Processing flow summary:**

1. **Null guard** — If either `key` or `subkey` is null, return null immediately. (Japanese comment: key, subkey がnullの場合、nullを返す — Return null if key/subkey is null)
2. **Separator scan** — Compute `key.indexOf("/")` to determine if a hierarchical key path was provided. The variable `separaterPoint` is stored but not subsequently used in this method.
3. **Key-based routing** — Chain of six `if/else-if` branches matching the `key` against hardcoded Japanese field name constants. Each branch further dispatches on `subkey` case-insensitively:
   - **明細インデックス** (Detail Index, field ID: `l2_detail_index`) — supports `value`, `enable`, `state` subkeys
   - **キャンペーンコード** (Campaign Code, field ID: `l2_dsp_campaign_cd`) — supports `value`, `enable`, `state` subkeys
   - **キャンペーン名** (Campaign Name, field ID: `l2_wrib_svc_nm`) — supports `value`, `enable`, `state` subkeys
   - **適用月** (Application Month, field ID: `l2_wrib_svc_tstaymd`) — supports `value`, `enable`, `state` subkeys
   - **行スタイルクラス** (Row Style Class, field ID: `l2_line_style_class`) — supports `value`, `state` subkeys (no `enable`)
   - **行スタイルID** (Row Style ID, field ID: `l2_line_style_id`) — supports `value`, `state` subkeys (no `enable`)
4. **Fallback** — If no matching key is found, return null. (Japanese comment: 条件に合致するプロパティが存在しない場合は、nullを返す — Return null if no matching property exists)

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `key` | `String` | The business field identifier (item name) that selects which of the six campaign data model fields to access. Must match one of the hardcoded Japanese field names: 明細インデックス, キャンペーンコード, キャンペーン名, 適用月, 行スタイルクラス, or 行スタイルID. The presence of "/" in the key is detected (via `indexOf`) for potential hierarchical routing but is not currently used for sub-dispatch in this method. |
| 2 | `subkey` | `String` | The access mode for the requested field, specifying whether to retrieve the data value (`"value"`), the enabled/read-only flag (`"enable"`), or the display state (`"state"`). Comparison is case-insensitive (`equalsIgnoreCase`). Not all fields support all subkeys — "行スタイルクラス" and "行スタイルID" only support "value" and "state", omitting "enable". |

**Instance fields read:**

| Field | Class | Description |
|-------|-------|-------------|
| `l2_detail_index_value`, `l2_detail_index_enabled`, `l2_detail_index_state` | `CRW03407SF03DBean` | Detail index data, enable flag, and state |
| `l2_dsp_campaign_cd_value`, `l2_dsp_campaign_cd_enabled`, `l2_dsp_campaign_cd_state` | `CRW03407SF03DBean` | Campaign code data, enable flag, and state |
| `l2_wrib_svc_nm_value`, `l2_wrib_svc_nm_enabled`, `l2_wrib_svc_nm_state` | `CRW03407SF03DBean` | Campaign name data, enable flag, and state |
| `l2_wrib_svc_tstaymd_value`, `l2_wrib_svc_tstaymd_enabled`, `l2_wrib_svc_tstaymd_state` | `CRW03407SF03DBean` | Application month data, enable flag, and state |
| `l2_line_style_class_value`, `l2_line_style_class_state` | `CRW03407SF03DBean` | Row style class data and state (no enable) |
| `l2_line_style_id_value`, `l2_line_style_id_state` | `CRW03407SF03DBean` | Row style ID data and state (no enable) |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `CRW03407SF03DBean.getL2_detail_index_enabled` | CRW03407SF03DBean | - | Calls `getL2_detail_index_enabled` in `CRW03407SF03DBean` |
| R | `CRW03407SF03DBean.getL2_detail_index_state` | CRW03407SF03DBean | - | Calls `getL2_detail_index_state` in `CRW03407SF03DBean` |
| R | `CRW03407SF03DBean.getL2_detail_index_value` | CRW03407SF03DBean | - | Calls `getL2_detail_index_value` in `CRW03407SF03DBean` |
| R | `CRW03407SF03DBean.getL2_dsp_campaign_cd_enabled` | CRW03407SF03DBean | - | Calls `getL2_dsp_campaign_cd_enabled` in `CRW03407SF03DBean` |
| R | `CRW03407SF03DBean.getL2_dsp_campaign_cd_state` | CRW03407SF03DBean | - | Calls `getL2_dsp_campaign_cd_state` in `CRW03407SF03DBean` |
| R | `CRW03407SF03DBean.getL2_dsp_campaign_cd_value` | CRW03407SF03DBean | - | Calls `getL2_dsp_campaign_cd_value` in `CRW03407SF03DBean` |
| R | `CRW03407SF03DBean.getL2_line_style_class_state` | CRW03407SF03DBean | - | Calls `getL2_line_style_class_state` in `CRW03407SF03DBean` |
| R | `CRW03407SF03DBean.getL2_line_style_class_value` | CRW03407SF03DBean | - | Calls `getL2_line_style_class_value` in `CRW03407SF03DBean` |
| R | `CRW03407SF03DBean.getL2_line_style_id_state` | CRW03407SF03DBean | - | Calls `getL2_line_style_id_state` in `CRW03407SF03DBean` |
| R | `CRW03407SF03DBean.getL2_line_style_id_value` | CRW03407SF03DBean | - | Calls `getL2_line_style_id_value` in `CRW03407SF03DBean` |
| R | `CRW03407SF03DBean.getL2_wrib_svc_nm_enabled` | CRW03407SF03DBean | - | Calls `getL2_wrib_svc_nm_enabled` in `CRW03407SF03DBean` |
| R | `CRW03407SF03DBean.getL2_wrib_svc_nm_state` | CRW03407SF03DBean | - | Calls `getL2_wrib_svc_nm_state` in `CRW03407SF03DBean` |
| R | `CRW03407SF03DBean.getL2_wrib_svc_nm_value` | CRW03407SF03DBean | - | Calls `getL2_wrib_svc_nm_value` in `CRW03407SF03DBean` |
| R | `CRW03407SF03DBean.getL2_wrib_svc_tstaymd_enabled` | CRW03407SF03DBean | - | Calls `getL2_wrib_svc_tstaymd_enabled` in `CRW03407SF03DBean` |
| R | `CRW03407SF03DBean.getL2_wrib_svc_tstaymd_state` | CRW03407SF03DBean | - | Calls `getL2_wrib_svc_tstaymd_state` in `CRW03407SF03DBean` |
| R | `CRW03407SF03DBean.getL2_wrib_svc_tstaymd_value` | CRW03407SF03DBean | - | Calls `getL2_wrib_svc_tstaymd_value` in `CRW03407SF03DBean` |

All 16 calls are **Read (R)** operations — pure getter delegation to the bean's own L2 instance fields. No SC (Service Component), CBS (Common Business Service), database tables, or entity persistence is involved in this method. It is a pure **in-memory data retrieval** method that maps UI-level key/subkey lookups to bean field accessors.

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Screen:CRW03407SF (indirect) | `CRW03407SFBean.buildItemList` -> `X33VDataTypeBeanInterface.loadModelData` | `getL2_* methods [R] bean instance fields` |

**Caller analysis details:**

The primary caller is `CRW03407SFBean` (the parent form bean). In its item list building methods, the bean creates rows containing data-type beans (such as `CRW03407SF03DBean` for "キャンペーン情報詳細" — Campaign Information Detail). When the UI framework needs to populate field values, it calls `loadModelData(subkey)` on the individual row bean. The call chain originates from the screen processing layer where the form bean iterates over list items and invokes the bean's `loadModelData` method for each field key.

No other classes were found directly calling `CRW03407SF03DBean.loadModelData(String, String)`. Other `loadModelData` matches in the search results belong to sibling DBean classes (CRW03407SF01DBean through CRW03407SF09DBean) and unrelated FW* series beans, which implement their own independent routing logic.

## 6. Per-Branch Detail Blocks

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

> Null guard: early return if either parameter is null. (Japanese comment: key, subkey がnullの場合、nullを返す — Return null if key/subkey is null)

| # | Type | Code |
|---|------|------|
| 1 | IF | `if (key == null || subkey == null)` |
| 2 | RETURN | `return null;` |

**Block 2** — [EXEC] `key.indexOf("/")` — separator scan (L278)

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

**Block 3** — [IF/ELSE-IF/ELSE-IF/ELSE-IF/ELSE-IF/ELSE-IF] `key.equals("明細インデックス")` (L280)
> Data type: String field "明細インデックス" (Detail Index, field ID: l2_detail_index). Processes three subkey variants.

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

| # | Type | Code |
|---|------|------|
| 1 | IF | `if (subkey.equalsIgnoreCase("value"))` |
| 2 | CALL | `return getL2_detail_index_value();` |

**Block 3.2** — [ELSE-IF] `subkey.equalsIgnoreCase("enable")` (L284)
> Subkey is "enable" — returns the getter value of `l2_detail_index_enable`. (Japanese comment: subkey が "enable" の場合、l2_detail_index_enable のgetterの戻り値を返す — Return getter value of l2_detail_index_enable when subkey is "enable")

| # | Type | Code |
|---|------|------|
| 1 | ELSE-IF | `else if (subkey.equalsIgnoreCase("enable"))` |
| 2 | CALL | `return getL2_detail_index_enabled();` |

**Block 3.3** — [ELSE-IF] `subkey.equalsIgnoreCase("state")` (L287)
> Subkey is "state" — returns the status. (Japanese comment: subkey が "state" の場合、ステータスを返す — Return status when subkey is "state")

| # | Type | Code |
|---|------|------|
| 1 | ELSE-IF | `else if (subkey.equalsIgnoreCase("state"))` |
| 2 | CALL | `return getL2_detail_index_state();` |

**Block 4** — [ELSE-IF] `key.equals("キャンペーンコード")` (L292)
> Data type: String field "キャンペーンコード" (Campaign Code, field ID: l2_dsp_campaign_cd). Processes three subkey variants.

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

| # | Type | Code |
|---|------|------|
| 1 | IF | `if (subkey.equalsIgnoreCase("value"))` |
| 2 | CALL | `return getL2_dsp_campaign_cd_value();` |

**Block 4.2** — [ELSE-IF] `subkey.equalsIgnoreCase("enable")` (L296)
> Subkey is "enable" — returns the getter value of `l2_dsp_campaign_cd_enable`. (Japanese comment: subkey が "enable" の場合、l2_dsp_campaign_cd_enable のgetterの戻り値を返す)

| # | Type | Code |
|---|------|------|
| 1 | ELSE-IF | `else if (subkey.equalsIgnoreCase("enable"))` |
| 2 | CALL | `return getL2_dsp_campaign_cd_enabled();` |

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

| # | Type | Code |
|---|------|------|
| 1 | ELSE-IF | `else if (subkey.equalsIgnoreCase("state"))` |
| 2 | CALL | `return getL2_dsp_campaign_cd_state();` |

**Block 5** — [ELSE-IF] `key.equals("キャンペーン名")` (L304)
> Data type: String field "キャンペーン名" (Campaign Name, field ID: l2_wrib_svc_nm). Processes three subkey variants.

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

| # | Type | Code |
|---|------|------|
| 1 | IF | `if (subkey.equalsIgnoreCase("value"))` |
| 2 | CALL | `return getL2_wrib_svc_nm_value();` |

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

| # | Type | Code |
|---|------|------|
| 1 | ELSE-IF | `else if (subkey.equalsIgnoreCase("enable"))` |
| 2 | CALL | `return getL2_wrib_svc_nm_enabled();` |

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

| # | Type | Code |
|---|------|------|
| 1 | ELSE-IF | `else if (subkey.equalsIgnoreCase("state"))` |
| 2 | CALL | `return getL2_wrib_svc_nm_state();` |

**Block 6** — [ELSE-IF] `key.equals("適用月")` (L316)
> Data type: String field "適用月" (Application Month / Effective Month, field ID: l2_wrib_svc_tstaymd). Processes three subkey variants.

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

| # | Type | Code |
|---|------|------|
| 1 | IF | `if (subkey.equalsIgnoreCase("value"))` |
| 2 | CALL | `return getL2_wrib_svc_tstaymd_value();` |

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

| # | Type | Code |
|---|------|------|
| 1 | ELSE-IF | `else if (subkey.equalsIgnoreCase("enable"))` |
| 2 | CALL | `return getL2_wrib_svc_tstaymd_enabled();` |

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

| # | Type | Code |
|---|------|------|
| 1 | ELSE-IF | `else if (subkey.equalsIgnoreCase("state"))` |
| 2 | CALL | `return getL2_wrib_svc_tstaymd_state();` |

**Block 7** — [ELSE-IF] `key.equals("行スタイルクラス")` (L328)
> Data type: String field "行スタイルクラス" (Row Style Class, field ID: l2_line_style_class). Only supports `value` and `state` subkeys — no `enable` variant.

**Block 7.1** — [IF] `subkey.equalsIgnoreCase("value")` (L329)

| # | Type | Code |
|---|------|------|
| 1 | IF | `if (subkey.equalsIgnoreCase("value"))` |
| 2 | CALL | `return getL2_line_style_class_value();` |

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

| # | Type | Code |
|---|------|------|
| 1 | ELSE-IF | `else if (subkey.equalsIgnoreCase("state"))` |
| 2 | CALL | `return getL2_line_style_class_state();` |

**Block 8** — [ELSE-IF] `key.equals("行スタイルID")` (L337)
> Data type: String field "行スタイルID" (Row Style ID, field ID: l2_line_style_id). Only supports `value` and `state` subkeys — no `enable` variant.

**Block 8.1** — [IF] `subkey.equalsIgnoreCase("value")` (L338)

| # | Type | Code |
|---|------|------|
| 1 | IF | `if (subkey.equalsIgnoreCase("value"))` |
| 2 | CALL | `return getL2_line_style_id_value();` |

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

| # | Type | Code |
|---|------|------|
| 1 | ELSE-IF | `else if (subkey.equalsIgnoreCase("state"))` |
| 2 | CALL | `return getL2_line_style_id_state();` |

**Block 9** — [ELSE / FALLBACK] (L345)
> No matching key found — return null. (Japanese comment: 条件に合致するプロパティが存在しない場合は、nullを返す — Return null if no matching property exists)

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return null;` |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| キャンペーン情報詳細 | Field | Campaign Information Detail — a list-type UI section showing campaign data rows for telecom service orders |
| 明細インデックス | Field | Detail Index (field ID: l2_detail_index) — internal row identifier for campaign detail line items |
| キャンペーンコード | Field | Campaign Code (field ID: l2_dsp_campaign_cd) — the DSP (Display Service Platform) campaign code identifier |
| キャンペーン名 | Field | Campaign Name (field ID: l2_wrib_svc_nm) — the name of the promotional campaign associated with a service order |
| 適用月 | Field | Application Month / Effective Month (field ID: l2_wrib_svc_tstaymd) — the month from which the campaign terms become effective |
| 行スタイルクラス | Field | Row Style Class (field ID: l2_line_style_class) — CSS class name controlling visual styling of a table row |
| 行スタイルID | Field | Row Style ID (field ID: l2_line_style_id) — the style ID used for row-level display customization |
| value | Access mode | Retrieves the actual data value of a field |
| enable | Access mode | Returns the enabled/read-only flag of a field (determines if the field is editable in the UI) |
| state | Access mode | Returns the display state of a field (e.g., visible, hidden, or other UI state) |
| DBean | Technical abbreviation | Data Bean — a view-layer bean that holds data for a specific screen section or form area |
| L2 / l2_ | Technical abbreviation | Level 2 data field — second-level form field within a nested list-type UI section (as opposed to L1 page-level fields) |
| X33VDataType* | Technical abbreviation | Fujitsu K-Opticom UI framework's view data type classes that implement dynamic form field binding |
| CRW03407SF | Module | Service contract information screen module — handles telecom service contract line item processing |
| separaterPoint | Technical abbreviation | Local variable storing the index of the "/" character in a key string (note: misspelled in source as "separater" not "separator") |
