# Business Logic — KKW02404SFLogic.executeDslSvc() [36 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.KKW02404SF.KKW02404SFLogic` |
| Layer | Service / Web Business Logic (Controller-adjacent — extends `JCCWebBusinessLogic`, sits behind a screen flow) |
| Module | `KKW02404SF` (Package: `eo.web.webview.KKW02404SF`) |

## 1. Role

### KKW02404SFLogic.executeDslSvc()

This method performs the **Fixed Global IP Address Cancellation Confirmation Service** execution. It is the core service-invocation routine for the "Fixed Global IP Address Information Update" screen (`KKW02404SF`), which manages the cancellation (解除) of fixed global IP address service contracts within the telecom contract management system.

The method follows a **data mapping then delegation** pattern: it first maps input DataBean fields into a `HashMap` (inputMap) covering three data domains — the service contract line-item details (`OpSvcKeiDslCC`), the Service Order Data (`JKKHakkoSODCC`), and the work tracking record (`KKSV0265WORK`). It then delegates to a background service via `invokeService`, which routes to the `KKSV0265` use case via the framework. Finally, it pulls results back from the output map into the DataBean via `getOpSvcKeiDslCC`.

The method acts as a **shared service dispatch entry point** on the logic class, called by `actionFix()` (confirmation/finalize button) and `actionUpd()` (update button). It clears the return message ID before service execution and does not perform its own validation — it relies on the mapper and the invoked service component to enforce business rules.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["executeDslSvc(params)"])

    START --> INIT["Initialize paramMap, inputMap, outputMap"]
    INIT --> SET_USECASE["Set paramMap<br>TELEGRAM_INFO_USECASE_ID = KKSV0265"]
    SET_USECASE --> CREATE_MAPPER["Create KKSV0265_KKSV0265OPDBMapper instance"]
    CREATE_MAPPER --> MAP_CANCELLATION["mapper.setOpSvcKeiDslCC<br>(paramBean, inputMap, func_code)"]
    MAP_CANCELLATION --> MAP_SOD["mapper.setJKKHakkoSODCC<br>(paramBean, inputMap, func_code)"]
    MAP_SOD --> MAP_WORK["mapper.setKKSV0265WORK<br>(paramBean, inputMap, func_code)"]
    MAP_WORK --> CLEAR_RETURN["paramBean[0].sendMessageString<br>(RTN_MSG_ID, DATABEAN_SET_VALUE, \"\")"]
    CLEAR_RETURN --> EXEC_SERVICE["invokeService<br>(paramMap, inputMap, outputMap)"]
    EXEC_SERVICE --> GET_RESULT["mapper.getOpSvcKeiDslCC<br>(paramBean, outputMap)"]
    GET_RESULT --> END_NODE(["Return / Next"])
```

**Processing flow description:**

1. **Initialize maps** — Three `HashMap` instances are created to serve distinct roles: `paramMap` for service invocation parameters, `inputMap` for data passed to the service, and `outputMap` for data returned from the service.
2. **Set use case ID** — The `TELEGRAM_INFO_USECASE_ID` is set to `"KKSV0265"` so that `invokeService` routes the call to the correct use case (service component).
3. **Create mapper** — A `KKSV0265_KKSV0265OPDBMapper` instance is instantiated to handle DataBean-to-HashMap mapping.
4. **Map cancellation data** — `setOpSvcKeiDslCC` copies the service contract line-item cancellation fields (the DSL service details being cancelled) from the DataBean into `inputMap`.
5. **Map SOD data** — `setJKKHakkoSODCC` copies the Service Order Data fields (order cancellation records) into `inputMap`.
6. **Map WORK data** — `setKKSV0265WORK` copies the work tracking record fields into `inputMap`.
7. **Clear return message** — The return message ID is reset to an empty string so no stale message carries over to the next operation.
8. **Invoke service** — The framework `invokeService` method delegates to the `KKSV0265` use case, executing the actual service cancellation logic. This is where data is read from and written to the database via the service component chain.
9. **Retrieve results** — `getOpSvcKeiDslCC` copies updated service contract line-item data from `outputMap` back into the DataBean for display.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `paramBean` | `X31SDataBeanAccess[]` | Array of screen data beans carrying the Fixed Global IP Address cancellation form data. Contains the service contract line-item details, order cancellation data, and work tracking records for the cancellation confirmation operation. `paramBean[0]` is used to send the return message. |
| 2 | `func_code` | `String` | Function code identifying the specific operation context (e.g., confirmation vs. update). Passed through the mapper methods to distinguish between different action modes when reading/writing DataBean fields. |

**Instance fields / external state:**

| Source | Description |
|--------|-------------|
| `JCCWebBusinessLogic.invokeService()` | Inherited method from parent class; routes to the `KKSV0265` use case framework for service execution. |
| `KKSV0265_KKSV0265OPDBMapper` (local) | Mapper object handling DataBean-to-HashMap field mapping for service contract cancellation data. |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `invokeService` | `JCCWebBusinessLogic` (framework router) | — | Framework-level service dispatch; routes to `KKSV0265` use case (see below for terminal operations) |
| R | `KKSV0265_KKSV0265OPDBMapper.getOpSvcKeiDslCC` | `KKSV0265` | `KK_T_OPSVKEI_ISP` (DSL service contract line-item) | Retrieves updated service contract line-item data from outputMap and writes back to DataBean after service execution |
| - | `KKSV0265_KKSV0265OPDBMapper.setOpSvcKeiDslCC` | `KKSV0265` | `KK_T_OPSVKEI_ISP` (DSL service contract line-item) | Maps service contract line-item fields from paramBean into inputMap for service input |
| - | `KKSV0265_KKSV0265OPDBMapper.setJKKHakkoSODCC` | `KKSV0265` | `KK_T_ODR_HAKKO_JOKEN` (Order Cancellation SOD) | Maps Service Order Data fields from paramBean into inputMap for service input |
| - | `KKSV0265_KKSV0265OPDBMapper.setKKSV0265WORK` | `KKSV0265` | `KK_T_WORK_KKW02404` (Work tracking record) | Maps work tracking fields from paramBean into inputMap for service input |
| - | `X31SDataBeanAccess.sendMessageString` | — | — | Clears the return message ID field on the DataBean with an empty string |

**CRUD classification rationale:**

- `invokeService` — **C/R/U/D** (all): The invoked `KKSV0265` use case performs the actual database operations for the cancellation flow — reading existing service contract data, writing cancellation records, and updating status fields.
- `getOpSvcKeiDslCC` — **R** (Read): Reads result data from the output map and populates the DataBean.
- `setOpSvcKeiDslCC` — **U** (Update): Populates the input map with cancellation data (writes to the map).
- `setJKKHakkoSODCC` — **U** (Update): Populates the input map with SOD cancellation data.
- `setKKSV0265WORK` — **U** (Update): Populates the input map with work tracking data.
- `sendMessageString` — **U** (Update): Sets the return message ID field value.

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | `KKW02404SFLogic.actionFix()` | `KKW02404SFLogic.actionFix()` -> `executeDslSvc()` | `getOpSvcKeiDslCC [R] KK_T_OPSVKEI_ISP`, `invokeService [-] KKSV0265 SC chain` |
| 2 | `KKW02404SFLogic.actionUpd()` | `KKW02404SFLogic.actionUpd()` -> `executeDslSvc()` | `getOpSvcKeiDslCC [R] KK_T_OPSVKEI_ISP`, `invokeService [-] KKSV0265 SC chain` |

**Terminal operations reached from this method:**

| Terminal | Type | Description |
|----------|------|-------------|
| `getOpSvcKeiDslCC` | R | Read — Retrieves DSL service contract line-item data from outputMap |
| `invokeService` | C/R/U/D | Delegates to `KKSV0265` use case which performs database-level cancellation operations across `KK_T_OPSVKEI_ISP`, `KK_T_ODR_HAKKO_JOKEN`, and `KK_T_WORK_KKW02404` |

The `actionFix()` method handles the **confirmation button** press (finalizing the cancellation), and `actionUpd()` handles the **update button** press (updating the cancellation record). Both route through `executeDslSvc` for the service invocation.

## 6. Per-Branch Detail Blocks

This method has **no conditional branches** (no if/else, switch, loops). It follows a purely linear execution path. Below is the block-by-block analysis of each processing step.

### Block 1 — [VARIABLE DECLARATION] (L549–L551)

> Variable definition for the three working maps. All are initialized to `null` and reassigned on the next lines.

| # | Type | Code |
|---|------|------|
| 1 | SET | `HashMap<String, Object> paramMap = null;` // Parameter map for service invocation |
| 2 | SET | `HashMap<String, Object> inputMap = null;` // Input map for service data transfer |
| 3 | SET | `HashMap<String, Object> outputMap = null;` // Output map for service results |

### Block 2 — [SET / ALLOCATION] (L555–L557)

> Map instantiation. The Japanese comment identifies each map's role: "パラメータ設定用マップ" (parameter setting map), "入力用マップ" (input map), "結果格納用マップ" (result storage map).

| # | Type | Code |
|---|------|------|
| 1 | SET | `paramMap = new HashMap<String, Object>();` // Parameter setting map [-> Java HashMap] |
| 2 | SET | `inputMap = new HashMap<String, Object>();` // Input map [-> Java HashMap] |
| 3 | SET | `outputMap = new HashMap<String, Object>();` // Result storage map [-> Java HashMap] |

### Block 3 — [SET] (L560)

> Set the use case ID to `"KKSV0265"` so that `invokeService` knows which service component to route to. `TELEGRAM_INFO_USECASE_ID` is a framework constant.

| # | Type | Code |
|---|------|------|
| 1 | SET | `paramMap.put(X31CWebConst.TELEGRAM_INFO_USECASE_ID, "KKSV0265");` // Set service use case ID |

### Block 4 — [SET] (L563)

> Instantiate the mapper that handles DataBean-to-HashMap field mapping for the KKSV0265 use case.

| # | Type | Code |
|---|------|------|
| 1 | SET | `KKSV0265_KKSV0265OPDBMapper mapper = new KKSV0265_KKSV0265OPDBMapper();` // Mapper for DSL service data |

### Block 5 — [CALL: setOpSvcKeiDslCC] (L566)

> Map cancellation data. Copies DSL service contract line-item fields (e.g., service number, contract details, cancellation reason) from the DataBean into `inputMap`.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `mapper.setOpSvcKeiDslCC(paramBean, inputMap, func_code);` // Service contract line-item cancellation mapping [-> OpSvcKeiDslCC] |

### Block 6 — [CALL: setJKKHakkoSODCC] (L568)

> Map Service Order Data. Copies SOD cancellation record fields from the DataBean into `inputMap`. "SODCCマッピング" (SODCC mapping).

| # | Type | Code |
|---|------|------|
| 1 | CALL | `mapper.setJKKHakkoSODCC(paramBean, inputMap, func_code);` // Service Order Data cancellation mapping [-> JKKHakkoSODCC] |

### Block 7 — [CALL: setKKSV0265WORK] (L570)

> Map work tracking record. Copies work tracking fields from the DataBean into `inputMap`. "WORKマッピング" (WORK mapping).

| # | Type | Code |
|---|------|------|
| 1 | CALL | `mapper.setKKSV0265WORK(paramBean, inputMap, func_code);` // Work tracking record mapping [-> KKSV0265WORK] |

### Block 8 — [CALL: sendMessageString] (L573)

> Clear the return message ID. The constant `RTN_MSG_ID` ("返却メッセージID", Return Message ID) is set to an empty string so that no stale confirmation message persists.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `paramBean[0].sendMessageString(KKW02404SFConst.RTN_MSG_ID, X31CWebConst.DATABEAN_SET_VALUE, "");` // Clear return message ID [-> RTN_MSG_ID="返却メッセージID", DATABEAN_SET_VALUE="dataBeanSetValue"] |

### Block 9 — [CALL: invokeService] (L576)

> Execute the service. Delegates to the framework's `invokeService` method, which routes to the `KKSV0265` use case (set in `paramMap`). This is where the actual cancellation business logic executes — the service component chain reads, updates, and writes cancellation records to the database. The Japanese comment identifies it as "サービス実行" (Service execution).

| # | Type | Code |
|---|------|------|
| 1 | CALL | `invokeService(paramMap, inputMap, outputMap);` // Execute KKSV0265 cancellation service [-> JCCWebBusinessLogic.invokeService()] |

### Block 10 — [CALL: getOpSvcKeiDslCC] (L579)

> Retrieve results. Copies updated service contract line-item data from `outputMap` back into the DataBean so the screen displays the post-cancellation state. The Japanese comment is "結果取得" (Result retrieval).

| # | Type | Code |
|---|------|------|
| 1 | CALL | `mapper.getOpSvcKeiDslCC(paramBean, outputMap);` // Retrieve DSL service results [-> OpSvcKeiDslCC] |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `KKW02404SF` | Module | Fixed Global IP Address Information Update — screen module for managing fixed global IP address service contract operations |
| `KKSV0265` | Use Case ID | Service Order Data for DSL service cancellation confirmation — the use case invoked during cancellation |
| DSL | Business term | Digital Subscriber Line — broadband internet access service over telephone lines |
| Fixed Global IP | Business term | A static public IP address assigned to a customer's connection for the internet service |
| Cancellation (解除) | Business term | The process of terminating a service contract for the Fixed Global IP Address |
| `paramBean` | Field | DataBean access array — carries the screen form data (input/output) between the presentation layer and business logic |
| `func_code` | Field | Function code — identifies which action triggered the method (e.g., confirmation/finalize vs. update) |
| `RTN_MSG_ID` | Constant | Return Message ID — the screen message field identifier; set to empty to clear stale messages |
| `TELEGRAM_INFO_USECASE_ID` | Constant | Framework constant — key used in paramMap to specify which use case/service component to invoke |
| `OpSvcKeiDslCC` | Domain entity | Service Contract Line Item (DSL) Cancellation Confirmation — the core entity for DSL service contract line items being cancelled |
| `JKKHakkoSODCC` | Domain entity | Service Order Data (SOD) Cancellation Confirmation — order cancellation records linked to the service cancellation |
| `KKSV0265WORK` | Domain entity | Work tracking record — internal processing status record for the KKSV0265 workflow |
| `invokeService` | Framework method | JCCWebBusinessLogic framework method that routes service calls to the correct use case based on `TELEGRAM_INFO_USECASE_ID` |
| `setOpSvcKeiDslCC` | Mapper method | Maps DSL service contract line-item fields from DataBean to HashMap for service input |
| `setJKKHakkoSODCC` | Mapper method | Maps Service Order Data cancellation fields from DataBean to HashMap for service input |
| `setKKSV0265WORK` | Mapper method | Maps work tracking record fields from DataBean to HashMap for service input |
| `getOpSvcKeiDslCC` | Mapper method | Retrieves updated DSL service contract line-item data from the service output HashMap back into the DataBean |
| SOD | Acronym | Service Order Data — the telecom order management entity representing customer service orders |
| `KK_T_OPSVKEI_ISP` | Entity / DB Table | Service contract line-item ISP table — stores DSL/ISP service contract details |
| `KK_T_ODR_HAKKO_JOKEN` | Entity / DB Table | Order cancellation SOD table — stores order cancellation records |
| DATABEAN_SET_VALUE | Constant | Framework constant — flag value indicating the `sendMessageString` method should set a value directly on the DataBean |
