---

# Business Logic — KKW00810SFLogic.actionInitKKW00810() [54 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.KKW00810SF.KKW00810SFLogic` |
| Layer | Controller (Package: `eo.web.webview.KKW00810SF`) |
| Module | `KKW00810SF` (Package: `eo.web.webview.KKW00810SF`) |

## 1. Role

### KKW00810SFLogic.actionInitKKW00810()

This method performs the **registration screen initialization process** for the Fixed IP Address Allocation (固定IPアドレス割当) screen in the KKW00810SF module. It serves as the primary entry point for preparing the registration screen's initial state — setting up the form bean with inheritance data, constructing a user-case payload with telemetry information (use-case ID, operation ID, operation timestamp), and invoking the downstream service component to retrieve existing fixed IP address allocation records.

The method follows the **request-response screen initialization pattern** commonly used in the K-Net web framework: it acquires the service form bean from the framework, initializes bean fields, populates a parameter map with user-case identifiers (`SVC_ID_KKSV0022` / `OP_ID_KKSV0022OP`), delegates data mapping to a DB mapper (`KKSV0022_KKSV0022OPDBMapper`), invokes the service component (`KKSV002201SC`) through the standard `invokeService()` gateway, deserializes the SC response back into the form bean, and validates the search error flag.

In the larger system, this method acts as the **screen-level orchestrator** that coordinates all initialization activities for a single screen request. It is called by `action_Init()` and bridges the web presentation layer with the service component layer. If the fixed IP address allocation search returns an error, the method surfaces a user-facing error message ("固定IPアドレス").

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["actionInitKKW00810"])
    STEP1["Get ServiceFormBean via getServiceFormBean()"]
    STEP2["Get inheritance data via JCCWebCommon.getScreenInfo(this)"]
    STEP3["Initialize form bean via initServiceFormBean(svcFormBean)"]
    STEP4["Create paramMap, inputMap, outputMap HashMaps"]
    STEP5["Set TELEGRAM_INFO_USECASE_ID = SVC_ID_KKSV0022"]
    STEP6["Set TELEGRAM_INFO_OPERATION_ID = OP_ID_KKSV0022OP"]
    STEP7["Set TELEGRAM_INFO_OPERATE_DATETIME via getOpeDateTimeStamp()"]
    STEP8["Create KKSV0022_KKSV0022OPDBMapper instance"]
    STEP9["Generate mapping instances via mapper.setKKSV002201CC()"]
    STEP10["Invoke SC service via invokeService(paramMap, inputMap, outputMap)"]
    STEP11["Deserialize mapping via mapper.getKKSV002201CC(paramBean, outputMap)"]
    STEP12["Get search error flag via JCCWebCommon.getSearchErrFlg"]
    CHECK_ERR{"searchErrFlg exists and not empty?"}
    SET_MSG["Set error message JKB5470_KW for 固定IPアドレレス"]
    EDIT_BEAN["Edit form bean via editServiceFormBean(svcFormBean)"]
    DUMP_BEAN["Dump DataBean via JSYwebLog.println()"]
    END_NODE(["Return true"])

    START --> STEP1 --> STEP2 --> STEP3 --> STEP4 --> STEP5 --> STEP6 --> STEP7 --> STEP8 --> STEP9 --> STEP10 --> STEP11 --> STEP12 --> CHECK_ERR
    CHECK_ERR -- Yes --> SET_MSG --> EDIT_BEAN --> DUMP_BEAN --> END_NODE
    CHECK_ERR -- No --> EDIT_BEAN --> DUMP_BEAN --> END_NODE
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| - | (none) | - | This method takes no parameters. It operates on instance fields and framework-provided data beans. |

| # | Field / External State | Type | Business Description |
|---|----------------------|------|---------------------|
| 1 | `this` (via `getScreenInfo`) | Screen logic context | Inherits screen-level context including user session, request attributes, and previous navigation state |
| 2 | `this` (via `getOpeDateTimeStamp`) | Screen logic context | Provides the current operation timestamp context for audit logging |
| 3 | `super.getServiceFormBean()` | Framework access | Retrieves the X31SDataBeanAccess instance bound to the current user session, carrying screen data across requests |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `JCCWebCommon.getScreenInfo` | JCCWebCommon | - | Reads screen context / inheritance data from the request scope |
| - | `initServiceFormBean` | KKW00810SFLogic | - | Initializes form bean fields with default values for the registration screen |
| - | `KKSV0022_KKSV0022OPDBMapper.setKKSV002201CC` | KKSV0022_KKSV0022OPDBMapper | - | Generates mapping instances from form bean to service-call input parameters |
| R | `invokeService` | KKW00810SFLogic | - | Invokes SC `KKSV002201SC` which performs a DB read for fixed IP address allocation records |
| - | `KKSV0022_KKSV0022OPDBMapper.getKKSV002201CC` | KKSV0022_KKSV0022OPDBMapper | - | Deserializes SC output map back into the form bean (fixed IP address allocation display results) |
| R | `JCCWebCommon.getSearchErrFlg` | JCCWebCommon | - | Reads the search error flag from the SC output map for SC code `KKSV041307SC` |
| - | `JCCWebCommon.setMessageInfo` | JCCWebCommon | - | Sets error message `JKB5470_KW` with argument `固定IPアドレス` when search error flag is set |
| U | `editServiceFormBean` | KKW00810SFLogic | - | Edits/updates the form bean fields with processed values for screen rendering |
| - | `dumpDatabean` | KKW00810SFLogic | - | Dumps DataBean state to the log for debugging |

## 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: `editServiceFormBean` [U], `setMessageInfo` [-], `getSearchErrFlg` [R], `invokeService` [-], `setKKSV002201CC` [-], `getKKSV002201CC` [-], `getScreenInfo` [R], `initServiceFormBean` [-], `dumpDatabean` [-]

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Screen:KKSV0022 | `action_Init` -> `actionInitKKW00810` | `editServiceFormBean` [U], `invokeService` [R KKSV002201SC (KK_T_FIXED_IP)], `getSearchErrFlg` [R], `setKKSV002201CC` [-], `getKKSV002201CC` [-], `setMessageInfo` [-] |

## 6. Per-Branch Detail Blocks

**Block 1** — [SET] `(L203)` Acquire service form bean from framework

| # | Type | Code |
|---|------|------|
| 1 | SET | `svcFormBean = super.getServiceFormBean()` // Get service form bean access layer |

**Block 2** — [EXEC] `(L206)` Get inheritance data from screen context

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `JCCWebCommon.getScreenInfo(this)` // Get inheritance data |

**Block 3** — [CALL] `(L209)` Initialize the service form bean

| # | Type | Code |
|---|------|------|
| 1 | CALL | `initServiceFormBean(svcFormBean)` // Change data from inheritance items |

**Block 4** — [SET] `(L211–215)` Create HashMaps for user-case ID, mapping, and service call results

| # | Type | Code |
|---|------|------|
| 1 | SET | `paramMap = new HashMap<String, Object>()` // HashMap for user-case ID storage |
| 2 | SET | `inputMap = new HashMap<String, Object>()` // HashMap for mapping result storage |
| 3 | SET | `outputMap = new HashMap<String, Object>()` // HashMap for service call result storage |

**Block 5** — [SET] `(L217)` Create parameter bean array

| # | Type | Code |
|---|------|------|
| 1 | SET | `paramBean = {svcFormBean}` // Get bean |

**Block 6** — [SET] `(L220–222)` Populate user-case telemetry map

| # | Type | Code |
|---|------|------|
| 1 | SET | `paramMap.put(X31CWebConst.TELEGRAM_INFO_USECASE_ID, SVC_ID_KKSV0022)` // Set use-case ID [-> SVC_ID_KKSV0022 = "KKSV0022"] |
| 2 | SET | `paramMap.put(X31CWebConst.TELEGRAM_INFO_OPERATION_ID, OP_ID_KKSV0022OP)` // Set operation ID [-> OP_ID_KKSV0022OP = "KKSV0022OP"] |
| 3 | SET | `paramMap.put(X31CWebConst.TELEGRAM_INFO_OPERATE_DATETIME, JCCWebCommon.getOpeDateTimeStamp(this, null))` // Set operation timestamp |

**Block 7** — [SET] `(L225–226)` Generate mapping instances via DB mapper

| # | Type | Code |
|---|------|------|
| 1 | SET | `mapper = new KKSV0022_KKSV0022OPDBMapper()` // Create mapper instance |
| 2 | SET | `inputMap = mapper.setKKSV002201CC(paramBean, inputMap, JPCModelConstant.FUNC_CD_1)` // Generate mapping instances |

**Block 8** — [CALL] `(L229)` Invoke service component

| # | Type | Code |
|---|------|------|
| 1 | CALL | `invokeService(paramMap, inputMap, outputMap)` // Service call processing |

**Block 9** — [CALL] `(L232)` Deserialize mapping from SC output

| # | Type | Code |
|---|------|------|
| 1 | CALL | `mapper.getKKSV002201CC(paramBean, outputMap)` // Deserialize — Get fixed IP address allocation processing result |

**Block 10** — [SET] `(L235)` Get search error flag

| # | Type | Code |
|---|------|------|
| 1 | SET | `searchErrFlg = JCCWebCommon.getSearchErrFlg("KKSV041307SC", outputMap)` // Get search error flag |

**Block 11** — [IF] `(L237)` Check search error flag and set error message if present

> If the search error flag from the SC response is non-null and non-empty, display an error message for the fixed IP address allocation operation.

| # | Type | Code |
|---|------|------|
| 1 | IF | `searchErrFlg != null && !searchErrFlg.trim().equals("")` |

**Block 11.1** — [ELSE-IF] `(L238–241)` Error handling branch

> Set error message for fixed IP address allocation.

| # | Type | Code |
|---|------|------|
| 1 | SET | `str = {"固定IPアドレス"}` // Error message argument |
| 2 | CALL | `JCCWebCommon.setMessageInfo(this, JPCOnlineMessageConstant.EKB5470_KW, str)` // Set error message |

**Block 12** — [CALL] `(L245)` Edit the service form bean for screen rendering

| # | Type | Code |
|---|------|------|
| 1 | CALL | `editServiceFormBean(svcFormBean)` // Edit service form bean |

**Block 13** — [EXEC] `(L248)` Dump DataBean state to log

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `JSYwebLog.println(JSYwebLog.DataBean_Dump, getClass(), dumpDatabean(), null, null, null)` // DataBean log output |

**Block 14** — [RETURN] `(L251)` Return success

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return true` |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `svcFormBean` | Field | Service form bean — the primary data carrier holding screen field values for the fixed IP address allocation registration screen |
| `paramMap` | Field | Parameter map — HashMap carrying user-case telemetry (use-case ID, operation ID, operation timestamp) to the service layer |
| `inputMap` | Field | Input map — HashMap used during bean-to-service parameter mapping via the DB mapper |
| `outputMap` | Field | Output map — HashMap receiving service component (SC) response data for deserialization back into the form bean |
| `KKSV0022` | Field | Use-case ID — the user-case identifier for the fixed IP address allocation screen session |
| `KKSV0022OP` | Field | Operation ID — the specific operation identifier within the KKSV0022 use-case for fixed IP address allocation processing |
| SC | Acronym | Service Component — the business logic layer that handles database CRUD operations and business rule enforcement |
| KKSV002201SC | SC Code | Service Component code that retrieves fixed IP address allocation records for a contract |
| KKSV041307SC | SC Code | Service Component code whose search error flag is checked after the SC call |
| DB Mapper | Component | Data mapping object (`KKSV0022_KKSV0022OPDBMapper`) that converts between form beans and service-call parameter maps |
| `invokeService` | Method | Standard framework gateway that invokes the target SC (`KKSV002201SC`) with the populated parameter map and returns results in the output map |
| `searchErrFlg` | Field | Search error flag — a string flag returned by the SC indicating whether the fixed IP address allocation search encountered an error |
| `JKB5470_KW` | Constant | Error message key — error message code displayed when fixed IP address allocation search fails |
| FUNC_CD_1 | Constant | Function code `1` — indicates the type of mapping operation performed by the DB mapper |
| Fixed IP Address Allocation (固定IPアドレス割当) | Business term | The business operation of assigning a fixed IP address to a telecommunications contract's line item |

---
