# Business Logic — KKW02410SFLogic.actionInit() [54 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.KKW02410SF.KKW02410SFLogic` |
| Layer | Web Service Logic (Controller/Business Logic) |
| Module | `KKW02410SF` (Package: `eo.web.webview.KKW02410SF`) |

## 1. Role

### KKW02410SFLogic.actionInit()

The `actionInit` method performs the **initial display processing** for the Fiber Option Update screen (フェムテルオプション変更確認画面). It is the entry point invoked when a user accesses the screen to review and confirm changes to their Fiber Option (フェムテルオプション) service. The method orchestrates the full initialization lifecycle: it retrieves screen context information, acquires the service form DataBean, delegates to internal helper methods to populate inherited information (`setHktgiBean`), fetches initial service data (`executeInitSvc`), and then sets up the DataBean with post-service results and processing-division-specific display content (`setDataInit`).

The method operates as a **routing/dispatch pattern** — it branches on the processing division (`TRAN_DIV`) to deliver context-appropriate messages. Specifically, it supports two mutually exclusive operational modes: **cancellation** (`OP_TRAN_DIV_DSL = "04"`) and **restoration** (`OP_TRAN_DIV_KAIHK = "05"`) of the Fiber Option service. Depending on the division value, a distinct status message is set via `setMessageInfo` so that the user sees the correct confirmation prompt on screen (e.g., "Fiber Option Cancellation" vs. "Fiber Option Restoration").

The method always succeeds — it returns `true` on completion and propagates any exceptions from called services upward. It sets the next screen name on the common info bean for navigation routing, and logs the DataBean state for debugging/tracing purposes.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["actionInit()"])
    START --> GET_SCREEN["JCCWebCommon.getScreenInfo this"]
    GET_SCREEN --> GET_BEAN["Get X31SDataBeanAccess bean = super.getServiceFormBean"]
    GET_BEAN --> WRAP_ARRAY["Wrap bean into X31SDataBeanAccess[] paramBean"]
    WRAP_ARRAY --> CREATE_MSG["Create String[] msgInfo for message display"]
    CREATE_MSG --> SET_HKTGI["setHktgiBean paramBean"]
    SET_HKTGI --> EXEC_INIT["executeInitSvc paramBean"]
    EXEC_INIT --> GET_TRAN_DIV["Get trandiv from bean sendMessageString TRAN_DIV GET"]
    GET_TRAN_DIV --> SET_DATA["setDataInit paramBean trandiv"]
    SET_DATA --> CHECK_DSL{OP_TRAN_DIV_DSL equals trandiv}
    CHECK_DSL -->|Yes Cancellation| MSG_DSL["Set msgInfo[0] to Fiber Option Cancellation"]
    MSG_DSL --> SET_MSG_DSL["JCCWebCommon.setMessageInfo EKB0370__I msgInfo"]
    SET_MSG_DSL --> SET_NEXT
    CHECK_DSL -->|No| CHECK_KAIHK{OP_TRAN_DIV_KAIHK equals trandiv}
    CHECK_KAIHK -->|Yes Restoration| MSG_KAIHK["Set msgInfo[0] to Fiber Option Restoration"]
    MSG_KAIHK --> SET_MSG_KAIHK["JCCWebCommon.setMessageInfo EKB0370__I msgInfo"]
    SET_MSG_KAIHK --> SET_NEXT
    CHECK_KAIHK -->|No| SET_NEXT
    SET_NEXT["Set NEXT_SCREEN_NAME via commoninfoBean"]
    SET_NEXT --> LOG_DUMP["JSYwebLog.println DataBean_Dump"]
    LOG_DUMP --> RETURN["Return true"]
    RETURN --> END_NODE(["End"])
```

**CRITICAL — Constant Resolution:**

| Constant | Resolved Value | Business Meaning |
|----------|---------------|-----------------|
| `OP_TRAN_DIV_DSL` | `"04"` | Cancellation processing division (解除 — contract termination) |
| `OP_TRAN_DIV_KAIHK` | `"05"` | Restoration processing division (回復 — service restoration) |
| `TRAN_DIV` | `"処理区分"` | Processing division — key used to retrieve the operation type from the DataBean |
| `MSGSTRING[0]` | `"フェムテルオプションの解除"` | "Fiber Option Cancellation" (displayed when `trandiv = "04"`) |
| `MSGSTRING[1]` | `"フェムテルオプションの回復"` | "Fiber Option Restoration" (displayed when `trandiv = "05"`) |

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| - | (none) | - | This method takes no parameters. All input is sourced from instance fields (the parent class's DataBean) and static constants. |

**Instance fields / external state read by this method:**

| Source | Usage |
|--------|-------|
| `super.getServiceFormBean()` | The service form DataBean containing screen state, inherited customer contract data, and processing parameters |
| `super.getCommonInfoBean()` | The common information bean used for screen navigation metadata |
| `KKW02410SFConst.TRAN_DIV` | Static constant defining the DataBean key for the processing division |
| `JKKCommonConst.OP_TRAN_DIV_DSL` | Static constant for cancellation division code `"04"` |
| `JKKCommonConst.OP_TRAN_DIV_KAIHK` | Static constant for restoration division code `"05"` |
| `JPCOnlineMessageConstant.EKB0370__I` | Static message template key used for the message output |

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `JCCWebCommon.getScreenInfo` | JCCWebCommon | - | Retrieves the current screen context information (screen ID, parameters, session data) and sets it into this logic instance |
| - | `setHktgiBean` | KKW02410SFLogic | - | Internal method — sets customer contract relay DataBean with inherited information for the initial display |
| - | `executeInitSvc` | KKW02410SFLogic | - | Internal method — executes the initial display service, fetching and preparing service data for the Fiber Option update screen |
| - | `setDataInit` | KKW02410SFLogic | - | Internal method — sets up the DataBean with post-service results, including operation date mapping and processing-division-specific display content |
| - | `X31SDataBeanAccess.sendMessageString` | DataBean | - | Retrieves the processing division (`TRAN_DIV`) from the DataBean for branching logic |
| - | `JCCWebCommon.setMessageInfo` | JCCWebCommon | - | Sets the output message to be displayed on screen, using the message template `EKB0370__I` |
| - | `X31SDataBeanAccess.sendMessageString` (set) | CommonInfoBean | - | Sets the next screen name (`NEXT_SCREEN_NAME`) for navigation routing after the init completes |
| - | `JSYwebLog.println` | JSYwebLog | - | Logs the DataBean state dump to the debug trace for operational visibility |

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Screen:KKW02410 (KKW024110PJP) | WEBGAMEN_KKW024100PJP.xml → KKW02410SF BL config → KKW02410SFLogic.actionInit | JCCWebCommon.getScreenInfo [R] screen context, setHktgiBean [R] customer contract relay, executeInitSvc [R] initial service data, setDataInit [U] DataBean setup |

**Notes:**
- The method is invoked as the `actionInit` entry point when the KKW02410SF screen (confirmation screen for Fiber Option update) is accessed. The XML configuration `WEBGAMEN_KKW024100PJP.xml` defines the BL as `<BL id="KKW02410SF" name="フェムテルオプション変更確認画面" class="eo.web.webview.KKW02410SF.KKW02410SFLogic">`.
- No other Java-level callers were found referencing `KKW02410SFLogic.actionInit` directly — it is invoked exclusively through the screen's BL routing framework.

## 6. Per-Branch Detail Blocks

**Block 1** — [SET] `JCCWebCommon.getScreenInfo(this)` (L79)

> Retrieve screen context and set it into the logic instance.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `JCCWebCommon.getScreenInfo(this)` // Screen context acquisition — gets screen ID and parameters [-> JCCWebCommon] |

---

**Block 2** — [SET] DataBean acquisition and wrapping (L82-L84)

> Obtain the service form DataBean from the parent class and wrap it into an array for passing to called methods.

| # | Type | Code |
|---|------|------|
| 1 | SET | `X31SDataBeanAccess bean = super.getServiceFormBean()` // Acquire service form DataBean from parent class |
| 2 | SET | `X31SDataBeanAccess[] paramBean = {bean}` // Wrap into single-element array for method signature compatibility |

---

**Block 3** — [SET] Message info array creation (L87)

> Allocate a message info holder for the conditional branch message output.

| # | Type | Code |
|---|------|------|
| 1 | SET | `String[] msgInfo = new String[1]` // Buffer for single-line message to be set via setMessageInfo |

---

**Block 4** — [CALL] Set inherited information (L90)

> Populate the DataBean with inherited customer contract relay data.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `setHktgiBean(paramBean)` // Internal: set customer contract relay information [-> KKW02410SFLogic] |

---

**Block 5** — [CALL] Execute initial display service (L93)

> Invoke the core service logic to fetch and prepare the initial display data for the Fiber Option update.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `executeInitSvc(paramBean)` // Internal: execute initial display service [-> KKW02410SFLogic] |

---

**Block 6** — [SET] Retrieve processing division (L96)

> Get the operation type (cancellation vs. restoration) from the DataBean to determine branching behavior.

| # | Type | Code |
|---|------|------|
| 1 | SET | `String trandiv = bean.sendMessageString(KKW02410SFConst.TRAN_DIV, X31CWebConst.DATABEAN_GET_VALUE)` // Read processing division key [-> KKW02410SFConst.TRAN_DIV="処理区分"] |

---

**Block 7** — [CALL] Set up DataBean with service results (L99)

> Configure the DataBean with post-service data, including operation date mapping and processing-division-specific content.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `setDataInit(paramBean, trandiv)` // Internal: set DataBean with service results [-> KKW02410SFLogic] |

---

**Block 8** — [IF] Processing division = Cancellation (L102)

> When the processing division indicates cancellation (`OP_TRAN_DIV_DSL = "04"`), set the cancellation message and output it to the screen.

| # | Type | Code |
|---|------|------|
| 1 | IF | `if(JKKCommonConst.OP_TRAN_DIV_DSL.equals(trandiv))` [-> JKKCommonConst.OP_TRAN_DIV_DSL="04" (JKKCommonConst.java:2510)] — "解除" (Cancellation) |
| 2 | SET | `msgInfo[0] = MSGSTRING[0]` // "フェムテルオプションの解除" = "Fiber Option Cancellation" [-> MSGSTRING[0]="フェムテルオプションの解除"] |
| 3 | CALL | `JCCWebCommon.setMessageInfo(this, JPCOnlineMessageConstant.EKB0370__I, msgInfo)` // Output cancellation confirmation message |

---

**Block 9** — [ELSE IF] Processing division = Restoration (L110)

> When the processing division indicates restoration (`OP_TRAN_DIV_KAIHK = "05"`), set the restoration message and output it to the screen.

| # | Type | Code |
|---|------|------|
| 1 | ELSE-IF | `else if(JKKCommonConst.OP_TRAN_DIV_KAIHK.equals(trandiv))` [-> JKKCommonConst.OP_TRAN_DIV_KAIHK="05" (JKKCommonConst.java:2511)] — "回復" (Restoration) |
| 2 | SET | `msgInfo[0] = MSGSTRING[1]` // "フェムテルオプションの回復" = "Fiber Option Restoration" [-> MSGSTRING[1]="フェムテルオプションの回復"] |
| 3 | CALL | `JCCWebCommon.setMessageInfo(this, JPCOnlineMessageConstant.EKB0370__I, msgInfo)` // Output restoration confirmation message |

---

**Block 10** — [SET] Set next screen name (L118-L120)

> Configure the common info bean with the next screen name for navigation. This is added since v4.01 (20121007) for screen routing.

| # | Type | Code |
|---|------|------|
| 1 | SET | `X31SDataBeanAccess commoninfoBean = super.getCommonInfoBean()` // Acquire common info bean |
| 2 | EXEC | `commoninfoBean.sendMessageString(CommonInfoCFConst.NEXT_SCREEN_NAME, X31CWebConst.DATABEAN_SET_VALUE, JKKScreenConst.SCREEN_NAME_KKW02410)` // Set next screen name [-> CommonInfoCFConst.NEXT_SCREEN_NAME, JKKScreenConst.SCREEN_NAME_KKW02410] |

---

**Block 11** — [EXEC] Log DataBean state (L123)

> Dump the current DataBean state to the log for operational traceability.

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

---

**Block 12** — [RETURN] Success (L125)

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return true` // Normal completion — screen proceeds to display |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `actionInit` | Method | Initial display processing — prepares screen state when a user first accesses the Fiber Option update confirmation screen |
| `trandiv` | Field/Variable | Processing division — indicates the operational mode of the screen: cancellation ("04") or restoration ("05") |
| `paramBean` | Variable | Service form DataBean array — carries screen data and business parameters between methods |
| `msgInfo` | Variable | Message info holder — single-slot array used to pass a message text to the screen message setter |
| `OP_TRAN_DIV_DSL` | Constant | Operation transfer division for "Dissolution" / Cancellation — value `"04"`, means the user is performing a Fiber Option contract termination |
| `OP_TRAN_DIV_KAIHK` | Constant | Operation transfer division for "Restoration" — value `"05"`, means the user is restoring a previously canceled Fiber Option service |
| `TRAN_DIV` | Constant (KKW02410SFConst) | DataBean key string `"処理区分"` used to retrieve the processing division value from the screen DataBean |
| `EKB0370__I` | Constant (JPCOnlineMessageConstant) | Message template ID for displaying operation status information on the confirmation screen |
| `NEXT_SCREEN_NAME` | Constant (CommonInfoCFConst) | Common info bean key for specifying the next screen to navigate to after the current processing completes |
| `SCREEN_NAME_KKW02410` | Constant (JKKScreenConst) | Screen identifier constant for the KKW02410 fiber option update screen |
| `setHktgiBean` | Method | Sets inherited customer contract relay list data on the DataBean — populates the customer's existing contract information for display |
| `executeInitSvc` | Method | Executes the initial display service — fetches service data needed for the Fiber Option update confirmation screen |
| `setDataInit` | Method | Sets up the DataBean with post-service results — configures operation date, end date, and processing-division-specific display content |
| フェムテルオプション | Business term | Fiber Option — NTT's fiber-optic broadband add-on service (Fiber To The Home) |
| 解除 | Japanese term | Cancellation / Dissolution — the act of terminating a service contract |
| 回復 | Japanese term | Restoration — the act of reactivating a previously canceled service |
| 変更確認画面 | Japanese term | Change confirmation screen — the UI where users review service changes before confirming |
| 初期表示処理 | Japanese term | Initial display processing — the screen initialization routine |
| DataBean | Technical term | Data transfer object carrying screen form data between presentation and business logic layers |
| KKW02410SF | Module ID | Screen module identifier — KKW02410 = Fiber Option Update, SF = Service Form |
| JCCWebBusinessLogic | Base class | Parent class providing common web business logic infrastructure (screen info, DataBean access, logging) |
