---

# Business Logic — FUW02501SFLogic.init() [107 LOC]

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

## 1. Role

### FUW02501SFLogic.init()

This method performs the **initialization processing for the Home Page Access Analysis Service Subscription (initial display) screen** — the entry point when a customer first visits the subscription application page (Javadoc: ホームページアクセス分析サービス申込画面の初期処理, "Homepage access analysis service subscription screen initialization processing"). It orchestrates the complete lifecycle of loading customer and service contract data, invoking the backend BPM service `FUSV0069` to retrieve pricing and subscription details, and preparing all screen display data for rendering.

The method handles a single service category — **Home Page Access Analysis Service (FUSV0069)** — which is a subscription-based analytics service that provides internet traffic and page access metrics to customers who subscribe to it. It implements a **delegation pattern** with service component routing: the `FUSV0069_FUSV0069OPDBMapper` sets up parameter maps for three SC endpoints (`FUSV006901SC`, `FUSV006902SC`, `FUSV006903SC`) which are invoked together in a single batch through the `invokeService` call, then the results are extracted and mapped back to the form bean.

This is the **primary screen entry point** for the FUW02501SF module. It sets up all display data including the MY Page URL protocol, optional subscription fee lists (basic fees, service handling fees, construction costs), maximum subscription contract counts, and the pay flag to determine whether the pricing table should display as free or chargeable. It also configures the next-screen redirect target (the confirmation screen, `FUW02501`).

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["init()"])

    START --> GET_COMMON["Get Common Form Bean
getCommonInfoBean()"]
    GET_COMMON --> GET_COMMON_INFO["Get Common Info Bean Info
getCommoninfoBeanInfo()"]
    GET_COMMON_INFO --> CHECK_SVC["Check Service Data
checkSvcData()"]
    CHECK_SVC --> GET_SERVICE_BEAN["Get Service Form Bean
getServiceFormBean()"]
    GET_SERVICE_BEAN --> CREATE_PARAM["Create paramMap and dataMap"]
    CREATE_PARAM --> CREATE_MAPPER["Create FUSV0069_FUSV0069OPDBMapper"]
    CREATE_MAPPER --> SET_01["setFUSV006901SC
Business Parameter Management Agreement
SC (MY Page URL protocol)"]
    SET_01 --> SET_02["setFUSV006902SC
Option Service Subscription Fee List SC"]
    SET_02 --> SET_03["setFUSV006903SC
Pricing_Course Subscription Service Agreement SC
(max subscription count)"]
    SET_03 --> SET_01CC["setFUSV006901CC
Initial Fee List CC"]
    SET_01CC --> INVOKE["invokeService(paramMap, dataMap, outputMap)
FUSV0069 BPM Service Invocation"]

    INVOKE --> CATCH_EX["Catch JCCWebServiceException
throw JCCBusinessException"]
    INVOKE --> GET_RESULTS["Get SC Results
getFUSV006901SC, getFUSV006903SC"]

    GET_RESULTS --> SET_PAY_FLG["Set Pay Flag
setPayFlg()"]
    SET_PAY_FLG --> SET_MANSION["Set Mansion Division
getMansionDiv()"]
    SET_MANSION --> CHECK_PAY{"payFlag == false?"}

    CHECK_PAY -->|true| FREE_PRICE["Set Free Price Info Map
setFreePrcInfoMap (no charge)"]
    CHECK_PAY -->|false| SKIP_FREE["Skip free price setup"]

    FREE_PRICE --> SET_PRICING_AREA["Set Pricing Area Info
setPrcInfoArea()"]
    SKIP_FREE --> SET_PRICING_AREA
    SET_PRICING_AREA --> SET_NOW_WEB_ID["Set Current Web ID"]
    SET_NOW_WEB_ID --> SET_NOW_HP_URL["Set Current Home Page URL"]
    SET_NOW_HP_URL --> SET_PRD_NOW["Set Pricing Display Current Day
setPrcDspNowDay()"]
    SET_PRD_NOW --> SET_NEXT_SCREEN["Set Next Screen ID and Name"]
    SET_NEXT_SCREEN --> RETURN_END(["Return true"])
```

**Processing Summary:**

1. **Common Form Bean Retrieval**: Gets the shared `X31SDataBeanAccess commoninfoBean` via `super.getCommonInfoBean()` and extracts customer contract info, SSO info, service contract info, and optional service contract info from the bean map.

2. **Service Data Validation**: Calls `checkSvcData(resultMap)` to validate the retrieved service data before proceeding.

3. **Service Form Bean Setup**: Gets the service-specific form bean and creates the parameter maps and mapper for the BPM service invocation.

4. **Service Component Registration**: Sets up 3 SC endpoints + 1 CC endpoint via the `FUSV0069_FUSV0069OPDBMapper`:
   - `FUSV006901SC`: Business parameter management agreement (MY Page URL protocol retrieval)
   - `FUSV006902SC`: Option service subscription fee list (basic fees, service handling fees, construction costs)
   - `FUSV006903SC`: Pricing_Course subscription service agreement (max subscription contract count)
   - `FUSV006901CC`: Initial fee list CC (computation)

5. **BPM Service Invocation**: Calls `invokeService(paramMap, dataMap, outputMap)` within a try-catch block. If `JCCWebServiceException` is thrown, it re-throws as `JCCBusinessException` with error code `JFUStrConst.ERROR_CODE_0002`.

6. **Result Extraction**: Reads back the SC results via `getFUSV006901SC` and `getFUSV006903SC`.

7. **Pay Flag and Mansion Division**: Sets the pay flag (`setPayFlg`) and mansion division (`getMansionDiv`) on the form bean.

8. **Free Price Conditional**: If `payFlag` is `false`, sets up the free pricing info map.

9. **Pricing Area Setup**: Calls `setPrcInfoArea` to prepare pricing table display data.

10. **Screen Metadata**: Sets the current Web ID, Home Page URL, current day, and next screen redirect info.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| - | (none) | - | This method takes no parameters. It operates entirely on the request-scoped data beans available through the base class and the session state. |

**Instance fields / external state read:**

| Source | Type | Business Description |
|--------|------|---------------------|
| `commoninfoBean` (via `super.getCommonInfoBean()`) | `X31SDataBeanAccess` | Shared form bean containing customer identity, SSO session info, and service contract data. Acts as the unified customer profile carrier. |
| `bean` (via `super.getServiceFormBean()`) | `X31SDataBeanAccess` | Service-specific form bean for the Home Page Access Analysis subscription screen. All output data is written here. |
| `this` (self reference for `setPrcDspNowDay`) | `FUW02501SFLogic` | Passed to `JFUWebCommon.setPrcDspNowDay(this)` for current day processing. |

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `getCommoninfoBeanInfo` | - | CommonInfoCF | Retrieves customer contract info, SSO info, service contract info, and optional service contract info from the shared form bean. |
| - | `checkSvcData` | - | - | Validates the retrieved service data to ensure data integrity before screen initialization. |
| R | `getMansionDiv` | - | - | Determines the mansion (apartment) division for the customer's address, used for service availability checks. |
| R | `getFUSV006901SC` | FUSV006901SC | EZM0321A010CBSMsg1List | Reads business parameter management agreement results including MY Page URL protocol from BPM response. |
| R | `getFUSV006903SC` | FUSV006903SC | EKK1881A010CBSMsg1List | Reads pricing course subscription service agreement results including max subscription contract count and free service value. |
| - | `setFUSV006901SC` | FUSV006901SC | - | Sets up the parameter map for MY Page URL protocol retrieval with FUNC_CD_1. |
| - | `setFUSV006902SC` | FUSV006902SC | - | Sets up the parameter map for optional service subscription fee list retrieval with FUNC_CD_2. |
| - | `setFUSV006903SC` | FUSV006903SC | - | Sets up the parameter map for pricing course subscription service agreement with FUNC_CD_1 and pricing course code. |
| - | `setFUSV006901CC` | FUSV006901CC | - | Sets up the parameter map for initial fee list computation (no BPM call). |
| - | `invokeService` | FUSV0069 | BPM FUSV0069 | Invokes the FUSV0069 BPM service which internally calls EKK0601B001CBS (fee retrieval), EKK1881A010BS (subscription info), EZM0321A010BS (business parameters), and initial fee computation. |
| - | `setPayFlg` | - | - | Computes whether the service is chargeable based on subscription contract count and pricing results. |
| - | `setFreePrcInfoMap` | JFUWebCommon | - | Sets up free pricing information map when payFlag is false (no charge service). |
| - | `setPrcInfoArea` | JFUWebCommon | - | Configures the pricing table display area with screen ID, SC title, and CC title metadata. |
| - | `setPrcDspNowDay` | JFUWebCommon | - | Sets the current day display on the pricing table for the screen. |
| R | `getScreenId` | JFUWebCommon | - | Retrieves the current screen ID for the next-screen redirect configuration. |

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Screen:FUW02501 (FUW02501SFLogic) | `FUW02501SFLogic.init()` | `invokeService [R] EZM0321A010CBSMsg1List, EKK0601B001CBSMsg1List, EKK1881A010CBSMsg1List` |
| 2 | FUW02501SFChecker | `FUW02501SFChecker` delegates validation to `FUW02501SFLogic` | `invokeService [R] FUSV0069 BPM endpoints` |

**How this method calls out (terminal endpoints):**

| # | Terminal Method | Terminal Type | SC / CBS / Entity |
|---|----------------|---------------|-------------------|
| 1 | `setFUSV006901SC` | Call | FUSV006901SC (EZM0321A010BS) |
| 2 | `setFUSV006902SC` | Call | FUSV006902SC (EKK0601B001BS) |
| 3 | `setFUSV006903SC` | Call | FUSV006903SC (EKK1881A010BS) |
| 4 | `setFUSV006901CC` | Call | FUSV006901CC (Initial fee computation) |
| 5 | `invokeService` | Call | FUSV0069 BPM (calls EZM0321A010, EKK0601B001, EKK1881A010) |
| 6 | `getFUSV006901SC` | Read | EZM0321A010CBSMsg1List (MY Page URL protocol) |
| 7 | `getFUSV006903SC` | Read | EKK1881A010CBSMsg1List (max subscription count) |
| 8 | `checkSvcData` | Check | Service data validation |
| 9 | `getCommoninfoBeanInfo` | Read | Common form info (customer + SSO + service contract) |
| 10 | `setPayFlg` | Compute | Pay flag determination |
| 11 | `getMansionDiv` | Read | Mansion division determination |
| 12 | `setPrcInfoArea` | Set | Pricing area configuration |

## 6. Per-Branch Detail Blocks

### Block 1 — Common Form Bean Retrieval (L94-103)

> Retrieve shared form bean, extract customer and service contract data.

| # | Type | Code |
|---|------|------|
| 1 | SET | `commoninfoBean = super.getCommonInfoBean()` // Get shared form bean |
| 2 | CALL | `resultMap = getCommoninfoBeanInfo(commoninfoBean)` // Extract customer + SSO + service contract info |
| 3 | SET | `ssoInfoBean = (X31SDataBeanAccess)resultMap.get(CommonInfoCFConst.SSO_INFO)` // SSO session info [CommonInfoCFConst.SSO_INFO] |
| 4 | SET | `svcKeiInfoBean = (X31SDataBeanAccess)resultMap.get(CommonInfoCFConst.SVC_KEI_INFO)` // Service contract info [CommonInfoCFConst.SVC_KEI_INFO] |
| 5 | SET | `opSvcKeiInfoBean = (X31SDataBeanAccess)resultMap.get(CommonInfoCFConst.OP_SVC_KEI_INFO)` // Optional service contract info [CommonInfoCFConst.OP_SVC_KEI_INFO] |
| 6 | SET | `sbopSvcKeiCnt = ((Integer)resultMap.get(SBOP_SVC_KEI_CNT)).intValue()` // Subscription optional service contract count [SBOP_SVC_KEI_CNT = "sbop_svc_kei_cnt"] |

### Block 2 — Service Data Check (L105)

> Validate the retrieved service data for integrity.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `checkSvcData(resultMap)` // Validate service contract data before proceeding |

### Block 3 — Service Form Bean Setup (L107-138)

> Prepare the service form bean, parameter maps, and SC/CC registration.

| # | Type | Code |
|---|------|------|
| 1 | SET | `bean = super.getServiceFormBean()` // Get service-specific form bean |
| 2 | SET | `paramMap = new HashMap<String, String>(16)` // Usecase ID storage map, capacity 16 |
| 3 | SET | `paramMap.put(X31CWebConst.TELEGRAM_INFO_USECASE_ID, USECASE_ID_FUSV0069)` // Set usecase ID to "FUSV0069" [TELEGRAM_INFO_USECASE_ID, USECASE_ID_FUSV0069="FUSV0069"] |
| 4 | SET | `mapper = new FUSV0069_FUSV0069OPDBMapper()` // Create mapper for T-C mapping |
| 5 | SET | `dataMap = new HashMap<String, Object>()` // Data map for SC invocation |
| 6 | SET | `paramBean = { bean, svcKeiInfoBean }` // Parameter bean array: [0]=service form, [1]=optional service info |
| 7 | SET | `JPCModelConstant.FUNC_CD_1` // Function code 1: Business parameter management [JPCModelConstant.FUNC_CD_1] |
| 8 | SET | `JPCModelConstant.FUNC_CD_2` // Function code 2: Fee list retrieval [JPCModelConstant.FUNC_CD_2] |
| 9 | CALL | `mapper.setFUSV006901SC(paramBean, dataMap, JPCModelConstant.FUNC_CD_1)` // Register MY Page URL protocol SC |
| 10 | CALL | `mapper.setFUSV006902SC(paramBean, dataMap, JPCModelConstant.FUNC_CD_2)` // Register option fee list SC |
| 11 | CALL | `mapper.setFUSV006903SC(paramBean, dataMap, JPCModelConstant.FUNC_CD_1)` // Register pricing course SC |
| 12 | CALL | `mapper.setFUSV006901CC(paramBean, dataMap)` // Register initial fee list CC |

### Block 4 — BPM Service Invocation (L140-157)

> Invoke the FUSV0069 BPM service with error handling.

| # | Type | Code |
|---|------|------|
| 1 | SET | `outputMap = new HashMap<String, Object>()` // Output result map |
| 2 | EXEC | `invokeService(paramMap, dataMap, outputMap)` // Call FUSV0069 BPM service to retrieve pricing, subscription info |

**Block 4.1 — Try-Catch: JCCWebServiceException (L149-156)**

> Catch web service exceptions and re-throw as business exceptions.

| # | Type | Code |
|---|------|------|
| 1 | CATCH | `JCCWebServiceException se` // Catch BPM service exceptions |
| 2 | RETURN | `throw new JCCBusinessException(JFUStrConst.ERROR_CODE_0002)` // Re-throw as business error [JFUStrConst.ERROR_CODE_0002] |

### Block 5 — Result Extraction (L160-163)

> Extract results from the BPM service response and map to form bean.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `mapper.getFUSV006901SC(bean, outputMap)` // Extract MY Page URL protocol → bean |
| 2 | CALL | `mapper.getFUSV006903SC(bean, outputMap, sbopSvcKeiCnt)` // Extract max subscription count and free value → bean |

### Block 6 — Pay Flag and Mansion Division (L165-167)

> Set the pay flag (whether the service is chargeable) and mansion division on the form bean.

| # | Type | Code |
|---|------|------|
| 1 | SET | `payFlag = bean.sendMessageBoolean(FUW02501SFConst.PAY_FLG, X31CWebConst.DATABEAN_SET_VALUE, setPayFlg(bean, outputMap, sbopSvcKeiCnt))` // Set pay flag from computed value [PAY_FLG = "有料フラグ", DATABEAN_SET_VALUE] |
| 2 | SET | `bean.sendMessageBoolean(FUW02501SFConst.MANSION_DIV, X31CWebConst.DATABEAN_SET_VALUE, getMansionDiv(bean, commoninfoBean, outputMap))` // Set mansion division [MANSION_DIV = "マンション区分"] |

### Block 7 — Free Price Conditional (L169-173)

> Conditional pricing setup based on pay flag.

| # | Type | Code |
|---|------|------|
| 1 | IF | `if (!payFlag)` // If NOT pay (free service) [payFlag == false] |

**Block 7.1 — ELSE (Free Pricing Setup) (L171-173)**

> Set free pricing info map when the service is free.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `JFUWebCommon.setFreePrcInfoMap(outputMap, SC_TITLE_FUSV006902)` // Set free pricing info map [SC_TITLE_FUSV006902 = "FUSV006902SC"] |

### Block 8 — Pricing Area Setup (L176)

> Configure the pricing table display area with all metadata.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `JFUWebCommon.setPrcInfoArea(bean, outputMap, SC_TITLE_FUSV006902, CC_TITLE_FUSV006901, JFUScreenConst.SCREEN_ID_FUW02501)` // Set pricing area [SC_TITLE_FUSV006902 = "FUSV006902SC", CC_TITLE_FUSV006901 = "FUSV006901CC", SCREEN_ID_FUW02501] |

### Block 9 — Screen Metadata Setup (L178-188)

> Set current Web ID, Home Page URL, current day, and next-screen redirect info.

| # | Type | Code |
|---|------|------|
| 1 | SET | `bean.sendMessageString(FUW02501SFConst.NOW_WEB_ID, X31CWebConst.DATABEAN_SET_VALUE, ssoInfoBean.sendMessageString(CommonInfoCFConst.WEB_ID_21, X31CWebConst.DATABEAN_GET_VALUE))` // Set current Web ID [NOW_WEB_ID = "現在のWeb ID", WEB_ID_21] |
| 2 | SET | `bean.sendMessageString(FUW02501SFConst.NOW_HP_URL, X31CWebConst.DATABEAN_SET_VALUE, bean.sendMessageString(FUW02501SFConst.URL_PROTOCOL, X31CWebConst.DATABEAN_GET_VALUE) + opSvcKeiInfoBean.sendMessageString(CommonInfoCFConst.URL_DOMAIN_28, X31CWebConst.DATABEAN_GET_VALUE) + opSvcKeiInfoBean.sendMessageString(CommonInfoCFConst.URL_ACCOUNT_28, X31CWebConst.DATABEAN_GET_VALUE))` // Build full HP URL: protocol + domain + account [NOW_HP_URL = "現在のホームページURL", URL_PROTOCOL, URL_DOMAIN_28, URL_ACCOUNT_28] |
| 3 | CALL | `JFUWebCommon.setPrcDspNowDay(this)` // Set pricing table display current day |
| 4 | SET | `commoninfoBean.sendMessageString(CommonInfoCFConst.NEXT_SCREEN_ID, X31CWebConst.DATABEAN_SET_VALUE, JFUWebCommon.getScreenId(this))` // Set next screen ID |
| 5 | SET | `commoninfoBean.sendMessageString(CommonInfoCFConst.NEXT_SCREEN_NAME, X31CWebConst.DATABEAN_SET_VALUE, JFUScreenConst.SCREEN_NAME_FUW02501)` // Set next screen name [NEXT_SCREEN_NAME, SCREEN_NAME_FUW02501] |

### Block 10 — Return (L190)

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return true` // Always returns true — processing result indicator |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `op_svc_kei_no` | Field | Optional service contract number — internal identifier for optional service contract line items |
| `sbop_svc_kei_cnt` | Field | Subscription optional service contract count — number of active subscription service contracts |
| `upd_dtm_bf` | Field | Update date/time (before) — timestamp captured prior to update for audit/optimistic locking |
| `pplan_kotei_amnt` | Field | Plan fixed amount — the fixed price of a pricing plan |
| `svc_kei_ucwk_no` | Field | Service detail work number — internal tracking ID for service contract line items |
| `ezm0321a010` | SC Code | Business parameter management SC — retrieves MY Page URL protocol configuration from business parameters |
| `ekk0601b001` | SC Code | Option service subscription fee list SC — retrieves basic fees, service handling fees, and construction costs for optional service subscriptions |
| `ekk1881a010` | SC Code | Pricing_Course subscription service agreement SC — retrieves max subscription count and free service values for subscription service agreements |
| `FUSV0069` | Business term | Home Page Access Analysis Service Subscription (initial display) — the BPM usecase for loading initial data on the analytics subscription application screen |
| `FUSV0070` | Business term | Home Page Access Analysis Service Subscription (application) — the BPM usecase for submitting the subscription application |
| `FUSV006901SC` | SC Code | Business parameter management agreement SC — retrieves MY Page URL protocol settings |
| `FUSV006902SC` | SC Code | Option service subscription fee list SC — retrieves pricing details (basic fee, handling fee, construction fee) |
| `FUSV006903SC` | SC Code | Pricing_Course subscription service agreement SC — retrieves max subscription count and free service amount |
| `FUSV006901CC` | CC Code | Initial fee list computation — computes initial one-time fees displayed on the subscription screen |
| `PAY_FLG` | Field | Pay flag — boolean flag indicating whether the service is chargeable (有料 = paid/chargeable) |
| `MANSION_DIV` | Field | Mansion division — customer housing type classification (apartment/condominium vs standalone), used for service availability |
| `NOW_WEB_ID` | Field | Current Web ID — the customer's current web login identifier from SSO session |
| `NOW_HP_URL` | Field | Current Home Page URL — the customer's homepage URL built from protocol + domain + account |
| `KEIYAKU_YAKKAN_DOI` | Field | Contract terms agreement — customer agreement status for contract terms |
| `RIYO_KIYAKU_DOI` | Field | Terms of use agreement — customer agreement status for service terms of use |
| `URL_PROTOCOL` | Field | URL protocol — the protocol portion of the MY Page URL (e.g., "https://") |
| `SSO_INFO` | Field | SSO session information — single sign-on session data including user identity |
| `SVC_KEI_INFO` | Field | Service contract information — customer's active service contract data |
| `OP_SVC_KEI_INFO` | Field | Optional service contract information — customer's optional/add-on service contract data |
| `NEXT_SCREEN_ID` | Field | Next screen ID — the ID of the next screen to redirect to after processing |
| `NEXT_SCREEN_NAME` | Field | Next screen name — the display name of the next screen |
| `FUNC_CD_1` | Constant | Function code 1 — used for business parameter management and subscription agreement operations |
| `FUNC_CD_2` | Constant | Function code 2 — used for fee list retrieval operations |
| `ERROR_CODE_0002` | Constant | System error code — generic service error used for web service and business exceptions |
| `ERROR_CODE_0103` | Constant | Contract limit error code — thrown when subscription count exceeds maximum allowed |
| SOD | Acronym | Service Order Data — telecom order fulfillment entity (referenced in order content codes) |
| FTTH | Business term | Fiber To The Home — fiber-optic internet service (service type classification) |
| BPM | Acronym | Business Process Management — the backend service execution engine (FUSV0069Flow / FUSV0069OPOperation) |
| SC | Acronym | Service Component — a service component endpoint that calls backend business logic |
| CC | Acronym | Computation Component — a client-side computation module (no BPM call) |
| BS | Acronym | Business Service — the backend service layer called by SCs |
| MY Page | Business term | MY Page — the customer's personalized portal/dashboard page for K-Opticom services |
| 有料 (Yuryo) | Business term | Paid/Chargeable — indicates a service or fee is not free; the payFlag determines if the pricing table shows charges |
| 無料 (Muryo) | Business term | Free/No charge — indicates a service is provided at no cost |
| マンション区分 (Mansion Kubun) | Field | Mansion (apartment) division — customer housing type classification used for service availability determination |
| 申込完了メール (Shinnyo Kanryo Mail) | Business term | Application completion email — notification email sent after subscription application (MSKM_COMP_MAIL_ID = "FUW025_1") |

---
