# Business Logic — FUW02401SFLogic.mskm() [23 LOC]

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

## 1. Role

### FUW02401SFLogic.mskm()

This method handles the "Submit" (申し込む) button press on the **Homepage URL Name Acquisition Application** screen — the confirmation screen where existing customers review and submit their request to acquire a free K-Opticom home page URL. The method performs end-to-end order processing: it validates the customer's session and relationship status via a common relation check, retrieves the shared form data, delegates to `cfmMskmSyori` which orchestrates the full service order pipeline (9 sequential SC/CC calls covering service registration, option contract updates, aging registration, progress registration, detail inquiry, contract closing, consent lookup, service IF data transfer, and order issuance), sends an application completion notification email, and configures the next screen redirect to the completion screen (FUW02403). It acts as the **primary entry point and business orchestrator** for the order-submit workflow, bridging the web presentation layer with the downstream service components.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["mskm()"])
    CHECK["checkCommonRelation
(commonity check)"]
    GETBEAN["getCommonInfoBean()
(shared form bean access)"]
    CFM["cfmMskmSyori(
CHEK_MSKM=\"mskm\",
commoninfoBean)"]
    MAIL["sendMskmFinMail(
MSKM_FIN_MAIL_FUW024_1=\"FUW024_1\")
(application completion mail)"]
    SETNAME["sendMessageString(
NEXT_SCREEN_NAME,
SCREEN_NAME_FUW02403
=\"Homepage URL acquisition
application completion\")"]
    SETID["sendMessageString(
NEXT_SCREEN_ID,
SCREEN_ID_FUW02403=\"FUW02403\")"]
    RETURN["return true
(success)"]

    START --> CHECK
    CHECK --> GETBEAN
    GETBEAN --> CFM
    CFM --> MAIL
    MAIL --> SETNAME
    SETNAME --> SETID
    SETID --> RETURN
```

**Processing flow:**

1. **Common relation check** — validates the customer's session validity, relationship status, and screen access permissions using `USECASE_ID_FUSV0025 = "FUSV0025"`.
2. **Retrieve shared form bean** — fetches the `X31SDataBeanAccess` containing customer contract data, SSO info, option service info, etc.
3. **Execute main processing** (`cfmMskmSyori`) — delegates to the core processing method with `CHEK_MSKM = "mskm"` which determines function code `FUNC_CD_1` (submission) and runs the full order registration pipeline.
4. **Send completion email** — triggers the application completion notification email with proc ID `MSKM_FIN_MAIL_FUW024_1 = "FUW024_1"`.
5. **Configure next screen** — sets redirect to the completion screen `FUW02403` ("Homepage URL acquisition application completion").
6. **Return success** — returns `true` to indicate normal completion.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| - | (none) | - | This is a no-argument entry point method. All input data comes from the shared form bean (session-scoped data bean containing customer contract information, SSO credentials, option service data, etc.). |
| - | `commoninfoBean` (internal) | `X31SDataBeanAccess` | Shared form bean containing: SSO info (WebID), current customer info, service contract info, service detail info, option service contract info. Retrieved via `super.getCommonInfoBean()`. |
| - | `USECASE_ID_FUSV0025` | `String` | Constant = `"FUSV0025"`. The service ID used for relation checking. Corresponds to the "Homepage URL Acquisition Application" use case. |
| - | `CHEK_MSKM` | `String` | Constant = `"mskm"`. Check type indicator passed to `cfmMskmSyori`. Determines function code `FUNC_CD_1` (submission mode, as opposed to initial display mode `FUNC_CD_2`). |
| - | `MSKM_FIN_MAIL_FUW024_1` | `String` | Constant = `"FUW024_1"`. Mail template proc ID for the application completion notification email. |
| - | `SCREEN_NAME_FUW02403` | `String` | Constant = `"ホームページURL名取得完了"` (Homepage URL acquisition application completion). Display name of the next screen. |
| - | `SCREEN_ID_FUW02403` | `String` | Constant = `"FUW02403"`. Screen ID of the next screen (completion screen). |

## 4. CRUD Operations / Called Services

### Pre-computed evidence from code analysis graph:

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `JFUCommonRelationCheck.checkCommonRelation` | - | - | Validates customer relationship/session validity before processing |
| C | `FUSV0025_FUSV0025OPDBMapper.setFUSV002501SC` | FUSV002501SC | KK_T_ODR_HAKKO_JOKEN (Option Service Contract <ISP>) | Application content acknowledgment registration — registers the homepage URL acquisition order with form code `CD00591_01` (WEB) |
| C | `FUSV0025_FUSV0025OPDBMapper.setFUSV002502SC` | FUSV002502SC | KK_T_OPSVKEI_ISP (Option Service Contract Info) | Option service contract <ISP> information update — updates post-change option service contract registration timestamp |
| C | `FUSV0025_FUSV0025OPDBMapper.setFUSV002503SC` | FUSV002503SC | - | Aging target registration |
| C | `FUSV0025_FUSV0025OPDBMapper.setFUSV002504SC` | FUSV002504SC | KK_T_HO_PROGRESS (Progress Info) | Progress registration — records order processing progress |
| C | `FUSV0025_FUSV0025OPDBMapper.setFUSV002505SC` | FUSV002505SC | - | Application detail inquiry and follow-up work request |
| C | `FUSV0025_FUSV0025OPDBMapper.setFUSV002506SC` | FUSV002506SC | - | Option service contract <ISP> closing |
| C | `FUSV0025_FUSV0025OPDBMapper.setFUSV002507SC` | FUSV002507SC | - | Option service contract <ISP> opening |
| R | `FUSV0025_FUSV0025OPDBMapper.setFUSV002501CC` | FUSV002501CC | - | Option service contract <ISP> consent lookup |
| R | `FUSV0025_FUSV0025OPDBMapper.setFUSV002502CC` | FUSV002502CC | - | Service IF result data transfer |
| R | `FUSV0025_FUSV0025OPDBMapper.setFUSV002503CC` | FUSV002503CC | - | Order issuance condition registration |
| R | `JFUWebCommon.setSvcKeiStat` | - | - | Sets service contract status in data map |
| R | `JFUWebCommon.setOpSvcKeiStatMyHpRsv1` | - | - | Sets option service contract status for home page reservation |
| R | `JFUMskmFinMail.sendMskmFinMail` | - | - | Sends application completion notification email with proc ID "FUW024_1" |
| R | `OneStopDataBeanAccess.sendMessageString` | - | - | Reads/writes shared form bean values for redirect screen configuration |

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Screen:FUW02401 (Homepage URL Name Acquisition Application) | `FUW02401SFChecker` (validation) -> `FUW02401SFLogic.mskm()` | `setFUSV002501SC [C] KK_T_ODR_HAKKO_JOKEN`<br>`setFUSV002502SC [C] KK_T_OPSVKEI_ISP`<br>`sendMskmFinMail [R] Email` |

**Notes on caller analysis:**
- The `mskm()` method is a public entry point invoked from the FUW02401SF web screen workflow (Homepage URL Name Acquisition Application). The checker class (`FUW02401SFChecker`) performs GUI validation before routing to the logic class.
- `FUW02601SFLogic` contains a `CHEK_MSKM` constant (`"mskm"`) and uses it as an `isTarget` parameter in `cfmMskmSyori`, but does **not** directly call `mskm()` — it uses it as a target type discriminator within the shared `cfmMskmSyori` processing.
- The method is the primary "submit" handler for the FUW02401SF screen flow.

## 6. Per-Branch Detail Blocks

**Block 1** — EXEC (L349) `[checkCommonRelation]`

> Performs common relationship check before processing. Validates session, user relationship, and screen access permissions.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `JFUCommonRelationCheck.checkCommonRelation(this, USECASE_ID_FUSV0025)` <br>// Common relation check processing [USECASE_ID_FUSV0025="FUSV0025"] |

**Block 2** — EXEC (L352) `[getCommonInfoBean]`

> Retrieves the shared form bean containing all customer data for this workflow.

| # | Type | Code |
|---|------|------|
| 1 | SET | `commoninfoBean = super.getCommonInfoBean()` <br>// Get shared form bean data bean access |

**Block 3** — CALL (L354) `[cfmMskmSyori]`

> Core processing: validates SSO WebID, finds matching option service contract, executes 9 sequential SC/CC calls for the full order pipeline, invokes the service, and checks max option service count.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `cfmMskmSyori(CHEK_MSKM, commoninfoBean)` <br>// Main processing [CHEK_MSKM="mskm"] |
|   | **Inside cfmMskmSyori:** | |
|   | SET | `webChgInfoBean = commoninfoBean.getDataBeanArray(WEB_CHG_INFO).getDataBean(0)` <br>// Get web change info from shared bean |
|   | SET | `ssoInfoBean = webChgInfoBean.getDataBeanArray(SSO_INFO).getDataBean(0)` <br>// Get SSO info |
|   | SET | `ssoInfoWebid = ssoInfoBean.sendMessageString(WEB_ID_21, GET_VALUE)` <br>// Get SSO WebID |
|   | IF | `JFUWebCommon.isNull(ssoInfoWebid)` <br>// [L503] SSO WebID not set check |
|   | 3.1 | `throw new JCCBusinessException(JFUStrConst.ERROR_CODE_0002)` <br>// System error "0002" |
|   | ELSE | Continue processing |
|   | SET | `genCustKeiInfoBean = webChgInfoBean.getDataBeanArray(GEN_CUST_KEI_INFO).getDataBean(0)` <br>// Get current customer info |
|   | SET | `svcKeiInfoBean = genCustKeiInfoBean.getDataBeanArray(SVC_KEI_INFO).getDataBean(0)` <br>// Get service contract info |
|   | SET | `svcKeiUcwkInfoBean = svcKeiInfoBean.getDataBeanArray(SVC_KEI_UCWK_INFO).getDataBean(0)` <br>// Get service detail info |
|   | SET | `opSvcKeiInfoArray = svcKeiUcwkInfoBean.getDataBeanArray(OP_SVC_KEI_INFO)` <br>// Get option service contract info array |
|   | FOR | `n = 0 to opSvcKeiInfoArray.getCount()-1` <br>// Iterate over option service contracts |
|   | 4.1 | SET `tmpopSvcKeiInfoOpSvcCd = tmpOpSvcKeiInfoBean.sendMessageString(OP_SVC_CD_28, GET_VALUE)` |
|   | 4.2 | IF `!JFUStrConst.CD00136_B002.equals(tmpopSvcKeiInfoOpSvcCd)` <br>// Skip if not My Home Page option |
|   | 4.3 | `continue` <br>// Not an option service My Home Page |
|   | 4.4 | IF `CD00037_910.equals(stat) || CD00037_920.equals(stat)` <br>// "910: Terminated" or "920: Cancelled" |
|   | 4.5 | `continue` <br>// Skip terminated/cancelled contracts |
|   | 4.6 | IF `ssoInfoWebid.equals(opSvcKeiInfoWebid)` <br>// Match SSO WebID to option service WebID |
|   | 4.7 | SET `opSvcKeiInfoBean = tmpOpSvcKeiInfoBean` <br>// Set matching option service |
|   | 4.8 | SET `webid = opSvcKeiInfoWebid` |
|   | 4.9 | IF `!isNull(opSvcKeiInfoUrlAccount)` <br>// Count URL accounts |
|   | 4.10 | `urlAccountCnt++` |
|   | | **End FOR** |
|   | | **End of data extraction** |
|   | SET | `bean = super.getServiceFormBean()` <br>// Get service form bean |
|   | IF | `isNull(webid)` <br>// [L592] WebID null check |
|   | 6.1 | `throw new JCCBusinessException(ERROR_CODE_0102)` <br>// Contract status error "0102" |
|   | | **Service call preparation** |
|   | SET | `paramMap.put(TELEGRAM_INFO_USECASE_ID, USECASE_ID_FUSV0025)` <br>// Use case ID "FUSV0025" |
|   | SET | `mapper = new FUSV0025_FUSV0025OPDBMapper()` |
|   | SET | `paramBean = {bean, opSvcKeiInfoBean, ssoInfoBean}` |
|   | IF | `CHEK_CFM.equals(isTarget)` <br>// [L612] Check processing type |
|   | 6.2 | SET `functionCode = JPCModelConstant.FUNC_CD_2` <br>// Initial display mode |
|   | ELSE | (isTarget = "mskm") |
|   | 6.3 | SET `functionCode = JPCModelConstant.FUNC_CD_1` <br>// Submission mode |
|   | SET | `dataMap = mapper.setFUSV002501SC(...)` <br>// Application content acknowledgment registration [C] |
|   | SET | `dataMap = mapper.setFUSV002502SC(...)` <br>// Option service contract <ISP> info update [C] |
|   | SET | `dataMap = mapper.setFUSV002503SC(...)` <br>// Aging target registration [C] |
|   | SET | `dataMap = mapper.setFUSV002504SC(...)` <br>// Progress registration [C] |
|   | SET | `dataMap = mapper.setFUSV002505SC(...)` <br>// Application detail inquiry, follow-up request [C] |
|   | SET | `dataMap = mapper.setFUSV002506SC(...)` <br>// Option service contract <ISP> closing [C] |
|   | SET | `dataMap = mapper.setFUSV002507SC(...)` <br>// Option service contract <ISP> opening [C] |
|   | SET | `dataMap = mapper.setFUSV002501CC(...)` <br>// Option service consent lookup [R] |
|   | SET | `dataMap = mapper.setFUSV002502CC(...)` <br>// Service IF data transfer [R] |
|   | SET | `dataMap = mapper.setFUSV002503CC(...)` <br>// Order issuance condition registration [R] |
|   | CALL | `JFUWebCommon.setSvcKeiStat(this, dataMap)` <br>// Set service contract status |
|   | CALL | `JFUWebCommon.setOpSvcKeiStatMyHpRsv1(this, dataMap)` <br>// Set option service status |
|   | SET | `outputMap = new HashMap<>()` |
|   | TRY | [L640] Service invocation |
|   | TRY-1 | `invokeService(paramMap, dataMap, outputMap)` <br>// Call the service pipeline |
|   | TRY-2 | SET `maxOpSvcCnt = bean.sendMessageString(MAX_OP_SVC_CNT, GET_VALUE)` <br>// Get max option service count |
|   | TRY-2 | SET `hp_url_domain = bean.sendMessageString(HP_URL_DOMAIN, GET_VALUE)` <br>// Get homepage URL domain |
|   | TRY-2 | IF `MAXOPSVCCNT_ZERO.equals(maxOpSvcCnt) || isNull(maxOpSvcCnt) || isNull(hp_url_domain)` <br>// No URL exists check |
|   | TRY-2.1 | `throw new JCCBusinessException(ERROR_CODE_0002)` <br>// System error "0002" |
|   | TRY-2 | ELSE |
|   | TRY-2.1 | IF `maxOpSvcCntInt <= urlAccountCnt` <br>// Exceeds max contract count |
|   | TRY-2.1.1 | `throw new JCCBusinessException(ERROR_CODE_0103)` <br>// Contract error "0103" |
|   | CATCH | `JCCWebServiceException se` <br>// [L682] Service exception handling |
|   | CATCH-1 | `checkException(se, isTarget)` <br>// Exception judgment processing |

**Block 4** — EXEC (L357) `[sendMskmFinMail]`

> Sends the application completion notification email after successful order processing.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `JFUWebCommon.sendMskmFinMail(this, MSKM_FIN_MAIL_FUW024_1)` <br>// Application completion mail [MSKM_FIN_MAIL_FUW024_1="FUW024_1"] |

**Block 5** — EXEC (L360) `[NEXT_SCREEN_NAME]`

> Configures the redirect to the completion screen's display name.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `commoninfoBean.sendMessageString(NEXT_SCREEN_NAME, SET_VALUE, SCREEN_NAME_FUW02403)` <br>// Set next screen name [SCREEN_NAME_FUW02403="Homepage URL acquisition application completion"] |

**Block 6** — EXEC (L363) `[NEXT_SCREEN_ID]`

> Configures the redirect to the completion screen's ID.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `commoninfoBean.sendMessageString(NEXT_SCREEN_ID, SET_VALUE, SCREEN_ID_FUW02403)` <br>// Set next screen ID [SCREEN_ID_FUW02403="FUW02403"] |

**Block 7** — RETURN (L365)

> Returns success to the caller.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return true` <br>// Processing result: normal end |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `mskm` | Field/Constant | Homepage URL Name Acquisition Application — the core business domain of this module. Stands for "Homepage URL Meisho Shuturyoku" (ホームページURL名取得). |
| `CHEK_MSKM` | Constant | Check type indicator = `"mskm"`. Passed to `cfmMskmSyori` to distinguish between submission processing ("mskm") and confirmation processing ("cfm"). |
| `USECASE_ID_FUSV0025` | Constant | Service ID `"FUSV0025"`. The use case identifier for the Homepage URL Acquisition Application service. |
| `USECASE_ID_FUSV0024` | Constant | Service ID `"FUSV0024"`. Alternative use case for initial display processing. |
| `MSKM_FIN_MAIL_FUW024_1` | Constant | Mail template proc ID `"FUW024_1"`. Identifies the application completion notification email template. |
| `FUNC_CD_1` | Constant | Function code for submission mode. Used in `cfmMskmSyori` when `CHEK_MSKM` is active (i.e., the user clicked "Submit"). |
| `FUNC_CD_2` | Constant | Function code for initial display/confirmation mode. Used in `cfmMskmSyori` when `CHEK_CFM` is active. |
| `SOD` | Acronym | Service Order Data — telecom order fulfillment entity. Referenced throughout the FUSV0025 mapper chain. |
| `SSO` | Acronym | Single Sign-On. Provides the customer's WebID used to match their option service contracts. |
| `WEB_ID` | Field | SSO WebID — the customer's unique web login identifier within the SSO system. |
| `GEN_CUST_KEI_INFO` | Field | Current customer info bean group — contains the customer's general service contract details. |
| `SVC_KEI_INFO` | Field | Service contract info — high-level service contract details (service type, status, etc.). |
| `SVC_KEI_UCWK_INFO` | Field | Service detail work info — granular service contract line item details. |
| `OP_SVC_KEI_INFO` | Field | Option service contract info — array of option service contracts (e.g., home page, email add-ons). |
| `OP_SVC_CD` | Field | Option service code — classifies the type of option service (e.g., `CD00136_B002` = My Home Page). |
| `OP_SVC_KEI_STAT` | Field | Option service contract status — contract lifecycle state (e.g., `CD00037_910` = "Terminated", `CD00037_920` = "Cancelled"). |
| `CD00136_B002` | Constant | Option service code for "My Home Page" — the only option service type eligible for homepage URL name acquisition. |
| `CD00037_910` | Constant | Status code "910" — Terminated (解済). Option service contracts with this status are skipped. |
| `CD00037_920` | Constant | Status code "920" — Cancelled (キャンセル済). Option service contracts with this status are skipped. |
| `CD00591_01` | Constant | Application form code "01" — WEB application type. Submitted in the order registration data. |
| `FUSV002501SC` | SC Code | Application content acknowledgment registration — registers the initial order submission record. |
| `FUSV002502SC` | SC Code | Option service contract <ISP> information update — updates ISP option service contract data. |
| `FUSV002503SC` | SC Code | Aging target registration — registers aging target values for the order. |
| `FUSV002504SC` | SC Code | Progress registration — records the processing progress in the order lifecycle. |
| `FUSV002505SC` | SC Code | Application detail inquiry and follow-up work request — submits detail inquiry and dispatches follow-up tasks. |
| `FUSV002506SC` | SC Code | Option service contract <ISP> closing — closes the ISP option service contract. |
| `FUSV002507SC` | SC Code | Option service contract <ISP> opening — opens the ISP option service contract. |
| `FUSV002501CC` | CC Code | Option service contract <ISP> consent lookup — retrieves consent data for ISP option services. |
| `FUSV002502CC` | CC Code | Service IF result data transfer — transfers data between service IFs. |
| `FUSV002503CC` | CC Code | Order issuance condition registration — registers order issuance conditions. |
| `MAX_OP_SVC_CNT` | Constant | "Maximum Option Service Count" — the maximum number of option services a customer can have. Retrieved from the service form bean. |
| `HP_URL_DOMAIN` | Constant | "Homepage Domain" — the homepage URL domain value. Retrieved from the service form bean. |
| `FTTH` | Business term | Fiber To The Home — fiber-optic broadband service (the underlying network technology for K-Opticom internet). |
| `ISP` | Acronym | Internet Service Provider — the internet connectivity service layer managed by K-Opticom. |
| `KKSV` | Acronym | K-Opticom Service View — the screen module naming convention for customer-facing screens. |
| `JCCBusinessException` | Class | Business-common exception class — used for business-level errors (e.g., "0102" contract status error, "0002" system error, "0103" contract count exceeded). |
| `NEXT_SCREEN_NAME` | Field | Shared form bean key for the next screen's display name. |
| `NEXT_SCREEN_ID` | Field | Shared form bean key for the next screen's internal ID. |
| `FUW02403` | Screen ID | Homepage URL Name Acquisition Completion screen — the screen displayed after successful submission. |
| `FUW02401` | Screen ID | Homepage URL Name Acquisition Application screen — the source screen where mskm() is invoked. |
| `JFUStrConst.CD00136_B002` | Constant | Option service code constant — identifies the "My Home Page" option service type. |
| `JPCModelConstant.FUNC_CD_1` | Constant | Function code = "1" — submission mode in service processing. |
| `JPCModelConstant.FUNC_CD_2` | Constant | Function code = "2" — initial display/confirmation mode. |
| `JPCModelConstant.RELATION_ERR` | Constant | Relation error flag — used in exception handling to detect relationship errors. |
| `EKK0361C050` | Constant | Error judgment template — EKK0361C050_Option Service Contract <ISP> Info Change. |
| `EZM0111D010` | Constant | Error judgment template — EZM0111D010_Engining Target Registration. |
