# Business Logic — KKW02541SFLogic.executeInitSvc() [24 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.KKW02541SF.KKW02541SFLogic` |
| Layer | Controller / Web Presentation Layer |
| Module | `KKW02541SF` (Package: `eo.web.webview.KKW02541SF`) |

## 1. Role

### KKW02541SFLogic.executeInitSvc()

This method performs the **initial display processing for the bandwidth information inquiry screen** (帯域情報照会初期表示). Its business purpose is to retrieve and present a list of all bandwidth information records associated with a customer's service contract, enabling the customer to view their current service details — including ISP authentication IDs, multi-session authentication IDs, usage months, advance warning dates, and bandwidth restriction implementation dates — before the screen renders to the user.

The method implements a **data mapping and delegation pattern**: it first sets up a use-case identifier (`KKSV0573`) in a parameter map to route the service invocation to the correct backend business process, then delegates input data mapping to `KKSV0573_KKSV0573OPDBMapper.setKKSV057301SC()` which maps the service contract number from the DataBean into the input map. It then invokes the central service dispatcher `invokeService()` to execute the `KKSV0573` use case, and finally maps the returned data back into the screen DataBean via `KKSV0573_KKSV0573OPDBMapper.getKKSV057301SC()`.

This is an **internal helper method** (private) that serves as the core data-fetching step during the screen's initialization flow. It is called exclusively by `actionInit()`, which orchestrates the full screen setup including screen info retrieval, DataBean inheritance, and authentication ID generation. The method has no conditional branches — it follows a single, linear processing path.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["executeInitSvc(paramBean)"])
    STEP1["Create paramMap, inputMap, outputMap (HashMap x3)"]
    STEP2["Set TELEGRAM_INFO_USECASE_ID = KKSV0573 in paramMap"]
    STEP3["Instantiate KKSV0573_KKSV0573OPDBMapper mapper"]
    STEP4["setKKSV057301SC(paramBean, inputMap, FUNC_CD_1=1)"]
    STEP5["invokeService(paramMap, inputMap, outputMap)"]
    STEP6["getKKSV057301SC(paramBean, outputMap)"]
    END_NODE(["Return void"])

    START --> STEP1 --> STEP2 --> STEP3 --> STEP4 --> STEP5 --> STEP6 --> END_NODE
```

The processing flow is strictly linear with no conditional branches:

1. **Map Creation (lines 89-91):** Three `HashMap<String, Object>` instances are created as working storage — `paramMap` holds the invocation parameters, `inputMap` holds the mapped input data for the service, and `outputMap` holds the results returned from the service.

2. **Use-Case Setup (line 93):** The `TELEGRAM_INFO_USECASE_ID` key is set to `"KKSV0573"` in `paramMap`, which directs the service dispatcher to the Bandwidth Information Inquiry use case.

3. **Mapper Instantiation (line 96):** A new `KKSV0573_KKSV0573OPDBMapper` object is created to handle DataBean-to-input-map and output-map-to-DataBean conversions for the `KKSV0573` use case.

4. **Input Mapping (line 99):** `setKKSV057301SC()` maps the service contract number (`サービス契約番号`) from the first element of `paramBean` into `inputMap` as `key_svc_kei_no`, along with the function code `FUNC_CD_1` (value `"1"`). The result is stored in `inputMap` under key `"KKSV057301SC"`.

5. **Service Invocation (line 102):** `invokeService()` (inherited from `JCCWebBusinessLogic`) executes the use case identified by `KKSV0573` in the parameter map, using `inputMap` as the input and `outputMap` to receive the results. This triggers the backend BPM/business process.

6. **Output Mapping (line 105):** `getKKSV057301SC()` reads the results from `outputMap` and maps them back into the DataBean array `paramBean`, populating each bandwidth information record with ISP authentication ID, multi-session authentication ID, usage month, advance warning date, and bandwidth restriction implementation date.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `paramBean` | `X31SDataBeanAccess[]` | Array of screen DataBeans representing the bandwidth information inquiry form. Element `[0]` contains the service contract number (`サービス契約番号`) used to look up bandwidth records, and a `帯域情報リスト` (bandwidth information list) DataBean array that is populated with inquiry results. |

**Instance fields / external state read:**
- None directly. The method relies entirely on its parameter and the inherited `invokeService()` method from `JCCWebBusinessLogic`.

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| M (Map) | `KKSV0573_KKSV0573OPDBMapper.setKKSV057301SC` | - | - | Maps input DataBean (service contract number) to input parameter map for the KKSV0573 use case. Extracts `サービス契約番号` and sets `key_svc_kei_no` and `func_code=1`. |
| C | `JCCWebBusinessLogic.invokeService` | KKSV0573 | EKK2411B001CBS | Executes the Bandwidth Information Inquiry use case (帯域情報照会). This is a service invocation that queries bandwidth information records. The backend CBS `EKK2411B001CBS` handles the data retrieval. |
| M (Map) | `KKSV0573_KKSV0573OPDBMapper.getKKSV057301SC` | - | - | Maps output results from the service response back into the screen DataBean. Populates each bandwidth information list entry with: ISP authentication ID, multi-session authentication ID, usage month, advance warning date, and bandwidth restriction implementation date. |

### How to classify:
- **M (Map):** Data mapping operations that convert between DataBeans and parameter maps — not database operations but essential screen data transformation steps.
- **C (Create):** In the context of this system's convention, service invocations that retrieve data from the BPM layer are classified under their CBS operation type. `invokeService` with a use case ID triggers the underlying CBS (`EKK2411B001CBS`) which performs a Read operation.

## 5. Dependency Trace

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

No screen/batch entry points found within 8 hops. Direct callers found: 1 methods.
Terminal operations from this method: `getKKSV057301SC` [M], `invokeService` [C - KKSV0573/EKK2411B001CBS], `setKKSV057301SC` [M]  # NOSONAR

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Screen:KKSV0573 (via actionInit) | `KKW02541SFLogic.actionInit()` -> `KKW02541SFLogic.executeInitSvc(paramBean)` | `setKKSV057301SC` [M], `invokeService` [C] KKSV0573/EKK2411B001CBS, `getKKSV057301SC` [M] |

**Notes:**
- `actionInit()` (lines 54–77) is the public entry point in `KKW02541SFLogic` that performs screen initialization. It retrieves screen info, obtains the service form bean, calls `setHktgiBean()` for inheritance, then calls `executeInitSvc()` to populate bandwidth data, and finally generates an authentication ID (`setNinshoID`).
- The use case `KKSV0573` corresponds to the Bandwidth Information Inquiry (帯域情報照会) flow, which maps to the CBS `EKK2411B001CBS` for data retrieval.

## 6. Per-Branch Detail Blocks

**Block 1** — [CREATION] (L89-91)

> Initialize three working HashMaps for parameter, input, and output data storage.

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

**Block 2** — [SET] (L93)

> Set the use-case identifier to route the service invocation to the KKSV0573 (Bandwidth Information Inquiry) business process.

| # | Type | Code |
|---|------|------|
| 1 | SET | `paramMap.put(X31CWebConst.TELEGRAM_INFO_USECASE_ID, "KKSV0573")` // Set use-case ID [-> TELEGRAM_INFO_USECASE_ID="KKSV0573"] |

**Block 3** — [INSTANTIATION] (L96)

> Create the mapper object for KKSV0573 DataBean conversion operations.

| # | Type | Code |
|---|------|------|
| 1 | SET | `mapper = new KKSV0573_KKSV0573OPDBMapper()` // Upper mapping handler [-> KKSV0573_KKSV0573OPDBMapper] |

**Block 4** — [CALL] (L99)

> Map the service contract number from paramBean into the input map, preparing data for the service invocation. The function code `FUNC_CD_1` (value `"1"`) indicates standard function mode.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `mapper.setKKSV057301SC(paramBean, inputMap, JPCModelConstant.FUNC_CD_1)` // Input mapping: service contract number to input map [-> FUNC_CD_1="1"] |

**Block 5** — [CALL] (L102)

> Execute the KKSV0573 use case via the service dispatcher. This triggers the backend BPM workflow and CBS `EKK2411B001CBS` to retrieve bandwidth information records. Results are placed in `outputMap`.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `invokeService(paramMap, inputMap, outputMap)` // Service invocation for KKSV0573 use case [-> KKSV0573/EKK2411B001CBS] |

**Block 6** — [CALL] (L105)

> Map the service results back into the screen DataBean. The mapper extracts the `EKK2411B001CBSMsg1List` from `outputMap` and populates each bandwidth information list entry with: ISP authentication ID (`isp_ninsho_id`), multi-session authentication ID (`mltise_ninsho_id`), usage month (`riyo_ym`), advance warning date (`yokoku_ymd`), and bandwidth restriction implementation date (`jishi_ymd`).

| # | Type | Code |
|---|------|------|
| 1 | CALL | `mapper.getKKSV057301SC(paramBean, outputMap)` // Output mapping: results to DataBean list |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `paramBean` | Field | Service form DataBean array — the screen's data transfer object carrying the service contract number and bandwidth information list |
| `key_svc_kei_no` | Field | Service detail number key — the primary key identifying a service contract, used to look up associated bandwidth records |
| `func_code` | Field | Function code — operation mode indicator; `"1"` represents standard function mode |
| TELEGRAM_INFO_USECASE_ID | Constant | Use-case identifier key — routes service invocations to the correct BPM process; value `"KKSV0573"` identifies the Bandwidth Information Inquiry use case |
| KKSV0573 | Business term | Bandwidth Information Inquiry (帯域情報照会) — a screen/use case that displays a customer's bandwidth information, including authentication details and usage dates |
| KKW02541SF | Business term | Bandwidth Restriction Inquiry Screen (帯域制限照会画面) — the web screen module for displaying bandwidth restriction and service details |
| KKSV0573_KKSV0573OPDBMapper | Component | DataBean-to-BP (business process) mapping class — handles conversion between screen DataBeans and BP parameter maps for the KKSV0573 use case |
| FUNC_CD_1 | Constant | Function code value `"1"` — indicates standard/normal function mode as defined in `JPCModelConstant` |
| `isp_ninsho_id` | Field | ISP Authentication ID — the authentication identifier used by Internet Service Provider access |
| `mltise_ninsho_id` | Field | Multi-Session Authentication ID — authentication identifier for multi-session (simultaneous connection) capability |
| `riyo_ym` | Field | Usage Month (利用月) — the billing/usage period in year-month format |
| `yokoku_ymd` | Field | Advance Warning Date (事前警告日) — the date on which the user receives advance notice before a bandwidth restriction is applied |
| `jishi_ymd` | Field | Bandwidth Restriction Implementation Date (帯域制限実施日) — the date when bandwidth restriction is actually enforced |
| `帯域情報リスト` | Field | Bandwidth Information List — the DataBean array holding the list of bandwidth records for a service contract |
| `サービス契約番号` | Field | Service Contract Number — the unique identifier for a customer's service contract, used as the lookup key for bandwidth information |
| EKK2411B001CBS | CBS | Bandwidth Information Inquiry CBS — the backend database component service that queries bandwidth information records from the database |
| invokeService | Method | Service dispatcher method (inherited from `JCCWebBusinessLogic`) — routes the use-case ID and input parameters to the BPM engine for execution |
| JCCWebBusinessLogic | Class | Common web business logic base class — provides shared service invocation, screen processing, and logging capabilities |
| X31SDataBeanAccess | Component | X31 framework DataBean accessor — the standard data transfer object used for screen-to-logic data communication in the X31 framework |
| X31CWebConst | Component | X31 web constant definitions class — defines constant keys like `TELEGRAM_INFO_USECASE_ID` for use-case routing |
| JPCModelConstant | Component | Platform constant definitions class — defines constant values like `FUNC_CD_1` used throughout the application |
| KK_T_BWSVCINFO | DB (inferred) | Bandwidth service information table — the likely database table storing bandwidth service records (referenced indirectly via CBS EKK2411B001CBS) |
