---
Business Logic — KKW02404SFLogic.getMsgRep() [58 LOC]

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

## 1. Role

### KKW02404SFLogic.getMsgRep()

This method provides business message string substitution for the KKW02404SF screen (contract modification/cancellation processing). When a user performs a DSL line cancellation, a service reactivation, or a reservation cancellation within the web screen, the system generates message IDs (e.g., EKB0690_NW, EKB5440_JW, EKB5420_JW) that require localized replacement strings for display. `getMsgRep` is a **routing/dispatch utility** that maps a processing-type flag (`trandiv`) and a message ID (`rtn_msg_id`) to a `String[]` array of placeholder values. The caller then passes these strings to `JCCWebCommon.setMessageInfo()`, which renders the message to the user with placeholders replaced.

The method implements a **branch-and-lookup pattern** driven by two orthogonal dimensions: the processing type (cancellation, reactivation, reservation cancellation) and the specific message ID. Each active branch produces a `String[]` with 2-3 replacement tokens. If no branch matches (including when the processing type is unrecognized or the message ID is not handled within a recognized type), the method returns `null`, signaling the caller to display the message ID alone without substitution.

Within the larger KKW02404SF screen flow, this method is called from `actionFix()` and `actionUpd()` — the two core action handlers for fixing (confirming) and updating (modifying) contract details. It serves as a **shared substitution utility** for the screen's message-dispensing infrastructure.

Note: A commented-out section (delimited by IT1-2013-0000140, deleted 2013/01/09) previously handled additional DSL cancellation messages (EKB5440_JW and EKB0270_NW) with replacement strings for "suspension" and "future date" scenarios, but these were removed and are no longer active.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["getMsgRep(trandiv, rtn_msg_id)"])

    START --> Cond1{Check trandiv}

    Cond1 --> DSL["OP_TRAN_DIV_DSL branch"]
    Cond1 --> KAIHK["OP_TRAN_DIV_KAIHK branch"]
    Cond1 --> RSV["OP_TRAN_DIV_RSV_CL branch"]
    Cond1 --> DEF["Default branch"]

    DSL --> DSLMsgCheck{Check rtn_msg_id}
    DSLMsgCheck --> DSL_MATCH[EKB0690_NW match]
    DSLMsgCheck --> DSL_OTHER[Other message]

    DSL_MATCH --> DSL_ARR["Create String array for EKB0690_NW"]
    DSL_ARR --> DSL_RETURN(["Return String array"])
    DSL_OTHER --> DSL_RET_NULL(["Return null"])

    KAIHK --> KaihkMsgCheck{Check rtn_msg_id}
    KaihkMsgCheck --> KAIHK_MATCH[EKB5440_JW match]
    KaihkMsgCheck --> KAIHK_OTHER[Other message]

    KAIHK_MATCH --> KAIHK_ARR["Create String array for EKB5440_JW"]
    KAIHK_ARR --> KAIHK_RETURN(["Return String array"])
    KAIHK_OTHER --> KAIHK_RET(["Return null"])

    RSV --> RsvMsgCheck{Check rtn_msg_id}
    RsvMsgCheck --> RSV_MATCH[EKB5420_JW match]
    RsvMsgCheck --> RSV_OTHER[Other message]

    RSV_MATCH --> RSV_ARR["Create String array for EKB5420_JW"]
    RSV_ARR --> RSV_RETURN(["Return String array"])
    RSV_OTHER --> RSV_RET(["Return null"])

    DEF --> DEF_RET(["Return null"])

    DSL_RET_NULL --> END(["End"])
    DSL_RETURN --> END
    KAIHK_RET --> END
    KAIHK_RETURN --> END
    RSV_RET --> END
    RSV_RETURN --> END
    DEF_RET --> END
```

**Branch Summary:**

| Branch | Processing Type | Condition | Message ID Match | Result |
|--------|----------------|-----------|-----------------|--------|
| A | DSL Line Cancellation | `OP_TRAN_DIV_DSL` | `EKB0690_NW` (Past Date) | Returns 2-element replacement array |
| B | DSL Line Cancellation | `OP_TRAN_DIV_DSL` | No match | Returns `null` |
| C | Service Reactivation | `OP_TRAN_DIV_KAIHK` | `EKB5440_JW` (Outside Reactivation Period) | Returns 2-element replacement array |
| D | Service Reactivation | `OP_TRAN_DIV_KAIHK` | No match | Returns `null` |
| E | Reservation Cancellation | `OP_TRAN_DIV_RSV_CL` | `EKB5420_JW` (Cancellation Not Allowed) | Returns 2-element replacement array |
| F | Reservation Cancellation | `OP_TRAN_DIV_RSV_CL` | No match | Returns `null` |
| G | Default (unrecognized) | None | N/A | Returns `null` |

**CRITICAL — Constant Resolution:**

| Constant | Resolved Value | Business Meaning |
|----------|---------------|-----------------|
| `JKKCommonConst.OP_TRAN_DIV_DSL` | `"DSL"` | Processing type for DSL line cancellation |
| `JKKCommonConst.OP_TRAN_DIV_KAIHK` | `"KAIHK"` | Processing type for service reactivation |
| `JKKCommonConst.OP_TRAN_DIV_RSV_CL` | `"RSV_CL"` | Processing type for reservation cancellation |
| `JPCOnlineMessageConstant.EKB0690_NW` | `"EKB0690_NW"` | Error message for past-date contract termination |
| `JPCOnlineMessageConstant.EKB5440_JW` | `"EKB5440_JW"` | Error message for outside reactivation period |
| `JPCOnlineMessageConstant.EKB5420_JW` | `"EKB5420_JW"` | Error message for cancellation not allowed |

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `trandiv` | `String` | Processing type flag that determines which business operation context the message substitution operates under. Controls the primary branching dimension: DSL cancellation (`OP_TRAN_DIV_DSL`), service reactivation (`OP_TRAN_DIV_KAIHK`), or reservation cancellation (`OP_TRAN_DIV_RSV_CL`). When the value does not match any of these, the method returns `null`. |
| 2 | `rtn_msg_id` | `String` | Return message ID — the unique identifier of an error/confirmation message defined in the system's message bundle. Each message ID maps to a specific business scenario (e.g., past date error, reactivation period exceeded, cancellation forbidden). The method checks this against known IDs within the active `trandiv` branch. |
| 3 | *(implicit)* `JPCOnlineMessageConstant.*` | `String constants` | Message ID constants referenced for matching. These define the set of message IDs that produce substitution strings. |
| 4 | *(implicit)* `JKKCommonConst.OP_TRAN_DIV_*` | `String constants` | Processing type constants used to branch on the business operation context. |

## 4. CRUD Operations / Called Services

This method performs **no database operations, no SC/CBS calls, and no CRUD operations**. It is a pure in-memory lookup/substitution utility. All method calls within this method are local `String` array creation and comparison operations.

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| *(none)* | *(none)* | *(none)* | *(none)* | This method contains no data access. It solely computes replacement strings from input parameters and constant message IDs. |

## 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: -

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Class:KKW02404SFLogic (actionFix) | `KKW02404SFLogic.actionFix()` → `getMsgRep(trandiv, rtn_msg_id)` | *(none — pure substitution, no downstream calls)* |
| 2 | Class:KKW02404SFLogic (actionUpd) | `KKW02404SFLogic.actionUpd()` → `getMsgRep(trandiv, rtn_msg_id)` | *(none — pure substitution, no downstream calls)* |

**Caller Context:**

- **actionFix()** (line ~489): Called after the user confirms contract modification details on the fix confirmation screen. The method retrieves substitution strings for the message ID produced by the fix operation (e.g., cancellation confirmation, reactivation result) and passes them to `JCCWebCommon.setMessageInfo()` for display.
- **actionUpd()** (line ~675): Called after the user submits a contract update. The method retrieves substitution strings for the message ID produced by the update operation and displays the result to the user.

## 6. Per-Branch Detail Blocks

**Block 1** — IF `JKKCommonConst.OP_TRAN_DIV_DSL.equals(trandiv)` [OP_TRAN_DIV_DSL="DSL"] (L825)

> Branch for DSL line cancellation processing. The original code contained two additional message-handling blocks (EKB5440_JW and EKB0270_NW) that were deleted per IT1-2013-0000140 on 2013/01/09 (commented out). Only the EKB0690_NW block remains active.

| # | Type | Code |
|---|------|------|
| 1 | COMP | `JKKCommonConst.OP_TRAN_DIV_DSL.equals(trandiv)` // Checks if processing type is DSL cancellation [-> OP_TRAN_DIV_DSL="DSL"] |

**Block 1.1** — IF `JPCOnlineMessageConstant.EKB0690_NW.equals(rtn_msg_id)` [EKB0690_NW="EKB0690_NW"] (L849)

> When the return message ID is EKB0690_NW (past date error — the user attempted a contract termination for a date in the past), create replacement strings for "utilization termination date" and "past".

| # | Type | Code |
|---|------|------|
| 1 | SET | `String[] str = new String[] {"utilization termination date", "past"};` // Creates 2-element replacement array [Japanese: "利用終止日", "過去"] |
| 2 | RETURN | `return str;` | Returns the replacement array to the caller |

**Block 2** — ELSE-IF `JKKCommonConst.OP_TRAN_DIV_KAIHK.equals(trandiv)` [OP_TRAN_DIV_KAIHK="KAIHK"] (L860)

> Branch for service reactivation processing. Checks if the return message ID is EKB5440_JW (outside the reactivation period).

| # | Type | Code |
|---|------|------|
| 1 | COMP | `JKKCommonConst.OP_TRAN_DIV_KAIHK.equals(trandiv)` // Checks if processing type is reactivation [-> OP_TRAN_DIV_KAIHK="KAIHK"] |

**Block 2.1** — IF `JPCOnlineMessageConstant.EKB5440_JW.equals(rtn_msg_id)` [EKB5440_JW="EKB5440_JW"] (L864)

> When the return message ID is EKB5440_JW (outside reactivation period — the user attempted reactivation outside the allowed window), create replacement strings for "outside reactivation period" and "reactivation".

| # | Type | Code |
|---|------|------|
| 1 | SET | `String[] str = new String[] {"outside reactivation period", "reactivation"};` // Creates 2-element replacement array [Japanese: "回復可能期間外", "回復は"] |
| 2 | RETURN | `return str;` | Returns the replacement array to the caller |

**Block 3** — ELSE-IF `JKKCommonConst.OP_TRAN_DIV_RSV_CL.equals(trandiv)` [OP_TRAN_DIV_RSV_CL="RSV_CL"] (L872)

> Branch for reservation cancellation processing. Added per IT2-2012-0001034. Checks if the return message ID is EKB5420_JW (cancellation not allowed).

| # | Type | Code |
|---|------|------|
| 1 | COMP | `JKKCommonConst.OP_TRAN_DIV_RSV_CL.equals(trandiv)` // Checks if processing type is reservation cancellation [-> OP_TRAN_DIV_RSV_CL="RSV_CL"] |

**Block 3.1** — IF `JPCOnlineMessageConstant.EKB5420_JW.equals(rtn_msg_id)` [EKB5420_JW="EKB5420_JW"] (L876)

> When the return message ID is EKB5420_JW (cancellation not allowed — the user attempted to cancel a reservation that cannot be cancelled), create replacement strings for "option" and "reservation cancellation".

| # | Type | Code |
|---|------|------|
| 1 | SET | `String[] str = new String[] {"option", "reservation cancellation"};` // Creates 2-element replacement array [Japanese: "オプション", "予約取消"] |
| 2 | RETURN | `return str;` | Returns the replacement array to the caller |

**Block 4** — DEFAULT (L877)

> When none of the processing types or message IDs match, return `null` to signal the caller to display the message ID without substitution.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return null;` | No matching branch — caller should display raw message ID |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `trandiv` | Field | Processing type division — a string flag indicating the type of business operation (cancellation, reactivation, reservation cancellation) being performed in the contract management flow |
| `rtn_msg_id` | Field | Return message ID — a unique identifier referencing a localized message in the system's message bundle (e.g., EKB0690_NW, EKB5440_JW, EKB5420_JW) |
| `OP_TRAN_DIV_DSL` | Constant | Processing type: DSL line cancellation — the user is cancelling an existing DSL (Digital Subscriber Line) internet service contract |
| `OP_TRAN_DIV_KAIHK` | Constant | Processing type: Service reactivation — the user is reactivating a suspended or previously cancelled service within the allowed reactivation window |
| `OP_TRAN_DIV_RSV_CL` | Constant | Processing type: Reservation cancellation — the user is cancelling a previously made service reservation or order |
| `EKB0690_NW` | Message ID | Past date termination error — displayed when a user attempts to set a contract termination date that is before today |
| `EKB5440_JW` | Message ID | Outside reactivation period error — displayed when a user attempts to reactivate a service outside the permitted reactivation window |
| `EKB5420_JW` | Message ID | Cancellation not allowed error — displayed when a user attempts to cancel a reservation that is not eligible for cancellation |
| `JPCOnlineMessageConstant` | Class | Message ID constant definitions — the class that defines all standardized message identifiers used across the JPC Online system |
| `JKKCommonConst` | Class | Common constants definitions — the class that defines shared constants including processing type divisions |
| `JCCWebCommon.setMessageInfo()` | Method | Web common message setter — the method that receives the message ID and replacement strings and formats the display message for the screen |
| `KKW02404SF` | Module | Contract modification/cancellation screen module — the web screen module that handles contract detail changes and cancellations |
| DSL | Business term | Digital Subscriber Line — a type of internet connection service managed in this system |
| KAIHK | Business term | Reactivation (Japanese: 回復) — the process of restoring a suspended or cancelled service |
| RSV_CL | Business term | Reservation Cancellation (Japanese: 予約取消) — the process of cancelling a pending service reservation |
