# Business Logic — KKW05602SFLogic.actionFix() [96 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.KKW05602SF.KKW05602SFLogic` |
| Layer | Controller / Screen Logic (Web presentation tier — logic layer within screen framework) |
| Module | `KKW05602SF` (Package: `eo.web.webview.KKW05602SF`) |

## 1. Role

### KKW05602SFLogic.actionFix()

This method serves as the post-processing entry point for the **Fiber-to-the-Home (FTTH) call sign (toki) update/deletion screen** in the eo光denwa (K-Opticom fiber optic phone) service management system. Specifically, it is called after the customer has reviewed and confirmed a change or cancellation of the call sign registration (トク登録変更・解除画面). Its primary responsibilities are: (1) invoking the core service flow `KKSV0171` — which handles customer consent checks, service contract agreement processing, order content registration, service contract detail updates, application detail review, and progress registration — using function code 1 (update/deletion path); (2) performing a conditional phone number status validation when the operation is an **update** (as opposed to a deletion), ensuring that the phone number is not in a port-out status and that phone number master data exists before allowing the update to proceed; and (3) setting up the next screen navigation target (KKW05606) and displaying a completion confirmation message to the customer. The method implements a **delegation pattern** by delegating all heavy lifting to the `KKSV0171` service mapper and a phone status validation helper, making it a thin orchestration layer within the larger screen flow.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["actionFix()"])
    START --> GETBEAN["Get X31SDataBeanAccess bean"]
    GETBEAN --> BEANNULL{bean is null?}
    BEANNULL -- "Yes" --> THROW["throw Exception"]
    BEANNULL -- "No" --> CREATEMAP["Create paramMap/inputMap/outputMap"]
    CREATEMAP --> INVOKE["invokeServiceKKSV0171(paramBean, FUNC_CODE_1)"]
    INVOKE --> GETUPDFLG["Get upd_cancel_flg from bean"]
    GETUPDFLG --> CHECKUPD{Is update?}
    CHECKUPD -- "No" --> SETCOMMON["Set commonBean NEXT_SCREEN_ID=KKW05606"]
    CHECKUPD -- "Yes" --> CHECKTEL["initTelnoStatCheckActionCfm(paramBean)"]
    CHECKTEL --> Telnostatus{checkOkTelnoStat?}
    Telnostatus -- "false" --> SKIPRETURN["return true (skip update)"]
    Telnostatus -- "true" --> SETCOMMON2["Set commonBean NEXT_SCREEN_ID=KKW05606"]
    SETCOMMON --> SETMSG["Set message info: KANRYO_MSG_ID + KanryoMsgChgStr"]
    SETCOMMON2 --> SETMSG2["Set message info: KANRYO_MSG_ID + KanryoMsgChgStr"]
    SETMSG --> RETURN["return true"]
    SETMSG2 --> RETURN
    THROW --> END(["End"])
    SKIPRETURN --> END
    RETURN --> END
```

**Branch descriptions:**
- **UPD_CANCEL_FLG_UPD = "1"** — The update flag value indicating this is an **update** (変更) operation (as opposed to a deletion). When set, the method performs a phone number status check before proceeding.
- **UPD_CANCEL_FLG_CANCEL = "2"** — The deletion flag value indicating a **deletion** (解除) operation. When set, the method skips the phone number status check entirely and proceeds directly to screen navigation setup.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| - | (none) | - | This method takes no parameters. All data is obtained internally from the service form DataBean via `super.getServiceFormBean()`. |
| 1 | bean (internal) | `X31SDataBeanAccess` | The screen's service form DataBean containing all customer input, call sign registration data, and the update/deletion flag (`UPD_CANCEL_FLG`). This bean carries the entire business context of the update screen operation. |
| 2 | paramBean (internal) | `X31SDataBeanAccess[]` | Array wrapping the service form bean, passed as a parameter to the `KKSV0171` service invocation mapper for bidirectional data flow. |
| 3 | paramMap (internal) | `HashMap<String, Object>` | Parameter setup map for the service invocation — holds user case ID and operation ID for tracing. |
| 4 | inputMap (internal) | `HashMap<String, Object>` | Input condition map that collects search/filter conditions passed to SC/CBS calls. |
| 5 | outputMap (internal) | `HashMap<String, Object>` | Result collection map that receives data from SC/CBS calls after service execution. |
| 6 | commonBean (internal) | `X31SDataBeanAccess` | The shared form DataBean obtained via `super.getCommonInfoBean()`, used to set the next screen ID and screen name for navigation. |
| 7 | upd_cancel_flg (internal) | `String` | The update/deletion flag retrieved from the bean, containing either "1" (Update) or "2" (Delete). Determines whether phone number status validation is required. |
| 8 | checkOkTelnoStat (internal) | `boolean` | Result of the phone number status validation check. `false` means the update should be skipped (phone is in port-out status or master data missing); `true` means update proceeds. |
| - | super.getServiceFormBean() | — | Returns the screen-level DataBean holding all form state and customer-entered data. |
| - | super.getCommonInfoBean() | — | Returns the shared cross-screen context bean for navigation settings. |

## 4. CRUD Operations / Called Services

### Pre-computed evidence from code analysis:

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `KKSV0171_KKSV0171OPDBMapper.setKKSV017101SC` | KKSV017101SC | — | Sets up customer consent check SC for the KKSV0171 service flow |
| - | `KKSV0171_KKSV0171OPDBMapper.setKKSV017102SC` | KKSV017102SC | — | Sets up service contract agreement SC for the KKSV0171 service flow |
| - | `KKSV0171_KKSV0171OPDBMapper.setKKSV017103SC` | KKSV017103SC | — | Sets up order content approval registration SC |
| - | `KKSV0171_KKSV0171OPDBMapper.setKKSV017104_2SC` | KKSV017104_2SC | — | Sets up service contract detail update SC for eo光denwa (update screen path) |
| - | `KKSV0171_KKSV0171OPDBMapper.setKKSV017105SC` | KKSV017105SC | — | Sets up application detail review and follow-up task delegation SC |
| - | `KKSV0171_KKSV0171OPDBMapper.setKKSV017106SC` | KKSV017106SC | — | Sets up progress registration SC |
| - | `KKSV0171_KKSV0171OPDBMapper.setKKSV017101CC` | KKSV017101CC | — | Sets up SODCC (Service Order Data Change Control) component |
| - | `KKSV0171_KKSV0171OPDBMapper.setTELNOSTATJUDGECC` | TELNOSTATJUDGECC | — | Sets up phone number status judgment component (ANP-4494) |
| - | `KKSV0171_KKSV0171OPDBMapper.setKKSV017112SC` | KKSV017112SC | — | Sets up phone number update SC |
| - | `KKSV0171_KKSV0171OPDBMapper.setKKSV017113SC` | KKSV017113SC | — | Sets up phone number consent check SC |
| - | `KKW05602SFLogic.invokeServiceKKSV0171` | KKW05602SFLogic | — | Internal method that orchestrates the KKSV0171 service mapper and calls `invokeService()` |
| - | `KKW05602SFLogic.initTelnoStatCheckActionCfm` | KKW05602SFLogic | — | Internal phone number status validation check method |
| - | `JCCWebCommon.setMessageInfo` | JCCWebCommon | — | Sets the completion message displayed to the customer |

### Service Flow (KKSV0171 invocation breakdown):

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `setKKSV017101SC` (set phase) | KKSV017101SC | — | Read customer consent data — お客様同意照会 (customer agreement inquiry) |
| R | `setKKSV017102SC` (set phase) | KKSV017102SC | — | Read service contract agreement data — サービス契約同意照会 (service contract agreement inquiry) |
| C/U | `setKKSV017103SC` (set phase) | KKSV017103SC | — | Register order content approval — 申込内容承認登録 (application content approval registration) |
| U | `setKKSV017104_2SC` (set phase) | KKSV017104_2SC | — | Update service contract details for eo光denwa — サービス契約内容<eo光電話>情報変更 |
| R | `setKKSV017105SC` (set phase) | KKSV017105SC | — | Review application details and follow-up tasks — 申込明細照察・後続業務依頼 (application detail review/follow-up) |
| C | `setKKSV017106SC` (set phase) | KKSV017106SC | — | Register progress — 進捗登録 (progress registration) |
| C | `setKKSV017101CC` (set phase) | KKSV017101CC | — | SODCC — Service Order Data Change Control (service order data management) |
| R | `setTELNOSTATJUDGECC` (set phase) | TELNOSTATJUDGECC | — | Phone number status judgment — 電話番号状態判定 (phone number status validation) |
| U | `setKKSV017112SC` (set phase) | KKSV017112SC | — | Phone number update — 電話番号更新 (phone number record update) |
| R | `setKKSV017113SC` (set phase) | KKSV017113SC | — | Phone number consent check — 電話番号同意照会 (phone number agreement inquiry) |
| C/R | `invokeService` | KKSV0171 | — | Executes the full KKSV0171 service flow (customer consent, contract agreement, order registration, detail update, progress registration) |
| R | `getTELNOSTATJUDGECC` (get phase) | TELNOSTATJUDGECC | — | Retrieves phone number status judgment results after service execution |

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Screen:KKW05602SF | `KKW05602SFController` -> `KKW05602SFLogic.actionFix` | `KKSV017101SC[R], KKSV017102SC[R], KKSV017103SC[C], KKSV017104_2SC[U], KKSV017105SC[R], KKSV017106SC[C], TELNOSTATJUDGECC[R], KKSV017112SC[U], KKSV017113SC[R]` |

**Notes:**
- This method is called by the `KKW05602SF` screen controller after the customer confirms the update/deletion operation on the call sign (トク) registration screen.
- No other Java files outside the `KKW05602SF` package directly reference this specific `actionFix()` method — it is tightly bound to the KKW05602SF screen flow.
- The terminal services (KKSV0171 series) handle the full end-to-end flow of customer consent, service contract detail update, order registration, and progress tracking for FTTH call sign modifications.

## 6. Per-Branch Detail Blocks

**Block 1** — [GET BEAN] (L2127)

> Retrieves the service form DataBean from the superclass. Throws an exception if the bean is null.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | CALL | `X31SDataBeanAccess bean = super.getServiceFormBean()` | Get the screen's service form DataBean for data access |
| 2 | IF | `if (null == bean)` | Null guard — the bean must exist to proceed |
| 2.1 | EXEC | `throw new Exception()` | Abort processing if bean is missing |
| 3 | SET | `X31SDataBeanAccess[] paramBean = { bean }` | Wrap bean in array for mapper parameter passing |

**Block 2** — [MAP CREATION] (L2134)

> Creates internal maps for the service invocation. Commented-out mapper setup lines indicate a previous template-based approach that was replaced with direct mapper instantiation.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | SET | `HashMap<String, Object> paramMap = new HashMap<String, Object>()` | Parameter setup map for service invocation |
| 2 | SET | `HashMap<String, Object> inputMap = new HashMap<String, Object>()` | Input condition map for SC/CBS calls |
| 3 | SET | `HashMap<String, Object> outputMap = new HashMap<String, Object>()` | Output result map for SC/CBS responses |

**Block 3** — [SERVICE INVOCATION: KKSV0171] (L2181)

> Invokes the core KKSV0171 service flow with function code 1, which corresponds to the update/deletion path. This single call orchestrates the full set of SC operations: customer consent, service contract agreement, order approval registration, service contract detail update, application detail review, progress registration, SODCC, phone status judgment, phone number update, and phone number consent check.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | CALL | `invokeServiceKKSV0171(paramBean, JKKCommonConst.FUNC_CODE_1)` | Execute full KKSV0171 service flow (update/deletion mode) |

**Block 4** — [UPDATE/DELETION FLAG CHECK] (L2202)

> Retrieves the update/deletion flag from the bean. If the flag equals "1" (update), performs a phone number status validation. If "2" (deletion) or any other value, skips the validation and proceeds directly to screen navigation setup.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | CALL | `String upd_cancel_flg = bean.sendMessageString(KKW05602SFConst.UPD_CANCEL_FLG, X31CWebConst.DATABEAN_GET_VALUE)` | Get the update/deletion flag from the bean (UPD_CANCEL_FLG = "更新・解除フラグ") |
| 2 | IF | `if (UPD_CANCEL_FLG_UPD.equals(upd_cancel_flg))` [UPD_CANCEL_FLG_UPD = "1"] | Check if this operation is an update |

**Block 4.1** — [PHONE NUMBER STATUS VALIDATION] (L2205)

> Conditional block entered only when the update flag is "1". Performs phone number status validation by calling `initTelnoStatCheckActionCfm`. If validation fails (phone is in port-out status or master data missing), the method returns true to skip the update processing and display an error message.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | CALL | `boolean checkOkTelnoStat = initTelnoStatCheckActionCfm(paramBean)` | Validate phone number status (port-out check, master data presence) |
| 2 | IF | `if (!checkOkTelnoStat)` | Phone status check failed |
| 2.1 | RETURN | `return true` | Skip update processing — error message already set by `initTelnoStatCheckActionCfm` |

**Block 5** — [SET NEXT SCREEN NAVIGATION] (L2212)

> After successful service processing (and optional phone status check), sets the next screen ID and screen name in the shared form bean for navigation. The next screen is KKW05606.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | CALL | `X31SDataBeanAccess commonBean = super.getCommonInfoBean()` | Get the shared form bean for cross-screen context |
| 2 | CALL | `commonBean.sendMessageString(CommonInfoCFConst.NEXT_SCREEN_ID, X31CWebConst.DATABEAN_SET_VALUE, JKKScreenConst.SCREEN_ID_KKW05606)` | Set next screen ID to KKW05606 |
| 3 | CALL | `commonBean.sendMessageString(CommonInfoCFConst.NEXT_SCREEN_NAME, X31CWebConst.DATABEAN_SET_VALUE, JKKScreenConst.SCREEN_NAME_KKW05606)` | Set next screen name to KKW05606 |

**Block 6** — [SET COMPLETION MESSAGE] (L2216)

> Sets the completion confirmation message to be displayed to the customer. The message ID is `KANRYO_MSG_ID = "EKB4390--I"` with the replacement string `KANRYO_MSG_CHG_STR = "更新"` (Update). The originally commented-out code used a dynamic `TOKI_STA_MSG_ID` with `getTikanStr(bean)` for transition-start messaging; this was replaced with a static completion message.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | SET | `String[] strs = { KANRYO_MSG_CHG_STR }` | Create message replacement array with "更新" (Update) |
| 2 | CALL | `JCCWebCommon.setMessageInfo(this, KANRYO_MSG_ID, strs)` | Display completion message EKB4390--I to the customer |

**Block 7** — [RETURN] (L2219)

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | RETURN | `return true` | Return true to indicate successful processing and trigger navigation to the next screen |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `upd_cancel_flg` | Field | Update/Deletion Flag — indicates whether the operation is an update ("1") or deletion ("2") of the call sign registration |
| UPD_CANCEL_FLG_UPD | Constant | Update flag value = "1" — represents a modification operation (更新) |
| UPD_CANCEL_FLG_CANCEL | Constant | Deletion flag value = "2" — represents a cancellation operation (解除) |
| KKW05602SF | Screen ID | Fiber optic phone call sign update/deletion screen — the screen where customers review and confirm call sign (トク) registration changes |
| KKW05606 | Screen ID | Next screen ID — the confirmation/completion screen navigated to after successful update processing |
| KKSV0171 | Screen ID | Core service screen for phone number update/deletion — handles customer consent, service contract agreement, order registration, detail updates, and progress registration |
| トク (Toki) | Business term | Call Sign — a phone number feature allowing callers to see the subscriber's registered name. トク登録 = call sign registration |
| FUNC_CODE_1 | Constant | Function code value = "1" — indicates the update/deletion path in service invocations |
| FUNC_CODE_2 | Constant | Function code value = "2" — indicates the inquiry/read path in service invocations |
| UCID_KKSV0171 | Constant | Use Case ID for KKSV0171 — identifies the use case in telemetry/tracing |
| OPID_KKSV0171OP | Constant | Operation ID for KKSV0171 Operator — identifies the specific operation in telemetry/tracing |
| KKSV017101SC | SC Code | Customer Consent Inquiry — checks customer agreement status |
| KKSV017102SC | SC Code | Service Contract Agreement Inquiry — retrieves service contract agreement details |
| KKSV017103SC | SC Code | Order Content Approval Registration — registers approved order content |
| KKSV017104_2SC | SC Code | Service Contract Detail Update for eo光denwa — updates fiber phone service contract information |
| KKSV017105SC | SC Code | Application Detail Review and Follow-up Delegation — reviews application details and delegates follow-up tasks |
| KKSV017106SC | SC Code | Progress Registration — registers the processing progress status |
| KKSV017101CC | SC Code | SODCC — Service Order Data Change Control component |
| TELNOSTATJUDGECC | SC Code | Phone Number Status Judgment Component — validates phone number state for port-out status and master data presence |
| KKSV017112SC | SC Code | Phone Number Update — updates the phone number record |
| KKSV017113SC | SC Code | Phone Number Consent Inquiry — checks phone number agreement status |
| PORTOUTSTATUM_ARI | Constant | Port-out status present = "1" — indicates the phone number is in a port-out or number cancellation state |
| PORTOUTSTATUM_NASHI | Constant | Port-out status absent = "0" — indicates no port-out issue |
| FTTH | Business term | Fiber To The Home — fiber-optic internet/phone service (eo光電話) |
| SOD | Acronym | Service Order Data — the telecom order fulfillment entity |
| DataBean | Pattern | Data transfer object carrying screen input/output data between UI and business logic layers |
| MAP (paramMap/inputMap/outputMap) | Pattern | HashMap-based data flow pattern for passing parameters, conditions, and results to/from service components |
| EKB4390--I | Message ID | Completion message identifier — displayed to confirm successful update processing |
| KANRYO_MSG_CHG_STR | Constant | Completion message replacement string = "更新" (Update) |
| 電話番号状態判定 | Japanese term | Phone Number Status Judgment — validation of phone number state before update processing |
| ポートアウト | Business term | Port-out — the process of transferring a phone number to a different carrier; in status indicates the number is being ported and cannot be modified |
| メッセージ置換文字 | Japanese term | Message replacement string — placeholder text substituted into message templates for display to customers |
