# Business Logic — KKW02404SFLogic.actionUpd() [68 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.KKW02404SF.KKW02404SFLogic` |
| Layer | Controller (Web Logic / Screen Logic) |
| Module | `KKW02404SF` (Package: `eo.web.webview.KKW02404SF`) |

## 1. Role

### KKW02404SFLogic.actionUpd()

This method is the "Update Confirmation Button" handler for the Fixed Global IP Address Information screen (KKW02404SF). It is invoked when a user clicks the **Update Confirmation** button on the initial data entry screen, triggering a confirmation workflow for **cancellation** (解約) of a fixed global IP address service.

The method follows a **branching dispatch pattern** based on the processing division (`TRAN_DIV`) field from the form DataBean. Currently, it supports one primary branch: **cancellation processing** (`TRAN_DIV = "04"`), which invokes the DSL (fixed global IP address) cancellation service via `executeDslSvc`.

The method's role in the larger system is as the central coordinator for the update-confirmation flow — it prepares DataBean values by delegating to `setDataDsl`, executes the backend cancellation service via an OP mapping mapper (`KKSV0265_KKSV0265OPDBMapper`), captures any error message IDs returned from the service layer, and then routes the user either to the next confirmation screen (`KKW02405`) on success or displays the appropriate error message inline on failure.

The return value is always `true`, indicating successful completion of the handler itself; business errors are communicated through message IDs rather than return values.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["actionUpd()"])
    START --> GET_BEANS["Get DataBean access objects
commoninfoBean, bean, paramBean"]
    GET_BEANS --> GET_TRAN_DIV["Get trantiv from bean
sendString TRAN_DIV"]
    GET_TRAN_DIV --> INIT_MSG["Initialize msgInfo[]
rtn_msg_id empty string"]
    INIT_MSG --> CHECK_DSL{"trantiv equals
OP_TRAN_DIV_DSL = 04"}
    CHECK_DSL -->|true| DSL_BRANCH["Process Cancel branch"]
    DSL_BRANCH --> SET_DATA_DSL["setDataDsl paramBean"]
    SET_DATA_DSL --> EXEC_DSL_SVC["executeDslSvc paramBean
FUNC_CD 2"]
    EXEC_DSL_SVC --> GET_RTN_MSG["Get rtn_msg_id from paramBean"]
    GET_RTN_MSG --> SET_MSG_INFO["Set msgInfo[0] = MSGSTRING[0]
Fixed Global IP Address Info Cancel"]
    SET_MSG_INFO --> CHECK_RTN{"rtn_msg_id is empty"}
    DSL_BRANCH --> CHECK_RTN
    CHECK_RTN -->|true| REDIRECT_NEXT["Set NEXT_SCREEN_ID to KKW02405
Set NEXT_SCREEN_NAME
setMessageInfo EKB0370__I msgInfo"]
    CHECK_RTN -->|false| HANDLE_MSG["Call getMsgRep trantiv rtn_msg_id"]
    HANDLE_MSG --> CHECK_NULL{"getMsgRep returns null"}
    CHECK_NULL -->|true| MSG_NO_SUBST["setMessageInfo this rtn_msg_id"]
    CHECK_NULL -->|false| MSG_SUBST["setMessageInfo this rtn_msg_id str"]
    MSG_NO_SUBST --> LOG_DATABEAN
    MSG_SUBST --> LOG_DATABEAN["Log DataBean dump JSYwebLog"]
    REDIRECT_NEXT --> LOG_DATABEAN
    MSG_NO_SUBST --> LOG_DATABEAN
    MSG_SUBST --> LOG_DATABEAN
    LOG_DATABEAN --> RETURN["Return true"]
    RETURN --> END(["End"])
```

**Branch summary:**

| Branch | Condition | Business Action |
|--------|-----------|----------------|
| Cancel (解約) | `trantiv` equals `OP_TRAN_DIV_DSL = "04"` | Calls `setDataDsl()` for DataBean preparation, then `executeDslSvc()` for cancellation service execution, sets `MSGSTRING[0]` ("Fixed Global IP Address Info Cancel") as the success message |
| Success routing | `rtn_msg_id` is empty string | Redirects to confirmation screen `KKW02405` (Fixed Global IP Address Information Update Confirmation), displays info message `EKB0370__I` |
| Error handling | `rtn_msg_id` is non-empty | Calls `getMsgRep()` for optional error text substitution, then displays message to user (with or without placeholder substitution) |

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| - | (none) | - | This method takes no parameters. All input data is obtained from the screen's DataBean via `super.getServiceFormBean()` and `super.getCommonInfoBean()`. |
| - | `bean` | `X31SDataBeanAccess` | The service form DataBean containing user-input fields such as `TRAN_DIV` (processing division), cancellation date fields (`USE_ENDYMD_YEAR`, `USE_ENDYMD_MON`, `USE_ENDYMD_DAY`), and `RTN_MSG_ID` for returned message ID. |
| - | `commoninfoBean` | `X31SDataBeanAccess` | The shared form DataBean used for cross-screen state, including `NEXT_SCREEN_ID` and `NEXT_SCREEN_NAME` for navigation to the confirmation screen. |
| - | `paramBean` | `X31SDataBeanAccess[]` | A single-element array wrapping `bean`, passed by reference to delegated methods (`setDataDsl`, `executeDslSvc`) so they can modify DataBean fields in-place. |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `KKW02404SFLogic.setDataDsl` | KKW02404SFLogic | - | Prepares DataBean with combined end date, service end date, charge end date, and progress flag for the DSL cancellation flow |
| - | `KKW02404SFLogic.executeDslSvc` | KKW02404SFLogic | - | Executes the fixed global IP address cancellation confirmation service (delegates to KKSV0265 mapper) |
| - | `KKW02404SFLogic.getMsgRep` | KKW02404SFLogic | - | Resolves error message ID to placeholder text for inline display |
| - | `KKW02404SFLogic.getCommonInfoBean` | JCCWebBusinessLogic (parent) | - | Retrieves the shared form DataBean instance |
| - | `KKW02404SFLogic.getServiceFormBean` | JCCWebBusinessLogic (parent) | - | Retrieves the service form DataBean instance |
| - | `KKW02404SFLogic.dumpDatabean` | JCCWebBusinessLogic (parent) | - | Serializes DataBean state for logging |
| C | `KKSV0265_KKSV0265OPDBMapper.setOpSvcKeiDslCC` | KKSV0265 | OP_SVC_KEI (DSL) | Maps service contract fields to cancellation request parameters |
| C | `KKSV0265_KKSV0265OPDBMapper.setJKKHakkoSODCC` | KKSV0265 | SOD | Maps order data for cancellation |
| C | `KKSV0265_KKSV0265OPDBMapper.setKKSV0265WORK` | KKSV0265 | WORK | Sets up working data for the cancellation process |
| - | `KKW02404SFLogic.invokeService` | JCCWebBusinessLogic (parent) | - | Invokes the backend EJB service with the prepared input map |
| R | `KKSV0265_KKSV0265OPDBMapper.getOpSvcKeiDslCC` | KKSV0265 | OP_SVC_KEI (DSL) | Retrieves cancellation service results into the DataBean |
| - | `JCCWebCommon.setMessageInfo` | JCCWebCommon | - | Sets the message to display to the user on screen |
| - | `JSYwebLog.println` | JSYwebLog | - | Logs DataBean dump to application log for debugging |

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Screen:KKW02404SF | `KKW02404SFLogic.actionUpd()` (entry point from update confirmation button) | `executeDslSvc -> KKSV0265_mapper [C] OP_SVC_KEI (DSL), SOD, WORK` |
| 2 | Screen:KKA14901SF | `KKA14901SFLogic.actionUpd()` calls `KKW02404SFLogic.actionUpd()` (indirect via KKW02404SF bean dispatch) | `executeDslSvc -> KKSV0265_mapper [C] OP_SVC_KEI (DSL)` |

**Notes:**
- The primary entry point is Screen `KKW02404SF` itself, which uses this method as its update confirmation handler.
- `KKA14901SF` also uses `KKW02404SF` components and may dispatch to this logic for cancellation processing.
- The terminal service chain flows through the `KKSV0265` mapper, which handles the actual EJB service invocation for fixed global IP address cancellation.

## 6. Per-Branch Detail Blocks

**Block 1** — [SET/GET] `DataBean Acquisition` (L441)

> Obtains the shared form DataBean and service form DataBean for subsequent processing.

| # | Type | Code |
|---|------|------|
| 1 | GET | `commoninfoBean = super.getCommonInfoBean()` // Get shared form DataBean [-> CommonInfoBean] |
| 2 | GET | `bean = super.getServiceFormBean()` // Get service form DataBean [-> ServiceFormBean] |
| 3 | SET | `paramBean = {bean}` // Single-element array wrapping the service form bean |

**Block 2** — [SET/GET] `Processing Division Extraction` (L450)

> Reads the processing division (`TRAN_DIV`) from the form to determine which business operation to perform.

| # | Type | Code |
|---|------|------|
| 1 | SET | `trandiv = bean.sendString(KKW02404SFConst.TRAN_DIV, DATABEAN_GET_VALUE)` // [-> TRAN_DIV="Processing Division"] |
| 2 | SET | `msgInfo = new String[1]` // Message display buffer |
| 3 | SET | `rtn_msg_id = ""` // Return message ID initialized empty |

**Block 3** — [IF] `Processing Division: Cancel (解約)` (L453)

> Checks if the processing division matches the DSL cancellation code (`"04"`). If so, executes the cancellation confirmation flow.
> [-> OP_TRAN_DIV_DSL="04"]

| # | Type | Code |
|---|------|------|
| 1 | IF | `JKKCommonConst.OP_TRAN_DIV_DSL.equals(trandiv)` // Is processing division = "04" (Cancel)? |
| 2 | CALL | `setDataDsl(paramBean)` // [Block 3.1] Prepare DataBean values for cancellation flow |
| 3 | CALL | `executeDslSvc(paramBean, JPCModelConstant.FUNC_CD_2)` // [Block 3.2] Execute fixed global IP address cancellation service |
| 4 | SET | `rtn_msg_id = paramBean[0].sendString(KKW02404SFConst.RTN_MSG_ID, DATABEAN_GET_VALUE)` // [-> RTN_MSG_ID="Return Message ID"] Get return message ID |
| 5 | SET | `msgInfo[0] = MSGSTRING[0]` // [-> MSGSTRING[0]="固定グローバルIPアドレス情報の解約" (Fixed Global IP Address Info Cancel)] |

**Block 3.1** — [PROC] `setDataDsl(DataBean Preparation)` (L516)

> Prepares the DataBean by combining year/month/day fields into full date strings and setting service-related date fields.

| # | Type | Code |
|---|------|------|
| 1 | GET | `use_endymd_year = paramBean[0].sendString(KKW02404SFConst.USE_ENDYMD_YEAR, GET_VALUE)` // [-> USE_ENDYMD_YEAR="利用終了日（年）"] |
| 2 | GET | `use_endymd_mon = paramBean[0].sendString(KKW02404SFConst.USE_ENDYMD_MON, GET_VALUE)` // [-> USE_ENDYMD_MON="利用終了日（月）"] |
| 3 | GET | `use_endymd_day = paramBean[0].sendString(KKW02404SFConst.USE_ENDYMD_DAY, GET_VALUE)` // [-> USE_ENDYMD_DAY="利用終了日（日）"] |
| 4 | SET | `use_endymd = year + mon + day` // Concatenate year+month+day into YYYYMMDD format |
| 5 | SET | `paramBean[0].sendString(KKW02404SFConst.USE_ENDYMD, SET_VALUE, use_endymd)` // [-> USE_ENDYMD="利用終了日"] Set combined end date |
| 6 | SET | `paramBean[0].sendString(KKW02404SFConst.SVC_ENDYMD, SET_VALUE, use_endymd)` // [-> SVC_ENDYMD="サービス終了年月日"] Set service end date |
| 7 | GET | `unyo_ymd = paramBean[0].sendString(KKW02404SFConst.USE_YMD, GET_VALUE)` // [-> USE_YMD="運用年月日"] |
| 8 | SET | `paramBean[0].sendString(KKW02404SFConst.SVC_CHRG_ENDYMD, SET_VALUE, unyo_ymd)` // [-> SVC_CHRG_ENDYMD="サービス課金終了年月日"] Set charge end date |
| 9 | SET | `paramBean[0].sendString(KKW02404SFConst.PRG_TKJK_1, SET_VALUE, KTIIPADR_INFO + DSL)` // [-> PRG_TKJK_1="進捗特記事項1"] Set progress flag: "固定グローバルIPアドレス情報" + "解約" |

**Block 3.2** — [PROC] `executeDslSvc(Cancellation Service Execution)` (L539)

> Executes the fixed global IP address cancellation confirmation service via the KKSV0265 mapper. This method handles the full service component (SC) dispatch chain including parameter mapping, service invocation, and result retrieval.

| # | Type | Code |
|---|------|------|
| 1 | SET | `paramMap = new HashMap()` // [-> TELEGRAM_INFO_USECASE_ID="KKSV0265"] Parameter setup map |
| 2 | SET | `inputMap = new HashMap()` // Input map for service parameters |
| 3 | SET | `outputMap = new HashMap()` // Output map for service results |
| 4 | SET | `paramMap.put(TELEGRAM_INFO_USECASE_ID, "KKSV0265")` // Set use case ID for tracing |
| 5 | SET | `mapper = new KKSV0265_KKSV0265OPDBMapper()` // Instantiate the OP-DB mapper for KKSV0265 |
| 6 | CALL | `mapper.setOpSvcKeiDslCC(paramBean, inputMap, func_code)` // Map service contract fields to cancellation request |
| 7 | CALL | `mapper.setJKKHakkoSODCC(paramBean, inputMap, func_code)` // Map SOD (Service Order Data) fields |
| 8 | CALL | `mapper.setKKSV0265WORK(paramBean, inputMap, func_code)` // Set up WORK table mapping |
| 9 | SET | `paramBean[0].sendString(RTN_MSG_ID, SET_VALUE, "")` // Clear return message ID before service execution |
| 10 | CALL | `invokeService(paramMap, inputMap, outputMap)` // Execute the backend EJB service |
| 11 | CALL | `mapper.getOpSvcKeiDslCC(paramBean, outputMap)` // Retrieve cancellation service results |

**Block 4** — [IF-ELSE] `Screen Navigation / Message Display` (L475)

> Determines whether to redirect to the next confirmation screen (on success) or display an error message (on failure).

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(rtn_msg_id)` // Is return message ID empty (success)? |

**Block 4.1** — [IF-BRANCH: Success] `Redirect to Confirmation Screen` (L478)

> On successful cancellation processing, set the next screen ID and display an info message to the user.

| # | Type | Code |
|---|------|------|
| 1 | SET | `commoninfoBean.sendString(CommonInfoCFConst.NEXT_SCREEN_ID, SET_VALUE, JKKScreenConst.SCREEN_ID_KKW02405)` // [-> SCREEN_ID_KKW02405="KKW02405"] Next screen: Fixed Global IP Address Information Update Confirmation |
| 2 | SET | `commoninfoBean.sendString(CommonInfoCFConst.NEXT_SCREEN_NAME, SET_VALUE, JKKScreenConst.SCREEN_NAME_KKW02405)` // [-> SCREEN_NAME_KKW02405="固定グローバルIPアドレス情報更新確認"] |
| 3 | CALL | `JCCWebCommon.setMessageInfo(this, JPCOnlineMessageConstant.EKB0370__I, msgInfo)` // [-> EKB0370__I=Info message constant] Display success message with MSGSTRING[0] substitution |

**Block 4.2** — [ELSE-IF] `Error: Display Message` (L487)

> When cancellation processing returned a non-empty message ID (indicating an error or warning), resolve and display it.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `str = getMsgRep(trandiv, rtn_msg_id)` // [-> getMsgRep] Resolve error message ID to placeholder text array |

**Block 4.2.1** — [IF] `Message without Substitution` (L491)

> When `getMsgRep` returns null, display the message ID alone.

| # | Type | Code |
|---|------|------|
| 1 | IF | `str == null` // No substitution text needed |
| 2 | CALL | `JCCWebCommon.setMessageInfo(this, rtn_msg_id)` // Display message ID directly to user |

**Block 4.2.2** — [ELSE] `Message with Substitution` (L495)

> When `getMsgRep` returns a substitution array, display the message with placeholders filled in.

| # | Type | Code |
|---|------|------|
| 1 | ELSE | `str != null` // Substitution text available |
| 2 | CALL | `JCCWebCommon.setMessageInfo(this, rtn_msg_id, str)` // Display message with substitution values |

**Block 5** — [PROC] `DataBean Log Output` (L502)

> Dumps the current DataBean state to the application log for debugging and audit purposes.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `JSYwebLog.println(DataBean_Dump, getClass(), dumpDatabean(), null, null, null)` // Log DataBean state |

**Block 6** — [RETURN] `Return Success` (L504)

> Always returns `true` regardless of whether the cancellation succeeded or an error was displayed. Error conditions are communicated via message display, not the return value.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return true` // Handler completed successfully |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `TRAN_DIV` | Field | Processing division — classifies the type of operation (cancellation, restoration, reservation cancellation). Value `"04"` means DSL cancellation. |
| `RTN_MSG_ID` | Field | Return message ID — a message identifier returned by the backend service to indicate success or specific error conditions. |
| `USE_ENDYMD` | Field | Service end date (year+month+day combined as YYYYMMDD string) — the date the service ends for this cancellation. |
| `USE_ENDYMD_YEAR` | Field | Service end date year — the year portion of the end date extracted from the form. |
| `USE_YMD` | Field | Operation date (year+month+day) — the operational date for billing calculations. |
| `SVC_ENDYMD` | Field | Service end year-month-day — the official service end date stored in the contract data. |
| `SVC_CHRG_ENDYMD` | Field | Service charge end year-month-day — the date until which the customer is billed for this service. |
| `PRG_TKJK_1` | Field | Progress special item 1 — a progress tracking field set to indicate "Fixed Global IP Address" + "Cancellation". |
| `OP_TRAN_DIV_DSL` | Constant | Operation processing division for DSL (Fixed Global IP Address) — value `"04"`, meaning "Cancel" (解約). |
| `FUNC_CD_2` | Constant | Function code "2" — indicates confirmation mode for service execution (vs. execution mode "1"). |
| `KKW02404SF` | Screen | Fixed Global IP Address Information Update screen — the main screen for entering/update-confirmation of fixed global IP address changes. |
| `KKW02405` | Screen | Fixed Global IP Address Information Update Confirmation screen — the confirmation screen displayed after successful processing. |
| `KKSV0265` | Use Case | Fixed Global IP Address Cancellation OP processing — the backend use case ID for cancellation service dispatch. |
| `MSGSTRING[0]` | Constant | "固定グローバルIPアドレス情報の解約" (Fixed Global IP Address Info Cancel) — the success message displayed on confirmation. |
| EKB0370__I | Message | Information message for cancellation confirmation — displayed when cancellation processing succeeds. |
| EKB0690_NW | Message | Past date error — returned when the cancellation end date is in the past. Substituted as "Use end date" + "Past". |
| SOD | Acronym | Service Order Data — the telecom order fulfillment entity that tracks service orders and their lifecycle. |
| DSL | Business term | Fixed Global IP Address — a dedicated (static) Internet Protocol address assigned to a customer's connection. |
| 解約 (Kaishaku) | Business term | Cancellation — the business operation of terminating a service contract. |
| 固定グローバルIPアドレス (Kotei Global IP Address) | Business term | Fixed Global IP Address — a static public IP address assigned to a customer's network connection. |
| `invokeService` | Method | Backend service invocation — delegates to EJB layer to execute the mapped service operation. |
| `KKSV0265_KKSV0265OPDBMapper` | Class | OP-DB Mapper — maps DataBean fields to service parameters and retrieves results back into the DataBean for the KKSV0265 use case. |
| JCCWebBusinessLogic | Parent Class | Base business logic class — provides common methods like `getCommonInfoBean()`, `getServiceFormBean()`, and `invokeService()`. |
