# Business Logic — KKW02510SFLogic.actionUpdCfm() [90 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.KKW02510SF.KKW02510SFLogic` |
| Layer | Controller (Web View / Front-end Logic) |
| Module | `KKW02510SF` (Package: `eo.web.webview.KKW02510SF`) |

## 1. Role

### KKW02510SFLogic.actionUpdCfm()

This method implements the **Update Confirmation button processing** on the Multi-Service Information Update screen (KKW02510SF). It is the central entry point that handles user confirmation of service changes, executing different update or cancellation workflows based on the processing division (`TRAN_DIV`). The method follows a **dispatch/routing design pattern** — it reads the `TRAN_DIV` flag from the DataBean, branches to one of two service paths (Cancellation for DSL service or Update for CHGE service), and then determines navigation to the next screen or displays an error message.

The method performs three major phases of processing: (1) DataBean configuration, where it extracts the process division from the session and prepares input maps; (2) Service invocation, where it delegates to either the cancellation service (KKSV0073/KKSV0073OP) for DSL operations or the update service (KKSV0072/KKSV0072OP) for CHGE operations; and (3) Navigation destination setup, where it either sets the next screen ID to KKW02511 (Update Confirmation) or displays a return error message. The method is the critical decision point in the multi-service update workflow — it ensures the correct service is invoked for the given operation type and handles post-service error recovery.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["actionUpdCfm start"])
    INIT_VARS["Initialize inputMap, outputMap, msgInfo, beans"]
    GET_TRAN_DIV["Get trans_div from DataBean"]
    CHECK_TRAN_DIV{"trans_div value?"}

    SET_DSLSRV["setDslsrv set cancellation data"]
    CALL_DSL_SVC["doService KKSV0073 KKSV0073OP"]
    STORE_DSLSRV["storeDataBeanDslsrv map output to bean"]
    MSG_DSL["msgInfo set cancellation message"]

    GET_PWD_INIT["Get PWD_INIT_FLG from DataBean"]
    SET_PWD_CTRL["Set PWD_INIT_FLG_CTRL control flag"]
    SET_CHGESRV["setChgesrv set update data"]
    CALL_CHGE_SVC["doService KKSV0072 KKSV0072OP"]
    STORE_CHGESRV["storeDataBeanChgesrv map output to bean"]
    MSG_CHGE["msgInfo set update message"]

    CHECK_RTN_MSG{"rtn_msgId null or empty?"}

    NAVIGATE["Set NEXT_SCREEN_ID and NEXT_SCREEN_NAME to KKW02511"]
    SET_MSG_INFO["JCCWebCommon.setMessageInfo EKB0370"]
    NAV_COMPLETE["Navigate to Update Confirmation screen"]

    ERROR_DISPLAY["displayGyomuErrorMsg display error"]
    DISPLAY_RTN_MSG["Display return message error"]

    DUMP_LOG["Dump DataBean to log"]
    RETURN_TRUE["Return true"]

    START --> INIT_VARS
    INIT_VARS --> GET_TRAN_DIV
    GET_TRAN_DIV --> CHECK_TRAN_DIV

    CHECK_TRAN_DIV -->|"OP_TRAN_DIV_DSL = 04 Cancellation"| SET_DSLSRV
    SET_DSLSRV --> CALL_DSL_SVC
    CALL_DSL_SVC --> STORE_DSLSRV
    STORE_DSLSRV --> MSG_DSL
    MSG_DSL --> CHECK_RTN_MSG

    CHECK_TRAN_DIV -->|"OP_TRAN_DIV_CHGE = 03 Update"| GET_PWD_INIT
    GET_PWD_INIT --> SET_PWD_CTRL
    SET_PWD_CTRL --> SET_CHGESRV
    SET_CHGESRV --> CALL_CHGE_SVC
    CALL_CHGE_SVC --> STORE_CHGESRV
    STORE_CHGESRV --> MSG_CHGE
    MSG_CHGE --> CHECK_RTN_MSG

    CHECK_RTN_MSG -->|"Yes"| NAVIGATE
    NAVIGATE --> SET_MSG_INFO
    SET_MSG_INFO --> NAV_COMPLETE
    NAV_COMPLETE --> DUMP_LOG

    CHECK_RTN_MSG -->|"No"| ERROR_DISPLAY
    ERROR_DISPLAY --> DISPLAY_RTN_MSG
    DISPLAY_RTN_MSG --> DUMP_LOG
    DUMP_LOG --> RETURN_TRUE
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| - | (none) | - | This method takes no explicit parameters. All data is obtained from instance fields and DataBeans. |

**Instance fields / external state read:**

| No | Source | Type | Business Description |
|----|--------|------|---------------------|
| 1 | `super.getCommonInfoBean()` | `X31SDataBeanAccess` | Shared form DataBean containing cross-screen navigation state (e.g., `NEXT_SCREEN_ID`, `NEXT_SCREEN_NAME`) |
| 2 | `super.getServiceFormBean()` | `X31SDataBeanAccess` | Service form DataBean containing the current screen's business data including `TRAN_DIV`, `PWD_INIT_FLG`, `RTN_MSG_ID` |
| 3 | `KKW02510SFConst.TRAN_DIV` | `String` constant | DataBean key for the process division flag that determines which service branch to execute |
| 4 | `KKW02510SFConst.PWD_INIT_FLG` | `String` constant | DataBean key for the password initialization flag in the CHGE branch |
| 5 | `KKW02510SFConst.PWD_INIT_FLG_CTRL` | `String` constant | DataBean key for the control copy of the password initialization flag |
| 6 | `KKW02510SFConst.RTN_MSG_ID` | `String` constant | DataBean key for the return message ID — used to determine if an error needs to be displayed |
| 7 | `JKKCommonConst.OP_TRAN_DIV_DSL` | `String = "04"` | Constant identifying the Cancellation processing division |
| 8 | `JKKCommonConst.OP_TRAN_DIV_CHGE` | `String = "03"` | Constant identifying the Update processing division |
| 9 | `JPCModelConstant.FUNC_CD_2` | `String` constant | Function code passed to data preparation methods, likely representing the "update confirmation" function type |
| 10 | `INFO_MSGSTRING[0]` | `String = "マルチセッショニング情報の変更"` | Success message for Update (CHGE) — "Multi-service information change" |
| 11 | `INFO_MSGSTRING[1]` | `String = "マルチセッショング情報の解約"` | Success message for Cancellation (DSL) — "Multi-service information cancellation" |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `JKKAddSupportCC.setMessageInfo` | JKKAddSupportCC | - | Calls `setMessageInfo` in `JKKAddSupportCC` |
| - | `JKKCreateNhkDntIktCC.setMessageInfo` | JKKCreateNhkDntIktCC | - | Calls `setMessageInfo` in `JKKCreateNhkDntIktCC` |
| - | `JKKFumeiKktkSvcKeiUpdCC.setMessageInfo` | JKKFumeiKktkSvcKeiUpdCC | - | Calls `setMessageInfo` in `JKKFumeiKktkSvcKeiUpdCC` |
| - | `JKKGetKikiUpdCodeNameCC.setMessageInfo` | JKKGetKikiUpdCodeNameCC | - | Calls `setMessageInfo` in `JKKGetKikiUpdCodeNameCC` |
| - | `JKKGetKojiAkTaknkikiCC.setMessageInfo` | JKKGetKojiAkTaknkikiCC | - | Calls `setMessageInfo` in `JKKGetKojiAkTaknkikiCC` |
| - | `OneStopDataBeanAccess.sendMessageString` | OneStopDataBeanAccess | - | Calls `sendMessageString` in `OneStopDataBeanAccess` |
| - | `KKW02510SFLogic.displayGyomuErrorMsg` | KKW02510SFLogic | - | Calls `displayGyomuErrorMsg` in `KKW02510SFLogic` |
| - | `KKW02510SFLogic.doService` | KKW02510SFLogic | - | Calls `doService` in `KKW02510SFLogic` |
| - | `KKW02510SFLogic.setChgesrv` | KKW02510SFLogic | - | Calls `setChgesrv` in `KKW02510SFLogic` |
| - | `KKW02510SFLogic.setDslsrv` | KKW02510SFLogic | - | Calls `setDslsrv` in `KKW02510SFLogic` |
| - | `KKW02510SFLogic.storeDataBeanChgesrv` | KKW02510SFLogic | - | Calls `storeDataBeanChgesrv` in `KKW02510SFLogic` |
| - | `KKW02510SFLogic.storeDataBeanDslsrv` | KKW02510SFLogic | - | Calls `storeDataBeanDslsrv` in `KKW02510SFLogic` |

### Per-branch analysis:

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| SET | `KKW02510SFLogic.setDslsrv` | - | `KKW02510SF` DataBean | Prepares cancellation input data by extracting DSL-related fields from the DataBean into the input Map (L251) |
| CALL | `KKW02510SFLogic.doService` | KKSV0073 | KKSV0073/KKSV0073OP (Cancellable service) | Invokes the cancellation service to process the DSL cancellation operation (L254) |
| SET | `KKW02510SFLogic.storeDataBeanDslsrv` | - | `KKW02510SF` DataBean | Maps cancellation output data from the service response back into the service form DataBean (L257) |
| SET | `KKW02510SFLogic.setChgesrv` | - | `KKW02510SF` DataBean | Prepares update input data by extracting CHGE-related fields from the DataBean into the input Map (L276) |
| CALL | `KKW02510SFLogic.doService` | KKSV0072 | KKSV0072/KKSV0072OP (Updatable service) | Invokes the update service to process the service contract update operation (L279) |
| SET | `KKW02510SFLogic.storeDataBeanChgesrv` | - | `KKW02510SF` DataBean | Maps update output data from the service response back into the service form DataBean (L282) |
| SET | `JCCWebCommon.setMessageInfo` | JCCWebCommon | - | Sets the confirmation screen message (EKB0370--I) for display on the next screen (L302) |
| EXEC | `KKW02510SFLogic.displayGyomuErrorMsg` | KKW02510SFLogic | - | Displays an error message when a return message ID exists, indicating a previous operation error (L307) |
| SET | `JSYwebLog.println` | JSYwebLog | - | Dumps the DataBean contents to the log for debugging purposes (L310) |
| RETURN | `return true` | - | - | Always returns true indicating normal completion (L313) |

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Screen:KKW02510SF | `KKW02510SFController.actionUpdCfm()` → `KKW02510SFLogic.actionUpdCfm()` | `doService KKSV0072 [U] KK_T_ODR_HAKKO_JOKEN, KK_T_OPSVKEI_ISP` |
| 2 | Screen:KKW02510SF | `KKW02510SFController.actionUpdCfm()` → `KKW02510SFLogic.actionUpdCfm()` | `doService KKSV0073 [U] KK_T_ODR_HAKKO_JOKEN, KK_T_OPSVKEI_ISP` |

**Notes:**
- The caller is inferred as `KKW02510SF` screen (the screen whose logic this method is defined in). This method is typically the handler for the "Update Confirmation" button on the KKW02510SF (Multi-Service Information Update Confirmation) screen.
- The method sets the next screen to `KKW02511` (Update Confirmation Check Screen: マルチセッショング情報更新確認).

## 6. Per-Branch Detail Blocks

### Block 1 — VARIABLE INITIALIZATION (L227–232)

> Initialize local variables and obtain DataBean access instances.

| # | Type | Code |
|---|------|------|
| 1 | SET | `inputMap = new HashMap<String, Object>()` // Service input data map |
| 2 | SET | `outputMap = new HashMap<String, Object>()` // Service output data map |
| 3 | SET | `msgInfo = new String[1]` // Message display array |
| 4 | SET | `commoninfoBean = super.getCommonInfoBean()` // Shared form DataBean access |
| 5 | SET | `bean = super.getServiceFormBean()` // Service form DataBean |
| 6 | SET | `paramBean = {bean}` // Array wrapper of service form DataBean |

### Block 2 — PROCESSING DIVISION RETRIEVAL (L238)

> Extract the processing division from the DataBean to determine which branch to follow.

| # | Type | Code |
|---|------|------|
| 1 | SET | `trans_div = bean.sendMessageString(KKW02510SFConst.TRAN_DIV, X31CWebConst.DATABEAN_GET_VALUE)` // Get process division (e.g., "03" for update, "04" for cancellation) |

### Block 3 — IF `OP_TRAN_DIV_DSL` (Cancellation Branch) `(JKKCommonConst.OP_TRAN_DIV_DSL.equals(trans_div))` [OP_TRAN_DIV_DSL="04"] (L241)

> This block handles the **cancellation (解約) processing path**. When the processing division equals "04" (Cancellation), the method prepares and invokes the DSL cancellation service.
> Original comment: 処理区分"解約" — Processing division "Cancellation"

#### Block 3.1 — Cancellation data preparation (L243)

| # | Type | Code |
|---|------|------|
| 1 | CALL | `setDslsrv(paramBean, inputMap, JPCModelConstant.FUNC_CD_2)` // Prepare cancellation data for service invocation |

#### Block 3.2 — Cancellation service invocation (L246)

| # | Type | Code |
|---|------|------|
| 1 | CALL | `doService("KKSV0073", "KKSV0073OP", inputMap, outputMap)` // Invoke cancellation service |

#### Block 3.3 — Output data mapping (L249)

> Original comment: 下りマッピングを実施します マッピングデータから、画面で必要な項目を設定します — Perform downstream mapping. Set necessary screen items from mapping data.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `storeDataBeanDslsrv(paramBean, outputMap)` // Map cancellation output to DataBean |

#### Block 3.4 — Set cancellation success message (L251–252)

| # | Type | Code |
|---|------|------|
| 1 | SET | `msgInfo = new String[1]` // Reset message array |
| 2 | SET | `msgInfo[0] = INFO_MSGSTRING[1]` // = "マルチセッショング情報の解約" (Multi-service information cancellation) |

### Block 4 — ELSE IF `OP_TRAN_DIV_CHGE` (Update Branch) `(JKKCommonConst.OP_TRAN_DIV_CHGE.equals(trans_div))` [OP_TRAN_DIV_CHGE="03"] (L255)

> This block handles the **update (変更) processing path**. When the processing division equals "03" (Update), the method manages password initialization flags, prepares and invokes the update service, and maps results.
> Original comment: 処理区分"更新" — Processing division "Update"

#### Block 4.1 — Password initialization flag handling (L257–260)

> Original comment: パスワード初期化フラグをパスワード初期化フラグ（制御用）に記録 — Record password initialization flag to password initialization flag (for control).

| # | Type | Code |
|---|------|------|
| 1 | SET | `init_flg = paramBean[0].sendMessageBoolean(KKW02510SFConst.PWD_INIT_FLG, X31CWebConst.DATABEAN_GET_VALUE)` // Retrieve password init flag from DataBean |
| 2 | SET | `paramBean[0].sendMessageBoolean(KKW02510SFConst.PWD_INIT_FLG_CTRL, X31CWebConst.DATABEAN_SET_VALUE, init_flg)` // Copy to control flag |

#### Block 4.2 — Update data preparation (L263)

> Original comment: 処理区分"更新" 更新用データ入力 — Processing division "Update", Input update data.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `setChgesrv(paramBean, inputMap, JPCModelConstant.FUNC_CD_2)` // Prepare update data for service invocation |

#### Block 4.3 — Update service invocation (L266)

> Original comment: 更新サービスを実施します — Execute update service.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `doService("KKSV0072", "KKSV0072OP", inputMap, outputMap)` // Invoke update service |

#### Block 4.4 — Output data mapping (L269)

> Original comment: 下りマッピングを実施します マッピングデータから、画面で必要な項目を設定します — Perform downstream mapping. Set necessary screen items from mapping data.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `storeDataBeanChgesrv(paramBean, outputMap)` // Map update output to DataBean |

#### Block 4.5 — Set update success message (L271–272)

| # | Type | Code |
|---|------|------|
| 1 | SET | `msgInfo = new String[1]` // Reset message array |
| 2 | SET | `msgInfo[0] = INFO_MSGSTRING[0]` // = "マルチセッショング情報の変更" (Multi-service information change) |

### Block 5 — RETURN MESSAGE ID CHECK (L277)

> Original comment: 「返却メッセージID」が空であれば、更新を確認するメッセージセットして次画面へ 「返却メッセージID」が存在する場合はエラーなので画面遷移できず「返却メッセージID」をメッセージ表示 — If "return message ID" is empty, set a confirmation message and navigate to next screen. If "return message ID" exists, it is an error so screen navigation is not possible; display the "return message ID" message.

| # | Type | Code |
|---|------|------|
| 1 | SET | `rtn_msgId = bean.sendMessageString(KKW02510SFConst.RTN_MSG_ID, X31CWebConst.DATABEAN_GET_VALUE)` // Get return message ID from DataBean |

### Block 6 — IF `rtn_msgId` null or empty (L280)

> When there is no return message ID, the method configures navigation to the next screen (KKW02511 — Update Confirmation Check Screen) and sets the success message for display.

#### Block 6.1 — Set next screen ID (L282)

> Original comment: 遷移先の画面IDを共有フォームBeanの項目に設定する — Set the next screen ID in the shared form Bean field.

| # | Type | Code |
|---|------|------|
| 1 | SET | `commoninfoBean.sendMessageString(CommonInfoCFConst.NEXT_SCREEN_ID, X31CWebConst.DATABEAN_SET_VALUE, JKKScreenConst.SCREEN_ID_KKW02511)` // Next screen = "KKW02511" |

#### Block 6.2 — Set next screen name (L284)

> Original comment: 遷移先の画面名を共有フォームBeanの項目に設定する — Set the next screen name in the shared form Bean field.

| # | Type | Code |
|---|------|------|
| 1 | SET | `commoninfoBean.sendMessageString(CommonInfoCFConst.NEXT_SCREEN_NAME, X31CWebConst.DATABEAN_SET_VALUE, JKKScreenConst.SCREEN_NAME_KKW02511)` // = "マルチセッショング情報更新確認" (Multi-service information update confirmation) |

#### Block 6.3 — Set confirmation message (L287)

> Original comment: 変更確認画面メッセージ出力 — Output change confirmation screen message.

| # | Type | Code |
|---|------|------|
| 1 | SET | `JCCWebCommon.setMessageInfo(this, JPCOnlineMessageConstant.EKB0370__I, msgInfo)` // Set message ID "EKB0370--I" with msgInfo array |

### Block 7 — ELSE if `rtn_msgId` not null/empty (L289)

> When a return message ID exists, an error occurred in a previous step, so the method displays the error message instead of navigating.
> Original comment: エラーなので画面遷移できず「返却メッセージID」をメッセージ表示 — Error so cannot navigate; display return message ID.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `displayGyomuErrorMsg(rtn_msgId, trans_div)` // Display business error message with return message ID and processing division |

### Block 8 — LOGGING AND RETURN (L291–292)

> Dump DataBean to log for debug trace and return success.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `JSYwebLog.println(JSYwebLog.DataBean_Dump, getClass(), dumpDatabean(), null, null, null)` // Log DataBean dump |
| 2 | RETURN | `return true` // Always returns true indicating normal exit |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `trans_div` | Field | Processing division — classifies which type of operation to perform (Update or Cancellation) |
| `TRAN_DIV` | Constant | DataBean key for the processing division value |
| `KKW02510SF` | Screen | Multi-Service Information Update Screen — the screen where users modify multi-service contract information |
| `KKW02511` | Screen | Multi-Service Information Update Confirmation Screen — the next screen shown after successful update confirmation |
| KKSV0072 | SC | Update Service Component — handles service contract update processing |
| KKSV0073 | SC | Cancellation Service Component — handles service contract cancellation processing |
| OP_TRAN_DIV_DSL | Constant = "04" | Operation processing division for Cancellation (解約) |
| OP_TRAN_DIV_CHGE | Constant = "03" | Operation processing division for Update (変更) |
| PWD_INIT_FLG | Constant | DataBean key for password initialization flag |
| PWD_INIT_FLG_CTRL | Constant | DataBean key for the control copy of the password initialization flag |
| RTN_MSG_ID | Constant | DataBean key for the return message ID — set when a previous operation produced an error |
| `INFO_MSGSTRING` | Constant | String array of success messages indexed by operation type |
| EKB0370--I | Message ID | Confirmation screen message code displayed on the update confirmation screen |
| `FUNC_CD_2` | Constant | Function code value "2" passed to data preparation methods, representing the update confirmation function type |
| 解約 (Kaiyaku) | Business term | Cancellation — termination of a service contract |
| 変更 (Henkou) | Business term | Update/Modification — changing existing service contract information |
| マルチセッショング (Maruchi sesshonng) | Business term | Multi-session — refers to managing multiple service contracts under a single customer account |
| 変更確認 (Henkou kakunin) | Business term | Update confirmation — the step where the user reviews and confirms changes before final submission |
| 下りマッピング (Kudari mappingu) | Business term | Downstream mapping — the process of mapping service output data back to the DataBean for display |
| doService | Method | Generic service invocation method that delegates to the appropriate SC/CBS based on screen and operation codes |
