# Business Logic — FUW02601SFLogic.init() [181 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.FUW02601SF.FUW02601SFLogic` |
| Layer | Service / Web Logic (Front-end business logic class extending `JCCWebBusinessLogic`) |
| Module | `FUW02601SF` (Package: `eo.web.webview.FUW02601SF`) |

## 1. Role

### FUW02601SFLogic.init()

This method performs the **initial display processing for the Mailing List Additional Subscription screen** (メーリングリスト追加申込画面の初期表示処理). It is the entry-point business logic invoked when a customer accesses the ML subscription screen in the K-Opticom customer support front-end portal.

The method executes three major business responsibilities in sequence: (1) **Counting current ML subscriptions** by iterating through the customer's service detail work records and identifying optional services coded as "B003" (Mailing List) that are neither cancelled (status "910: 解約済み") nor terminated (status "920: キャンセル済み"), (2) **Invoking downstream service components** that prepare pricing/course information, optional service agreement references, business parameter management data, and NG word (blocked keyword) lists, and (3) **Populating the form DataBean** with calculated values such as current ML subscription count, remaining available count, publication setting options, contract agreement flag, mansion division flag, and payment flag.

The method uses a **delegation and routing design pattern**: it collects hierarchical shared form bean data through nested DataBean array traversals, then delegates pricing and service data retrieval to the `FUSV0060_FUSV0060OPDBMapper` which orchestrates multiple SC (Service Component) calls. The method acts as the **screen-specific business logic controller** for the ML subscription screen, coordinating all pre-display data preparation before handing control to the view layer.

If the customer's optional service count exceeds the maximum permitted ML subscription count, a contract status error (ERROR_CODE_0102) is thrown. If any web service invocation fails, a business error (ERROR_CODE_0002) is thrown. On success, the method sets navigation metadata (next screen name and ID) on the common info bean and returns `true` for normal completion.

## 2. Processing Pattern (Detailed Business Logic)

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

    START --> GET_COMMON["Get Common Info Bean"]
    GET_COMMON --> GET_WEB_CHG["Get WEB Change Info Array"]
    GET_WEB_CHG --> GET_WEB_CHG_SINGLE["Get Single Web Change Info Bean index 0"]
    GET_WEB_CHG_SINGLE --> GET_GEN_CUST["Get Current Customer Contract Array"]
    GET_GEN_CUST --> GET_GEN_CUST_SINGLE["Get Single Gen Customer Bean index 0"]
    GET_GEN_CUST_SINGLE --> GET_SVC_KEI["Get Service Contract Array"]
    GET_SVC_KEI --> GET_SVC_KEI_SINGLE["Get Single Service Contract Bean index 0"]
    GET_SVC_KEI_SINGLE --> GET_SVC_UCWK["Get Service Detail Work Array"]
    GET_SVC_UCWK --> GET_SVC_UCWK_SINGLE["Get Single Service Detail Bean index 0"]
    GET_SVC_UCWK_SINGLE --> INIT_CNT["Set mailingListCnt = 0"]

    INIT_CNT --> LOOP_SVCUCWK["Loop svcKeiUcwkInfoArray for k"]
    LOOP_SVCUCWK --> GET_SVCUCWK_K["Reassign svcKeiUcwkInfoBean from index k"]
    GET_SVCUCWK_K --> GET_OP_SVC["Get Optional Service Array"]
    GET_OP_SVC --> LOOP_OP_SVC["Loop opSvcKeiInfoArray for n"]
    LOOP_OP_SVC --> GET_TMP_OP["Get tmpOpSvcKeiInfoBean from index n"]
    GET_TMP_OP --> GET_OP_SVC_CD["Get Option Service Code OP_SVC_CD_28"]
    GET_OP_SVC_CD --> GET_OP_SVC_STAT["Get Option Service Status OP_SVC_KEI_STAT_28"]

    GET_OP_SVC_STAT --> CHECK_CD{CD00136_B003=B003 and
Status not 910 and not 920}
    CHECK_CD -->|True| INCR_CNT["Increment mailingListCnt"]
    CHECK_CD -->|False| END_LOOP_N["End inner loop n"]
    INCR_CNT --> END_LOOP_N
    END_LOOP_N --> END_LOOP_K["End outer loop k"]
    END_LOOP_K --> BUILD_PARAM["Build paramMap with USECASE_ID_FUSV0060"]
    BUILD_PARAM --> BUILD_MAPPER["Create FUSV0060_FUSV0060OPDBMapper"]
    BUILD_MAPPER --> CALL_SET01["setFUSV006001SC Fee Course Optional Service FUNC_CD=2"]
    CALL_SET01 --> CALL_SET02["setFUSV006002SC Price Plan Unit Price FUNC_CD=1"]
    CALL_SET02 --> CALL_SET01CC["setFUSV006001CC Initial Fee List CC"]
    CALL_SET01CC --> CALL_SET03["setFUSV006003SC Business Parameter Mgmt FUNC_CD=1"]
    CALL_SET03 --> CALL_SET04["setFUSV006004SC Business Parameter Mgmt FUNC_CD=1"]
    CALL_SET04 --> CALL_SET05["setFUSV006005SC NG Word List Front FUNC_CD=1"]
    CALL_SET05 --> INVOKESVC["invokeService paramMap dataMap outputMap"]

    INVOKESVC --> TRY_SUCCESS["invokeService success"]
    INVOKESVC --> TRY_EXCEPTION["JCCWebServiceException caught"]
    TRY_SUCCESS --> GET_SC01["getFUSV006001SC with mailingListCnt"]
    TRY_SUCCESS --> GET_SC03["getFUSV006003SC"]
    GET_SC03 --> GET_SC04["getFUSV006004SC"]
    GET_SC04 --> GET_SC05["getFUSV006005SC NG Word"]
    GET_SC05 --> GET_SC02["getFUSV006002SC Price Plan"]
    GET_SC02 --> GET_PAYFLG["getPayFlg bean"]
    TRY_EXCEPTION --> THROW02["Throw JCCBusinessException ERROR_CODE_0002"]

    GET_PAYFLG --> CHECK_PAY{!payFlg free}
    CHECK_PAY -->|True| SET_FREE["setFreePrcInfoMap outputMap SC_TITLE_FUSV006002"]
    CHECK_PAY -->|False| SET_PRCAREA["setPrcInfoArea bean outputMap SC_TITLE CC_TITLE SCREEN_ID"]
    SET_FREE --> SET_PRCAREA

    SET_PRCAREA --> CHECK_MAXML{maxOpSvcCnt <= mailingListCnt}
    CHECK_MAXML -->|True| THROW0102["Throw JCCBusinessException ERROR_CODE_0102 Contract Status Error"]
    CHECK_MAXML -->|False| SET_NOW_CNT["Set NOW_MLLIST_STKU_CNT current count"]
    SET_NOW_CNT --> SET_ZAN_CNT["Set NOW_MLLIST_STKU_ZAN_CNT remaining count"]

    SET_ZAN_CNT --> GET_KOKAI["Get KOKAI_SET_LIST array"]
    GET_KOKAI --> GET_DISP_MAP["getDispItemsAsMap QUERY_KOUKAI_SETTEI_PATH QUERY_ATTR_NAME"]
    GET_DISP_MAP --> BUILD_TREEMAP["Create TreeMap addAll dispDefinitionMap"]
    BUILD_TREEMAP --> GET_SETS["Get keySet iterator"]
    GET_SETS --> LOOP_KOKAI{while hasNext}
    LOOP_KOKAI -->|True| ADD_KOKAI["AddDataBean Set name value for each item"]
    ADD_KOKAI --> INC_CNT["cnt++"]
    INC_CNT --> LOOP_KOKAI
    LOOP_KOKAI -->|False| SET_AGREE["Set KEIYAKU_YAKKAN_DOI false"]
    SET_AGREE --> SET_MANSION["Set MANSION_DIV getMansionDiv"]
    SET_MANSION --> SET_PAYFLG_BEAN["Set PAY_FLG payFlg"]
    SET_PAYFLG_BEAN --> SET_NOWDAY["setPrcDspNowDay this"]
    SET_NOWDAY --> SET_NEXTSCREEN["Set NEXT_SCREEN_NAME SCREEN_NAME_FUW02601"]
    SET_NEXTSCREEN --> SET_NEXTID["Set NEXT_SCREEN_ID getScreenId"]
    SET_NEXTID --> RETURN_TRUE["Return true"]
    THROW02 --> RETURN_TRUE
    THROW0102 --> RETURN_TRUE
```

**Constant Resolution:**

| Constant | Resolved Value | Business Meaning |
|----------|---------------|-----------------|
| `JFUStrConst.CD00136_B003` | `"B003"` | Option service code for Mailing List service |
| `JFUStrConst.CD00037_910` | `"910"` | Service status: Cancelled (解約済み) |
| `JFUStrConst.CD00037_920` | `"920"` | Service status: Terminated (キャンセル済み) |
| `USECASE_ID_FUSV0060` | `"FUSV0060"` | Service ID for ML additional subscription screen |
| `SC_TITLE_FUSV006002` | `"FUSV006002SC"` | Price Plan Fixed Unit Price (Optional Registration Fee) service title |
| `CC_TITLE_FUSV006001` | `"FUSV006001CC"` | Initial Fee List (common component) title |
| `SCREEN_ID_FUW02601` | `"FUW02601"` | Screen ID for ML Additional Subscription |
| `SCREEN_NAME_FUW02601` | `メーリングリスト追加申込` | Screen name for ML Additional Subscription |
| `FUNC_CD_2` | `2` | Function code parameter for fee course optional service |
| `FUNC_CD_1` | `1` | Function code parameter for other SC/CBS calls |

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| - | `(none)` | - | This method takes no explicit parameters. It reads all necessary data from inherited form beans and the common info context via the framework's bean access mechanisms. |

**Instance fields / External state read by this method:**

| No | Source | Type | Business Description |
|----|--------|------|---------------------|
| 1 | `super.getCommonInfoBean()` | `X31SDataBeanAccess` | Shared form bean containing cross-screen context data (WEB change info, customer contract, service contract, service detail work records) |
| 2 | `super.getServiceFormBean()` | `X31SDataBeanAccess` | Screen-specific form bean for FUW02601SF (Mailing List subscription form data) |
| 3 | `super.invokeService()` | inherited method | Web service invocation from base class `JCCWebBusinessLogic` — dispatches to the mapping layer |
| 4 | `this` | `FUW02601SFLogic` | Passed to `setPrcDspNowDay` and `getScreenId` for screen ID resolution |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `FUSV0060_FUSV0060OPDBMapper.setFUSV006001SC` | EKK0811A010 | — | Sets fee course + optional service agreement reference data (FUNC_CD=2) |
| R | `FUSV0060_FUSV0060OPDBMapper.setFUSV006002SC` | — | — | Sets price plan fixed unit price (optional registration fee) list reference data (FUNC_CD=1) |
| R | `FUSV0060_FUSV0060OPDBMapper.setFUSV006001CC` | — | — | Sets initial fee list common component reference data |
| R | `FUSV0060_FUSV0060OPDBMapper.setFUSV006003SC` | EZM0321A010 | — | Sets business parameter management agreement reference data (FUNC_CD=1) |
| R | `FUSV0060_FUSV0060OPDBMapper.setFUSV006004SC` | EZM0321A010 | — | Sets business parameter management agreement reference data (FUNC_CD=1) |
| R | `FUSV0060_FUSV0060OPDBMapper.setFUSV006005SC` | EZM0161B020 | — | Sets NG word list front reference data (FUNC_CD=1) |
| - | `FUSV02601SFLogic.invokeService` | — | — | Invokes web service with paramMap, dataMap, outputMap |
| R | `FUSV0060_FUSV0060OPDBMapper.getFUSV006001SC` | EKK0811A010 | — | Retrieves fee course + optional service agreement SC result with mailing list count |
| R | `FUSV0060_FUSV0060OPDBMapper.getFUSV006003SC` | EZM0321A010 | — | Retrieves business parameter management agreement SC result |
| R | `FUSV0060_FUSV0060OPDBMapper.getFUSV006004SC` | EZM0321A010 | — | Retrieves business parameter management agreement SC result |
| R | `FUSV0060_FUSV0060OPDBMapper.getFUSV006005SC` | EZM0161B020 | — | Retrieves NG word list SC result |
| R | `FUSV0060_FUSV0060OPDBMapper.getFUSV006002SC` | — | — | Retrieves price plan fixed unit price SC result |
| - | `FUSV02601SFLogic.getPayFlg` | — | — | Determines whether the subscription is paid (有料) or free |
| - | `FUSV02601SFLogic.getMansionDiv` | — | — | Determines whether the customer resides in a mansion |
| R | `JFUWebCommon.getDispItemsAsMap` | — | — | Reads publication setting configuration items from external config path |
| - | `JFUWebCommon.setFreePrcInfoMap` | — | — | Sets free pricing information map for the display |
| - | `JFUWebCommon.setPrcInfoArea` | — | — | Sets price information area for display |
| - | `JFUWebCommon.setPrcDspNowDay` | — | — | Sets current date display for price table |
| - | `JFUWebCommon.getScreenId` | — | — | Retrieves the screen ID for the current screen context |
| - | `JCCWebBusinessLogic.invokeService` | — | — | Base class method that dispatches service invocation to the web service layer |

**CRUD Classification:**

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `FUSV0060_FUSV0060OPDBMapper.setFUSV006001SC` | EKK0811A010SC | — | Read fee course and optional service agreement reference data (1) |
| R | `FUSV0060_FUSV0060OPDBMapper.setFUSV006002SC` | — | — | Read price plan fixed unit price (optional registration fee) list reference data (2) |
| R | `FUSV0060_FUSV0060OPDBMapper.setFUSV006001CC` | — | — | Read initial fee list common component reference data (3) |
| R | `FUSV0060_FUSV0060OPDBMapper.setFUSV006003SC` | EZM0321A010SC | — | Read business parameter management agreement reference data (4) |
| R | `FUSV0060_FUSV0060OPDBMapper.setFUSV006004SC` | EZM0321A010SC | — | Read business parameter management agreement reference data (5) |
| R | `FUSV0060_FUSV0060OPDBMapper.setFUSV006005SC` | EZM0161B020SC | — | Read NG word list front reference data (6) |
| R | `FUSV0060_FUSV0060OPDBMapper.getFUSV006001SC` | EKK0811A010SC | — | Read fee course and optional service agreement SC result with mailing list count (7) |
| R | `FUSV0060_FUSV0060OPDBMapper.getFUSV006003SC` | EZM0321A010SC | — | Read business parameter management agreement SC result (8) |
| R | `FUSV0060_FUSV0060OPDBMapper.getFUSV006004SC` | EZM0321A010SC | — | Read business parameter management agreement SC result (9) |
| R | `FUSV0060_FUSV0060OPDBMapper.getFUSV006005SC` | EZM0161B020SC | — | Read NG word list SC result (10) |
| R | `FUSV0060_FUSV0060OPDBMapper.getFUSV006002SC` | — | — | Read price plan fixed unit price SC result (11) |

**Notes on SC Codes:**
- `EKK0811A010SC` — Fee Course / Optional Service Agreement Reference (料金コース・オプションサービス一意照会)
- `EZM0321A010SC` — Business Parameter Management Agreement Reference (業務パラメータ管理一意照会)
- `EZM0161B020SC` — NG Word List Front (NGワード一覧照会 フロント)
- The `setFUSV006002SC` (Price Plan Fixed Unit Price) and `setFUSV006001CC` (Initial Fee List CC) SC codes are not explicitly resolved to a known SC Code pattern from source inspection.

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Screen: FUW02601 | Framework Screen Controller -> `FUW02601SFLogic.init()` | `invokeService -> EKK0811A010SC [R]`, `EZM0321A010SC [R]`, `EZM0161B020SC [R]` |

**Call Chain Details:**
- The `FUW02601` screen (メーリングリスト追加申込 / Mailing List Additional Subscription) is a front-end customer portal screen.
- The framework's screen controller dispatches to the `FUW02601SFLogic.init()` method on initial screen load.
- The FUW prefix (`FUW`) indicates a front-end web screen module in the K-Opticom customer system.
- The `FUSV0060` service ID corresponds to the ML additional subscription sub-service.

## 6. Per-Branch Detail Blocks

**Block 1** — [SET] Shared Form Bean Data Retrieval (L110)

> Retrieves the hierarchical shared form bean data through nested DataBean array traversals. This establishes the customer context chain: common info -> web change info -> customer contract -> service contract -> service detail work.

| # | Type | Code |
|---|------|------|
| 1 | SET | `commoninfoBean = super.getCommonInfoBean()` // Get shared form bean |
| 2 | SET | `webChgInfoBeanArray = commoninfoBean.getDataBeanArray(CommonInfoCFConst.WEB_CHG_INFO)` // Get WEB change info array |
| 3 | SET | `webChgInfoBean = webChgInfoBeanArray.getDataBean(0)` // Get single web change info bean |
| 4 | SET | `genCustKeiInfoArray = webChgInfoBean.getDataBeanArray(CommonInfoCFConst.GEN_CUST_KEI_INFO)` // Get customer contract array |
| 5 | SET | `genCustKeiInfoBean = genCustKeiInfoArray.getDataBean(0)` // Get single customer bean |
| 6 | SET | `svcKeiInfoArray = genCustKeiInfoBean.getDataBeanArray(CommonInfoCFConst.SVC_KEI_INFO)` // Get service contract array |
| 7 | SET | `svcKeiInfoBean = svcKeiInfoArray.getDataBean(0)` // Get single service contract bean |
| 8 | SET | `svcKeiUcwkInfoArray = svcKeiInfoBean.getDataBeanArray(CommonInfoCFConst.SVC_KEI_UCWK_INFO)` // Get service detail work array |
| 9 | SET | `svcKeiUcwkInfoBean = svcKeiUcwkInfoArray.getDataBean(0)` // Get single service detail bean |
| 10 | SET | `mailingListCnt = 0` // Initialize ML subscription counter [-> 0] |

**Block 2** — [WHILE] Iterate Optional Services — Outer Loop (L147)

> Iterates through all service detail work records to count current ML subscriptions. For each service detail work, checks if it has an option service that matches the ML code ("B003") and is still active (not cancelled "910" or terminated "920").

| # | Type | Code |
|---|------|------|
| 1 | LOOP | `for (int k = 0; k < svcKeiUcwkInfoArray.getCount(); k++)` // Outer loop over service detail work records |
| 2 | SET | `svcKeiUcwkInfoBean = svcKeiUcwkInfoArray.getDataBean(k)` // Reassign bean for current index |
| 3 | SET | `opSvcKeiInfoArray = svcKeiUcwkInfoBean.getDataBeanArray(CommonInfoCFConst.OP_SVC_KEI_INFO)` // Get optional service array |
| 4 | CALL | `JFUWebCommon.setPrcInfoArea(bean, outputMap, SC_TITLE_FUSV006002, CC_TITLE_FUSV006001, JFUScreenConst.SCREEN_ID_FUW02601)` // Set price info area |

**Block 2.1** — [WHILE] Inner Loop over Optional Services (L153)

> Iterates through optional services within each service detail work record.

| # | Type | Code |
|---|------|------|
| 1 | LOOP | `for (int n = 0; n < opSvcKeiInfoArray.getCount(); n++)` // Inner loop over optional services |
| 2 | SET | `tmpOpSvcKeiInfoBean = opSvcKeiInfoArray.getDataBean(n)` // Get optional service bean |
| 3 | SET | `tmpopSvcKeiInfoOpSvcCd = tmpOpSvcKeiInfoBean.sendMessageString(CommonInfoCFConst.OP_SVC_CD_28, X31CWebConst.DATABEAN_GET_VALUE)` // Get option service code |
| 4 | SET | `opSvcKeiStat = tmpOpSvcKeiInfoBean.sendMessageString(CommonInfoCFConst.OP_SVC_KEI_STAT_28, X31CWebConst.DATABEAN_GET_VALUE)` // Get option service status |

**Block 2.1.1** — [IF] Option Service = Mailing List AND Status Active (L160) `[JFUStrConst.CD00136_B003="B003"] [JFUStrConst.CD00037_910="910"] [JFUStrConst.CD00037_920="920"]`

> Checks if the option service code is "B003" (Mailing List) AND the service status is NOT "910" (Cancelled) and NOT "920" (Terminated). If both conditions are met, the subscription is counted.

| # | Type | Code |
|---|------|------|
| 1 | IF | `JFUStrConst.CD00136_B003.equals(tmpopSvcKeiInfoOpSvcCd)` // [CD00136_B003="B003"] Option service code is Mailing List |
| 2 | AND | `!(JFUStrConst.CD00037_910.equals(opSvcKeiStat) || JFUStrConst.CD00037_920.equals(opSvcKeiStat))` // [CD00037_910="910", CD00037_920="920"] Status NOT Cancelled and NOT Terminated |
| 3 | EXEC | `mailingListCnt++` // Increment ML subscription count |

**Block 3** — [SET] Prepare Service Invocation Parameters (L174)

> Creates the parameter map with the service ID, instantiates the mapping mapper, and configures the initial data map with service setup calls.

| # | Type | Code |
|---|------|------|
| 1 | SET | `paramMap = new HashMap<String, String>(16)` // Create parameter map [capacity=16] |
| 2 | EXEC | `paramMap.put(X31CWebConst.TELEGRAM_INFO_USECASE_ID, USECASE_ID_FUSV0060)` // [USECASE_ID_FUSV0060="FUSV0060"] Set service ID |
| 3 | SET | `mapper = new FUSV0060_FUSV0060OPDBMapper()` // Create DB mapper |
| 4 | SET | `dataMap = new HashMap<String, Object>()` // Create data map |
| 5 | SET | `paramBean = {bean, svcKeiInfoBean}` // Array of form beans for service calls |
| 6 | CALL | `dataMap = mapper.setFUSV006001SC(paramBean, dataMap, JPCModelConstant.FUNC_CD_2)` // [FUNC_CD_2=2] Set fee course + optional service (1) |
| 7 | CALL | `dataMap = mapper.setFUSV006002SC(paramBean, dataMap, JPCModelConstant.FUNC_CD_1)` // [FUNC_CD_1=1] Set price plan unit price (2) |
| 8 | CALL | `dataMap = mapper.setFUSV006001CC(paramBean, dataMap, null)` // Set initial fee list CC (3) |
| 9 | CALL | `dataMap = mapper.setFUSV006003SC(paramBean, dataMap, JPCModelConstant.FUNC_CD_1)` // Set business parameter mgmt (4) |
| 10 | CALL | `dataMap = mapper.setFUSV006004SC(paramBean, dataMap, JPCModelConstant.FUNC_CD_1)` // Set business parameter mgmt (5) |
| 11 | CALL | `dataMap = mapper.setFUSV006005SC(paramBean, dataMap, JPCModelConstant.FUNC_CD_1)` // Set NG word list front (6) |
| 12 | SET | `outputMap = new HashMap<String, Object>()` // Create output map |
| 13 | SET | `payFlg = false` // Initialize payment flag |

**Block 4** — [TRY-CATCH] Service Invocation and Result Processing (L194)

> Invokes the web service to retrieve pricing and service data, then processes the results. If a `JCCWebServiceException` occurs, it is caught and re-thrown as a business exception.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `invokeService(paramMap, dataMap, outputMap)` // Invoke web service |
| 2 | CALL | `bean = mapper.getFUSV006001SC(bean, outputMap, mailingListCnt)` // Get fee course result with mailing list count (7) |
| 3 | CALL | `bean = mapper.getFUSV006003SC(bean, outputMap)` // Get business parameter result (8) |
| 4 | CALL | `bean = mapper.getFUSV006004SC(bean, outputMap)` // Get business parameter result (9) |
| 5 | CALL | `bean = mapper.getFUSV006005SC(bean, outputMap)` // Get NG word result (10) |
| 6 | CALL | `bean = mapper.getFUSV006002SC(bean, outputMap)` // Get price plan result (11) |
| 7 | CALL | `payFlg = getPayFlg(bean)` // Determine payment flag |

**Block 4.1** — [IF] Free Subscription Case (No Payment Required) (L213) `[!payFlg]`

> If the subscription is free (payFlg is false), set the free pricing information map.

| # | Type | Code |
|---|------|------|
| 1 | IF | `!payFlg` // Free subscription case |
| 2 | EXEC | `JFUWebCommon.setFreePrcInfoMap(outputMap, SC_TITLE_FUSV006002)` // [SC_TITLE_FUSV006002="FUSV006002SC"] Set free price info |

**Block 4.2** — [EXEC] Set Price Info Area (L221)

> Sets the price information area on the bean for display, regardless of payment flag.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `JFUWebCommon.setPrcInfoArea(bean, outputMap, SC_TITLE_FUSV006002, CC_TITLE_FUSV006001, JFUScreenConst.SCREEN_ID_FUW02601)` // Set price info area |

**Block 4.3** — [CATCH] Service Exception Handler (L223) `[JCCWebServiceException]`

| # | Type | Code |
|---|------|------|
| 1 | CATCH | `catch (JCCWebServiceException se)` // Catch web service exception |
| 2 | EXEC | `throw new JCCBusinessException(JFUStrConst.ERROR_CODE_0002)` // [ERROR_CODE_0002] Re-throw as business exception |

**Block 5** — [SET] ML Subscription Count Check (L229)

> Checks whether the customer's remaining ML subscription capacity has been exhausted. The max permitted count is retrieved from the bean; if the current count meets or exceeds the max, an error is thrown.

| # | Type | Code |
|---|------|------|
| 1 | SET | `maxOpSvcCnt = bean.sendMessageLong(FUW02601SFConst.MLLIST_STKU_PSB_CNT, X31CWebConst.DATABEAN_GET_VALUE).longValue()` // Get max permitted ML count |
| 2 | IF | `maxOpSvcCnt <= mailingListCnt` // [ERROR_CODE_0102] Count exceeds max capacity |
| 3 | EXEC | `throw new JCCBusinessException(JFUStrConst.ERROR_CODE_0102)` // [ERROR_CODE_0102="0102"] Contract status error |

**Block 6** — [SET] Set Subscription Counts on Bean (L239)

> Sets the current ML subscription count and remaining count on the form bean for display.

| # | Type | Code |
|---|------|------|
| 1 | SET | `bean.sendMessageLong(FUW02601SFConst.NOW_MLLIST_STKU_CNT, X31CWebConst.DATABEAN_SET_VALUE, Long.valueOf(mailingListCnt))` // Set current count |
| 2 | SET | `bean.sendMessageLong(FUW02601SFConst.NOW_MLLIST_STKU_ZAN_CNT, X31CWebConst.DATABEAN_SET_VALUE, Long.valueOf(maxOpSvcCnt - mailingListCnt))` // Set remaining count |

**Block 7** — [WHILE] Iterate Publication Settings (L248)

> Builds the publication setting list by reading configuration items from an external config path, sorting them with a TreeMap, and adding each as a DataBean entry.

| # | Type | Code |
|---|------|------|
| 1 | SET | `kokaiSetListArray = bean.getDataBeanArray(FUW02601SFConst.KOKAI_SET_LIST)` // Get publication setting list array |
| 2 | SET | `dispDefinitionMap = JFUWebCommon.getDispItemsAsMap(QUERY_KOUKAI_SETTEI_PATH, QUERY_ATTR_NAME)` // Get display items as map from config |
| 3 | SET | `treeMapObj = new TreeMap<String, String>()` // Create sorted map |
| 4 | EXEC | `treeMapObj.putAll(dispDefinitionMap)` // Add all items to sorted map |
| 5 | SET | `setObj = treeMapObj.keySet()` // Get keys |
| 6 | SET | `it = setObj.iterator()` // Create iterator |
| 7 | SET | `cnt = 0` // Initialize counter |
| 8 | LOOP | `while (it.hasNext())` // Iterate through sorted publication settings |
| 9 | SET | `kokaiSetValue = it.next()` // Get next setting value |
| 10 | SET | `kokaiSetMei = dispDefinitionMap.get(kokaiSetValue)` // Get display name for value |
| 11 | EXEC | `kokaiSetListArray.addDataBean()` // Add new bean entry |
| 12 | SET | `kokaiSetBean = kokaiSetListArray.getDataBean(cnt)` // Get the new bean |
| 13 | EXEC | `kokaiSetBean.sendMessageString(FUW02601SFConst.KOKAI_SET_MEI_01, X31CWebConst.DATABEAN_SET_VALUE, kokaiSetMei)` // Set display name |
| 14 | EXEC | `kokaiSetBean.sendMessageString(FUW02601SFConst.KOKAI_SET_VALUE_01, X31CWebConst.DATABEAN_SET_VALUE, kokaiSetValue)` // Set value |
| 15 | EXEC | `cnt++` // Increment counter |

**Block 8** — [SET] Initialize Display Values (L269)

> Sets default display values for the initial screen rendering.

| # | Type | Code |
|---|------|------|
| 1 | SET | `bean.sendMessageBoolean(FUW02601SFConst.KEIYAKU_YAKKAN_DOI, X31CWebConst.DATABEAN_SET_VALUE, false)` // [KEIYAKU_YAKKAN_DOI="契約約款の同意"] Set contract agreement flag to false (unchecked) |
| 2 | SET | `bean.sendMessageBoolean(FUW02601SFConst.MANSION_DIV, X31CWebConst.DATABEAN_SET_VALUE, getMansionDiv(commoninfoBean, bean, outputMap))` // [MANSION_DIV="マンション区分"] Set mansion division flag from helper method |
| 3 | SET | `bean.sendMessageBoolean(FUW02601SFConst.PAY_FLG, X31CWebConst.DATABEAN_SET_VALUE, payFlg)` // [PAY_FLG="有料フラグ"] Set payment flag |

**Block 9** — [SET] Set Display Metadata (L280)

> Configures the current date display and navigation metadata for the screen.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `JFUWebCommon.setPrcDspNowDay(this)` // Set current date for price table display |
| 2 | EXEC | `commoninfoBean.sendMessageString(CommonInfoCFConst.NEXT_SCREEN_NAME, X31CWebConst.DATABEAN_SET_VALUE, JFUScreenConst.SCREEN_NAME_FUW02601)` // [SCREEN_NAME_FUW02601="メーリングリスト追加申込"] Set next screen name |
| 3 | EXEC | `commoninfoBean.sendMessageString(CommonInfoCFConst.NEXT_SCREEN_ID, X31CWebConst.DATABEAN_SET_VALUE, JFUWebCommon.getScreenId(this))` // [SCREEN_ID_FUW02601="FUW02601"] Set next screen ID |
| 4 | RETURN | `return true` // [true: 正常終了] Return normal completion |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|-----------------|
| `mailingListCnt` | Field | ML subscription count — running counter of active ML subscriptions for the current customer |
| `maxOpSvcCnt` | Field | Maximum optional service count — maximum permitted ML subscriptions for this customer |
| `payFlg` | Field | Payment flag — boolean indicating whether the ML subscription is a paid (有料) service |
| `opSvcKeiStat` | Field | Option service contract status — current status code of an optional service subscription |
| `tmpopSvcKeiInfoOpSvcCd` | Field | Temporary option service code — the service type code extracted from an optional service record |
| `kokaiSetValue` | Field | Publication setting value — internal value for a publication setting option |
| `kokaiSetMei` | Field | Publication setting name — display label for a publication setting option |
| `GEN_CUST_KEI_INFO` | Constant | Current customer contract — shared form bean key for customer contract information |
| `SVC_KEI_INFO` | Constant | Service contract — shared form bean key for service contract details |
| `SVC_KEI_UCWK_INFO` | Constant | Service detail work information — shared form bean key for service work records |
| `OP_SVC_KEI_INFO` | Constant | Optional service contract information — nested bean array for optional services within a service detail record |
| `WEB_CHG_INFO` | Constant | WEB change information — shared form bean key for WEB-based change records |
| `KEIYAKU_YAKKAN_DOI` | Constant | Contract agreement (契約約款の同意) — checkbox flag for accepting contract terms and conditions |
| `MANSION_DIV` | Constant | Mansion division (マンション区分) — flag indicating if the customer is in a mansion-type housing |
| `PAY_FLG` | Constant | Payment flag (有料フラグ) — boolean indicating paid service status |
| `KOKAI_SET_LIST` | Constant | Publication setting list (公開設定リスト) — DataBean array for publication setting options |
| `NOW_MLLIST_STKU_CNT` | Constant | Current ML subscription count (現在のメーリングリスト取得数) — bean field storing current subscription count |
| `NOW_MLLIST_STKU_ZAN_CNT` | Constant | Remaining ML subscription count (現在のメーリングリスト取得可能残り) — bean field for remaining available count |
| `MLLIST_STKU_PSB_CNT` | Constant | Max ML subscription possible count (メーリングリスト取得可能数) —bean field for maximum permitted count |
| `CD00136_B003` | Constant | `"B003"` — Option service code identifier for Mailing List (メーリングリスト) |
| `CD00037_910` | Constant | `"910"` — Service status code meaning "Cancelled" (解約済み) |
| `CD00037_920` | Constant | `"920"` — Service status code meaning "Terminated" (キャンセル済み) |
| ERROR_CODE_0002 | Constant | Business error code — thrown when web service invocation fails |
| ERROR_CODE_0102 | Constant | `"0102"` — Contract status error — thrown when ML subscription count exceeds the permitted maximum |
| FUSV0060 | Constant | Service ID for Mailing List Additional Subscription screen |
| EKK0811A010SC | SC Code | Fee Course + Optional Service One-Time Reference (料金コース・オプションサービス一意照会) |
| EZM0321A010SC | SC Code | Business Parameter Management One-Time Reference (業務パラメータ管理一意照会) |
| EZM0161B020SC | SC Code | NG Word List Front Reference (NGワード一覧照会 フロント) |
| FUNC_CD_1 | Constant | `"1"` — Function code parameter for standard reference operations |
| FUNC_CD_2 | Constant | `"2"` — Function code parameter for fee course optional service operations |
| SCREEN_ID_FUW02601 | Constant | `"FUW02601"` — Screen identifier for Mailing List Additional Subscription |
| SCREEN_NAME_FUW02601 | Constant | `"メーリングリスト追加申込"` — Screen name for Mailing List Additional Subscription |
| ML | Abbreviation | Mailing List — email distribution list service offered to customers |
| SC | Abbreviation | Service Component — service layer component that handles data access and business operations |
| CC | Abbreviation | Common Component — shared/common service component for reusable functionality |
| CBS | Abbreviation | Common Business Service — shared business service layer component |
| NG Word | Business term | Blocked keyword — a word or phrase that is not permitted in subscription-related input fields |
| OP_SVC_CD_28 | Constant | Option service code field key (value "28") in the optional service DataBean |
| OP_SVC_KEI_STAT_28 | Constant | Option service contract status field key (value "28") in the optional service DataBean |
| DataBean | Technical term | A structured data container in the X31 framework that holds screen field values and supports message-based access |
| DataBeanArray | Technical term | A collection wrapper for DataBean instances, providing indexed access and count operations |
| invokeService | Method | Framework method that dispatches service calls to the web service mapping layer |
| FUSV0060_FUSV0060OPDBMapper | Component | DataBean-to-BP (Business Procedure) mapping class for ML subscription screen |
| 解約済み | Japanese term | Cancelled — service status indicating the contract has been formally cancelled |
| キャンセル済み | Japanese term | Terminated — service status indicating the subscription has been cancelled |
| 有料 | Japanese term | Paid/Chargeable — indicates a service that requires payment |
| 契約約款の同意 | Japanese term | Agreement to contract terms and conditions — customer consent checkbox for the subscription agreement |
| 公開設定 | Japanese term | Publication settings — configuration options controlling the visibility/display of service information |
| 業務パラメータ管理 | Japanese term | Business parameter management — system parameter configuration data |
| 料金コース | Japanese term | Fee course — pricing tier or package selection for the subscription |
| オプションサービス | Japanese term | Optional service — add-on services beyond the base subscription (e.g., ML) |
| 契約情報 | Japanese term | Contract information — customer's service contract records |
| 変更情報 | Japanese term | Change information — records of previous changes to the service |
