---
title: Business Logic — KKW02510SFLogic.setHktgiBean()
layer: Controller
module: KKW02510SF
source_file: source/koptWebB/src/eo/web/webview/KKW02510SF/KKW02510SFLogic.java
line_range: "599-696"
loc: 98
---

# Business Logic — KKW02510SFLogic.setHktgiBean() [98 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.KKW02510SF.KKW02510SFLogic` |
| Layer | Controller |
| Module | `KKW02510SF` (Package: `eo.web.webview.KKW02510SF`) |

## 1. Role

### KKW02510SFLogic.setHktgiBean()

This method performs the initial page data bean setup for the multi-selection information update screen (KKW02510SF), which is used to update customer contract continuation details. Its primary business purpose is to extract key customer contract data from an input source DataBean (`custKeiHktgiInf`) and map those fields onto the screen-level DataBean (`paramBean[0]`) so the UI can render the current state for display. The method retrieves the operation date, system ID (SYSID), service contract number, processing classification, movement classification, movement reasons (handled via a loop that populates a detail list), optional service contract number, application number, and application detail number. It implements a data transformation and routing design pattern — reading from the customer contract continuation bean and distributing fields into separate destination beans (top-level screen bean and nested movement reason detail list). It serves as the central data mapping entry point called during screen initialization (`actionInit`) to populate the page's presentation model before rendering.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["setHktgiBean(paramBean)"])
    START --> STEP1["Step 1: Get operation date and set UNYO_YMD"]
    STEP1 --> STEP2["Step 2: Get customer contract continuation list and first bean"]
    STEP2 --> STEP3["Step 3: Extract SYSID from custKeiHktgiInf"]
    STEP3 --> STEP4["Step 4: Extract SVC_KEI_NO"]
    STEP4 --> STEP5["Step 5: Extract TRAN_DIV"]
    STEP5 --> STEP6["Step 6: Extract IDO_DIV"]
    STEP6 --> STEP7["Step 7: Get IDO_RSN_MEMO and IDO_RSN_CD_01 count"]
    STEP7 --> STEP8["Step 8: Get IDO_RSN_LIST array"]
    STEP8 --> CLEAR["clearArray IDO_RSN_LIST"]
    CLEAR --> LOOP_START{"i < maxIndex?"}
    LOOP_START -->|true| LOOP_BODY["Create detail bean, set IDO_RSN_CD and IDO_RSN_MEMO"]
    LOOP_BODY --> INCREMENT["i++"]
    INCREMENT --> LOOP_START
    LOOP_START -->|false| LOOP_END["End loop"]
    LOOP_END --> STEP9["Step 9: Extract OP_SVC_KEI_NO"]
    STEP9 --> STEP10["Step 10: Extract MSKM_NO"]
    STEP10 --> STEP11["Step 11: Extract MSKM_DTL_NO"]
    STEP11 --> END_NODE(["Return void"])
```

**Step descriptions:**

1. **Step 1** — Calls `JCCWebCommon.getOpeDate(this, null)` to obtain the current operation date string, then sets it onto the screen DataBean under the key `UNYO_YMD` ("運用年月日" — operation date).
2. **Step 2** — Retrieves the customer contract continuation list DataBean array using the key `HKTGI_CUST_KEI_HKTGI_LIST` ("顧客契約引継リスト") and extracts the first element (index 0) as `custKeiHktgiInf`.
3. **Step 3** — Extracts `SYSID` from `custKeiHktgiInf` under key `SYSID_01` and writes it to the screen DataBean under `SYSID` (both keys resolve to "SYSID").
4. **Step 4** — Extracts `SVC_KEI_NO` ("サービス契約番号" — service contract number) from `custKeiHktgiInf` under key `SVC_KEI_NO_01` and writes it to the screen DataBean under `SVC_KEI_NO`.
5. **Step 5** — Extracts `TRAN_DIV` ("処理区分" — processing classification) from `custKeiHktgiInf` under key `TRAN_DIV_01` and writes it to the screen DataBean under `TRAN_DIV`.
6. **Step 6** — Extracts `IDO_DIV` ("異動区分" — movement classification) from `custKeiHktgiInf` under key `IDO_DIV_01` and writes it to the screen DataBean under `IDO_DIV`.
7. **Step 7** — Extracts `IDO_RSN_MEMO` ("異動理由メモ" — movement reason memo) from `custKeiHktgiInf` under key `IDO_RSN_MEMO_01`. Also retrieves the element count of `IDO_RSN_CD_01` ("異動理由コード" — movement reason code) to determine loop iterations.
8. **Step 8–Loop** — Clears the existing `IDO_RSN_LIST` ("異動理由リスト" — movement reason list) DataBean array and then iterates `maxIndex` times. In each iteration, a new detail DataBean is created via `addDataBean()`, and the movement reason code and memo are set onto it. Note: A previously commented-out loop (lines 638-670) was replaced with this implementation because the original approach (reading from the movement reason list bean directly) was not functioning correctly ("動作不正のため、異動理由リストより取得する処理に変更" — "Due to incorrect behavior, changed to process that retrieves from movement reason list").
9. **Step 9** — Extracts `OP_SVC_KEI_NO` ("オプションサービス契約番号" — option service contract number) from `custKeiHktgiInf` under key `OP_SVC_KEI_NO_01` at index 0, and writes it to the screen DataBean under `OP_SVC_KEI_NO`.
10. **Step 10** — Extracts `MSKM_NO` ("申請番号" — application number) from `custKeiHktgiInf` under key `MSKM_NO_01` and writes it to the screen DataBean under `MSKM_NO`.
11. **Step 11** — Extracts `MSKM_DTL_NO` ("申請詳細番号" — application detail number) from `custKeiHktgiInf` under key `MSKM_DTL_NO_01` and writes it to the screen DataBean under `MSKM_DTL_NO`.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `paramBean` | `X31SDataBeanAccess[]` | The screen DataBean access array representing the presentation model for the multi-selection information update screen. `paramBean[0]` is the primary DataBean into which all extracted customer contract fields are set. It carries operation date, SYSID, service contract number, processing classification, movement classification, movement reason details, optional service contract number, application number, and application detail number. |

**Instance fields / external state read:**

| # | Field | Source Class | Business Description |
|---|-------|-------------|---------------------|
| 1 | `this` (logic context) | `KKW02510SFLogic` | Passed to `JCCWebCommon.getOpeDate()` to obtain the operation date; provides the logic instance context for date retrieval. |

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `JCCWebCommon.getOpeDate` | JCCWebCommon | - | Calls `getOpeDate` in `JCCWebCommon` to retrieve the current operation date. |
| R | `X31SDataBeanAccess.getDataBeanArray` | X31SDataBeanAccess | - | Reads a DataBean array from `paramBean[0]` — retrieves customer contract continuation list. |
| R | `X31SDataBeanAccess.getDataBean` | X31SDataBeanAccess | - | Reads a single DataBean at index 0 from the customer contract continuation list. |
| R | `X31SDataBeanAccess.sendMessageString` | X31SDataBeanAccess | - | Reads field values (SYSID, service contract number, processing classification, movement classification, movement reason memo, optional service contract number, application number, application detail number) from `custKeiHktgiInf`. |
| - | `X31SDataBeanAccess.sendMessageString` | X31SDataBeanAccess | - | Sets field values (operation date, SYSID, service contract number, processing classification, movement classification, optional service contract number, application number, application detail number) onto the screen DataBean `paramBean[0]`. |
| R | `X31SDataBeanAccess.sendMessage` | X31SDataBeanAccess | - | Calls `sendMessage` with `DATABEAN_GET_COUNT` to retrieve the element count of movement reason codes. |
| R | `X31SDataBeanAccess.getDataBeanArray` | X31SDataBeanAccess | - | Retrieves the movement reason list array (`"異動理由リスト"`) from `paramBean[0]`. |
| - | `X31SDataBeanAccessArray.clearArray` | X31SDataBeanAccessArray | - | Clears the existing movement reason list DataBean array before repopulating it. |
| C | `X31SDataBeanAccessArray.addDataBean` | X31SDataBeanAccessArray | - | Creates new DataBean entries in the movement reason list within the loop. |
| - | `X31SDataBeanAccess.sendMessageString` | X31SDataBeanAccess | - | Sets movement reason code (`IDO_RSN_CD_02`) and movement reason memo (`IDO_RSN_MEMO_02`) onto each movement reason detail bean in the loop. |

## 5. Dependency Trace

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

No screen/batch entry points found within 8 hops. Direct callers found: 1 methods.
Terminal operations from this method: `sendMessageString` [-], `sendMessageString` [-], `sendMessageString` [-], `sendMessageString` [-], `sendMessageString` [-], `sendMessageString` [-], `sendMessageString` [-], `sendMessageString` [-], `addDataBean` [C], `sendMessage` [-].

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Logic:KKW02510SFLogic | `actionInit` -> `setHktgiBean` | `sendMessageString` [-], `sendMessageString` [-], `sendMessageString` [-], `sendMessageString` [-], `sendMessageString` [-], `sendMessageString` [-], `sendMessageString` [-], `sendMessageString` [-], `addDataBean` [C], `sendMessage` [-] |

**Caller detail:**
- `KKW02510SFLogic.actionInit()` — The screen initialization logic that calls `setHktgiBean(paramBean)` to populate the DataBean fields required for initial screen display. This is the sole direct caller.

## 6. Per-Branch Detail Blocks

**Block 1** — [SET] (operation date retrieval and assignment) (L599–L602)

> Retrieves the current operation date using `JCCWebCommon.getOpeDate()` and sets it onto the screen DataBean for display.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `unyo_ymd = JCCWebCommon.getOpeDate(this, null)` | [JCCWebCommon.getOpeDate] |
| 2 | SET | `paramBean[0].sendMessageString(KKW02510SFConst.UNYO_YMD, X31CWebConst.DATABEAN_SET_VALUE, unyo_ymd)` | [-> UNYO_YMD="運用年月日" (operation date)] |

**Block 2** — [SET] (customer contract continuation list acquisition) (L604–L606)

> Extracts the customer contract continuation list array from the screen DataBean and retrieves the first element (index 0) as the source bean for all field extractions.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `custKeiHktgiList = paramBean[0].getDataBeanArray(JKKCommonConst.HKTGI_CUST_KEI_HKTGI_LIST)` | [HKTGI_CUST_KEI_HKTGI_LIST="顧客契約引継リスト" (customer contract continuation list)] |
| 2 | EXEC | `custKeiHktgiInf = custKeiHktgiList.getDataBean(0)` | Retrieves first element at index 0 |

**Block 3** — [IF] (SYSID extraction and assignment) (L608–L610)

> Extracts the system ID from the customer contract continuation bean and writes it to the screen DataBean. Both source and destination keys resolve to "SYSID".

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `sysid = custKeiHktgiInf.sendMessageString(KKW02510SFConst.SYSID_01, X31CWebConst.DATABEAN_GET_VALUE)` | [-> SYSID_01="SYSID"] |
| 2 | SET | `paramBean[0].sendMessageString(KKW02510SFConst.SYSID, X31CWebConst.DATABEAN_SET_VALUE, sysid)` | [-> SYSID="SYSID"] |

**Block 4** — [IF] (Service contract number extraction) (L612–L614)

> Extracts the service contract number from the customer contract continuation bean and sets it to the screen DataBean.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `svc_kei_no = custKeiHktgiInf.sendMessageString(KKW02510SFConst.SVC_KEI_NO_01, X31CWebConst.DATABEAN_GET_VALUE)` | [-> SVC_KEI_NO_01="サービス契約番号" (service contract number)] |
| 2 | SET | `paramBean[0].sendMessageString(KKW02510SFConst.SVC_KEI_NO, X31CWebConst.DATABEAN_SET_VALUE, svc_kei_no)` | [-> SVC_KEI_NO="サービス契約番号" (service contract number)] |

**Block 5** — [IF] (Processing classification extraction) (L616–L618)

> Extracts the processing classification code (e.g., differentiates between new registration, change, cancellation operations) from the source bean and writes it to the screen DataBean.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `trans_div = custKeiHktgiInf.sendMessageString(KKW02510SFConst.TRAN_DIV_01, X31CWebConst.DATABEAN_GET_VALUE)` | [-> TRAN_DIV_01="処理区分" (processing classification)] |
| 2 | SET | `paramBean[0].sendMessageString(KKW02510SFConst.TRAN_DIV, X31CWebConst.DATABEAN_SET_VALUE, trans_div)` | [-> TRAN_DIV="処理区分" (processing classification)] |

**Block 6** — [IF] (Movement classification extraction) (L620–L622)

> Extracts the movement classification code (indicates whether a change, suspension, or cancellation is being performed) from the source bean and writes it to the screen DataBean.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `ido_div = custKeiHktgiInf.sendMessageString(KKW02510SFConst.IDO_DIV_01, X31CWebConst.DATABEAN_GET_VALUE)` | [-> IDO_DIV_01="異動区分" (movement classification)] |
| 2 | SET | `paramBean[0].sendMessageString(KKW02510SFConst.IDO_DIV, X31CWebConst.DATABEAN_SET_VALUE, ido_div)` | [-> IDO_DIV="異動区分" (movement classification)] |

**Block 7** — [SET] (movement reason list array acquisition) (L624)

> Acquires the movement reason list DataBean array from the screen DataBean.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `ido_rsn_list = paramBean[0].getDataBeanArray(KKW02510SFConst.IDO_RSN_LIST)` | [-> IDO_RSN_LIST="異動理由リスト" (movement reason list)] |

**Block 8** — [SET] (movement reason memo extraction — comment block markers) (L627–L629)

> Extracts the movement reason memo from the source bean. This memo is later reused for all movement reason detail entries.
> <!-- 異動理由メモ対応 Start/End (Movement reason memo support Start/End) -->

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `ido_rsn_memo = custKeiHktgiInf.sendMessageString(KKW02510SFConst.IDO_RSN_MEMO_01, X31CWebConst.DATABEAN_GET_VALUE)` | [-> IDO_RSN_MEMO_01="異動理由メモ" (movement reason memo)] |

**Block 9** — [SET] (movement reason code count retrieval) (L632)

> Retrieves the number of movement reason code entries to determine the iteration count for the movement reason detail loop.

| # | Type | Code |
|---|------|------|
| 1 | SET | `cnt = (Integer)custKeiHktgiInf.sendMessage(KKW02510SFConst.IDO_RSN_CD_01, X31CWebConst.DATABEAN_GET_COUNT)` | [-> IDO_RSN_CD_01="異動理由コード" (movement reason code)] |

**Block 10** — [FOR] (Movement reason detail list population — commented-out original) (L635–L669)

> A previously active loop that has been commented out. It iterated over the count and populated the movement reason list DataBean array by reading movement reason codes from the source bean. This was replaced because it had incorrect behavior ("動作不正のため、異動理由リストより取得する処理に変更").
> <!-- 異動理由メモ対応 追加Start/End (Movement reason memo support addition Start/End) -->

| # | Type | Code |
|---|------|------|
| 1 | FOR | `for(int i = 0; i < cnt; i++)` | Commented out |
| 2 | SET | `ido_rsn_bean = ido_rsn_list.addDataBean()` | Commented out |
| 3 | EXEC | `ido_rsn_cd = custKeiHktgiInf.sendMessageString(KKW02510SFConst.IDO_RSN_CD_01, X31CWebConst.DATABEAN_GET_VALUE, i)` | Commented out |
| 4 | SET | `ido_rsn_bean.sendMessageString(KKW02510SFConst.IDO_RSN_CD_02, X31CWebConst.DATABEAN_SET_VALUE, ido_rsn_cd)` | Commented out |
| 5 | SET | `ido_rsn_bean.sendMessageString(KKW02510SFConst.IDO_RSN_MEMO_02, X31CWebConst.DATABEAN_SET_VALUE, ido_rsn_memo)` | Commented out |

**Block 11** — [FOR] (Movement reason detail list population — active implementation) (L677–L694)

> Clears the existing movement reason list and repopulates it by iterating over the count from the source bean. For each iteration, a new movement reason detail bean is created, and its movement reason code and memo fields are set. The memo is shared across all entries (extracted once in Block 8). This is the active replacement for the commented-out Block 10, changed due to incorrect behavior in the original implementation.
> <!-- 異動理由リストからスキマ格納値の設定を行う (Set skipped storage values from movement reason list) -->

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `ekk1091d010Arr = paramBean[0].getDataBeanArray("異動理由リスト")` | [Movement reason list array] |
| 2 | EXEC | `ekk1091d010Arr.clearArray()` | Clears existing entries before repopulation |
| 3 | SET | `maxIndex = (Integer)custKeiHktgiInf.sendMessage(KKW02510SFConst.IDO_RSN_CD_01, X31CWebConst.DATABEAN_GET_COUNT)` | [-> IDO_RSN_CD_01="異動理由コード" (movement reason code)] |
| 4 | FOR | `for(int i = 0; i < maxIndex; i++)` | Iterates over movement reason entries |

**Block 11.1** — [FOR BODY] (Individual movement reason detail bean population) (L679–L692)

> For each iteration of the movement reason loop, creates a new detail bean, extracts the movement reason code from the source, and sets both the code and the shared memo onto the detail bean.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `ekk1091d010dtlBean = ekk1091d010Arr.addDataBean()` | Creates new detail DataBean |
| 2 | EXEC | `ido_rsn_cd = custKeiHktgiInf.sendMessageString(KKW02510SFConst.IDO_RSN_CD_01, X31CWebConst.DATABEAN_GET_VALUE, i)` | [-> IDO_RSN_CD_01="異動理由コード" (movement reason code)] |
| 3 | SET | `ekk1091d010dtlBean.sendMessageString(KKW02510SFConst.IDO_RSN_CD_02, X31CWebConst.DATABEAN_SET_VALUE, ido_rsn_cd)` | [-> IDO_RSN_CD_02="異動理由コード" (movement reason code)] |
| 4 | SET | `ekk1091d010dtlBean.sendMessageString(KKW02510SFConst.IDO_RSN_MEMO_02, X31CWebConst.DATABEAN_SET_VALUE, ido_rsn_memo)` | [-> IDO_RSN_MEMO_02="異動理由メモ" (movement reason memo)] |

**Block 12** — [IF] (Optional service contract number extraction) (L697–L699)

> Extracts the optional service contract number from the first element (index 0) of the customer contract continuation bean and sets it to the screen DataBean.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `op_svc_kei_no = custKeiHktgiInf.sendMessageString(KKW02510SFConst.OP_SVC_KEI_NO_01, X31CWebConst.DATABEAN_GET_VALUE, 0)` | [-> OP_SVC_KEI_NO_01="オプションサービス契約番号" (option service contract number), index 0] |
| 2 | SET | `paramBean[0].sendMessageString(KKW02510SFConst.OP_SVC_KEI_NO, X31CWebConst.DATABEAN_SET_VALUE, op_svc_kei_no)` | [-> OP_SVC_KEI_NO="オプションサービス契約番号" (option service contract number)] |

**Block 13** — [IF] (Application number extraction) (L701–L703)

> Extracts the application number from the customer contract continuation bean and sets it to the screen DataBean.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `mskm_no = custKeiHktgiInf.sendMessageString(KKW02510SFConst.MSKM_NO_01, X31CWebConst.DATABEAN_GET_VALUE)` | [-> MSKM_NO_01="申請番号" (application number)] |
| 2 | SET | `paramBean[0].sendMessageString(KKW02510SFConst.MSKM_NO, X31CWebConst.DATABEAN_SET_VALUE, mskm_no)` | [-> MSKM_NO="申請番号" (application number)] |

**Block 14** — [IF] (Application detail number extraction) (L705–L707)

> Extracts the application detail number from the customer contract continuation bean and sets it to the screen DataBean.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `mskm_dtl_no = custKeiHktgiInf.sendMessageString(KKW02510SFConst.MSKM_DTL_NO_01, X31CWebConst.DATABEAN_GET_VALUE)` | [-> MSKM_DTL_NO_01="申請詳細番号" (application detail number)] |
| 2 | SET | `paramBean[0].sendMessageString(KKW02510SFConst.MSKM_DTL_NO, X31CWebConst.DATABEAN_SET_VALUE, mskm_dtl_no)` | [-> MSKM_DTL_NO="申請詳細番号" (application detail number)] |

**Block 15** — [RETURN] (void return) (L708)

> Returns void — the method completes after all DataBean fields have been populated.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return;` (implicit) | — |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `unyo_ymd` | Field | Operation date — current system date in YYYY-MM-DD format used for display |
| `sysid` | Field | System ID — internal identifier for the customer system |
| `svc_kei_no` | Field | Service contract number — identifies the service contract line item |
| `trans_div` | Field | Processing classification — code that classifies the type of processing (e.g., new registration, change, cancellation) |
| `ido_div` | Field | Movement classification — code indicating the type of change/movement operation |
| `ido_rsn_cd` | Field | Movement reason code — code specifying the reason for the movement/change |
| `ido_rsn_memo` | Field | Movement reason memo — free-text description of the movement reason |
| `op_svc_kei_no` | Field | Option service contract number — identifies an optional service associated with the main contract |
| `mskm_no` | Field | Application number — the application/ticket number for the request |
| `mskm_dtl_no` | Field | Application detail number — the detailed line-item number within an application |
| `HKTGI_CUST_KEI_HKTGI_LIST` | Constant | Customer contract continuation list — DataBean array key holding customer contract continuation data |
| `UNYO_YMD` | Constant | Operation date — screen field key for the operation date |
| `SYSID` | Constant | System ID — screen field key for the system ID |
| `SVC_KEI_NO` | Constant | Service contract number — screen field key for service contract number |
| `TRAN_DIV` | Constant | Processing classification — screen field key for processing classification code |
| `IDO_DIV` | Constant | Movement classification — screen field key for movement classification code |
| `IDO_RSN_LIST` | Constant | Movement reason list — DataBean array key for the movement reason detail list |
| `IDO_RSN_MEMO` | Constant | Movement reason memo — field key for movement reason memo in detail bean |
| `OP_SVC_KEI_NO` | Constant | Option service contract number — screen field key for option service contract number |
| `MSKM_NO` | Constant | Application number — screen field key for application number |
| `MSKM_DTL_NO` | Constant | Application detail number — screen field key for application detail number |
| KKW02510SF | Module | Multi-selection information update screen — customer-facing web screen for updating customer contract continuation details |
| DataBean | Technical | X31SDataBeanAccess — the framework's data transfer object for passing screen data between presentation and logic layers |
| actionInit | Method | Screen initialization entry point — called during screen startup to populate DataBeans |
| JCCWebCommon | Component | Common web utility class providing shared operations like `getOpeDate()` |
| X31CWebConst | Component | Web framework constants — includes `DATABEAN_SET_VALUE` and `DATABEAN_GET_VALUE` for DataBean read/write operations |
