# Business Logic — KKW00804SFLogic.actionInit() [21 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.KKW00804SF.KKW00804SFLogic` |
| Layer | Controller / Screen Logic (Web presentation layer) |
| Module | `KKW00804SF` (Package: `eo.web.webview.KKW00804SF`) |

## 1. Role

### KKW00804SFLogic.actionInit()

This method is the **initial display processing entry point** for the My Home Page (MyHP) information registration screen (`KKW00804`). Its Javadoc reads: "初期表示処理を行います。" (Performs initial display processing.). It serves as the first business logic method invoked when a customer accesses the MyHP registration screen (KKW00804) from the K-Opticom customer portal. The method orchestrates a four-step initialization pipeline: (1) retrieving prior screen context information via `JCCWebCommon.getScreenInfo()`, (2) acquiring the customer's contract lineage (parent contract identifiers) through `setHktgiBean()`, (3) executing the comprehensive initial display service which fetches operation service contracts, ISP agreement details, home page capacity info, access analytics data, business parameters, customer agreement records, service contract summaries, and fee/course sub-service listings via `executeInitSvc()`, and (4) applying final DataBean initial value configurations — including default dropdown selections for home page capacity and access analysis, domain resolution fallback, and operational date parsing — through `setInitBean()`. The method follows a **sequential delegation** pattern, where each step builds upon the previous one's side effects on the shared `X31SDataBeanAccess[]` parameter array. It has no conditional branches; it always executes the full pipeline in order and returns `true` on success, or throws an `Exception` on failure. This is the screen entry point for KKW00804, the MyHome Page information registration screen.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["actionInit()"])

    START --> GET_SCREEN["JCCWebCommon.getScreenInfo(this)"]

    GET_SCREEN --> GET_BEAN["super.getServiceFormBean()"]

    GET_BEAN --> WRAP_BEAN["X31SDataBeanAccess[] paramBean = {bean}"]

    WRAP_BEAN --> CALL_SET_HKTGI["setHktgiBean(paramBean)"]

    CALL_SET_HKTGI --> CALL_EXEC_INIT["executeInitSvc(paramBean)"]

    CALL_EXEC_INIT --> CALL_SET_INIT["setInitBean(paramBean)"]

    CALL_SET_INIT --> RETURN_TRUE["return true"]

    RETURN_TRUE --> END(["End"])
```

**Processing Flow Description:**

The method executes a linear pipeline with no conditional branches:

1. **Screen Info Acquisition** — Calls `JCCWebCommon.getScreenInfo(this)` to retrieve screen context (screen ID, function code, previous screen information) and store it in the business logic's internal state.
2. **Bean Access Acquisition** — Calls `super.getServiceFormBean()` to obtain the DataBean for screen data exchange, then wraps it in a single-element array `paramBean` for passing to subsequent methods.
3. **Contract Lineage Loading** — Delegates to `setHktgiBean(paramBean)` to load the customer's parent contract information (service contract numbers, billing codes) into the DataBean.
4. **Initial Display Service** — Delegates to `executeInitSvc(paramBean)`, the most complex method in the pipeline, which:
   - Sets the operation service code to MyHP (`OP_SVC_CD_MYHP`)
   - Creates a mapper (`KKSV0005_KKSV0005OPDBMapper`) and configures 9 SC calls for setting up screen data
   - Invokes the service pipeline via `invokeService()`
   - Retrieves and maps back the results
   - Builds dropdown lists for home page capacity and access analysis
   - Sets the operational date
5. **Initial Bean Configuration** — Delegates to `setInitBean(paramBean)` to:
   - Set initial dropdown index values for home page capacity and access analysis
   - Resolve home page domain (fallback to URL domain if empty)
   - Parse the operational date into year, month, and day components for the `useStayYmd` (use end date) fields
6. **Return** — Returns `true` indicating successful initialization.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| - | (none) | - | This method takes no explicit parameters. It derives all needed context from the HTTP request scope and instance fields. |

**Instance Fields / External State Read:**

| # | Field / External Source | Business Description |
|---|------------------------|---------------------|
| 1 | `this` (passed to `getScreenInfo`) | The business logic instance itself — carries prior screen context (screen ID, function code) set up by the framework before this method is called. |
| 2 | `super.getServiceFormBean()` | The X31S DataBean holding all screen input/output data fields for the MyHP registration screen. |
| 3 | `JCCWebCommon.getOpeDate(this, null)` | Operational date from the system — used for setting the default "use end date" year/month/day and for the `unyoYmd` field. |

## 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 | - | Calls `getScreenInfo` in `JCCWebCommon` to retrieve screen context (screen ID, function code). |
| - | `KKW00804SFLogic.setHktgiBean` | KKW00804SFLogic | - | Delegates to load customer parent contract information (service contract numbers, billing codes). |
| - | `KKW00804SFLogic.executeInitSvc` | KKW00804SFLogic | - | Delegates to execute the initial display service, which calls multiple SCs. |
| - | `KKW00804SFLogic.setInitBean` | KKW00804SFLogic | - | Delegates to set DataBean initial values (dropdown defaults, domain resolution, date parsing). |

### Cascaded SC Calls (via `executeInitSvc`):

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `KKSV000504SC` | KKSV000504SC | - | Operation service contract list acquisition SC. |
| R | `KKSV000501SC` | KKSV000501SC | - | Operation service contract (ISP) agreement acquisition SC. |
| R | `KKSV000502SC` | KKSV000502SC | - | Home page capacity information acquisition SC. |
| R | `KKSV000503SC` | KKSV000503SC | - | Access analytics information acquisition SC. |
| R | `KKSV000505SC` | KKSV000505SC | - | Business parameter management agreement SC. |
| R | `KKSV000506SC` | KKSV000506SC | - | Customer agreement acquisition SC. |
| R | `KKSV000507SC` | KKSV000507SC | - | Service contract agreement acquisition SC. |
| R | `KKSV000508SC` | KKSV000508SC | - | Fee/course_sub-service list acquisition SC. |

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Screen:KKW00804 | `KKW008040PJP.jsp` (JSF view) -> framework invokes `KKW00804SFLogic.actionInit()` | `JCCWebCommon.getScreenInfo`, `setHktgiBean`, `KKSV000504SC`, `KKSV000501SC`, `KKSV000502SC`, `KKSV000503SC`, `KKSV000505SC`, `KKSV000506SC`, `KKSV000507SC`, `KKSV000508SC`, `setInitBean` |

**Caller Notes:**
- The MyHP registration screen `KKW008040PJP.jsp` uses JSF (JavaServer Faces) with `<%@ page import="eo.web.webview.KKW00804SF.*"%>`. The X33 framework dispatches to `actionInit()` as the initialization handler when the screen loads.
- `KKW008050PJP.jsp` and `KKW008060PJP.jsp` reference the `KKW00804SF` package for bean access but are confirmation and completion screens respectively, not direct callers of `actionInit`.

## 6. Per-Branch Detail Blocks

**Block 1** — [LINEAR PIPELINE STEP] (L143)

> Screen context information retrieval. This step fetches the screen ID, function code, and previous screen information from the framework context and stores them in the business logic instance.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `JCCWebCommon.getScreenInfo(this);` // Retrieve screen context info [-> Screen ID, Function Code] |

**Block 2** — [LINEAR PIPELINE STEP] (L147)

> DataBean access acquisition. Obtains the screen DataBean from the parent class and wraps it in an array for passing to subsequent processing methods.

| # | Type | Code |
|---|------|------|
| 1 | SET | `X31SDataBeanAccess bean = super.getServiceFormBean();` // Get DataBean from parent framework class |
| 2 | SET | `X31SDataBeanAccess[] paramBean = {bean};` // Wrap single DataBean in array |

**Block 3** — [LINEAR PIPELINE STEP] (L150)

> Customer contract lineage loading. Delegates to `setHktgiBean` to populate the DataBean with the customer's parent contract information (service contract numbers, billing/pricing codes). This step establishes the customer's contract context for subsequent operations.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `setHktgiBean(paramBean);` // Load customer parent contract information (service contract #, billing codes) |

**Block 4** — [LINEAR PIPELINE STEP] (L153)

> Initial display service execution. The core processing step that invokes the full screen initialization service pipeline. This method (defined at L299) orchestrates: setting operation service code, creating the mapper, calling 9 SCs for screen data setup, executing the service, mapping results back, building dropdown lists for capacity and access analysis, and setting the operational date. See `KKW00804SFLogic.executeInitSvc` for full detail.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `executeInitSvc(paramBean);` // Execute initial display service — calls KKSV000501SC through KKSV000508SC |

**Block 5** — [LINEAR PIPELINE STEP] (L156)

> DataBean initial value configuration. Delegates to `setInitBean` which:
> - Sets the initial dropdown index (0) for home page capacity info and access analysis info
> - Resolves home page domain (if empty, falls back to the URL domain parameter)
> - Parses the operational date into year, month, and day components for the `useStayYmd` fields
> See `KKW00804SFLogic.setInitBean` for full detail.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `setInitBean(paramBean);` // Set DataBean initial values: dropdown defaults, domain fallback, date parse |

**Block 6** — [RETURN] (L158)

> Success return. The method always returns `true` since exceptions propagate upward and no error handling is done locally.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return true;` // Indicate successful initialization |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `unyoYmd` | Field | Operational date — the system's current date in `yyyyMMdd` format, used as reference date for service operations |
| `svc_keiStat` | Field | Service detail status — tracks the processing status of a service line item |
| `hpad_domain` | Field | Home page address domain — the domain portion of the customer's registered home page URL |
| `hpad_account` | Field | Home page address account — the account/path portion of the customer's registered home page URL |
| `hp_capa_info` | Field | Home page capacity info — dropdown selection of available home page bandwidth/storage capacity options |
| `accss_bnsk_info` | Field | Access analysis info — dropdown selection of access analytics plan options |
| `useStayYmd` | Field | Use end date — the customer's planned service end date, entered as year/month/day components |
| `capa` | Field | Capacity — the numeric home page capacity code selected by the customer |
| `hp_capaNm` | Field | Home page capacity name — the display name of the selected capacity option (e.g., "100MB plan") |
| `webId` | Field | Web ID — the customer's portal login identifier, displayed read-only on the registration screen |
| MyHP | Business term | My Home Page — K-Opticom's customer self-service portal where customers manage their subscriptions |
| OP_SVC_CD_MYHP | Constant | Operation Service Code for MyHP — identifies the MyHP service channel in operation service records |
| KKW00804 | Screen ID | My Home Page information registration screen — the screen where customers select and register their MyHP settings |
| KKW00804SF | Module | MyHP registration screen logic module — contains all business logic for the MyHP registration workflow |
| X31SDataBeanAccess | Technical type | X31 framework DataBean access wrapper — the standard data exchange object for screen input/output in the X31 web framework |
| invokeService | Method | Service execution invoker — the framework method that dispatches to the registered CBS/SC pipeline |
| JSYwebLog | Utility | Web logging utility — application logging class for DataBean dump and debug output |
