---

# Business Logic — KKW02541SFLogic.actionInit() [27 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.KKW02541SF.KKW02541SFLogic` |
| Layer | Controller (Web Logic — inherits from `JCCWebBusinessLogic`) |
| Module | `KKW02541SF` (Package: `eo.web.webview.KKW02541SF`) |

## 1. Role

### KKW02541SFLogic.actionInit()

This method is the **initial display processing** (初期表示処理) entry point for the **Domain Restriction License** (帯域制限执照) screen — a customer-facing web screen used to display and manage domain (bandwidth) restriction information associated with a customer's service contract. Upon invocation, it retrieves the current screen context, fetches the domain info list from the backend via the `EKK2411B001CBS` service component (which queries the FTTH registration table `KK_T_FTTH_TSRCK_JSK`), configures authentication identifiers for both ISP and multi-service (multise) access per row, and prepares the DataBean for rendering. The method follows a **sequential pipeline pattern**: screen info retrieval → DataBean setup → service invocation → presentation augmentation → navigation setup. It has no conditional input branches — it always executes the full pipeline unconditionally, returning `true` on success.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["actionInit()"])
    START --> S1["JCCWebCommon.getScreenInfo(this)"]
    S1 --> S2["Get X31SDataBeanAccess from super.getServiceFormBean()"]
    S2 --> S3["Set paramBean = {bean}"]
    S3 --> S4["setHktgiBean(paramBean)"]
    S4 --> S4A["Retrieve SVC_KEI_NO from DataBean"]
    S4A --> S4B["Set SVC_KEI_NO back to DataBean"]
    S4B --> S5["executeInitSvc(paramBean)"]
    S5 --> S5A["Create paramMap, inputMap, outputMap"]
    S5A --> S5B["Set TELEGRAM_INFO_USECASE_ID = KKSV0573"]
    S5B --> S5C["Map DataBean fields via KKSV0573_KKSV0573OPDBMapper"]
    S5C --> S5D["Call invokeService(paramMap, inputMap, outputMap)"]
    S5D --> S5E["EKK2411B001CBS reads KK_T_FTTH_TSRCK_JSK"]
    S5E --> S5F["Map EKK2411B001CBSMsg1List results back to DataBean"]
    S5F --> S6["setNinshoID(paramBean)"]
    S6 --> S6A["Get TIK_LIST DataBeanArray"]
    S6A --> S6B["FOR each index i in TIK_LIST"]
    S6B --> S6C["Get ISP_NINSHO_ID and MLTISE_NINSHO_ID"]
    S6C --> S6D{MLTISE_NINSHO_ID == null or empty?}
    S6D -->|Yes| S6E["ninsho_id = isp_ninsho_id"]
    S6D -->|No| S6F["ninsho_id = isp_ninsho_id + ',' + mltise_ninsho_id"]
    S6E --> S6G["Set NINSHO_ID_01 in DataBean"]
    S6F --> S6G
    S6G --> S6H{Row style: i is odd?}
    S6H -->|Yes| S6I["Set ROW_STYLE_01 = even"]
    S6H -->|No| S6J["Set ROW_STYLE_01 = odd"]
    S6I --> S6K["NEXT index"]
    S6J --> S6K
    S6K --> S6B
    S6B --> S7["Set NEXT_SCREEN_NAME = KKW02541"]
    S7 --> S8["JSYwebLog.println(DataBean_Dump)"]
    S8 --> S9["return true"]
    S9 --> END(["END"])
```

**Processing Description:**

1. **Screen Info Retrieval** — `JCCWebCommon.getScreenInfo(this)` fetches common screen metadata and populates the logic instance with screen context (screen ID, user info, etc.).

2. **DataBean Acquisition** — The service form DataBean (`X31SDataBeanAccess`) is obtained from the superclass and wrapped in an array `paramBean` for downstream methods.

3. **DataBean Setup (`setHktgiBean`)** — Sets the service contract number (サービス契約番号, `svc_kei_no`) in the DataBean. In v4.01, this was simplified to read/set the value directly on the top-level bean rather than from a nested customer contract list.

4. **Initial Service Invocation (`executeInitSvc`)** — Calls the domain info display service:
   - Sets the use-case ID `KKSV0573` (Domain Info Display operation).
   - Maps the DataBean fields (service contract number) into a parameter map via `KKSV0573_KKSV0573OPDBMapper.setKKSV057301SC()`.
   - Invokes the backend via `invokeService()`, which routes to `EKK2411B001CBS`.
   - The CBS queries `KK_T_FTTH_TSRCK_JSK` for all active FTTH registration records (`MK_FLG = '0'`) filtered by `SVC_KEI_NO`, ordered by `FTTH_TUSHIN_USE_YM DESC`.
   - Maps the result set (domain restriction details) back to the DataBean via `KKSV0573_KKSV0573OPDBMapper.getKKSV057301SC()`.

5. **Authentication ID Generation (`setNinshoID`)** — For each domain info row:
   - Retrieves ISP authentication ID (ISP認証ID) and Multise authentication ID (マルチセッション用認証ID).
   - If multise ID is empty/null, uses ISP ID alone; otherwise concatenates both with a comma separator.
   - Sets the display authentication ID (表示用認証ID).
   - Assigns alternating row style (`odd`/`even`) for Zebra-striping in the UI, based on index parity.

6. **Navigation Setup** — Sets `NEXT_SCREEN_NAME` to `KKW02541` (Domain Restriction License) as the current screen identifier.

7. **DataBean Dump Logging** — Logs the complete DataBean state for debugging via `JSYwebLog.println(JSYwebLog.DataBean_Dump, ...)`.

8. **Returns `true`** — Indicates successful initialization.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| - | `(none)` | - | This method takes no parameters. All input data is sourced from the instance's inherited session state and the DataBean obtained via `super.getServiceFormBean()`. |
| - | `super.getServiceFormBean()` (inherited state) | `X31SDataBeanAccess` | The page-scoped DataBean carrying customer context and domain restriction list data. Contains the service contract number (`SVC_KEI_NO`) and the domain info list (`TIK_LIST`) used throughout processing. |
| - | `super.getCommonInfoBean()` (inherited state) | `X31SDataBeanAccess` | The common info bean used for navigation metadata, including setting the next screen name for the response cycle. |

## 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 | - | Retrieves screen context and metadata for the current web session |
| - | `X31SDataBeanAccess.getServiceFormBean` | X31SDataBeanAccess | - | Gets the DataBean instance carrying form data from the session |
| - | `KKW02541SFLogic.setHktgiBean` | KKW02541SFLogic | - | Configures the service contract number in the DataBean (internal helper) |
| - | `KKW02541SFLogic.executeInitSvc` | KKW02541SFLogic | - | Invokes the domain info display service and maps results to the DataBean |
| - | `KKW02541SFLogic.setNinshoID` | KKW02541SFLogic | - | Generates and sets authentication IDs for each domain info row |
| R | `KKSV0573_KKSV0573OPDBMapper.setKKSV057301SC` | KKSV0573_KKSV0573OPDBMapper | - | Maps DataBean fields (svc_kei_no) into CBS input parameter map |
| R | `invokeService` | KKW02541SFLogic | - | Delegates to the BPM/CBS layer to execute the domain info display service |
| R | `EKK2411B001CBS` | EKK2411B001CBS | `KK_T_FTTH_TSRCK_JSK` | Reads FTTH registration records filtered by service contract number and active flag (`MK_FLG = '0'`), ordered by use date descending |
| R | `KKSV0573_KKSV0573OPDBMapper.getKKSV057301SC` | KKSV0573_KKSV0573OPDBMapper | - | Maps CBS output (`EKK2411B001CBSMsg1List`) back into the DataBean's domain info list |
| - | `JSYwebLog.println` | JSYwebLog | - | Logs the DataBean dump to the application trace log |

**Additional method calls within the method (parameter/local object EXECs):**

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| EXEC | `paramMap.put(TELEGRAM_INFO_USECASE_ID, "KKSV0573")` | - | - | Sets the use-case identifier for the service invocation |
| EXEC | `paramBean[0].sendMessageString(SVC_KEI_NO, GET_VALUE)` | - | - | Reads the service contract number from the DataBean |
| EXEC | `paramBean[0].sendMessageString(SVC_KEI_NO, SET_VALUE, svc_kei_no)` | - | - | Writes the service contract number back to the DataBean |
| EXEC | `tik_list.getCount()` / `tik_list.getDataBean(i)` / `tik_list.addDataBean()` | - | - | Iterates and accesses domain info list items in the DataBean |
| EXEC | `tik_bean.sendMessageString(ISP_NINSHO_ID_01, GET_VALUE)` | - | - | Reads ISP authentication ID per row |
| EXEC | `tik_bean.sendMessageString(MLTISE_NINSHO_ID_01, GET_VALUE)` | - | - | Reads Multise authentication ID per row |
| EXEC | `tik_bean.sendMessageString(NINSHO_ID_01, SET_VALUE, ninsho_id)` | - | - | Sets the combined authentication ID per row |
| EXEC | `tik_bean.sendMessageString(ROW_STYLE_01, SET_VALUE, "even"/"odd")` | - | - | Sets row styling for Zebra-striping per row |
| EXEC | `commoninfoBean.sendMessageString(NEXT_SCREEN_NAME, SET_VALUE, SCREEN_NAME_KKW02541)` | - | - | Sets the current screen name for navigation context |

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Screen:KKSV0573 | `KKSV0573OPOperation` -> `KKSV0573Flow` -> `invokeService` -> `KKW02541SFLogic.actionInit` | `EKK2411B001CBS [R] KK_T_FTTH_TSRCK_JSK` |

**Notes on caller analysis:** The `actionInit` method is the initialization entry point of the `KKW02541SF` screen logic. It is invoked by the `KKSV0573` screen operation flow (BP process: `KKSV0573OPOperation` -> `KKSV0573Flow`), which is the BPM workflow that handles the Domain Info Display use case. Other screens such as `KKA16601SF` and `KKW00128SF` reference `KKW02541SF` constants (screen ID) for navigation purposes but do not directly call `actionInit`.

## 6. Per-Branch Detail Blocks

**Block 1** — [ASSIGN/SEQUENCE] `(line 50)`

> No conditional branches at the top level. The method executes a linear sequence of operations.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `JCCWebCommon.getScreenInfo(this)` // Retrieve screen context and metadata [-> JCCWebCommon] |
| 2 | SET | `X31SDataBeanAccess bean = super.getServiceFormBean()` // Get the service form DataBean |
| 3 | SET | `X31SDataBeanAccess[] paramBean = {bean}` // Wrap in array for downstream methods |
| 4 | CALL | `setHktgiBean(paramBean)` // Set service contract number in DataBean |
| 5 | CALL | `executeInitSvc(paramBean)` // Invoke domain info display service |
| 6 | CALL | `setNinshoID(paramBean)` // Generate authentication IDs for display |
| 7 | SET | `X31SDataBeanAccess commoninfoBean = super.getCommonInfoBean()` // Get common info bean |
| 8 | SET | `CommonInfoCFConst.NEXT_SCREEN_NAME` = `X31CWebConst.DATABEAN_SET_VALUE` = `JKKScreenConst.SCREEN_NAME_KKW02541` ("帯域制限执照") // Set screen name |
| 9 | EXEC | `JSYwebLog.println(JSYwebLog.DataBean_Dump, getClass(), dumpDatabean(), null, null, null)` // Log DataBean dump |
| 10 | RETURN | `return true` // Normal completion |

**Block 1.1** — [NESTED: `setHktgiBean`] `(line 113-132)`

> Copies the service contract number (サービス契約番号) into the DataBean. In v4.01 (IT1-2012-0001210), this was simplified from reading a nested customer contract list to reading directly from the top-level bean.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `paramBean[0].sendMessageString(KKW02541SFConst.SVC_KEI_NO, X31CWebConst.DATABEAN_GET_VALUE)` // Read svc_kei_no ["サービス契約番号"] |
| 2 | SET | `svc_kei_no` = result of above |
| 3 | EXEC | `paramBean[0].sendMessageString(KKW02541SFConst.SVC_KEI_NO, X31CWebConst.DATABEAN_SET_VALUE, svc_kei_no)` // Set svc_kei_no back |

**Block 1.2** — [NESTED: `executeInitSvc`] `(line 85-110)`

> Invokes the domain info display service (帯域情報照会サービス). Sets the use-case ID to `KKSV0573`, maps DataBean fields via the DB mapper, calls the backend CBS, and maps results back.

| # | Type | Code |
|---|------|------|
| 1 | SET | `HashMap<String, Object> paramMap = new HashMap<>()` // Parameter map for service call |
| 2 | SET | `HashMap<String, Object> inputMap = new HashMap<>()` // Input map for CBS |
| 3 | SET | `HashMap<String, Object> outputMap = new HashMap<>()` // Output map for CBS results |
| 4 | SET | `paramMap.put(X31CWebConst.TELEGRAM_INFO_USECASE_ID, "KKSV0573")` // Set use-case ID |
| 5 | SET | `KKSV0573_KKSV0573OPDBMapper mapper = new KKSV0573_KKSV0573OPDBMapper()` // Create DB mapper |
| 6 | CALL | `mapper.setKKSV057301SC(paramBean, inputMap, JPCModelConstant.FUNC_CD_1)` // Map DataBean -> CBS input [FUNC_CD_1 = "1"] |
| 7 | CALL | `invokeService(paramMap, inputMap, outputMap)` // Execute CBS [EKK2411B001CBS] |
| 8 | CALL | `mapper.getKKSV057301SC(paramBean, outputMap)` // Map CBS output -> DataBean |

**Block 1.3** — [NESTED: `setNinshoID`] `(line 138-195)`

> Iterates over the domain info list (帯域情報リスト), processes authentication IDs per row, and assigns row styles.

| # | Type | Code |
|---|------|------|
| 1 | SET | `X31SDataBeanAccessArray tik_list = paramBean[0].getDataBeanArray(KKW02541SFConst.TIK_LIST)` // Get domain info list ["帯域情報リスト"] |
| 2 | SET | `for(int i = 0; i < tik_list.getCount(); i++)` // Loop over all domain info rows |

**Block 1.3.1** — [FOR BODY] `(line 143-194)`

| # | Type | Code |
|---|------|------|
| 1 | SET | `X31SDataBeanAccess tik_bean = null` |
| 2 | IF | `tik_list.getCount() - 1 >= i` (line 144) |

**Block 1.3.2** — [IF-TRUE] `(line 145-146)`

| # | Type | Code |
|---|------|------|
| 1 | SET | `tik_bean = tik_list.getDataBean(i)` // Get existing row |

**Block 1.3.3** — [IF-FALSE] `(line 147-149)`

| # | Type | Code |
|---|------|------|
| 1 | SET | `tik_bean = tik_list.addDataBean()` // Create new row |

**Block 1.3.4** — [IF-ELSE] `if (tik_bean == null)` `(line 150-153)`

> If the row bean is still null after the above, skip processing this iteration.

| # | Type | Code |
|---|------|------|
| 1 | SET | `continue` // Skip to next row |

**Block 1.3.5** — [SEQUENTIAL: auth ID processing] `(line 156-172)`

| # | Type | Code |
|---|------|------|
| 1 | SET | `String ninsho_id = null` // Display authentication ID |
| 2 | SET | `String isp_ninsho_id = tik_bean.sendMessageString(KKW02541SFConst.ISP_NINSHO_ID_01, GET)` // ISP auth ID ["ISP認証ID"] |
| 3 | SET | `String mltise_ninsho_id = tik_bean.sendMessageString(KKW02541SFConst.MLTISE_NINSHO_ID_01, GET)` // Multise auth ID ["マルチセッション用認証ID"] |
| 4 | IF | `mltise_ninsho_id == null || "".equals(mltise_ninsho_id)` (line 158) |

**Block 1.3.6** — [IF-TRUE: no multise ID] `(line 159-160)`

| # | Type | Code |
|---|------|------|
| 1 | SET | `ninsho_id = isp_ninsho_id` // Use ISP ID alone |

**Block 1.3.7** — [IF-FALSE: has multise ID] `(line 161-163)`

| # | Type | Code |
|---|------|------|
| 1 | SET | `ninsho_id = isp_ninsho_id + "," + mltise_ninsho_id` // Concatenate with comma |

**Block 1.3.8** — [POST-IF] `(line 165-166)`

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `tik_bean.sendMessageString(KKW02541SFConst.NINSHO_ID_01, SET, ninsho_id)` // Set combined auth ID ["表示用認証ID"] |

**Block 1.3.9** — [IF-ELSE] `if (i % 2 == 1)` (Zebra-striping) `(line 170-176)`

| # | Type | Code |
|---|------|------|
| 1 | IF | `i % 2 == 1` (odd index) |

**Block 1.3.10** — [IF-TRUE: odd row] `(line 171-172)`

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `tik_bean.sendMessageString(KKW02541SFConst.ROW_STYLE_01, SET, "even")` // Row style ["行スタイル"] = "even" |

**Block 1.3.11** — [IF-FALSE: even row] `(line 173-175)`

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `tik_bean.sendMessageString(KKW02541SFConst.ROW_STYLE_01, SET, "odd")` // Row style ["行スタイル"] = "odd" |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `KKW02541` | Screen ID | Domain Restriction License screen — displays and manages bandwidth restriction settings for a customer's service contract |
| 帯域制限执照 (Taiiki Seigen Shouro) | Screen Name | "Domain Restriction License" — the Japanese business name for the screen |
| `TIK_LIST` | Constant | Domain info list — the DataBean array holding domain (bandwidth) restriction detail rows |
| `SVC_KEI_NO` | Constant | Service contract number (サービス契約番号) — internal identifier for a customer's telecom service contract |
| `ISP_NINSHO_ID_01` | Constant | ISP authentication ID (ISP認証ID) — authentication identifier for ISP-level access |
| `MLTISE_NINSHO_ID_01` | Constant | Multise authentication ID (マルチセッション用認証ID) — authentication identifier for multi-session access |
| `NINSHO_ID_01` | Constant | Display authentication ID (表示用認証ID) — combined authentication ID shown on the screen |
| `ROW_STYLE_01` | Constant | Row style (行スタイル) — CSS row class for Zebra-striping, set to "odd" or "even" |
| `FTTH_TSRCK_JSK` / `KK_T_FTTH_TSRCK_JSK` | DB Table | FTTH Registration/Confirmation Table (FTTH契約確認表) — stores FTTH service contract and registration data; alias `KK2411` in SQL |
| `MK_FLG` | Field | Mask flag (マスクフラグ) — active record flag; `MK_FLG = '0'` means the record is active/visible |
| `SVC_KEI_NO` | Field | Service contract number — foreign key linking FTTH registrations to a specific service contract |
| `FTTH_TUSHIN_USE_YM` | Field | FTTH activation use year/month (FTTH送信利用年月) — timestamp used for ordering results descending |
| `TIK_CTL_JSSI_YMD` | Field | Domain restriction implementation date (帯域制限実施日) — date when domain restriction was enacted |
| `ISP_NINSHO_ID` | Field | ISP authentication ID — per-record authentication identifier for ISP access |
| `MLTISE_NINSHO_ID` | Field | Multise authentication ID — per-record authentication identifier for multi-session access |
| `PCRS_CD` | Field | PC registration code (PC登録コード) — code identifying the customer's registered PC |
| `EKK2411B001CBS` | CBS Code | Domain info display CBS (帯域情報照会CBS) — backend service component that queries FTTH registration data |
| `KKSV0573` | Use-case ID | Domain info display use case (帯域情報一覧照会使用例) — the BPM use-case identifier for this service |
| `FUNC_CD_1` / `"1"` | Constant | Function code value `1` — indicates the "list query by service contract number" operation mode |
| `KKSV0573_OPOperation` | BPM Operation | BPM operation class for the Domain Restriction License screen |
| `JCCWebCommon` | Component | Shared web common component — provides screen info, validation, and navigation utilities |
| `X31SDataBeanAccess` | Class | Service-side DataBean access class — carries form data between screen and logic |
| `invokeService` | Method | Delegates to the BPM/CBS layer to execute business logic via the service invocation framework |
| `DATABEAN_GET_VALUE` / `DATABEAN_SET_VALUE` | Constant | DataBean message types for reading and writing field values |

---