# Business Logic — FUW02501SFLogic.mskm() [26 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.FUW02501SF.FUW02501SFLogic` |
| Layer | Service / Business Logic (Web Frontend) |
| Module | `FUW02501SF` (Package: `eo.web.webview.FUW02501SF`) |

## 1. Role

### FUW02501SFLogic.mskm()

This method handles the **submit action** for the "Homepage Access Analysis Service Application" screen. When a customer clicks the "Subscribe" (申し込む) button on the homepage access analysis service application form, this method is invoked to orchestrate the entire application submission workflow. The business domain covers the subscription of K-Opticom's homepage access analysis (web analytics) service to an existing Internet service customer. The method follows a **delegation + chaining pattern**: it delegates common relation validation, core execution, customer data refresh, completion mail notification, and screen routing to `JFUWebCommon` utility methods and the inherited `execute()` method. As a screen entry point for the application submission workflow, it serves as the terminal processing step of the FUW02501SF screen — after this method completes successfully, the user is redirected to the FUW02503 screen (application confirmation screen). The method always returns `true` to indicate successful completion; any business errors are propagated as exceptions (inherited from the `JCCBusinessException` contract).

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["mskm()"])
    A["JFUWebCommon.checkCommonRelation FUSV0070"] --> B["Get Common Info Bean"]
    B --> C["execute bean FUNC_CD_1"]
    C --> D["JFUWebCommon.refreshGenCustKei"]
    D --> E["JFUWebCommon.sendMskmFinMail FUW025_1"]
    E --> F["Set NEXT_SCREEN_ID FUW02503"]
    F --> G["Set NEXT_SCREEN_NAME"]
    G --> H["return true"]

    START --> A --> B --> C --> D --> E --> F --> G --> H
```

**Processing flow:**

1. **Common relation check** — Validates that the current customer's service contract is valid and associated with use case `FUSV0070` (Homepage Access Analysis Service Application - Submit). This is a front-line validation gate.
2. **Get common form bean** — Retrieves the shared `X31SDataBeanAccess` common info bean from the superclass, which contains consolidated customer and service contract data.
3. **Execute** — Delegates to the `execute()` method to perform the core subscription logic. The method is called with `FUNC_CD_1 = "1"` (standard function code) and the common info bean as parameters. The `execute()` method internally handles data persistence, contract registration, and further service component calls.
4. **Refresh current customer contract** — Updates the consolidated customer contract information (`genCustKei`) to reflect the newly submitted service subscription.
5. **Send completion mail** — Triggers the application completion notification email (mail ID: `FUW025_1`) to confirm the subscription request to the customer.
6. **Set next screen ID** — Configures the navigation to `FUW02503` (the application confirmation screen) in the common info bean's `NEXT_SCREEN_ID` message field.
7. **Set next screen name** — Configures the display name for screen `FUW02503` in the common info bean's `NEXT_SCREEN_NAME` message field.
8. **Return** — Always returns `true` to indicate successful processing completion.

**Constant Resolution:**

| Constant | Resolved Value | Business Meaning |
|----------|---------------|------------------|
| `USECASE_ID_FUSV0070` | `"FUSV0070"` | Service ID: Homepage Access Analysis Service Application (Submit) |
| `MSKM_COMP_MAIL_ID` | `"FUW025_1"` | Completion notification mail template ID for FUW025 |
| `JPCModelConstant.FUNC_CD_1` | `"1"` | Standard function code for normal processing |

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| - | (none) | - | This method takes no parameters; it operates on instance state (common info bean, service form bean) managed through the `JCCWebBusinessLogic` superclass. |

**Instance fields / external state read:**

| Source | Access Method | Business Description |
|--------|--------------|---------------------|
| `JCCWebBusinessLogic.commonInfoBean` | `super.getCommonInfoBean()` | Shared form data bean containing customer info, SSO session data, service contract info, and optional service contract info. |
| `JFUWebCommon` utility class | static method calls | Provides cross-cutting concerns: relation checks, customer refresh, mail sending, screen navigation. |
| `FUW02501SFLogic.execute()` | inherited method | Performs core business logic for the application submission (contract registration, data persistence). |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| C | `JFUWebCommon.checkCommonRelation(this, USECASE_ID_FUSV0070)` | - | - | Validates customer-service contract validity for use case FUSV0070 (reads validation rules) |
| C | `execute(commoninfoBean, FUNC_CD_1)` | - | - | Core application submission logic; internally registers service contracts and subscriptions |
| U | `JFUWebCommon.refreshGenCustKei(this)` | - | - | Refreshes consolidated customer contract information after subscription |
| C | `JFUWebCommon.sendMskmFinMail(this, MSKM_COMP_MAIL_ID)` | - | - | Sends application completion notification email (mail template FUW025_1) |
| U | `commoninfoBean.sendMessageString(NEXT_SCREEN_ID, ...)` | - | - | Sets next screen ID (FUW02503) in common info message map |
| U | `commoninfoBean.sendMessageString(NEXT_SCREEN_NAME, ...)` | - | - | Sets next screen display name in common info message map |

### Detailed call chain from `execute()`:

The `execute()` method (inherited from `JCCWebBusinessLogic` or overridden in `FUW02501SFLogic`) internally invokes multiple service components. Based on the class-level constants and mapper usage in the `init()` method (same class), the execution flow includes:

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| C | `FUSV0070_FUSV0070OPDBMapper.setFUSV0070xxSC` | FUSV0070 | - | Service registration mapper for application submission (called by execute) |
| C | `EKK0411D010` (sub-operation service contract ISP registration) | EKK0411D010 | - | ISP service contract registration entity (class constant) |

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Screen: FUW02501SF (Homepage Access Analysis Service Application) | `WEBVLCOMMANDMAP_FUW025010PJP → BL id=FUV02501SF → FUW02501SFLogic.mskm()` | `checkCommonRelation [R] validation rules` |
| 2 | Screen: FUW02501SF | `FUW02501SFLogic.mskm() → execute() → FUSV0070_FUSV0070OPDBMapper` | `execute [C] service contract registration` |
| 3 | Screen: FUW02501SF | `FUW02501SFLogic.mskm() → refreshGenCustKei()` | `refreshGenCustKei [U] consolidated customer contract` |
| 4 | Screen: FUW02501SF | `FUW02501SFLogic.mskm() → sendMskmFinMail(FUW025_1)` | `sendMskmFinMail [C] completion notification email` |
| 5 | Screen: FUW02502SF (Homepage Access Analysis Service Application — variant) | `WEBVLCOMMANDMAP_FUW025020PJP → BL id=FUV02501SF → FUW02501SFLogic.mskm()` | `checkCommonRelation [R] validation rules` |

**Notes on call chains:**
- The screen configuration XML (`WEBVLCOMMANDMAP_FUW025010PJP.xml`, `WEBVLCOMMANDMAP_FUW025020PJP.xml`) maps VL (View Layer) IDs to the `FUW02501SF` business logic.
- The business logic XML (`x31business_logic_FUW02501SF.xml`) registers `FUW02501SFLogic` as the handler for the "Homepage Access Analysis Service Application" screen.
- Multiple screen definition files reference the same BL class, indicating the same business logic is used across related screens in the service application flow (initial display → application form → confirmation).

## 6. Per-Branch Detail Blocks

**Block 1** — [EXEC] `(common relation check)` (L232-237)

> Performs front-line validation of the customer's service contract validity for the given use case ID. This is a guard clause that prevents invalid customers from proceeding with the application submission.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `JFUWebCommon.checkCommonRelation(this, USECASE_ID_FUSV0070)` // Validates customer-service contract for use case FUSV0070 |

**Block 2** — [EXEC] `(get common form bean)` (L239-241)

> Retrieves the shared form data bean from the superclass, which contains consolidated customer information, SSO session data, and service contract details.

| # | Type | Code |
|---|------|------|
| 1 | SET | `commoninfoBean = super.getCommonInfoBean()` // Gets shared form data bean from JCCWebBusinessLogic |

**Block 3** — [EXEC] `(core execution)` (L242)

> Delegates the core application submission logic to the `execute()` method with the standard function code. This is the primary business processing step that handles service contract registration.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `execute(commoninfoBean, JPCModelConstant.FUNC_CD_1)` // FUNC_CD_1 = "1" (standard function code) |

**Block 4** — [EXEC] `(refresh customer contract)` (L245)

> Updates the consolidated customer contract information to reflect the newly submitted service subscription. Ensures downstream systems see the updated contract state.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `JFUWebCommon.refreshGenCustKei(this)` // Refreshes genCustKei (consolidated customer contract info) |

**Block 5** — [EXEC] `(send completion mail)` (L248)

> Triggers the application completion notification email to the customer. The mail template ID `FUW025_1` specifies the completion confirmation email format.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `JFUWebCommon.sendMskmFinMail(this, MSKM_COMP_MAIL_ID)` // MSKM_COMP_MAIL_ID = "FUW025_1" (completion mail template) |

**Block 6** — [EXEC] `(set next screen ID)` (L251)

> Configures the screen navigation target for post-processing display. Sets the next screen to FUW02503 (application confirmation screen).

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `commoninfoBean.sendMessageString(CommonInfoCFConst.NEXT_SCREEN_ID, X31CWebConst.DATABEAN_SET_VALUE, JFUScreenConst.SCREEN_ID_FUW02503)` // Sets navigation target screen ID |

**Block 7** — [EXEC] `(set next screen name)` (L253-254)

> Sets the human-readable display name for the next screen in the message map, used for UI breadcrumbs or page titles.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `commoninfoBean.sendMessageString(CommonInfoCFConst.NEXT_SCREEN_NAME, X31CWebConst.DATABEAN_SET_VALUE, JFUScreenConst.SCREEN_NAME_FUW02503)` // Sets next screen display name |

**Block 8** — [RETURN] `(return)` (L256-257)

> Always returns `true` to signal successful processing completion to the calling framework.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return true` // Indicates processing result |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `mskm` | Method | Short for "Moushikomi Shori" (申し込む処理) — the submit/subscribe action processing for the homepage access analysis service |
| `USECASE_ID_FUSV0070` | Constant | Service ID: Homepage Access Analysis Service Application (Application/Submit) — identifies the business process |
| `USECASE_ID_FUSV0069` | Constant | Service ID: Homepage Access Analysis Service Application (Initial Display) — screen initialization use case |
| `MSKM_COMP_MAIL_ID` | Constant | Application completion mail template ID — value "FUW025_1", specifies the email template for subscription completion notification |
| `FUNC_CD_1` | Constant | Function code "1" — standard/normal function code for regular processing (as opposed to preview, batch, etc.) |
| `genCustKei` | Field | General customer contract — consolidated customer contract information across all services for a given customer |
| `FUSV0070` | Business term | Homepage Access Analysis Service Application (Submit) — the business use case for submitting a subscription request |
| `FUSV0069` | Business term | Homepage Access Analysis Service Application (Initial Display) — the business use case for displaying the application form |
| `FUW02501SF` | Screen | Homepage Access Analysis Service Application screen — the main screen where customers review service details and submit their subscription |
| `FUW02503` | Screen | Homepage Access Analysis Service Application Confirmation screen — the screen displayed after successful submission for confirmation |
| `NEXT_SCREEN_ID` | Constant | Common info field for navigation — specifies which screen to display after processing completes |
| `NEXT_SCREEN_NAME` | Constant | Common info field for display name — specifies the human-readable title of the next screen |
| `checkCommonRelation` | Method | Validates that the current user's service contract is valid for the specified use case |
| `refreshGenCustKei` | Method | Refreshes/reloads consolidated customer contract data from the database after a subscription change |
| `sendMskmFinMail` | Method | Sends application completion notification email to the customer |
| `execute` | Method | Core business logic handler — performs service contract registration and data persistence for the application |
| `commoninfoBean` | Object | Shared form data bean containing customer info, SSO session data, service contract info, and navigation configuration |
| `JCCWebBusinessLogic` | Class | Base class for web frontend business logic — provides common form bean access, message handling, and screen navigation utilities |
| `JFUWebCommon` | Class | Web-layer common utility class — provides shared methods for relation checks, customer refresh, mail sending, and screen configuration |
| `X31SDataBeanAccess` | Class | Shared data bean access object — provides access to form data, message maps, and sub-beans for the web view |
| `EKK0411D010` | SC Code | Sub-operation service contract <ISP> registration — entity/SC for registering ISP-level service contracts |
| `SUBOP_SVC_KEI_CNT` | Field | Sub-operation service contract count — number of active sub-operation service contracts for the customer |
| `op_svc_kei_no` | Field | Operation service contract number — the service contract identifier for the operation-level service |
| `SOD` | Acronym | Service Order Data — telecom order fulfillment entity in K-Opticom's system |
| `FTTH` | Business term | Fiber To The Home — fiber-optic broadband service (context: homepage access analysis is an add-on service for FTTH customers) |
| `KK_T_SVC_KEI` | DB Table | Service contract table — stores customer service contract records |
| `KK_T_OP_SVC_KEI` | DB Table | Operation service contract table — stores operation-level service contract records (ISP contracts) |
