# Business Logic — KKW00816SFLogic.actionInit() [25 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.KKW00816SF.KKW00816SFLogic` |
| Layer | Controller (webview business logic, extends `JCCWebBusinessLogic`) |
| Module | `KKW00816SF` (Package: `eo.web.webview.KKW00816SF`) |

## 1. Role

### KKW00816SFLogic.actionInit()

This method is the initial display entry point for the KKW00816SF screen, responsible for routing the user's initial page load to the correct processing branch based on the **next screen ID** carried in the request's common information. It implements a **screen-dispatch pattern**: it reads the `NEXT_SCREEN_ID` from the shared `CommonInfoBean` (which holds cross-screen navigation context managed by the X31S web framework) and compares it against known screen identifiers. If the target screen is `KKW00816` (the multi-session registration screen), the method delegates to `actionMltiseInit()`, which performs the full initialization — including fetching the service form bean, setting operation date/time, and populating data beans with customer/option contract data via SC calls. If the target screen is `KKW00817` or `KKW00818`, the method currently executes an empty block and returns `true` (no-op initialization for those screens). Any unrecognized screen ID also falls through to return `true`, acting as a safe default. The method has no parameters and no throws documented beyond `Exception` inherited from the framework, reflecting that its primary role is navigational dispatch rather than data manipulation.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["actionInit() Entry"])
    GET_COMMON["Get CommonInfoBean
super.getCommonInfoBean()"]
    GET_SCREEN_ID["Retrieve NEXT_SCREEN_ID
sendMessageString(CommonInfoCFConst.NEXT_SCREEN_ID)"]
    COND_KKW00816{SCREEN_ID_KKW00816
== screenId}
    DELEGATE["actionMltiseInit()
Multi-session init processing"]
    COND_KKW00817{SCREEN_ID_KKW00817
== screenId}
    COND_KKW00818{SCREEN_ID_KKW00818
== screenId}
    RETURN_TRUE["Return true"]
    RETURN_RESULT["actionMltiseInit()
Return result"]
    END_NODE(["Return / Next"])

    START --> GET_COMMON
    GET_COMMON --> GET_SCREEN_ID
    GET_SCREEN_ID --> COND_KKW00816
    COND_KKW00816 -- "KKW00816" --> DELEGATE
    DELEGATE --> RETURN_RESULT
    RETURN_RESULT --> END_NODE
    COND_KKW00816 -- "not KKW00816" --> COND_KKW00817
    COND_KKW00817 -- "KKW00817" --> RETURN_TRUE
    COND_KKW00817 -- "not KKW00817" --> COND_KKW00818
    COND_KKW00818 -- "KKW00818" --> RETURN_TRUE
    COND_KKW00818 -- "default
any other screen" --> RETURN_TRUE
    RETURN_TRUE --> END_NODE
```

**CRITICAL — Constant Resolution:**

| Constant | Screen ID | Business Meaning | Source Location |
|----------|-----------|------------------|-----------------|
| `SCREEN_ID_KKW00816` | `"KKW00816"` | Multi-session registration screen (initial display for multi-line service contracts) | `JKKScreenConst.java:519` (koptWebB) |
| `SCREEN_ID_KKW00817` | `"KKW00817"` | Single-session variant screen (placeholder, no initialization logic) | `JKKScreenConst.java:523` (koptWebB) |
| `SCREEN_ID_KKW00818` | `"KKW00818"` | Single-session variant screen (placeholder, no initialization logic) | `JKKScreenConst.java:527` (koptWebB) |

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| - | (none) | - | This method takes no parameters; all input is derived from the shared web framework context. |
| 1 | `commoninfoBean` (retrieved) | `X31SDataBeanAccess` | Common information data bean from the framework's session-scoped `CommonInfoBean`. Contains cross-screen navigation state, including the `NEXT_SCREEN_ID` that determines routing. |

**Instance fields / external state read:**

| Source | Type | Description |
|--------|------|-------------|
| `super.getCommonInfoBean()` | `X31SDataBeanAccess` | Framework-managed common information bean (session-scoped). Provides `sendMessageString()` to read/write common data items across the request lifecycle. |

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `OneStopDataBeanAccess.sendMessageString` | X31S Framework | - | Reads the `NEXT_SCREEN_ID` value from the common info data bean. This is a framework-level read of navigation context, not a database query. |
| R | `super.getCommonInfoBean` | X31S Framework | - | Retrieves the session-scoped common information bean from the framework. |
| CALL | `KKW00816SFLogic.actionMltiseInit` | KKW00816SFLogic | - | Delegates to multi-session initialization. See Block 1.M for the downstream SC calls (`KKSV003001SC`, `KKSV003002SC`) which perform customer contract and option contract lookups. |

**Downstream CRUD from `actionMltiseInit()`:**

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `setKKSV003001SC` | KKSV003001SC | Customer contract tables | Reads customer contract agreement data (service contract list) for the multi-session init. |
| R | `setKKSV003002SC` | KKSV003002SC | Option contract tables | Reads customer option agreement data (option service contract list) for the multi-session init. |

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Screen:KKW00816 (Framework-dispatched) | `KKW00816SFLogic.actionInit` (entry point — invoked by web framework via screen ID mapping) | `actionMltiseInit` -> `setKKSV003001SC [R] Customer contract`, `setKKSV003002SC [R] Option contract` |
| 2 | Screen:KKW00817 (Framework-dispatched) | `KKW00816SFLogic.actionInit` (entry point — no-op branch) | No terminal CRUD |
| 3 | Screen:KKW00818 (Framework-dispatched) | `KKW00816SFLogic.actionInit` (entry point — no-op branch) | No terminal CRUD |

**Notes on caller discovery:** No direct Java callers to `actionInit()` were found outside this class. The method is invoked through the **X31S web framework's screen dispatch mechanism** — the framework maps screen IDs (e.g., `KKW00816`) to corresponding `actionInit()` methods on the associated `Logic` classes. The `KKW00816SFChecker` class references `KKW00816SFLogic` as the business logic class under validation but does not directly call `actionInit()`.

## 6. Per-Branch Detail Blocks

**Block 1** — [SET] Retrieve common info bean (L95)

> Obtain the shared session-scoped common information data bean from the framework. This bean carries cross-screen navigation context.

| # | Type | Code |
|---|------|------|
| 1 | SET | `X31SDataBeanAccess commoninfoBean = super.getCommonInfoBean()` |

**Block 2** — [SET] Get next screen ID (L97)

> Read the `NEXT_SCREEN_ID` from the common info bean. This is the key that determines which screen branch to follow.

| # | Type | Code |
|---|------|------|
| 1 | SET | `String screenId = commoninfoBean.sendMessageString(CommonInfoCFConst.NEXT_SCREEN_ID, X31CWebConst.DATABEAN_GET_VALUE)` |

**Block 3** — [IF-ELSE IF-ELSE] Screen ID dispatch (L101)

> Compare `screenId` against known screen IDs to route to the appropriate initialization handler.

| # | Type | Code |
|---|------|------|
| 1 | COND | `JKKScreenConst.SCREEN_ID_KKW00816.equals(screenId)` [SCREEN_ID_KKW00816="KKW00816"] (L101) |
| 2 | COND | `JKKScreenConst.SCREEN_ID_KKW00817.equals(screenId)` [SCREEN_ID_KKW00817="KKW00817"] (L107) |
| 3 | COND | `JKKScreenConst.SCREEN_ID_KKW00818.equals(screenId)` [SCREEN_ID_KKW00818="KKW00818"] (L111) |
| 4 | SET | `return true;` (L113) — default fallthrough for any unmatched screen ID |

**Block 3.1** — [IF: KKW00816 branch] (L101)

> The primary branch: when the target screen is `KKW00816`, delegate to the multi-session initialization method.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `actionMltiseInit()` — delegates to full multi-session init. This method retrieves the service form bean, validates it is not null, sets the data bean via `setDataBean()`, populates the operation date/time from the online operation date, and maps SC codes for customer and option contract data retrieval. |

**Block 3.2** — [ELSE IF: KKW00817 branch] (L107)

> Placeholder branch for screen `KKW00817`. The block body is empty — no processing is performed. The method falls through to the final `return true;`.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | *(empty block — no operations)* |

**Block 3.3** — [ELSE IF: KKW00818 branch] (L111)

> Placeholder branch for screen `KKW00818`. The block body is empty — no processing is performed. The method falls through to the final `return true;`.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | *(empty block — no operations)* |

**Block 4** — [RETURN] Default success (L113)

> For any screen ID not matching the three known values, return `true` to indicate successful initialization (no-op for unrecognized screens).

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

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `NEXT_SCREEN_ID` | Field | Next screen identifier — framework-level data item that carries the target screen ID across navigation requests. Used to determine which screen's initialization logic should execute. |
| `KKW00816` | Screen ID | Multi-session registration screen — the primary screen for registering multiple service contracts (customer contracts + option contracts) in a single operation. |
| `KKW00817` | Screen ID | Single-session variant screen — a placeholder screen ID branch with no initialization logic currently implemented. |
| `KKW00818` | Screen ID | Single-session variant screen — a placeholder screen ID branch with no initialization logic currently implemented. |
| `X31SDataBeanAccess` | Framework Class | Framework data access bean that provides `sendMessageString()` for reading and writing data items within a shared data context (session/request scope). |
| `X31CWebConst` | Framework Const | Framework constant class containing data bean access mode constants such as `DATABEAN_GET_VALUE` and `DATABEAN_SET_VALUE`. |
| `DATABEAN_GET_VALUE` | Constant | Framework constant indicating a read operation on a data bean field. |
| `CommonInfoCFConst` | Framework Const | Framework constant class containing the `NEXT_SCREEN_ID` field name used for screen navigation routing. |
| `actionMltiseInit` | Method | Multi-session initialization — the full initialization handler for screen KKW00816. Retrieves the service form bean, sets operation date/time, and calls SC methods to populate customer and option contract data. |
| `JCCWebBusinessLogic` | Framework Class | Base class for all web-layer business logic classes in the X31S framework. Provides framework integration methods such as `getCommonInfoBean()`, `getServiceFormBean()`, and `setDataBean()`. |
| `JKKScreenConst` | Const Class | Screen identifier constant definitions. Contains all screen ID constants used for screen routing, including `SCREEN_ID_KKW00816`, `SCREEN_ID_KKW00817`, and `SCREEN_ID_KKW00818`. |
| `KKSV003001SC` | SC Code | Customer contract agreement SC — retrieves customer contract list data (service agreements). |
| `KKSV003002SC` | SC Code | Customer option agreement SC — retrieves option service contract list data. |
| `UNYO_YMD` | Field | Operation date (YYYYMMDD) — the current online business date used to timestamp the initialization. |
| `UNYO_DTM` | Field | Operation date-time (YYYYMMDDHHmmss) — the current online business date-time stamp used to timestamp the initialization. |
| MLTISE | Abbreviation | Multi-session — refers to the multi-service-registration workflow where multiple customer and option contracts are handled in a single screen session. |
