# Business Logic — FUW02201SFLogic.mskm() [27 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.FUW02201SF.FUW02201SFLogic` |
| Layer | Web Business Logic Controller |
| Module | `FUW02201SF` (Package: `eo.web.webview.FUW02201SF`) |

## 1. Role

### FUW02201SFLogic.mskm()

This method handles the business logic triggered when a user clicks the **"Apply" (申込む) button** on the **Mail Virus Check Service Application Screen** (メールウイルスチェックサービス申込画面). It is the final processing step that commits the user's subscription request for K-Opticom's mail virus protection service. The method follows a linear, sequential processing pattern with no conditional branching: it first validates the common relation state of the customer's session, then dispatches the full service registration workflow through the `execute()` method (which internally coordinates a series of SC/CBS calls including subscription content acceptance registration, sub-optional ISP contract registration and inquiry, progress registration, and detail inquiry/subsequent task delegation), refreshes the current customer contract information in the shared form, sends a completion notification email via the MSKM mail component, and finally configures the redirect to the completion screen (FUW02203 — "メールウイルスチェックサービス申込完了"). This method serves as the **entry point / screen handler** for the FUW02201SF module's application submission flow, directly invoked by the web framework when the submit button action is triggered.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["mskm()"])
    CHECK["JFUWebCommon.checkCommonRelation(this, FUSV0058)"]
    GET_BEAN["X31SDataBeanAccess commoninfoBean = super.getCommonInfoBean()"]
    EXEC["execute(commoninfoBean, FUNC_CD_1 = 1)"]
    REFRESH["JFUWebCommon.refreshGenCustKei(this)"]
    SEND_MAIL["JFUWebCommon.sendMskmFinMail(this, FUW022_1)"]
    SET_SNAME["commoninfoBean.sendMessageString(NEXT_SCREEN_NAME, SCREEN_NAME_FUW02203 = メールウイルスチェックサービス申込完了)"]
    SET_SID["commoninfoBean.sendMessageString(NEXT_SCREEN_ID, SCREEN_ID_FUW02203 = FUW02203)"]
    RETURN_TRUE["return true"]
    END_SCREEN(["Next Screen: FUW02203"])

    START --> CHECK
    CHECK --> GET_BEAN
    GET_BEAN --> EXEC
    EXEC --> REFRESH
    REFRESH --> SEND_MAIL
    SEND_MAIL --> SET_SNAME
    SET_SNAME --> SET_SID
    SET_SID --> RETURN_TRUE
    RETURN_TRUE --> END_SCREEN
```

**Processing description:**

1. **Common Relation Check:** Validates session integrity using the usecase ID `FUSV0058`. If validation fails, an exception is thrown.
2. **Retrieve Common Info Bean:** Obtains the shared form data bean (`X31SDataBeanAccess`) via `super.getCommonInfoBean()`. This bean carries all customer, service contract, and subscription state data across the screen.
3. **Execute Service Registration:** Calls `execute()` with the common info bean and function code `FUNC_CD_1 = "1"`. This single call internally chains 9 mapper calls (`setFUSV005801SC` through `setFUSV005808CC`) which register subscription content, sub-optional ISP contracts, perform ISP contract inquiries and settlements, register progress, delegate detail inquiry/subsequent tasks, transfer service IF data, issue SOD, and determine family pack induction criteria. Then it invokes the actual service via `invokeService()`.
4. **Refresh Current Customer Contract:** Calls `JFUWebCommon.refreshGenCustKei(this)` to synchronize the shared form with the latest customer contract data from the backend.
5. **Send Completion Email:** Calls `JFUWebCommon.sendMskmFinMail(this, MSKM_COMP_MAIL_ID)` where `MSKM_COMP_MAIL_ID = "FUW022_1"`. This triggers the completion notification email to the customer.
6. **Set Redirect Screen Name:** Stores the redirect destination screen name (`"メールウイルスチェックサービス申込完了"`) in the common info bean.
7. **Set Redirect Screen ID:** Stores the redirect destination screen ID (`"FUW02203"`) in the common info bean.
8. **Return Success:** Returns `true` indicating normal completion.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| - | (none) | - | This method takes no parameters. All business data is obtained from the instance state (shared form bean) inherited from the parent `JCCWebBusinessLogic` class. |

**Instance fields / external state read:**

| No | Field / State | Type | Business Description |
|----|--------------|------|---------------------|
| 1 | `this` (current logic instance) | `FUW02201SFLogic` | Business logic context carrying shared form data, session state, and usecase ID |
| 2 | `super.getCommonInfoBean()` | `X31SDataBeanAccess` | Shared form data bean containing customer info, service contract info, invoiced contract info, service detail work info, optional service contract info, sub-optional service contract info, and more |
| 3 | `USECASE_ID_FUSV0058` | `String = "FUSV0058"` | Use case identifier for the mail virus check service application use case |
| 4 | `JPCModelConstant.FUNC_CD_1` | `String = "1"` | Function code indicating the primary application operation (submit/apply) |
| 5 | `MSKM_COMP_MAIL_ID` | `String = "FUW022_1"` | Mail completion notification template identifier for the mail virus check service application |
| 6 | `CommonInfoCFConst.NEXT_SCREEN_NAME` | `String = "遷移先画面名"` (Redirect Screen Name) | Key for setting the redirect destination screen name in the shared form |
| 7 | `CommonInfoCFConst.NEXT_SCREEN_ID` | `String = "遷移先画面ID"` (Redirect Screen ID) | Key for setting the redirect destination screen ID in the shared form |
| 8 | `JFUScreenConst.SCREEN_ID_FUW02203` | `String = "FUW02203"` | Target screen ID for the completion screen |
| 9 | `JFUScreenConst.SCREEN_NAME_FUW02203` | `String = "メールウイルスチェックサービス申込完了"` (Mail Virus Check Service Application Completed) | Target screen name for the completion screen |
| 10 | `X31CWebConst.DATABEAN_SET_VALUE` | Constant | Constant indicating a set operation on the shared form bean |

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `JFUWebCommon.checkCommonRelation` | JFUWebCommon | - | Validates common relation state for usecase `FUSV0058`; checks session and customer data consistency |
| - | `FUW02201SFLogic.execute` | FUW02201SFLogic | - | Internal service registration orchestration — dispatches 9 mapper calls + invokeService |
| - | `FUSV0058_FUSV0058OPDBMapper.setFUSV005801SC` | FUSV005801SC | EKK0011D020CBS | Subscription content acceptance registration (MSKM detail data) |
| - | `FUSV0058_FUSV0058OPDBMapper.setFUSV005802SC` | FUSV005802SC | EKK0411D010CBS | Sub-optional service contract <ISP> registration |
| - | `FUSV0058_FUSV0058OPDBMapper.setFUSV005807SC` | FUSV005807SC | EKK0411C020CBS | Sub-optional service contract <ISP> inquiry |
| - | `FUSV0058_FUSV0058OPDBMapper.setFUSV005803SC` | FUSV005803SC | EKK0411C040CBS | Sub-optional service contract <ISP> settlement |
| - | `FUSV0058_FUSV0058OPDBMapper.setFUSV005804SC` | FUSV005804SC | EKK0411C050CBS | Sub-optional service contract <ISP> usage start |
| - | `FUSV0058_FUSV0058OPDBMapper.setFUSV005805SC` | FUSV005805SC | EKK1091D010CBS | Progress registration |
| - | `FUSV0058_FUSV0058OPDBMapper.setFUSV005806SC` | FUSV005806SC | EKK0021C060CBS | Detail inquiry / subsequent task delegation |
| - | `FUSV0058_FUSV0058OPDBMapper.setFUSV005801CC` | FUSV005801CC | JFUTransferCC | Service IF result data transfer |
| - | `FUSV0058_FUSV0058OPDBMapper.setFUSV005802CC` | FUSV005802CC | JKKHakkoSODCC | Service order data (SOD) issuance |
| - | `FUSV0058_FUSV0058OPDBMapper.setFUSV005808CC` | FUSV005808CC | FUSV005808CC | Family pack induction criteria determination |
| - | `JFUWebCommon.setOpSvcKeiStatMail` | JFUWebCommon | - | Sets optional service contract status for mail (called within execute) |
| - | `invokeService` | BPM | FUSV0058Flow | Invokes the backend BPM service flow for the mail virus check application |
| - | `JFUWebCommon.refreshGenCustKei` | JFUWebCommon | - | Refreshes current customer contract data in shared form |
| - | `JFUWebCommon.sendMskmFinMail` | JFUWebCommon | JFUMskmFinMail / JFUMskmFinMailCC | Sends the mail virus check service application completion notification email using template `FUW022_1` |
| - | `sendMessageString` | X31SDataBeanAccess | - | Sets redirect screen name and ID in the shared form bean |

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Screen: FUSV0058 | `FUSV0058 screen submit button` -> `FUW02201SFLogic.mskm` | `FUSV005801SC [C] KK_T_EKK0011D020 (MSKM detail)`, `FUSV005802SC [C] KK_T_EKK0411D010 (ISP contract)`, `FUSV005805SC [C] KK_T_EKK1091D010 (progress)`, `FUSV005806SC [U] KK_T_EKK0021C060 (detail inquiry)` |
| 2 | Screen: FUW02201SF | `FUW02201SF web screen` -> `FUW02201SFLogic.mskm` | `FUSV005801SC [C] KK_T_EKK0011D020`, `FUSV005802SC [C] KK_T_EKK0411D010`, `FUSV005804SC [U] KK_T_EKK0411C050`, `FUSV005805SC [C] KK_T_EKK1091D010`, `JFUMskmFinMail [S] Completion Email (FUW022_1)` |

**Notes on caller context:**
- This method is invoked as the action handler for the **"Apply" button** on the mail virus check service application screen (FUW02201SF / FUSV0058 use case).
- The screen is part of K-Opticom's web customer-facing portal for telecom service applications.
- The terminal operations reach the following DB tables/entities via the `execute()` mapper chain: subscription content (`KK_T_EKK0011D020`), ISP contracts (`KK_T_EKK0411D010`, `KK_T_EKK0411C020`, `KK_T_EKK0411C040`, `KK_T_EKK0411C050`), progress registration (`KK_T_EKK1091D010`), and detail inquiry/subsequent tasks (`KK_T_EKK0021C060`).

## 6. Per-Branch Detail Blocks

**Block 1** — [METHOD ENTRY] `(mskm() - no conditions)` (L366)

> Entry point of the method. This method has no conditional branches — it follows a linear execution path from start to return.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `JFUWebCommon.checkCommonRelation(this, USECASE_ID_FUSV0058)` // Validate session and common relation for usecase `FUSV0058` [-> USECASE_ID_FUSV0058 = "FUSV0058"] |
| 2 | CALL | `X31SDataBeanAccess commoninfoBean = super.getCommonInfoBean()` // Retrieve shared form data bean |
| 3 | CALL | `execute(commoninfoBean, JPCModelConstant.FUNC_CD_1)` // Dispatch full service registration workflow [-> FUNC_CD_1 = "1"] |
| 4 | CALL | `JFUWebCommon.refreshGenCustKei(this)` // Refresh current customer contract data |
| 5 | CALL | `JFUWebCommon.sendMskmFinMail(this, MSKM_COMP_MAIL_ID)` // Send application completion email [-> MSKM_COMP_MAIL_ID = "FUW022_1"] |
| 6 | CALL | `commoninfoBean.sendMessageString(CommonInfoCFConst.NEXT_SCREEN_NAME, X31CWebConst.DATABEAN_SET_VALUE, JFUScreenConst.SCREEN_NAME_FUW02203)` // Set redirect screen name [-> SCREEN_NAME_FUW02203 = "メールウイルスチェックサービス申込完了"] |
| 7 | CALL | `commoninfoBean.sendMessageString(CommonInfoCFConst.NEXT_SCREEN_ID, X31CWebConst.DATABEAN_SET_VALUE, JFUScreenConst.SCREEN_ID_FUW02203)` // Set redirect screen ID [-> SCREEN_ID_FUW02203 = "FUW02203"] |
| 8 | RETURN | `return true` // Return success — application completed normally |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `mskm` | Method | Mail Virus Check Service — a K-Opticom value-added service that provides email-based virus scanning protection for subscribed customers |
| FUSV0058 | Use Case ID | Use case identifier for the mail virus check service application process; used for session tracking and BPM flow routing |
| FUW02201SF | Module | Web screen module for the Mail Virus Check Service Application (confirmation screen); part of the FUW022xx series of web service screens |
| FUW02203 | Screen ID | Mail virus check service application completion screen — the destination screen shown after successful subscription |
| `MSKM_COMP_MAIL_ID` | Constant | Mail completion notification template ID; value `"FUW022_1"` identifies the specific email template for mail virus check service application completion |
| `FUNC_CD_1` | Constant | Function code value `"1"` indicating the primary application (submit) operation; distinguishes from other operations like inquiry or cancel |
| `USECASE_ID_FUSV0058` | Constant | Use case ID `"FUSV0058"` identifying this business use case for session management and BPM routing |
| `checkCommonRelation` | Method | Validates that the customer's session data, contract status, and common relation data are consistent; prevents stale-state processing |
| `execute()` | Method | Internal method within FUW02201SFLogic that orchestrates the full mail virus check service registration by chaining 9 SC/CBS mapper calls and invoking the backend BPM service |
| `invokeService()` | Method | Low-level method that executes the remote BPM service flow (FUSV0058Flow) with prepared input parameters; handles SOAP/WebService communication |
| `FUSV005801SC` | SC Code | Subscription content acceptance registration SC — registers the MSKM (mail virus check) service subscription detail data |
| `FUSV005802SC` | SC Code | Sub-optional service contract ISP registration SC — registers the optional ISP subscription component |
| `FUSV005807SC` | SC Code | Sub-optional service contract ISP inquiry SC — performs inquiry on the ISP contract |
| `FUSV005803SC` | SC Code | Sub-optional service contract ISP settlement SC — finalizes the ISP contract settlement |
| `FUSV005804SC` | SC Code | Sub-optional service contract ISP usage start SC — activates the ISP service for usage |
| `FUSV005805SC` | SC Code | Progress registration SC — registers the service application progress status |
| `FUSV005806SC` | SC Code | Detail inquiry / subsequent task delegation SC — performs detail inquiry and delegates follow-up tasks |
| `FUSV005801CC` | SC Code | Service IF result data transfer CC — transfers service interface result data |
| `FUSV005802CC` | SC Code | Service order data (SOD) issuance CC — triggers SOD generation for the registered service |
| `FUSV005808CC` | SC Code | Family pack induction criteria determination CC — determines eligibility for family pack discounts |
| `getCommonInfoBean()` | Method | Parent class method that returns the shared form data bean (`X31SDataBeanAccess`) containing all customer and contract information |
| `refreshGenCustKei()` | Method | Refreshes current customer contract data (`genCustKei` = 現顧客契約) in the shared form from the backend |
| `sendMskmFinMail()` | Method | Sends the application completion notification email using the MSKM mail component |
| `X31SDataBeanAccess` | Class | Shared form data access bean for transferring structured data between the web screen and business logic |
| `JFUWebCommon` | Class | Common web business utility class providing shared methods for relation checking, customer refresh, and mail sending |
| BPM | Acronym | Business Process Management — the backend workflow engine that processes service applications |
| SOD | Acronym | Service Order Data — the internal service order record generated for newly registered services |
| SC | Acronym | Service Component — a service component layer class (e.g., FUSV005801SC) that handles data mapping for a specific business operation |
| CC | Acronym | Common Component — a shared component class (e.g., JKKHakkoSODCC) providing reusable business logic across multiple screens |
| BS | Acronym | Business Step — the backend EJB layer (e.g., EKK0011D020CBS) that executes database operations |
| CBS | Acronym | CBS Message — the message/DTO class for BS-layer data exchange (e.g., EKK0011D020CBSMsg) |
| KK_T_* | Table Prefix | K-Opticom table naming convention for transaction/operation tables (e.g., KK_T_EKK0011D020) |
| `sendMessageString()` | Method | Sets a string value into the shared form data bean for use by downstream screens |
