# Business Logic — KKW00846SF01DBean.storeModelData() [84 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.KKA18001SF.KKW00846SF01DBean` |
| Layer | Service/DTO (Data Bean — web presentation layer data model) |
| Module | `KKA18001SF` (Package: `eo.web.webview.KKA18001SF`) |

## 1. Role

### KKW00846SF01DBean.storeModelData()

This method serves as the **central data-dispatch hub** for binding incoming model values to a web presentation bean in the K-Opticom telecom order management system. Its primary business operation is to receive a named data item (`key`) along with a sub-key identifying the data aspect (`value` or `state`), cast the payload (`in_value`) to the appropriate type, and write it into the corresponding internal field. It implements a **routing/dispatch pattern**: the method branches on the `key` parameter to determine which of six business data domains is being populated — system ID, service contract number, variation classification, error reason codes (a variable-length list), error reason memo, or processing classification — then delegates to strongly-typed setter methods within the bean itself. In the larger system, this method is the **primary input surface** of `KKW00846SF01DBean`, consumed by the X33V framework's model-loading infrastructure (invoked during view rendering and form submission) as well as by the bean's own recursive delegation for list-bound items. Each branch corresponds to a distinct business entity: SYSID is the system record identifier, the service contract number identifies the customer's service line, variation fields track service changes, error reason codes/memo record cancellation or error details, and the processing classification flag tracks the type of data processing performed.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["storeModelData key, subkey, in_value, isSetAsString"])
    NULL_CHECK{key or subkey is null?}
    SEPARATOR["Find / index in key"]
    DISPATCH{key equals}
    SYSID{key equals SYSID}
    SVCKEI{key equals サービス契約番号}
    IDODIV{key equals 変動区分}
    IDORSNCD{key equals 変動理由コード}
    IDORSNMENO{key equals 変動理由メモ}
    TRANDIV{key equals 処理区分}

    SUBKEY_VALUE{subkey equals value}
    SUBKEY_STATE{subkey equals state}

    SYSID_SET_VALUE["setSysid_value"]
    SYSID_SET_STATE["setSysid_state"]
    SVC_SET_VALUE["setSvc_kei_no_value"]
    SVC_SET_STATE["setSvc_kei_no_state"]
    IDO_DIV_SET_VALUE["setIdo_div_value"]
    IDO_DIV_SET_STATE["setIdo_div_state"]
    IDO_RSMENO_SET_VALUE["setIdo_rsn_memo_value"]
    IDO_RSMENO_SET_STATE["setIdo_rsn_memo_state"]
    TRAN_SET_VALUE["setTran_div_value"]
    TRAN_SET_STATE["setTran_div_state"]

    EXTRACT_INDEX["Extract index substring"]
    PARSE_INT{Integer parse success?}
    BOUNDS_CHECK{0 <= index < list size}
    RECURSIVE_SET["Cast to X33VDataTypeStringBean and call storeModelData"]

    RETURN(["Return / End"])

    START --> NULL_CHECK
    NULL_CHECK -->|Yes| RETURN
    NULL_CHECK -->|No| SEPARATOR
    SEPARATOR --> DISPATCH
    DISPATCH -->|equals SYSID| SYSID{key equals SYSID}
    DISPATCH -->|equals サービス契約番号| SVCKEI{key equals SVC_KAI_NO}
    DISPATCH -->|equals 変動区分| IDODIV{key equals IDO_DIV}
    DISPATCH -->|equals 変動理由コード| IDORSNCD{key equals IDO_RSN_CD}
    DISPATCH -->|equals 変動理由メモ| IDORSNMENO{key equals IDO_RSN_MEMO}
    DISPATCH -->|equals 処理区分| TRANDIV{key equals TRAN_DIV}

    SYSID{key equals SYSID} -->|Yes| SUBKEY_VALUE
    SVCKEI{key equals SVC_KAI_NO} -->|Yes| SUBKEY_VALUE
    IDODIV{key equals IDO_DIV} -->|Yes| SUBKEY_VALUE
    IDORSNMENO{key equals IDO_RSN_MEMO} -->|Yes| SUBKEY_VALUE
    TRANDIV{key equals TRAN_DIV} -->|Yes| SUBKEY_VALUE

    SUBKEY_VALUE -->|equals value| SYSID_SET_VALUE
    SUBKEY_VALUE -->|equals state| SYSID_SET_STATE
    SYSID_SET_VALUE --> RETURN
    SYSID_SET_STATE --> RETURN

    SVCKEI -->|Yes| SVC_VALUE_Q{subkey equals value}
    SVC_VALUE_Q -->|equals value| SVC_SET_VALUE
    SVC_VALUE_Q -->|equals state| SVC_SET_STATE
    SVC_SET_VALUE --> RETURN
    SVC_SET_STATE --> RETURN

    IDODIV -->|Yes| IDO_DIV_VALUE_Q{subkey equals value}
    IDO_DIV_VALUE_Q -->|equals value| IDO_DIV_SET_VALUE
    IDO_DIV_VALUE_Q -->|equals state| IDO_DIV_SET_STATE
    IDO_DIV_SET_VALUE --> RETURN
    IDO_DIV_SET_STATE --> RETURN

    IDORSNCD{key equals IDO_RSN_CD} -->|Yes| EXTRACT_INDEX
    EXTRACT_INDEX --> PARSE_INT
    PARSE_INT -->|Success| BOUNDS_CHECK
    PARSE_INT -->|Failure| RETURN
    BOUNDS_CHECK -->|Valid| RECURSIVE_SET
    BOUNDS_CHECK -->|Invalid| RETURN
    RECURSIVE_SET --> RETURN

    IDORSNMENO{key equals IDO_RSN_MEMO} -->|Yes| IDO_MEMO_VALUE_Q{subkey equals value}
    IDO_MEMO_VALUE_Q -->|equals value| IDO_RSMENO_SET_VALUE
    IDO_MEMO_VALUE_Q -->|equals state| IDO_RSMENO_SET_STATE
    IDO_RSMENO_SET_VALUE --> RETURN
    IDO_RSMENO_SET_STATE --> RETURN

    TRANDIV{key equals TRAN_DIV} -->|Yes| TRAN_VALUE_Q{subkey equals value}
    TRAN_VALUE_Q -->|equals value| TRAN_SET_VALUE
    TRAN_VALUE_Q -->|equals state| TRAN_SET_STATE
    TRAN_SET_VALUE --> RETURN
    TRAN_SET_STATE --> RETURN
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `key` | `String` | The **item name (項目名)** — a domain-specific identifier that determines which of the six business data categories is being populated. Valid values are: `"SYSID"` (system record ID), `"サービス契約番号"` (Service Contract Number), `"変動区分"` (Variation Classification), `"変動理由コード"` (Error Reason Code, list-bound with index suffix), `"変動理由メモ"` (Error Reason Memo), `"処理区分"` (Processing Classification). |
| 2 | `subkey` | `String` | The **sub-key (サブキー)** specifying which attribute of the item is being set. Accepts `"value"` to set the data value, or `"state"` to set the edit state (e.g., whether the field is read-only or editable). Case-insensitive matching. |
| 3 | `in_value` | `Object` | The **payload data (データ)**. Cast to `String` for all fields except the list-bound error reason codes, where it is forwarded recursively to the target `X33VDataTypeBean`. The actual type depends on the calling framework context. |
| 4 | `isSetAsString` | `boolean` | A **type coercion flag (型設定フラグ)**. When `true`, indicates that a `Long`-typed item's value property should receive a `String` value (i.e., force string-mode setting). Passed through during recursive delegation to list elements. |

**Instance fields read:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `ido_rsn_cd_list` | `X33VDataTypeList` | A typed list of error reason code entries. Each element is cast to `X33VDataTypeStringBean` for recursive model data setting. Populated in the constructor as a new `X33VDataTypeList`. |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| U | `KKW00846SF01DBean.setSysid_value` | - | sysid_value field | Sets the SYSID value (system record identifier) |
| U | `KKW00846SF01DBean.setSysid_state` | - | sysid_state field | Sets the SYSID edit state |
| U | `KKW00846SF01DBean.setSvc_kei_no_value` | - | svc_kei_no_value field | Sets the service contract number value |
| U | `KKW00846SF01DBean.setSvc_kei_no_state` | - | svc_kei_no_state field | Sets the service contract number edit state |
| U | `KKW00846SF01DBean.setIdo_div_value` | - | ido_div_value field | Sets the variation classification value |
| U | `KKW00846SF01DBean.setIdo_div_state` | - | ido_div_state field | Sets the variation classification edit state |
| U | `KKW00846SF01DBean.storeModelData` | - | ido_rsn_cd_list element | Recursively delegates to error reason code list element |
| U | `KKW00846SF01DBean.setIdo_rsn_memo_value` | - | ido_rsn_memo_value field | Sets the error reason memo value |
| U | `KKW00846SF01DBean.setIdo_rsn_memo_state` | - | ido_rsn_memo_state field | Sets the error reason memo edit state |
| U | `KKW00846SF01DBean.setTran_div_value` | - | tran_div_value field | Sets the processing classification value |
| U | `KKW00846SF01DBean.setTran_div_state` | - | tran_div_state field | Sets the processing classification edit state |
| R | `ido_rsn_cd_list.size` | - | - | Reads the size of the error reason code list |
| R | `ido_rsn_cd_list.get(tmpIndex)` | - | - | Retrieves the element at the parsed index |

All operations are **updates (U)** to internal bean fields — this method is a pure data-binding setter with no external database or service component interactions.

## 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: `setTran_div_state` [-], `setTran_div_value` [-], `setIdo_rsn_memo_state` [-], `setIdo_rsn_memo_value` [-], `storeModelData` [-], `storeModelData` [-], `storeModelData` [-], `setIdo_div_state` [-], `setIdo_div_value` [-], `setSvc_kei_no_state` [-], `setSvc_kei_no_value` [-], `setSysid_state` [-], `setSysid_value` [-]

This method is a **framework-consumed bean method** — it is called by the X33V data-binding infrastructure during model loading/view rendering, not directly by screen or batch entry points. The pre-computed caller analysis indicates 2 direct internal callers, all within `KKW00846SF01DBean` (likely from other methods such as `loadModelData`, `exportModelData`, or list-element initialization).

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Internal: `KKW00846SF01DBean` | `KKW00846SF01DBean.*` -> `KKW00846SF01DBean.storeModelData` | `setSysid_value [U] sysid_value field` |
| 2 | Internal: `KKW00846SF01DBean` | `KKW00846SF01DBean.*` -> `KKW00846SF01DBean.storeModelData` | `setSvc_kei_no_value [U] svc_kei_no_value field` |

No external screen (KKSV*) or batch entry points were found within 8 hops. This method is exclusively consumed by the X33V framework's model-loading mechanisms and internal bean operations.

## 6. Per-Branch Detail Blocks

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

Early-termination guard: if either the item name or sub-key is null, the method exits immediately without performing any work.

| # | Type | Code |
|---|------|------|
| 1 | CHECK | `key == null || subkey == null` |
| 2 | RETURN | `return;` // 項目名とサブキーがnullの場合、処理を中止 (If item name and sub-key are null, abort processing) |

**Block 2** — [SET] `separaterPoint` extraction (L357)

Extract the position of the first `/` character in the key. Used later by the error reason code list branch to extract an index from compound keys like `"変動理由コード/0"`.

| # | Type | Code |
|---|------|------|
| 1 | SET | `int separaterPoint = key.indexOf("/")` // Find separator position for index extraction (リスト中のインデックスを見つけるためのセパレータ位置を取得) |

**Block 3** — [IF-ELSEIF chain — Dispatcher on `key`] (L360–431)

This is the core dispatch block. The method branches on the `key` parameter to determine which business data domain to handle. There are six branches, each handling a distinct field type.

---

**Block 3.1** — [IF] `key.equals("SYSID")` [SYSID] (L361)

Handle the SYSID (system record identifier) field. The SYSID is the system's internal record identifier for the order/service entry.

| # | Type | Code |
|---|------|------|
| 1 | IF | `key.equals("SYSID")` // データタイプがStringの項目"SYSID" (Data type is String item "SYSID") |
| 2 | IF-ELSE | `subkey.equalsIgnoreCase("value")` |
| 3 | CALL | `setSysid_value((String)in_value);` |
| 4 | ELSE-IF | `subkey.equalsIgnoreCase("state")` //subkeyが"state"の場合、ステータスを返す。 (If subkey is "state", return the state.) |
| 5 | CALL | `setSysid_state((String)in_value);` |

---

**Block 3.2** — [ELSE-IF] `key.equals("サービス契約番号")` [SVCKEI_NO = "サービス契約番号"] (L370)

Handle the service contract number field (項目ID: `svc_kei_no`). This is the customer's service contract line item number.

| # | Type | Code |
|---|------|------|
| 1 | ELSE-IF | `key.equals("サービス契約番号")` // データタイプがStringの項目"サービス契約番号"(項目ID:svc_kei_no) (Data type is String item "Service Contract Number" (Item ID: svc_kei_no)) |
| 2 | IF | `subkey.equalsIgnoreCase("value")` |
| 3 | CALL | `setSvc_kei_no_value((String)in_value);` |
| 4 | ELSE-IF | `subkey.equalsIgnoreCase("state")` //subkeyが"state"の場合、ステータスを返す。 (If subkey is "state", return the state.) |
| 5 | CALL | `setSvc_kei_no_state((String)in_value);` |

---

**Block 3.3** — [ELSE-IF] `key.equals("変動区分")` [IDO_DIV = "変動区分"] (L379)

Handle the variation classification field (項目ID: `ido_div`). Tracks whether a service change/variation has occurred.

| # | Type | Code |
|---|------|------|
| 1 | ELSE-IF | `key.equals("変動区分")` // データタイプがStringの項目"変動区分"(項目ID:ido_div) (Data type is String item "Variation Classification" (Item ID: ido_div)) |
| 2 | IF | `subkey.equalsIgnoreCase("value")` |
| 3 | CALL | `setIdo_div_value((String)in_value);` |
| 4 | ELSE-IF | `subkey.equalsIgnoreCase("state")` //subkeyが"state"の場合、ステータスを返す。 (If subkey is "state", return the state.) |
| 5 | CALL | `setIdo_div_state((String)in_value);` |

---

**Block 3.4** — [ELSE-IF] `key.equals("変動理由コード")` [IDO_RSN_CD = "変動理由コード"] (L388)

Handle the error reason code field — this is the most complex branch. It manages a **variable-length list** of error/cancellation reason codes. The key contains a compound value like `"変動理由コード/0"` where the index after the slash identifies which list element to target.

| # | Type | Code |
|---|------|------|
| 1 | ELSE-IF | `key.equals("変動理由コード")` // 配列項目 "変動理由コード"(String型。項目ID:ido_rsn_cd) (Array item "Error Reason Code" (String type. Item ID: ido_rsn_cd)) |
| 2 | SET | `key = key.substring(separaterPoint + 1);` // ("ido_rsn_cd/0"から最初の"/"より後を取獲得)。 (Extract substring after first "/".) |
| 3 | SET | `Integer tmpIndexInt = null;` // 今度はリスト中のインデックスを見る (Now look at the index in the list) |
| 4 | TRY | `tmpIndexInt = Integer.valueOf(key);` |
| 5 | CATCH | `catch(NumberFormatException e) { tmpIndexInt = null; }` // インデックス値が数値文字列でない場合は、ここでnullを返す。 (If index value is not a numeric string, return null here.) |
| 6 | IF | `tmpIndexInt != null` // インデックス値が数値文字列の場合 (If index value is a numeric string) |
| 7 | SET | `int tmpIndex = tmpIndexInt.intValue();` |
| 8 | IF | `tmpIndex >= 0 && tmpIndex < ido_rsn_cd_list.size()` // インデックス値がリスト個数-1以下の場合 (If index value is <= list size - 1) |
| 9 | CALL | `((X33VDataTypeStringBean)ido_rsn_cd_list.get(tmpIndex)).storeModelData(subkey, in_value);` // キャスト部分は、項目定義型に合わせX33VDataTypeStringBean, X33VDataTypeLongBean, X33VDataTypeBooleanBeanのうち1つを指定。X33VDataTypeLongBeanではsubkeyと入力値およびisSetAsStringフラグを引数に指定 (Cast section specifies one of X33VDataTypeStringBean, X33VDataTypeLongBean, or X33VDataTypeBooleanBean according to the item definition type.) |
| 10 | ELSE | (implicit) — do nothing: index out of bounds, silently skipped |

**Block 3.4.1** — [TRY-CATCH] Integer parsing (L395–402)

Safely attempt to parse the index substring as an integer. If the key portion after the `/` is not a valid integer (e.g., `"変動理由コード/abc"`), the parse fails and `tmpIndexInt` remains `null`, causing the block to silently skip.

| # | Type | Code |
|---|------|------|
| 1 | TRY | `tmpIndexInt = Integer.valueOf(key);` |
| 2 | CATCH | `catch(NumberFormatException e) { tmpIndexInt = null; }` |

**Block 3.4.2** — [IF] `tmpIndexInt != null && bounds valid` (L403)

When parsing succeeds, check bounds against `ido_rsn_cd_list.size()`. If the index is within range, cast the list element to `X33VDataTypeStringBean` and recursively call `storeModelData` on it. This is how list-bound items receive their data — each list element is itself a bean that handles its own key-value binding.

| # | Type | Code |
|---|------|------|
| 1 | IF | `tmpIndexInt != null` |
| 2 | SET | `int tmpIndex = tmpIndexInt.intValue();` |
| 3 | IF | `tmpIndex >= 0 && tmpIndex < ido_rsn_cd_list.size()` |
| 4 | CALL | `((X33VDataTypeStringBean)ido_rsn_cd_list.get(tmpIndex)).storeModelData(subkey, in_value);` |
| 5 | ELSE | (implicit) — silently skip out-of-bounds indices |

---

**Block 3.5** — [ELSE-IF] `key.equals("変動理由メモ")` [IDO_RSN_MEMO = "変動理由メモ"] (L409)

Handle the error reason memo field (項目ID: `ido_rsn_memo). Stores a free-text explanation for the error/cancellation reason.

| # | Type | Code |
|---|------|------|
| 1 | ELSE-IF | `key.equals("変動理由メモ")` // データタイプがStringの項目"変動理由メモ"(項目ID:ido_rsn_memo) (Data type is String item "Error Reason Memo" (Item ID: ido_rsn_memo)) |
| 2 | IF | `subkey.equalsIgnoreCase("value")` |
| 3 | CALL | `setIdo_rsn_memo_value((String)in_value);` |
| 4 | ELSE-IF | `subkey.equalsIgnoreCase("state")` //subkeyが"state"の場合、ステータスを返す。 (If subkey is "state", return the state.) |
| 5 | CALL | `setIdo_rsn_memo_state((String)in_value);` |

---

**Block 3.6** — [ELSE-IF] `key.equals("処理区分")` [TRAN_DIV = "処理区分"] (L418)

Handle the processing classification field (項目ID: `tran_div`). Tracks the type of data processing being performed (e.g., creation, modification, cancellation).

| # | Type | Code |
|---|------|------|
| 1 | ELSE-IF | `key.equals("処理区分")` // データタイプがStringの項目"処理区分"(項目ID:tran_div) (Data type is String item "Processing Classification" (Item ID: tran_div)) |
| 2 | IF | `subkey.equalsIgnoreCase("value")` |
| 3 | CALL | `setTran_div_value((String)in_value);` |
| 4 | ELSE-IF | `subkey.equalsIgnoreCase("state")` //subkeyが"state"の場合、ステータスを返す。 (If subkey is "state", return the state.) |
| 5 | CALL | `setTran_div_state((String)in_value);` |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `sysid` | Field | System ID — the system's internal record identifier for a service/order entry |
| `sysid_value` | Field | SYSID value — the actual system record ID string |
| `sysid_state` | Field | SYSID state — edit state flag (e.g., read-only, editable) |
| `svc_kei_no` | Field | Service contract number — the customer's service line item identifier (サービス契約番号) |
| `svc_kei_no_value` | Field | Service contract number value |
| `svc_kei_no_state` | Field | Service contract number edit state |
| `ido_div` | Field | Variation classification — indicates whether a service change/variation has occurred (変動区分) |
| `ido_div_value` | Field | Variation classification value |
| `ido_div_state` | Field | Variation classification edit state |
| `ido_rsn_cd` | Field | Error/cancellation reason code — classifies the reason for a service change or cancellation (変動理由コード). Stored as a list (`ido_rsn_cd_list`) of typed beans |
| `ido_rsn_cd_list` | Field | List of error reason code entries. Each element is an `X33VDataTypeBean` (typically `X33VDataTypeStringBean`) |
| `ido_rsn_memo` | Field | Error/cancellation reason memo — free-text explanation for the reason code (変動理由メモ) |
| `ido_rsn_memo_value` | Field | Error reason memo value |
| `ido_rsn_memo_state` | Field | Error reason memo edit state |
| `tran_div` | Field | Processing classification — the type of processing operation (処理区分). Values such as "0" (new), "1" (modify), "2" (cancel) |
| `tran_div_value` | Field | Processing classification value |
| `tran_div_state` | Field | Processing classification edit state |
| key | Parameter | Item name (項目名) — identifies which business data domain is being set |
| subkey | Parameter | Sub-key (サブキー) — specifies the attribute type: `"value"` for data, `"state"` for edit state |
| in_value | Parameter | Data payload (データ) — the value to assign, cast to the appropriate type |
| isSetAsString | Parameter | String coercion flag (String型値の設定フラグ) — when true, forces a Long-typed field to accept a String value |
| X33V | Framework | Fujitsu Futurity X33V — the web framework providing the bean infrastructure (`X33VViewBaseBean`, `X33VDataTypeList`, `X33VDataTypeBeanInterface`) |
| X33VDataTypeList | Framework type | A typed list collection for holding structured data beans |
| X33VDataTypeStringBean | Framework type | A data-type bean wrapping a String value with state management |
| K-Opticom | Business | Japanese telecommunications provider — the company whose order management system this bean serves |
