# Business Logic — FUW02401SFLogic.cfm() [17 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.FUW02401SF.FUW02401SFLogic` |
| Layer | Controller (Web Business Logic, extends `JCCWebBusinessLogic`) |
| Module | `FUW02401SF` (Package: `eo.web.webview.FUW02401SF`) |

## 1. Role

### FUW02401SFLogic.cfm()

This method handles the **confirmation button** operation on the **Homepage URL Name Application Screen** (ホームページURL名取得申込画面). When a customer applies for a Homepage (web page) URL name through K-Opticom's self-service portal, this method is invoked upon pressing the "Confirm" button to validate and prepare the submitted data for final submission. It acts as the first processing gate between the data entry screen (FUW02401) and the submission/completion screen (FUW02402).

The method follows a **delegation pattern** — it delegates the core validation and mask processing to the shared `cfmMskmSyori()` helper method, which handles both confirmation (`cfm` mode) and submission (`mskm` mode) checks based on the passed mode flag. After validation passes, it configures navigation metadata to route the user to screen `FUW02402` (the application completion/summary screen). This method is the **primary entry point for the confirmation flow** of the Homepage URL name registration business process, serving the FTTH/homepage registration service domain.

It is distinct from the `mskm()` method in the same class: `cfm()` handles the intermediate confirmation step (no email is sent, no final submission occurs), while `mskm()` handles the final submission step (which sends a completion email and navigates to screen `FUW02403`).

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["cfm"])
    A["Get commoninfoBean"]
    B["cfmMskmSyori cfmmode commoninfoBean"]
    C["Set NEXT_SCREEN_NAME to FUW02402"]
    D["Set NEXT_SCREEN_ID to FUW02402"]
    E["Return true"]
    FIN(["End"])

    START --> A
    A --> B
    B --> C
    C --> D
    D --> E
    E --> FIN
```

**Processing steps:**

1. **Retrieve shared form bean** — Obtains the `X31SDataBeanAccess commoninfoBean` from the parent class via `super.getCommonInfoBean()`, which holds all shared UI data including customer info, SSO info, service contract info, and optional service contract details.

2. **Execute confirmation/mask processing** — Calls `cfmMskmSyori(CHEK_CFM, commoninfoBean)` where `CHEK_CFM = "cfm"`. This triggers validation and data masking logic specific to the confirmation step. The internal `cfmMskmSyori()` method (lines 485–764 of the same class) performs:
   - Extraction of shared form data (Web change info, SSO info, general customer info, service contract info, service detail work info, optional service contract info)
   - SSO WebID validation — throws `JCCBusinessException` if SSO WebID is not set
   - Iteration over optional service items to identify which ones require Homepage URL name registration
   - Database lookup via `FUSV0024_FUSV0024OPDBMapper` and `FUSV0025_FUSV0025OPDBMapper` to resolve service details (usecase IDs, title SC codes)
   - Writing the resolved Homepage URL account name into the application bean

3. **Set next screen name** — Sets the navigation metadata `NEXT_SCREEN_NAME` to `SCREEN_NAME_FUW02402` via `commoninfoBean.sendMessageString()`.

4. **Set next screen ID** — Sets the navigation metadata `NEXT_SCREEN_ID` to `SCREEN_ID_FUW02402` via `commoninfoBean.sendMessageString()`.

5. **Return success** — Returns `true` indicating normal completion. Errors (including exceptions from `cfmMskmSyori`) propagate upward.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| - | (none) | - | This method takes no parameters. It operates entirely on shared form state managed through the inherited `getCommonInfoBean()` mechanism. |

**Instance fields / external state read:**

| State | Source | Business Description |
|-------|--------|---------------------|
| `commoninfoBean` | `super.getCommonInfoBean()` | Shared form data bean containing customer contract information, SSO session data, service contract details, and optional service data needed for validation and Homepage URL name resolution |

## 4. CRUD Operations / Called Services

### Pre-computed evidence from code analysis:

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `super.getCommonInfoBean` | JCCWebBusinessLogic | - | Retrieves shared form data bean from parent class |
| - | `FUW02401SFLogic.cfmMskmSyori` | FUW02401SFLogic | - | Delegates to confirmation/mask processing method |
| - | `X31SDataBeanAccess.sendMessageString` | OneStopDataBeanAccess | - | Reads/writes shared form bean data strings |

### Deep trace into `cfmMskmSyori` (called by `cfm`):

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `FUSV0024_FUSV0024OPDBMapper.selectByDataBean` | FUSV0024OPDBMapper | KK_T_OPSVKEI_ISP (via data bean mapping) | Reads optional service contract detail data to resolve usecase ID and title SC code for each optional service item |
| R | `FUSV0025_FUSV0025OPDBMapper.selectByDataBean` | FUSV0025OPDBMapper | KK_T_OP_SVKEI_INFO_ISP (via data bean mapping) | Reads optional service contract info for URL account name lookup |
| - | `JFUCommonRelationCheck.checkCommonRelation` | JFUCommonRelationCheck | - | Performed in `mskm()` (not in `cfm()`), but part of shared framework |

**Note:** The `cfm()` method itself has no direct database operations. All data access is delegated to `cfmMskmSyori()`, which performs read operations via the `FUSV0024` and `FUSV0025` database mappers to resolve Homepage URL name data from the optional service contract tables.

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Screen:FUW02401 | `FUW02401SFLogic.cfm()` | `cfmMskmSyori` [R] FUSV0024/FUSV0025 mappers |
| 2 | Screen:FUW02402 | `FUW02402SFLogic` (related screen in same module) | Shares common info bean data populated by `cfm()` |

**Call chain explanation:** The `cfm()` method is invoked as part of the **Homepage URL Name Application** screen flow (FUW02401). When the user presses the "Confirm" button, the web framework dispatches to this method through the business logic layer. The screen FUW02401 handles data entry, and `cfm()` processes the confirmation, validates data, resolves the Homepage URL name from optional service contracts, and navigates to screen FUW02402 (the application result screen).

**Called services chain:**
- `cfm()` → `cfmMskmSyori()` → `FUSV0024_FUSV0024OPDBMapper` (Read) / `FUSV0025_FUSV0025OPDBMapper` (Read) → Optional service contract tables

## 6. Per-Branch Detail Blocks

**Block 1** — [CALL] `(no condition, linear execution)` (L319)

> Retrieves the shared form data bean from the parent class.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `X31SDataBeanAccess commoninfoBean = super.getCommonInfoBean();` // Get shared form bean for data access |

**Block 2** — [CALL] `(no condition, linear execution)` (L326)

> Delegates to the confirmation/mask processing method with the confirmation mode flag `CHEK_CFM = "cfm"`.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `cfmMskmSyori(CHEK_CFM, commoninfoBean);` // CHEK_CFM = "cfm" — Confirmation check processing |

**Details of `cfmMskmSyori` processing (called from Block 2):**

**Block 2.1** — [SET] `(Extract Web change info)` (L493)

| # | Type | Code |
|---|------|------|
| 1 | SET | `X31SDataBeanAccess webChgInfoBean = commoninfoBean.getDataBeanArray(CommonInfoCFConst.WEB_CHG_INFO).getDataBean(0);` // Get Web change info from shared form |

**Block 2.2** — [SET] `(Extract SSO info)` (L495)

| # | Type | Code |
|---|------|------|
| 1 | SET | `X31SDataBeanAccess ssoInfoBean = webChgInfoBean.getDataBeanArray(CommonInfoCFConst.SSO_INFO).getDataBean(0);` // Get SSO session info |

**Block 2.3** — [IF] `(Validate SSO WebID is not null)` (L497)

> If SSO WebID is not set, logs an error and throws a system exception.

| # | Type | Code |
|---|------|------|
| 1 | SET | `String ssoInfoWebid = ssoInfoBean.sendMessageString(CommonInfoCFConst.WEB_ID_21, X31CWebConst.DATABEAN_GET_VALUE);` // Get SSO WebID |
| 2 | IF | `if (JFUWebCommon.isNull(ssoInfoWebid))` // Check SSO WebID is present |

**Block 2.3.1** — [ELSE branch of IF] `(SSO WebID is null — error)` (L501)

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `X31SWebLog.DEBUG_LOG.debug("[SSO WebID not set error]");` // Log error |
| 2 | CALL | `throw new JCCBusinessException(JFUStrConst.ERROR_CODE_0002);` // System error — SLO (system error) |

**Block 2.4** — [SET] `(Extract customer and service contract info)` (L506–L513)

| # | Type | Code |
|---|------|------|
| 1 | SET | `X31SDataBeanAccess genCustKeiInfoBean = webChgInfoBean.getDataBeanArray(CommonInfoCFConst.GEN_CUST_KEI_INFO).getDataBean(0);` // General customer info |
| 2 | SET | `X31SDataBeanAccess svcKeiInfoBean = genCustKeiInfoBean.getDataBeanArray(CommonInfoCFConst.SVC_KEI_INFO).getDataBean(0);` // Service contract info |
| 3 | SET | `X31SDataBeanAccess svcKeiUcwkInfoBean = svcKeiInfoBean.getDataBeanArray(CommonInfoCFConst.SVC_KEI_UCWK_INFO).getDataBean(0);` // Service detail work info |
| 4 | SET | `X31SDataBeanAccess opSvcKeiInfoBean = null;` // Optional service contract info (initialized null) |

**Block 2.5** — [FOR] `(Iterate over optional service items)` (L518)

> Loops through all optional service contract items to identify which ones require Homepage URL name registration and resolves the URL account name from the database.

| # | Type | Code |
|---|------|------|
| 1 | SET | `X31SDataBeanAccessArray opSvcKeiInfoArray = svcKeiUcwkInfoBean.getDataBeanArray(CommonInfoCFConst.OP_SVC_KEI_INFO);` // Get optional service array |
| 2 | SET | `String webid = null;` // Initialize webid holder |
| 3 | SET | `int urlAccountCnt = 0;` // Initialize URL account counter |
| 4 | FOR | `for (int n = 0; n < opSvcKeiInfoArray.getCount(); n++)` // Iterate optional service items |

**Block 2.5.1** — [SET] `(Extract optional service item fields)` (L520–L533)

| # | Type | Code |
|---|------|------|
| 1 | SET | `X31SDataBeanAccess tmpOpSvcKeiInfoBean = opSvcKeiInfoArray.getDataBean(n);` // Get nth optional service item |
| 2 | SET | `String opSvcKeiInfoWebid = tmpOpSvcKeiInfoBean.sendMessageString(CommonInfoCFConst.WEB_ID_28, DATABEAN_GET_VALUE);` // Get WebID |
| 3 | SET | `String opSvcKeiInfoUrlAccount = tmpOpSvcKeiInfoBean.sendMessageString(CommonInfoCFConst.URL_ACCOUNT_28, DATABEAN_GET_VALUE);` // Get URL account |
| 4 | SET | `String tmpopSvcKeiInfoOpSvcCd = tmpOpSvcKeiInfoBean.sendMessageString(CommonInfoCFConst.OP_SVC_CD_28, DATABEAN_GET_VALUE);` // Optional service code |
| 5 | SET | `String tmpopSvcKeiInfoOpSvcStat = tmpOpSvcKeiInfoBean.sendMessageString(CommonInfoCFConst.OP_SVC_KEI_STAT_28, DATABEAN_GET_VALUE);` // Optional service status |

**Block 2.5.2** — [IF] `(Skip non-ISP optional service items)` (L535)

> If the optional service code is not `CD00136_B002` (ISP service), skip this item.

| # | Type | Code |
|---|------|------|
| 1 | IF | `if (!JFUStrConst.CD00136_B002.equals(tmpopSvcKeiInfoOpSvcCd))` // [CD00136_B002 = "ISP service code"] — Not ISP, skip |

**Block 2.5.2.1** — [ELSE] `(Continue to next optional service item)` (L539)

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `continue;` // Skip to next item — optional service is not ISP |

**Block 2.5.3** — [IF] `(ISP service item — resolve Homepage URL name)` (L541+)

> For ISP optional service items, resolve the Homepage URL name via database mapper and write it into the application bean.

| # | Type | Code |
|---|------|------|
| 1 | SET | `webid = tmpOpSvcKeiInfoBean.sendMessageString(CommonInfoCFConst.WEB_ID_28, DATABEAN_GET_VALUE);` // Get webid for lookup |
| 2 | CALL | `Map paramMap = new HashMap();` // Prepare parameter map for DB lookup |
| 3 | SET | `paramMap.put(FUW02401SFConst.NOW_WEB_ID, webid);` // Put webid in parameter |
| 4 | CALL | `FUSV0024_FUSV0024OPDBMapper.selectByDataBean(USECASE_ID_FUSV0024, paramMap);` // [FUSV0024] Resolve usecase ID |
| 5 | CALL | `FUSV0025_FUSV0025OPDBMapper.selectByDataBean(USECASE_ID_FUSV0025, paramMap);` // [FUSV0025] Resolve title SC code |
| 6 | SET | `bean.sendMessageString(FUW02401SFConst.NOW_WEB_ID, DATABEAN_SET_VALUE, webid);` // Write webid to application bean |

**Block 3** — [CALL] `(Set next screen name)` (L329)

> Configures the navigation destination screen name for post-confirmation routing.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `commoninfoBean.sendMessageString(CommonInfoCFConst.NEXT_SCREEN_NAME, DATABEAN_SET_VALUE, JFUScreenConst.SCREEN_NAME_FUW02402);` // Set next screen to FUW02402 |

**Block 4** — [CALL] `(Set next screen ID)` (L332)

> Configures the navigation destination screen ID for post-confirmation routing.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `commoninfoBean.sendMessageString(CommonInfoCFConst.NEXT_SCREEN_ID, DATABEAN_SET_VALUE, JFUScreenConst.SCREEN_ID_FUW02402);` // Set next screen ID to FUW02402 |

**Block 5** — [RETURN] `(Return success)` (L335)

> Returns `true` to indicate the confirmation processing completed successfully.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return true;` // Normal completion — navigate to FUW02402 |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `FUW02401SF` | Module | Homepage URL Name Application — the business module for applying for a Homepage (web page) URL name through K-Opticom's self-service portal |
| `FUW02402` | Screen | Application Result/Completion Screen — the screen displayed after successful confirmation of the Homepage URL name application |
| `FUW02403` | Screen | Final Submission Screen — the screen displayed after the mskm (submission) method processes the final submission with email notification |
| `commoninfoBean` | Field | Shared form data bean — holds all shared UI/session data including customer info, SSO info, and service contract data |
| `CFM` | Acronym | Confirmation — the confirmation step in the application workflow where data is validated before final submission |
| `MSKM` | Acronym | Mask/Sharing (Mash/Kyoyu) — the final submission step, abbreviated from Japanese マスク処理 (mask processing) / 共有 (sharing) |
| `CHEK_CFM` | Constant | Confirmation mode flag — value `"cfm"`, passed to `cfmMskmSyori` to indicate this is the confirmation processing branch |
| `CHEK_MSKM` | Constant | Submission mode flag — value `"mskm"`, passed to `cfmMskmSyori` to indicate this is the final submission processing branch |
| `WEB_CHG_INFO` | Field | Web change information — contains Web-specific data including SSO session details |
| `SSO_INFO` | Field | Single Sign-On information — contains the user's SSO session data including WebID for authentication |
| `WEB_ID_21` | Field | SSO WebID (21-digit identifier) — the customer's SSO login identifier used for authentication validation |
| `GEN_CUST_KEI_INFO` | Field | General customer contract information — contains the customer's contract data |
| `SVC_KEI_INFO` | Field | Service contract information — contains service-level contract details |
| `SVC_KEI_UCWK_INFO` | Field | Service detail work information — contains service item-level details including optional services |
| `OP_SVC_KEI_INFO` | Field | Optional service contract information — contains optional add-on service items |
| `OP_SVC_CD_28` | Field | Optional service code (28-digit) — identifies the type of optional service (e.g., ISP = CD00136_B002) |
| `URL_ACCOUNT_28` | Field | URL account name (28-char max) — the Homepage URL account name to be registered |
| `CD00136_B002` | Constant | ISP service code — the code value identifying an ISP (Internet Service Provider) optional service item |
| `FUSV0024` | UseCase ID | Use case for resolving optional service contract detail data (usecase ID lookup) |
| `FUSV0025` | UseCase ID | Use case for resolving optional service contract info (title SC code lookup) |
| `FUSV002404SC` | SC Code | Title price list fixed unit price (optional service application fee) SC — service component for retrieving title/pricing information |
| `FUSV002401CC` | CC Code | Initial fee list CC — common component for retrieving initial fee information |
| `JCCBusinessException` | Exception | Business logic exception — thrown when validation fails (e.g., missing SSO WebID, business rule violation) |
| `ERROR_CODE_0002` | Constant | System error code — indicates a system-level error (thrown when SSO WebID is not set) |
| `DATABEAN_GET_VALUE` | Constant | Data bean read operation — flag used to retrieve a value from a data bean |
| `DATABEAN_SET_VALUE` | Constant | Data bean write operation — flag used to set a value in a data bean |
| `JFUWebCommon` | Class | Web common utility class — provides shared web-layer helper methods including null checking and email sending |
| `JFUCommonRelationCheck` | Class | Common relation check utility — performs cross-screen relation validation checks |
| `JFUStrConst` | Class | String constants — contains error codes, service codes, and other string constants |
| `FUSV0024_FUSV0024OPDBMapper` | Mapper | Database mapper for FUSV0024 use case — reads optional service contract detail data |
| `FUSV0025_FUSV0025OPDBMapper` | Mapper | Database mapper for FUSV0025 use case — reads optional service contract info data |
