# Business Logic — ZMW01904SFLogic.getInfoInitData() [68 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.ZMW01904SF.ZMW01904SFLogic` |
| Layer | Controller (Web View Logic — `eo.web.webview` package) |
| Module | `ZMW01904SF` (Package: `eo.web.webview.ZMW01904SF`) |

## 1. Role

### ZMW01904SFLogic.getInfoInitData()

This method performs the **initial data acquisition and screen initialization** for the ENUM port switching (ENUM cut-off) virtual screen. In the context of K-Opticom's telecom service management system, ENUM port switching is a portability service that allows customers to retain their telephone number when switching telecommunications providers (number portability). The method orchestrates the complete lifecycle of gathering initial display data: it sets up upper and lower mapping structures for the ENUM service history data via the `ZMSV0133_ZMSV0133OPDBMapper`, conditionally includes aging number filtering when present, invokes the underlying service layer (`ZMSV0133`) to retrieve service history records, clears and repopulates the ENUM history list data bean, applies pagination controls for both upper and lower page links, and finally initializes the edit controls and button enable/disable states for the initial screen display.

The method implements the **delegation pattern** — it delegates data mapping to the `ZMSV0133_ZMSV0133OPDBMapper` and service invocation to the inherited `invokeService` from `JCCWebBusinessLogic`. It also implements the **builder pattern** in its setup phase, sequentially configuring all eight SC codes (`ZMSV013301SC` through `ZMSV013308SC`) before the service call, and then sequentially retrieving results after the service returns. Its role in the larger system is as the **central entry point for the initial load of the ENUM cut-off virtual screen** — called from `fin()`, `init()`, and `paging()` within `ZMW01904SFLogic` to populate all screen data needed for the first render.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["getInfoInitData(bean, viewLogic, gamenId)"])

    START --> P1["Initialize paramBean, paramMap, dataMap, outputMap"]
    P1 --> P2["Extract agingNo = getSendMessageString(bean, AGING_NO)"]
    P2 --> P3["Create ZMSV0133_ZMSV0133OPDBMapper"]
    P3 --> P4["setZMSV013301SC - upper mapping"]
    P4 --> P5["upmapperPageLinkInfo - upper pagination"]
    P5 --> P6["setZMSV013302SC"]
    P6 --> P7["setZMSV013303SC"]
    P7 --> P8["setZMSV013304SC"]
    P8 --> COND1{agingNo == BLANK?}
    COND1 -- No (agingNo has value) --> P9["setZMSV013305SC - include aging"]
    P9 --> P10["setZMSV013306SC"]
    COND1 -- Yes (agingNo is blank) --> P10
    P10 --> P11["setZMSV013307SC"]
    P11 --> P12["setZMSV013308SC"]
    P12 --> P13["invokeService - call service layer"]
    P13 --> P14["Clear ENUM history list (clearArray)"]
    P14 --> P15["getZMSV013301SC - lower mapping"]
    P15 --> P16["getZMSV013302SC"]
    P16 --> P17["getZMSV013303SC"]
    P17 --> P18["getZMSV013304SC"]
    P18 --> P19["getZMSV013305SC"]
    P19 --> P20["getZMSV013306SC"]
    P20 --> P21["getZMSV013307SC"]
    P21 --> P22["getZMSV013308SC"]
    P22 --> P23["downmapperPageLinkInfo - lower pagination"]
    P23 --> P24["initEdit - initialize edit controls"]
    P24 --> P25["initBtnEdit - button enable/disable"]
    P25 --> P26["setSearchCommand - set pagination event ID"]
    P26 --> END(["Return"])
```

**Processing steps explained:**

1. **Parameter Setup** — Wraps the input `bean` in a one-element array (`paramBean`), creates three HashMaps: `paramMap` (parameter map for the service call with use case ID `SV133`), `dataMap` (mapping input/output map), and `outputMap` (service result data map).
2. **Aging Number Extraction** — Retrieves the aging number from the bean using the utility method, storing it for conditional branch logic.
3. **Mapper Instantiation** — Creates a new instance of `ZMSV0133_ZMSV0133OPDBMapper` to handle the mapping between the data bean and the service layer.
4. **Upper Mapping Phase** — Sets up eight SC (Service Component) codes in sequence using `set` methods. SC codes 01 through 04 are always configured. SC code 05 is conditionally configured only when an aging number is present (i.e., the aging number is NOT blank). SC codes 06 through 08 are always configured. Pagination links are set up for the upper page (SC 01) during this phase.
5. **Service Invocation** — Calls `invokeService` to execute the `ZMSV0133` service layer with the parameter map, data map, and output map.
6. **ENUM History Reset** — Clears the existing ENUM history list data bean to prepare for fresh data population.
7. **Lower Mapping Phase** — Retrieves all eight SC codes' data from the service output using `get` methods, mapping the results back into the data bean.
8. **Pagination Finalization** — Sets up the lower page links (SC 01).
9. **UI Initialization** — Initializes the edit controls and button enable/disable states for the initial screen display.
10. **Search Command Setup** — Sets the pagination event ID as the search command.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `bean` | `X31SDataBeanAccess` | The screen data bean that holds all form data and business data for the ENUM cut-off virtual screen. It carries user-entered search criteria (including the aging number) and receives the populated data for display. |
| 2 | `viewLogic` | `JCCWebBusinessLogic` | The view logic instance used for view-related operations. It is passed through the method signature but not directly referenced within the method body — used by called methods (e.g., `initEdit`, `initBtnEdit`) that may need access to view-level utilities. |
| 3 | `gamenId` | `String` | The screen area/frame identifier used for pagination context. It determines which pagination navigation zone is being handled (upper or lower page links), allowing multiple paginated sections on the same screen. |

**External state / instance fields read:**
| Source | Field/State | Business Description |
|--------|-------------|---------------------|
| `this` (ZMW01904SFLogic) | Implicit reference to `this` for calling `initEdit`, `initBtnEdit`, and passing as context to `upmapperPageLinkInfo`/`downmapperPageLinkInfo` | The logic instance provides access to inherited `invokeService` and other base-class utilities. |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `ZMSV0133_ZMSV0133OPDBMapper.getZMSV013301SC` | ZMSV0133 | `EZM0541B010CBSMsg1List` (ENUM history list) | Retrieves ENUM service history record for SC01 (service basic info) |
| R | `ZMSV0133_ZMSV0133OPDBMapper.getZMSV013302SC` | ZMSV0133 | ENUM service history detail | Retrieves ENUM port switching service detail data (SC02) |
| R | `ZMSV0133_ZMSV0133OPDBMapper.getZMSV013303SC` | ZMSV0133 | ENUM service history | Retrieves ENUM service history data (SC03) |
| R | `ZMSV0133_ZMSV0133OPDBMapper.getZMSV013304SC` | ZMSV0133 | ENUM service history | Retrieves ENUM service history data (SC04) |
| R | `ZMSV0133_ZMSV0133OPDBMapper.getZMSV013305SC` | ZMSV0133 | ENUM service history (filtered by aging) | Retrieves ENUM service history data (SC05) — only called when an aging number is present |
| R | `ZMSV0133_ZMSV0133OPDBMapper.getZMSV013306SC` | ZMSV0133 | ENUM service history | Retrieves ENUM service history data (SC06) |
| R | `ZMSV0133_ZMSV0133OPDBMapper.getZMSV013307SC` | ZMSV0133 | ENUM service history | Retrieves ENUM service history data (SC07) |
| R | `ZMSV0133_ZMSV0133OPDBMapper.getZMSV013308SC` | ZMSV0133 | ENUM service history | Retrieves ENUM service history data (SC08) |
| - | `JCCBatCommon.invokeService` | `JCCBatCommon` | (ZMSV0133 service layer) | Invokes the ZMSV0133 service component which reads ENUM service history data from the database and populates the output map |
| R | `OneStopDataBeanAccessArray.getDataBeanArray` | OneStopDataBeanAccess | `EZM0541B010CBSMsg1List` | Retrieves the ENUM history data bean array for clearing |
| R | `OneStopDataBeanAccessArray.clearArray` | OneStopDataBeanAccessArray | `EZM0541B010CBSMSG1LIST` | Clears all entries in the ENUM history list to prepare for fresh data |
| R | `JZMWebCommon.getSendMessageString` | JZMWebCommon | bean data | Retrieves a message string field value from the data bean |
| - | `JCCWebCommon.upmapperPageLinkInfo` | JCCWebCommon | - | Sets up upper page pagination links for display |
| - | `JCCWebCommon.downmapperPageLinkInfo` | JCCWebCommon | - | Sets up lower page pagination links for display |
| - | `JZMWebCommon.setSearchCommand` | JZMWebCommon | - | Sets the search command ID for pagination event handling |

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Caller: `fin()` (ZMW01904SFLogic) | `fin()` -> `getInfoInitData(bean, viewLogic, gamenId)` | `invokeService[ZMSV0133]` (R) `EZM0541B010CBSMsg1List` |
| 2 | Caller: `init()` (ZMW01904SFLogic) | `init()` -> `getInfoInitData(bean, viewLogic, gamenId)` | `invokeService[ZMSV0133]` (R) `EZM0541B010CBSMsg1List` |
| 3 | Caller: `paging()` (ZMW01904SFLogic) | `paging()` -> `getInfoInitData(bean, viewLogic, gamenId)` | `invokeService[ZMSV0133]` (R) `EZM0541B010CBSMsg1List` |

**Call Chain Details:**
All three callers are methods within the same `ZMW01904SFLogic` class:
- **`fin()`** — Called during finalization (end-of-screen cleanup/refresh), refreshes the initial data.
- **`init()`** — The primary entry point for the initial screen load, calls `getInfoInitData` to populate all screen data.
- **`paging()`** — Called when the user navigates between paginated pages, refreshes data for the current page.

**Terminal Operations (reached from this method):**
- `setSearchCommand` [-] (no CRUD — UI state)
- `initBtnEdit` [-] (no CRUD — UI state)
- `initEdit` [-] (no CRUD — UI state)
- `downmapperPageLinkInfo` [-] (no CRUD — UI pagination)
- `getZMSV013301SC` through `getZMSV013308SC` [R] (Read from ENUM service history)

## 6. Per-Branch Detail Blocks

**Block 1** — [SET] (L548)
> Initialize data structures: wrap the bean in an array, create the parameter, data, and output maps.

| # | Type | Code |
|---|------|------|
| 1 | SET | `X31SDataBeanAccess[] paramBean = { bean };` // Wrap bean in one-element array |
| 2 | SET | `HashMap<String, Object> paramMap = new HashMap<String, Object>();` // Parameter map for service invocation |
| 3 | SET | `paramMap.put(X31CWebConst.TELEGRAM_INFO_USECASE_ID, JZMWebConst.SV133);` // Set use case ID -> `SV133 = "ZMSV0133"` [-> USE_CASE="ZMSV0133"] |
| 4 | SET | `HashMap<String, Object> dataMap = new HashMap<String, Object>();` // Mapping input/output map |
| 5 | SET | `HashMap<String, Object> outputMap = new HashMap<String, Object>();` // Service result data map |

**Block 2** — [SET] (L555)
> Extract the aging number from the bean for use in conditional processing.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `String agingNo = JZMWebCommon.getSendMessageString(bean, ZMW01904SFConst.AGING_NO);` // Retrieve aging number from bean [-> AGING_NO="エイ ジング番号"] |

**Block 3** — [SET] (L558)
> Instantiate the mapper for ENUM service data mapping.

| # | Type | Code |
|---|------|------|
| 1 | SET | `ZMSV0133_ZMSV0133OPDBMapper mapper = new ZMSV0133_ZMSV0133OPDBMapper();` // Create mapping handler for ZMSV0133 service |

**Block 4** — [SET] (L561)
> Upper mapping phase — always-configured SC codes (01-04).

| # | Type | Code |
|---|------|------|
| 1 | CALL | `mapper.setZMSV013301SC(paramBean, dataMap, JPCModelConstant.FUNC_CD_1);` // Set SC01 mapping [-> FUNC_CD_1="1"] |
| 2 | CALL | `JZMWebCommon.upmapperPageLinkInfo(this, "ZMSV013301SC", dataMap, gamenId);` // Set upper pagination links for SC01 |
| 3 | CALL | `mapper.setZMSV013302SC(paramBean, dataMap, JPCModelConstant.FUNC_CD_1);` // Set SC02 mapping |
| 4 | CALL | `mapper.setZMSV013303SC(paramBean, dataMap, JPCModelConstant.FUNC_CD_1);` // Set SC03 mapping |
| 5 | CALL | `mapper.setZMSV013304SC(paramBean, dataMap, JPCModelConstant.FUNC_CD_1);` // Set SC04 mapping |

**Block 5** — [IF] `(agingNo != BLANK)` `[BLANK="empty string / whitespace check"]` (L565)
> If an aging number is present (not blank), include the aging number SC code (SC05) in the mapping. The comment says: "If there is no aging number, do not process the aging number SIF" (エイ ジング番号が无ければエイ ジングスキーマのSIFを処理しない).

| # | Type | Code |
|---|------|------|
| 1 | CALL | `mapper.setZMSV013305SC(paramBean, dataMap, JPCModelConstant.FUNC_CD_1);` // Set SC05 mapping — only when aging number is present |

**Block 5.1** — [ELSE] (agingNo == BLANK)
> When the aging number is blank, SC05 is skipped entirely — no aging-specific filtering is applied to the service query.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | (no-op — skip SC05 mapping) |

**Block 6** — [SET] (L568)
> Continue upper mapping with always-configured SC codes (06-08).

| # | Type | Code |
|---|------|------|
| 1 | CALL | `mapper.setZMSV013306SC(paramBean, dataMap, JPCModelConstant.FUNC_CD_1);` // Set SC06 mapping |
| 2 | CALL | `mapper.setZMSV013307SC(paramBean, dataMap, JPCModelConstant.FUNC_CD_1);` // Set SC07 mapping |
| 3 | CALL | `mapper.setZMSV013308SC(paramBean, dataMap, JPCModelConstant.FUNC_CD_1);` // Set SC08 mapping |

**Block 7** — [CALL] (L571)
> Invoke the service layer to execute the ZMSV0133 service with all configured parameters.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `invokeService(paramMap, dataMap, outputMap);` // Execute service — delegates to `JCCBatCommon.invokeService` [inherited from JCCWebBusinessLogic] |

**Block 8** — [SET] (L573)
> Reset the ENUM history list before populating fresh data.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `bean.getDataBeanArray(ZMW01904SFConst.EZM0541B010CBSMSG1LIST).clearArray();` // Clear ENUM history list [-> EZM0541B010CBSMSG1LIST="EZM0541B010CBSMSG1LIST"] |

**Block 9** — [SET] (L576)
> Lower mapping phase — retrieve results from all eight SC codes and populate the data bean.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `mapper.getZMSV013301SC(paramBean, outputMap);` // Get SC01 result data |
| 2 | CALL | `mapper.getZMSV013302SC(paramBean, outputMap);` // Get SC02 result data |
| 3 | CALL | `mapper.getZMSV013303SC(paramBean, outputMap);` // Get SC03 result data |
| 4 | CALL | `mapper.getZMSV013304SC(paramBean, outputMap);` // Get SC04 result data |
| 5 | CALL | `mapper.getZMSV013305SC(paramBean, outputMap);` // Get SC05 result data (only set if agingNo was non-blank) |
| 6 | CALL | `mapper.getZMSV013306SC(paramBean, outputMap);` // Get SC06 result data |
| 7 | CALL | `mapper.getZMSV013307SC(paramBean, outputMap);` // Get SC07 result data |
| 8 | CALL | `mapper.getZMSV013308SC(paramBean, outputMap);` // Get SC08 result data |

**Block 10** — [SET] (L581)
> Set up lower pagination links for display.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `JZMWebCommon.downmapperPageLinkInfo(this, "ZMSV013301SC", outputMap, gamenId);` // Set lower pagination links for SC01 |

**Block 11** — [CALL] (L584)
> Initialize the edit controls on the screen.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `this.initEdit(paramBean);` // Initialize edit controls for initial display |

**Block 12** — [CALL] (L587)
> Control button enable/disable states for the initial display.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `this.initBtnEdit(paramBean);` // Button enable/disable control for initial display |

**Block 13** — [CALL] (L590)
> Set the search command ID for pagination event handling.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `JZMWebCommon.setSearchCommand(this, JZMWebConst.EVENT_ID_PAGING);` // Set pagination event ID as search command |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `AGING_NO` | Field | Aging Number — the aging number (エイ ジング番号), an internal tracking identifier for aging-related service processing in the ENUM port switching workflow |
| `EZM0541B010CBSMSG1LIST` | Field/Constant | ENUM History List — the data bean array holding ENUM port switching history records for display on the virtual screen |
| ENUM | Business term | Electronic Number Mapping — a telecommunications protocol that maps telephone numbers to IP-based addresses, enabling number portability in K-Opticom's service portfolio |
| ENUM 切替 (Kirikae) | Business term | ENUM Port Switching — the process of switching a customer's telephone number from one provider to another while retaining the number (number portability) |
| ENUM 切替仮想 (Kirikae Kaso) | Business term | ENUM Port Switching Virtual — the virtual screen module (ZMW01904SF) that displays ENUM port switching history and status |
| `gamenId` | Field | Screen Area ID — the identifier for a specific screen area/frame, used to scope pagination navigation to the correct section on multi-zone screens |
| SVC_KEI_NO | Field | Service Detail Number (サービス詳細番号) — internal tracking ID for a specific service line item |
| SVC_KEI_UCWK_NO | Field | Service Detail Work Number — work tracking number for service contract processing |
| TELNO | Field | Telephone Number (電話番号) — the customer's phone number |
| DSP_TELNO | Field | Display Telephone Number (電話番号（表示用）) — phone number formatted for screen display |
| KOJIN_HOJIN_TLN_TAI_CD | Field | Individual/Corporate Telephone Number Band Code (個人法人番号帯コード) — classifies whether the telephone number belongs to an individual (1) or corporate (2) customer |
| BNGSHUTK_JGS_CD | Field | Number Acquisition Provider Code (番号取得事業者コード) — code identifying the provider from which the number was acquired |
| ITNMT_JGS_CD | Field | Transfer-from Provider Code (移転元事業者コード) — code identifying the original service provider before portability transfer |
| SINSEI_NAIYO | Field | Application Content (申請内容) — the type of application/submission for the ENUM port switching request |
| KIRIKAESHORI | Field | Switching Process (切替処理) — indicates whether the switching process has been executed or not |
| CNGBF_ITNSK_JGS_CD | Field | Pre-switch / Transfer-from Provider Code (変更前・移転先事業者コード) — the provider code before the switch |
| CNGBF_ITNSK_DOMAIN | Field | Pre-switch / Transfer-from Domain (変更前・移転先ドメイン) — the domain information for the pre-switch provider |
| SV133 | Constant | Use Case ID "ZMSV0133" — identifies the ENUM service history service component for use case routing |
| ZMSV0133 | SC Code | ENUM Service History — the service component handling ENUM port switching data retrieval |
| ZMSV013301SC - ZMSV013308SC | SC Codes | Service Component subcodes 01-08 — individual SC codes within ZMSV0133 for different data segments (service basic info, details, history records, etc.) |
| FUNC_CD_1 | Constant | Function Code 1 — a standard function code constant from JPCModelConstant used to indicate standard data retrieval mode |
| AGING_NO | Constant | "エイ ジング番号" — the constant key for the aging number field in the data bean |
| BLANK | Constant | Empty string / whitespace check — used to test if a string field has no value |
| X31SDataBeanAccess | Type | X31 Framework Data Bean Access — the framework class for accessing screen data beans carrying form data and business data |
| JCCWebBusinessLogic | Type | Base web business logic class — the parent class providing `invokeService` and common web utilities |
| ZMSV0133_ZMSV0133OPDBMapper | Type | ZMSV0133 Open DB Mapper — the mapping class that handles data transformation between the data bean and the service layer for the ZMSV0133 service |
| upmapperPageLinkInfo | Method | Upper page pagination link setup — configures pagination links for the upper page section |
| downmapperPageLinkInfo | Method | Lower page pagination link setup — configures pagination links for the lower page section |
| initEdit | Method | Initialize edit controls — sets up input field enable/disable states for the initial screen |
| initBtnEdit | Method | Initialize button edit — controls button enable/disable states for the initial screen |
| setSearchCommand | Method | Set search command — registers the pagination event ID for event handling |
| EVENT_ID_PAGING | Constant | Pagination event ID constant — the standard event identifier for pagination operations |
| invokeService | Method | Service invocation — inherited method that routes to the appropriate service component (ZMSV0133) for data processing |
| TELEGRAM_INFO_USECASE_ID | Constant | Telegram use case ID — the framework constant key for setting the use case identifier in the parameter map |
