# Business Logic — ZMW01904SFLogic.init() [57 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.ZMW01904SF.ZMW01904SFLogic` |
| Layer | Webview / Screen Business Logic (Controller tier within the Web layer) |
| Module | `ZMW01904SF` (Package: `eo.web.webview.ZMW01904SF`) |

## 1. Role

### ZMW01904SFLogic.init()

This method performs the **initial display processing** for the ENUM Portability (ENUM Sekki) screen — the primary interface where customers and staff review and submit portability requests for telephone numbers between telecommunications carriers. As the entry point for screen ZMW01904, it orchestrates the full initialization sequence: retrieving shared context beans, determining the operational mode (update vs. inquiry) based on the originating screen, configuring navigation metadata, and delegating to `getInfoInitData()` for field-level initialization.

The method implements a **routing/dispatch design pattern** by branching on the `screenId` value to distinguish three distinct navigation scenarios: (1) redirection from the Phone Number Update screen (ZMW02001) triggers Update Mode, (2) redirection from the Phone Number Details screen (ZMW02201) triggers Inquiry Mode, and (3) any other navigation defaults to Inquiry Mode. This allows the same screen to support both data modification workflows and read-only viewing workflows seamlessly.

In the larger system, this method serves as the **screen entry point** for the ENUM Portability feature within the K-Opticom customer backend system. The ENUM Portability feature enables telephone number porting (MNP — Mobile Number Portability) between carriers, a regulated telecommunications service in Japan. The method ensures that when users arrive at this screen from any source, the UI state, navigation context, and operational mode are properly configured before any display data is loaded.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["init Entry"])
    GET_COMMON["getCommonInfoBean"]
    GET_SERVICE["getServiceFormBean"]
    GET_SCREEN["getScreenId this"]
    CHECK_NULL{"screenId equals null"}
    SET_SCREEN["setScreenId ZMW01906 ZMW01904"]
    CREATE_PARAM["create paramBean array"]
    CHECK_SCREEN{"screenId equals ZMW02001"}
    UPDATE_MODE["sendMessageString UPD_MODE value 1"]
    CHECK_INQ{"screenId equals ZMW02201"}
    INQUIRY_MODE["sendMessageString UPD_MODE value 0"]
    DEFAULT_INQ["sendMessageString UPD_MODE value 0"]
    CLEAR_PAGE["clearPageLinkInfo"]
    GET_SCREEN_INFO["getScreenInfo"]
    INIT_DATA["getInfoInitData bean this gamenId"]
    SET_PAGING["setSearchCommand PAGING"]
    SET_NEXT_SCREEN["set NEXT_SCREEN_ID and NEXT_SCREEN_NAME"]
    RETURN_TRUE["return true"]

    START --> GET_COMMON
    START --> GET_SERVICE
    START --> GET_SCREEN
    GET_SCREEN --> CHECK_NULL
    CHECK_NULL --> Yes["Yes"]
    CHECK_NULL --> No["No"]
    Yes --> SET_SCREEN
    No --> CREATE_PARAM
    SET_SCREEN --> CREATE_PARAM
    CREATE_PARAM --> CHECK_SCREEN
    CHECK_SCREEN --> Yes2["Yes"]
    CHECK_SCREEN --> No2["No"]
    Yes2 --> UPDATE_MODE
    No2 --> CHECK_INQ
    UPDATE_MODE --> CHECK_INQ
    CHECK_INQ --> Yes3["Yes"]
    CHECK_INQ --> No3["No"]
    Yes3 --> INQUIRY_MODE
    No3 --> DEFAULT_INQ
    INQUIRY_MODE --> CLEAR_PAGE
    DEFAULT_INQ --> CLEAR_PAGE
    CLEAR_PAGE --> GET_SCREEN_INFO
    GET_SCREEN_INFO --> INIT_DATA
    INIT_DATA --> SET_PAGING
    SET_PAGING --> SET_NEXT_SCREEN
    SET_NEXT_SCREEN --> RETURN_TRUE
```

**Branch Explanation:**

| Branch | Condition | Business Meaning |
|--------|-----------|-----------------|
| Branch 1 | `screenId == null` | No screen context exists — set redirect to ENUM Portability Completion screen (ZMW01906) |
| Branch 2 | `screenId == ZMW02001` | Arrived from Phone Number Info Update screen — set Update Mode (`UPD_INQ_MODE_FLG_UPD = "1"`) |
| Branch 3 | `screenId == ZMW02201` | Arrived from Phone Number Details screen — set Inquiry Mode (`UPD_INQ_MODE_FLG_INQ = "0"`) |
| Branch 4 | `else` (default) | Arrived from any other screen — default to Inquiry Mode (`UPD_INQ_MODE_FLG_INQ = "0"`) |

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| - | (none) | - | This method takes no parameters. All input is derived from the HTTP session, screen context, and inherited state from the parent `JCCWebBusinessLogic` class. |

**External state / instance fields accessed:**

| # | Field / External State | Access Pattern | Business Description |
|---|----------------------|----------------|---------------------|
| 1 | `CommonInfoBean` (via `getCommonInfoBean()`) | Read | Shared web-view common context bean holding cross-screen navigation metadata such as next screen ID and next screen name |
| 2 | `ServiceFormBean` (via `getServiceFormBean()`) | Read | Screen-specific form bean for the ENUM Portability screen, carrying user input and displayed data |
| 3 | `gamenId` (via `getGamenId()`) | Read | Screen identification ID used for page linking and navigation context (obtained via `JCCFrontRequestFilter` or `FUW10901SFLogic`) |
| 4 | `this` (JCCWebBusinessLogic context) | Read/Write | Request scope context used by common utilities for screen ID, page link, and screen info management |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `JZMWebCommon.getScreenId` | JZMWebCommon | - | Retrieves the originating screen ID from the request context session |
| - | `JZMWebCommon.setScreenId` | JZMWebCommon | - | Sets the current screen ID and previous screen ID in the request context (for back navigation) |
| - | `X31SDataBeanAccess.sendMessageString` | X31SDataBeanAccess | - | Sets message values into the service form bean for mode flags and screen references |
| - | `JZMWebCommon.clearPageLinkInfo` | JZMWebCommon | - | Clears pagination and page link information to prepare for fresh initial display |
| - | `JCCWebCommon.getScreenInfo` | JCCWebCommon | - | Retrieves and restores inherited screen information from the session for the current screen ID |
| C | `ZMW01904SFLogic.getInfoInitData` | ZMW01904SFLogic | - | Initializes display fields, edit settings, and button active/inactive state control for the ENUM Portability screen |
| - | `JZMWebCommon.setSearchCommand` | JZMWebCommon | - | Sets the search command event ID (PAGING) for pagination control |
| - | `X31SDataBeanAccess.sendMessageString` | CommonInfoBean | - | Sets the next screen ID and next screen name metadata for post-processing navigation routing |

**CRUD Classification Notes:**
- No direct database CRUD operations (C/R/U/D) are executed within this method. All called methods are utility/setter operations for screen state management, navigation configuration, and bean population.
- The `getInfoInitData()` call is the most operationally significant — it internally handles data reads (R) from backend SC/CBS layers for ENUM portability history, phone number info, port-out status, and related carrier change data, but those operations are encapsulated within that method.

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Screen:ZMW01904 (ENUM Portability) | `ZMW01904SFormLogic.init` -> `ZMW01904SFLogic.init` | `getInfoInitData [C] screen_init_data` |
| 2 | Screen:ZMW02001 (Phone Number Update) | `ZMW02001SFormLogic.process` -> redirect -> `ZMW01904SFLogic.init` | `sendMessageString [SET] UPD_INQ_MODE_FLG="1"` |
| 3 | Screen:ZMW02201 (Phone Number Details) | `ZMW02201SFormLogic.process` -> redirect -> `ZMW01904SFLogic.init` | `sendMessageString [SET] UPD_INQ_MODE_FLG="0"` |

**Caller Context:**
- **ZMW01904 (ENUM Portability)**: The primary entry point. This screen displays the ENUM portability screen where users view and submit portability requests.
- **ZMW02001 (Phone Number Update)**: After updating phone number information, the user is redirected back to the ENUM Portability screen in Update Mode.
- **ZMW02201 (Phone Number Details)**: After viewing phone number details, the user is redirected to the ENUM Portability screen in Inquiry Mode.

## 6. Per-Branch Detail Blocks

**Block 1** — [SET/GET] `(Bean Retrieval)` (L219)

> Retrieve the common context bean and service form bean from the request scope. These provide the data backbone for all subsequent processing.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `getCommonInfoBean()` // Retrieve the common form bean (X31SDataBeanAccess) |
| 2 | CALL | `getServiceFormBean()` // Retrieve the service form bean (X31SDataBeanAccess) |

---

**Block 2** — [IF] `(screenId == null)` [SCREEN_ID_NULL_CHECK] (L224)

> Check if the originating screen ID is null. When null, it means the session context was lost or this is an unexpected entry — redirect the user to the ENUM Portability Completion screen (ZMW01906).

| # | Type | Code |
|---|------|------|
| 1 | CALL | `JZMWebCommon.getScreenId(this)` // Get the current screen ID from context |
| 2 | SET | `screenId = null` // screenId is null — no originating screen |
| 3 | CALL | `JZMWebCommon.setScreenId(this, JZMScreenConst.SCREEN_ID_ZMW01906, JZMScreenConst.SCREEN_ID_ZMW01904)` // Set redirect target to ZMW01906 (ENUM Portability Completion), prev screen = ZMW01904 |

**Block 2.1** — [ELSE] `(screenId != null)` [SCREEN_ID_PRESENT] (L224)

> screenId is valid — proceed to set up mode flags based on the originating screen.

| # | Type | Code |
|---|------|------|
| 1 | SET | `paramBean[0] = bean` // Wrap service form bean in array for downstream access |

**Block 2.1.1** — [IF] `(screenId == ZMW02001)` [SCREEN_ID_ZMW02001 = "ZMW02001"] (L232)

> User arrived from the Phone Number Update screen. Set Update Mode flag and capture the previous screen ID. In Update Mode, the screen allows modification of portability-related data.

| # | Type | Code |
|---|------|------|
| 1 | SET | `UPD_INQ_MODE_FLG_UPD = "1"` // Private constant: Update Mode flag value |
| 2 | EXEC | `paramBean[0].sendMessageString(ZMW01904SFConst.UPD_INQ_MODE_FLG, X31CWebConst.DATABEAN_SET_VALUE, UPD_INQ_MODE_FLG_UPD)` // Set mode flag to "1" (Update Mode) |
| 3 | EXEC | `paramBean[0].sendMessageString(ZMW01904SFConst.BEF_SCREENID, X31CWebConst.DATABEAN_SET_VALUE, screenId)` // Store previous screen ID ZMW02001 |

**Block 2.1.2** — [ELSE IF] `(screenId == ZMW02201)` [SCREEN_ID_ZMW02201 = "ZMW02201"] (L237)

> User arrived from the Phone Number Details screen. Set Inquiry Mode flag and capture the previous screen ID. In Inquiry Mode, the screen is read-only.

| # | Type | Code |
|---|------|------|
| 1 | SET | `UPD_INQ_MODE_FLG_INQ = "0"` // Private constant: Inquiry Mode flag value |
| 2 | EXEC | `paramBean[0].sendMessageString(ZMW01904SFConst.UPD_INQ_MODE_FLG, X31CWebConst.DATABEAN_SET_VALUE, UPD_INQ_MODE_FLG_INQ)` // Set mode flag to "0" (Inquiry Mode) |
| 3 | EXEC | `paramBean[0].sendMessageString(ZMW01904SFConst.BEF_SCREENID, X31CWebConst.DATABEAN_SET_VALUE, screenId)` // Store previous screen ID ZMW02201 |

**Block 2.1.3** — [ELSE] `(default)` [DEFAULT_SCREEN] (L243)

> User arrived from any screen other than ZMW02001 or ZMW02201. Default to Inquiry Mode. The comment explicitly states "unscreen from an unexpected screen, inquiry mode" — this is a safety fallback.

| # | Type | Code |
|---|------|------|
| 1 | SET | `UPD_INQ_MODE_FLG_INQ = "0"` // Private constant: Inquiry Mode flag value |
| 2 | EXEC | `paramBean[0].sendMessageString(ZMW01904SFConst.UPD_INQ_MODE_FLG, X31CWebConst.DATABEAN_SET_VALUE, UPD_INQ_MODE_FLG_INQ)` // Set mode flag to "0" (Inquiry Mode) |
| 3 | EXEC | `paramBean[0].sendMessageString(ZMW01904SFConst.BEF_SCREENID, X31CWebConst.DATABEAN_SET_VALUE, screenId)` // Store previous screen ID |

---

**Block 3** — [SET] `(Page Information Initialization)` (L249)

> Clear pagination and page link information to prepare a clean initial display state.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `JZMWebCommon.clearPageLinkInfo(this, this.getGamenId())` // Clear page link info for the current screen |

---

**Block 4** — [SET] `(Inherited Information Retrieval)` (L252)

> Retrieve and restore inherited screen information from the session, keyed by the current screen ID (ZMW01904).

| # | Type | Code |
|---|------|------|
| 1 | CALL | `JCCWebCommon.getScreenInfo(this, JZMScreenConst.SCREEN_ID_ZMW01904)` // Restore session screen info for ZMW01904 |

---

**Block 5** — [CALL] `(Initial Display Field Initialization)` (L255)

> The core initialization call. Delegates to `getInfoInitData()` which handles: initial display field acquisition, edit settings, and button active/inactive state control. This method reads ENUM portability history, phone number status, port-out application info, and carrier change data to populate the screen.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `this.getInfoInitData(bean, this, this.getGamenId())` // Initialize all display fields and UI state for ENUM portability |

---

**Block 6** — [SET] `(Search Command ID Setting)` (L258)

> Set the search command event ID for pagination control.

| # | Type | Code |
|---|------|------|
| 1 | SET | `EVENT_ID_PAGING = "PAGING"` // Private constant: Pagination event identifier |
| 2 | CALL | `JZMWebCommon.setSearchCommand(this, JZMWebConst.EVENT_ID_PAGING)` // Register PAGING as the active search command |

---

**Block 7** — [SET] `(Next Screen ID and Name Setting)` (L261)

> Set the next screen navigation metadata so that post-processing operations (e.g., button click handlers) know where to route the user next.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `commoninfoBean.sendMessageString(CommonInfoCFConst.NEXT_SCREEN_ID, X31CWebConst.DATABEAN_SET_VALUE, JZMScreenConst.SCREEN_ID_ZMW01904)` // Set next screen ID to ZMW01904 |
| 2 | CALL | `commoninfoBean.sendMessageString(CommonInfoCFConst.NEXT_SCREEN_NAME, X31CWebConst.DATABEAN_SET_VALUE, JZMScreenConst.SCREEN_NAME_ZMW01904)` // Set next screen name to "ENUM Sekki" (ENUM Portability) |

---

**Block 8** — [RETURN] `(Success)` (L264)

> Return true to indicate successful initialization.

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

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `ENUM` | Business term | Electronic Network Management — K-Opticom's proprietary telecommunications service brand for integrated internet, phone, and broadcast services |
| `ENUM Sekki` | Japanese term | ENUM Portability — the screen/module for managing telephone number portability (MNP: Mobile Number Portability) between carriers within the ENUM service framework |
| `ZMW01904` | Screen ID | ENUM Portability main screen — primary interface for viewing and submitting portability requests |
| `ZMW01905` | Screen ID | ENUM Portability Confirmation screen — user reviews and confirms portability details before submission |
| `ZMW01906` | Screen ID | ENUM Portability Completion screen — confirmation screen shown after successful portability submission |
| `ZMW02001` | Screen ID | Phone Number Info Update screen — allows modification of telephone number details |
| `ZMW02201` | Screen ID | Phone Number Details screen — read-only view of telephone number information |
| `UPD_INQ_MODE_FLG` | Field | Update/Inquiry Mode Flag — distinguishes between data modification mode ("1") and read-only inquiry mode ("0") |
| `UPD_INQ_MODE_FLG_UPD` | Constant | Private constant value "1" — Update Mode flag value, set when arriving from ZMW02001 |
| `UPD_INQ_MODE_FLG_INQ` | Constant | Private constant value "0" — Inquiry Mode flag value, set when arriving from ZMW02201 or any other screen |
| `BEF_SCREENID` | Field | Previous Screen ID — stores the ID of the screen from which the user navigated to the current screen |
| `SINSEI_NAIYO_FLG` | Field | Application Content Flag — flag indicating the type of portability application (e.g., port-out, inter-carrier transfer) |
| `TELNO` | Field | Telephone Number — the phone number subject to portability |
| `AGING_NO` | Field | Aging Number — internal processing/queue number for the portability request |
| `DSP_TELNO` | Field | Display Telephone Number — formatted phone number for UI presentation |
| `BNGSHUTK_JGS_CD` | Field | Number Acquisition Carrier Code — code identifying the carrier that acquired the telephone number |
| `ITNMT_JGS_CD` | Field | Pre-transfer Carrier Code — code identifying the carrier before porting |
| `CNGAF_ITNSK_JGS_CD` | Field | Post-change Carrier Code — code identifying the carrier after porting |
| `KOJIN_HOJIN_TLN_TAI_CD` | Field | Individual/Corporate Telephone Number Band Code — classifies whether the phone number belongs to an individual or corporate customer |
| `SVC_KEI_NO` | Field | Service Contract Number — unique identifier for a service contract line item |
| `PORT_OUT_NO` | Field | Port-out Number — the application/reference number for a port-out request |
| `SOD` | Acronym | Service Order Data — the entity/table storing service order information including portability requests |
| `ENUMSOD_DOMAIN` | Field | ENUM SODO Domain — domain classification for ENUM SOD records |
| `ENUMSOD_DMSKNO_KN` | Field | DSS Business Contract Number (Individual) — individual customer's DSS contract number |
| `ENUMSOD_DMSKNO_HN` | Field | DSS Business Contract Number (Corporate) — corporate customer's DSS contract number |
| `NEWTSHIN_PORT_OUT_NO` | Field | Latest Application Port-out Number — the most recent port-out application number |
| `ZNKISHIN_PORT_OUT_NO` | Field | Previous Application Port-out Number — the port-out number from the prior application |
| `NEXT_SCREEN_ID` | Field | Next Screen ID — navigation metadata specifying the target screen after processing |
| `NEXT_SCREEN_NAME` | Field | Next Screen Name — human-readable name of the next screen |
| `EVENT_ID_PAGING` | Constant | "PAGING" — event identifier for pagination controls on the screen |
| `DATABEAN_SET_VALUE` | Constant | "SET_VALUE" — message type indicating a value should be set in the data bean |
| `DATABEAN_GET_VALUE` | Constant | "GET_VALUE" — message type indicating a value should be retrieved from the data bean |
| `gamenId` | Field | Screen ID — the current screen's identification ID used for page linking and navigation |
| `JCCWebBusinessLogic` | Class | Base business logic class — parent class providing common web business logic utilities (getCommonInfoBean, getServiceFormBean, getGamenId, etc.) |
| `X31SDataBeanAccess` | Class | Data bean access class — provides the `sendMessageString` interface for storing/retrieving values in the screen's data bean |
| `MNP` | Acronym | Mobile Number Portability — the Japanese telecommunications service allowing customers to retain their phone number when switching carriers |
| `ENUMCC_ERR_FLG_0001` | Constant | Error flag "0001" — Application content value missing |
| `ENUMCC_ERR_FLG_0002` | Constant | Error flag "0002" — Phone number status judgment target exclusion |
| `ENUMCC_ERR_FLG_1001` | Constant | Error flag "1001" — Port-out (IP telephone number): contract data exists error |
| `ENUMCC_ERR_FLG_2001` | Constant | Error flag "2001" — Inter-carrier transfer (IP telephone number): contract data exists error |
| `ENUMCC_ERR_FLG_3001` | Constant | Error flag "3001" — Fax cancellation (other company received): contract data exists error |
