# Business Logic — FUW02601SFLogic.cfmMskmSyori() [110 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.FUW02601SF.FUW02601SFLogic` |
| Layer | Service (Web Service Logic) |
| Module | `FUW02601SF` (Package: `eo.web.webview.FUW02601SF`) |

## 1. Role

### FUW02601SFLogic.cfmMskmSyori()

This method is the central processing hub for the "Messaging List Addition Application" screen (FUW02601), handling both confirmation button (確認ボタン) and submit button (申込ボタン) operations. The screen belongs to the broadband messaging list addition application domain — a service where customers register or update their preferred messaging lists (sub-domain names for ISP email services).

The method implements a **delegation and dispatch pattern**: it extracts nested contract information from a shared form bean tree, prepares a parameter map pointing to the `FUSV0061` use case, and then delegates the heavy lifting to a chain of 10 `FUSV0061_FUSV0061OPDBMapper` service component methods (SCs), which collectively handle application content acceptance registration, option service contract (ISP) registration and inquiry, email target registration, progress registration, and post-processing inquiry. It then invokes the overarching FUSV0061 service via `invokeService()`, passing the aggregated data map as input and capturing the output map for subsequent processing.

The method's role in the larger system is as a **shared controller logic entry point** — it is called by both `cfm()` (confirmation mode, `isTarget = "cfm"`) and `mskm()` (submit mode, `isTarget = "mskm"`), routing each through the same data preparation pipeline but with different `functionCode` values (`"1"` for confirm, `"2"` for submit) that instruct downstream SCs whether to return data for display or to perform actual database registration.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["cfmMskmSyori isTarget commoninfoBean"])
    STEP1["Retrieve current customer contract info"]
    STEP2["Extract webChgInfoBean genCustKeiInfoArray"]
    STEP3["Loop genCustKeiInfoArray by i"]
    STEP4["Loop svcKeiInfoArray by j"]
    STEP5["Loop seikyKeiInfoArray by k"]
    STEP6["Assign seikyKeiInfoBean last iteration"]
    STEP7["Get service form bean"]
    STEP8["Set selected publication setting display name"]
    STEP9["Create paramMap with USECASE_ID_FUSV0061"]
    STEP10["Create FUSV0061_FUSV0061OPDBMapper"]
    STEP11["Create paramBean array and dataMap"]
    STEP12["Determine functionCode from isTarget"]
    COND{isTarget equals cfm?}
    FUNC1["functionCode equals 1 Confirm"]
    FUNC2["functionCode equals 2 Submit"]
    STEP13["setFUSV006101SC Application content acceptance registration"]
    STEP14["setFUSV006102SC Option service contract ISP registration"]
    STEP15["setFUSV006108SC Option service contract ISP inquiry"]
    STEP16["setFUSV006103SC Option service contract ISP termination"]
    STEP17["setFUSV006104SC Option service contract ISP start"]
    STEP18["setFUSV006105SC Email target registration"]
    STEP19["setFUSV006106SC Progress registration"]
    STEP20["setFUSV006107SC Application detail review and post processing"]
    STEP21["setFUSV006101CC Service IF result data transfer CC"]
    STEP22["setFUSV006102CC Order issuance condition registration CC"]
    STEP23["Create outputMap for search results"]
    STEP24["Set service contract status"]
    STEP25["Invoke service"]
    STEP26["Handle JCCWebServiceException"]
    STEP27["checkException se isTarget"]
    END_NODE(["Return"])

    START --> STEP1 --> STEP2 --> STEP3 --> STEP4 --> STEP5 --> STEP6
    STEP6 --> STEP7 --> STEP8 --> STEP9 --> STEP10 --> STEP11 --> STEP12
    STEP12 --> COND
    COND -->|Yes| FUNC1
    COND -->|No| FUNC2
    FUNC1 --> STEP13
    FUNC2 --> STEP13
    STEP13 --> STEP14 --> STEP15 --> STEP16 --> STEP17 --> STEP18 --> STEP19 --> STEP20 --> STEP21 --> STEP22 --> STEP23 --> STEP24 --> STEP25 --> STEP26 --> STEP27 --> END_NODE
```

**Processing Steps:**

1. **Retrieve and traverse customer contract info**: Extracts the nested bean tree from `commoninfoBean` — going from WEB_CHG_INFO -> GEN_CUST_KEI_INFO -> SVC_KEI_INFO -> SEIKY_KEI_INFO — keeping only the last (most recently updated) `seikyKeiInfoBean` across all iterations. This bean contains settlement/billing contract line item data.

2. **Prepare publication setting matching**: Retrieves the "selected publication setting (display name)" from the service form bean, then iterates through the publication setting list (KOKAI_SET_LIST) to find the entry matching the user's selection. When a match is found, the corresponding display name (KOKAI_SET_MEI) is stored in the form bean as CHOICE_KOKAI_SET_MEI.

3. **Set up service invocation context**: Creates a HashMap `paramMap` with `TELEGRAM_INFO_USECASE_ID = "FUSV0061"`, instantiates `FUSV0061_FUSV0061OPDBMapper`, and prepares a `paramBean` array containing the form bean, customer info bean, service info bean, and settlement info bean.

4. **Determine function code**: Branches on `isTarget` — if `CHEK_CFM.equals("cfm")`, sets `functionCode = JPCModelConstant.FUNC_CD_2` (value "2", submit mode); otherwise sets `functionCode = JPCModelConstant.FUNC_CD_1` (value "1", confirm mode).

5. **Execute 10 sequential SC operations**: Calls mapper methods in order: `setFUSV006101SC` (application content acceptance registration), `setFUSV006102SC` (option service contract ISP registration), `setFUSV006108SC` (option service contract ISP inquiry — returns updated dataMap), `setFUSV006103SC` (option service contract ISP termination), `setFUSV006104SC` (option service contract ISP start), `setFUSV006105SC` (email target registration), `setFUSV006106SC` (progress registration), `setFUSV006107SC` (application detail review and post processing), `setFUSV006101CC` (service IF result data transfer CC), `setFUSV006102CC` (order issuance condition registration CC).

6. **Set service contract status and invoke service**: Calls `JFUWebCommon.setSvcKeiStat()` to set the service contract status from the processed data, then invokes the overarching FUSV0061 service via `invokeService(paramMap, dataMap, outputMap)`.

7. **Exception handling**: If a `JCCWebServiceException` is thrown, delegates to `checkException(se, isTarget)` for exception processing and display routing.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `isTarget` | `String` | Button type indicator — determines whether the operation is a confirmation preview (`"cfm"`) or an actual submit (`"mskm"`). When `isTarget = "cfm"`, `functionCode = "2"` (submit mode); otherwise `functionCode = "1"` (confirm mode). This inversion is used by downstream SCs to decide whether to perform write operations or read-only data retrieval. |
| 2 | `commoninfoBean` | `X31SDataBeanAccess` | Shared form data bean containing the complete customer contract information tree. It holds the WEB_CHG_INFO array, which contains GEN_CUST_KEI_INFO (current customer contract details), which in turn contains SVC_KEI_INFO (service contract line items), which contain SEIKY_KEI_INFO (settlement/billing contract line items). The method traverses this tree to isolate the latest settlement bean. |

**Instance fields and external state read:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `USECASE_ID_FUSV0061` | `String` | Constant `"FUSV0061"` — identifies the messaging list addition application use case for service invocation routing. |
| `CHEK_CFM` | `String` | Constant `"cfm"` — value used to distinguish confirmation button processing from submit button processing. |
| `this` | `FUW02601SFLogic` | The enclosing class instance, passed to `setFUSV006101CC` for callback context. |
| `super.getServiceFormBean()` | `X31SDataBeanAccess` | Protected method inherited from parent class — returns the service form bean containing screen input data and publication settings. |
| `super.invokeService()` | — | Protected method inherited from parent class — invokes the FUSV0061 CBS service. |
| `super.checkException()` | — | Protected method inherited from parent class — accessible as `checkException()` — processes web service exceptions and routes error displays. |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `FUSV0061_FUSV0061OPDBMapper.setFUSV006101SC` | FUSV006101SC | Application content acceptance registration data | Reads customer and service contract information to prepare application content acceptance (申込内容承諾) for registration processing (EKK0011D020) |
| C | `FUSV0061_FUSV0061OPDBMapper.setFUSV006102SC` | FUSV006102SC | Option service contract (ISP) table | Registers option service contract <ISP> (オプションサービス契約<ISP>) — EKK0361D010 |
| R | `FUSV0061_FUSV0061OPDBMapper.setFUSV006108SC` | FUSV006108SC | Option service contract (ISP) table | Inquiries option service contract <ISP> data and returns updated dataMap — EKK0361C0XX inquiry |
| U | `FUSV0061_FUSV0061OPDBMapper.setFUSV006103SC` | FUSV006103SC | Option service contract (ISP) table | Terminates option service contract <ISP> — EKK0361C030 |
| C | `FUSV0061_FUSV0061OPDBMapper.setFUSV006104SC` | FUSV006104SC | Option service contract (ISP) table | Starts option service contract <ISP> — EKK0361C040 |
| C | `FUSV0061_FUSV0061OPDBMapper.setFUSV006105SC` | FUSV006105SC | Email target registration table | Registers email target (エイリアン登録) — EZM0111D010 |
| C | `FUSV0061_FUSV0061OPDBMapper.setFUSV006106SC` | FUSV006106SC | Progress registration table | Registers progress (進捗登録) — EKK1091D010 |
| R | `FUSV0061_FUSV0061OPDBMapper.setFUSV006107SC` | FUSV006107SC | Application detail review data | Performs application detail review and post-processing delegation — EKK0021C060 |
| R | `FUSV0061_FUSV0061OPDBMapper.setFUSV006101CC` | FUSV006101CC | - | Transfers service IF result data to form bean CC |
| C | `FUSV0061_FUSV0061OPDBMapper.setFUSV006102CC` | FUSV006102CC | Order issuance condition table | Registers order issuance conditions (オーダー発行条件登録) |
| R | `OneStopDataBeanAccess.getCount` | - | - | Counts items in data bean array (used in traversal of genCustKeiInfoArray, svcKeiInfoArray, seikyKeiInfoArray) |
| R | `OneStopDataBeanAccessArray.getDataBean` | - | - | Retrieves individual data bean at given index from array |
| R | `OneStopDataBeanAccess.getDataBeanArray` | - | - | Retrieves nested data bean array by key |
| R | `OneStopDataBeanAccess.sendMessageString` | - | - | Gets/sets string value in data bean |
| - | `JFUWebCommon.setSvcKeiStat` | - | - | Sets service contract status field in output data |
| - | `invokeService` | FUSV0061 | - | Invokes the FUSV0061 CBS service (Messaging List Addition Application) |
| - | `checkException` | - | - | Processes JCCWebServiceException for display routing |

## 5. Dependency Trace

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

No screen/batch entry points found within 8 hops. Direct callers found: 2 methods.

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | `FUW02601SFLogic.cfm()` | `cfm()` -> `cfmMskmSyori(CHEK_CFM, commoninfoBean)` | `setSvcKeiStat`, `invokeService` (FUSV0061), `checkException` |
| 2 | `FUW02601SFLogic.mskm()` | `mskm()` -> `cfmMskmSyori(CHEK_MSKM, commoninfoBean)` | `setSvcKeiStat`, `invokeService` (FUSV0061), `checkException` |

**Call chain details:**

- **cfm()** (confirmation): Called by screen FUW02601 when the user clicks the confirmation button. Passes `CHEK_CFM = "cfm"`, which sets `functionCode = "2"`. This triggers confirm-mode processing through the 10 SC methods.

- **mskm()** (submit): Called by screen FUW02601 when the user clicks the submit button. Passes `CHEK_MSKM = "mskm"`, which sets `functionCode = "1"`. This triggers actual submit-mode processing through the 10 SC methods.

**Terminal operations from this method:** `checkException`, `invokeService` (×1), `setSvcKeiStat` (×3 via JFUWebCommon), `setFUSV006101SC`, `setFUSV006102SC`, `setFUSV006108SC`, `setFUSV006103SC`, `setFUSV006104SC`, `setFUSV006105SC`, `setFUSV006106SC`, `setFUSV006107SC`, `setFUSV006101CC`, `setFUSV006102CC`, `sendMessageString`, `getCount`, `getDataBean`, `getDataBeanArray`

## 6. Per-Branch Detail Blocks

**Block 1** — [ASSIGN] (L468)

> Retrieves current customer contract information from the shared form bean by traversing the nested bean tree. Only the last-seated `seikyKeiInfoBean` (settlement contract) is retained.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `webChgInfoBeanArray = commoninfoBean.getDataBeanArray(WEB_CHG_INFO)` [-> `WEB_CHG_INFO = "WEB変更情報"`] // Get WEB change info array |
| 2 | CALL | `webChgInfoBean = webChgInfoBeanArray.getDataBean(0)` |
| 3 | CALL | `genCustKeiInfoArray = webChgInfoBean.getDataBeanArray(GEN_CUST_KEI_INFO)` [-> `GEN_CUST_KEI_INFO = "現顧客契約情報"`] // Get current customer contract info |
| 4 | SET | `genCustKeiInfoBean = null` |
| 5 | SET | `svcKeiInfoBean = null` |
| 6 | SET | `seikyKeiInfoBean = null` |
| 7 | FOR | `for (int i = 0; i < genCustKeiInfoArray.getCount(); i++)` |
| 8 | SET | `genCustKeiInfoBean = genCustKeiInfoArray.getDataBean(i)` |
| 9 | FOR | `for (int j = 0; j < svcKeiInfoArray.getCount(); j++)` |
| 10 | SET | `svcKeiInfoBean = svcKeiInfoArray.getDataBean(j)` |
| 11 | FOR | `for (int k = 0; k < seikyKeiInfoArray.getCount(); k++)` |
| 12 | SET | `seikyKeiInfoBean = seikyKeiInfoArray.getDataBean(k)` // Retains last value |

**Block 2** — [ASSIGN] (L486)

> Gets the service form bean and sets the selected publication setting (display name) by matching the selected publication value against each item in the publication setting list.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `bean = super.getServiceFormBean()` // Get service form bean |
| 2 | SET | `choiceKokaiSetValue = bean.sendMessageString(CHOICE_KOKAI_SET_VALUE, DATABEAN_GET_VALUE)` [-> `CHOICE_KOKAI_SET_VALUE = "選択された公開設定(値)"`] // Get selected publication setting value |
| 3 | CALL | `subBeanArray = bean.getDataBeanArray(KOKAI_SET_LIST)` [-> `KOKAI_SET_LIST = "公開設定リスト"`] // Get publication setting list |
| 4 | FOR | `for (int i = 0; i < subBeanArray.getCount(); i++)` |
| 5 | SET | `subBean = subBeanArray.getDataBean(i)` |
| 6 | SET | `kokaiSetMei = subBean.sendMessageString(KOKAI_SET_MEI_01, DATABEAN_GET_VALUE)` [-> `KOKAI_SET_MEI_01 = "公開設定(表示名)"`] |
| 7 | SET | `kokaiSetValue = subBean.sendMessageString(KOKAI_SET_VALUE_01, DATABEAN_GET_VALUE)` [-> `KOKAI_SET_VALUE_01 = "公開設定(値)"`] |

**Block 2.1** — [IF] `kokaiSetValue.equals(choiceKokaiSetValue)` (L493)

> When the publication setting value matches the user's selection, store the corresponding display name back to the form bean.

| # | Type | Code |
|---|------|------|
| 1 | SET | `bean.sendMessageString(CHOICE_KOKAI_SET_MEI, DATABEAN_SET_VALUE, kokaiSetMei)` [-> `CHOICE_KOKAI_SET_MEI = "選択された公開設定(表示名)"`] |

**Block 3** — [ASSIGN] (L498)

> Creates the service invocation parameter map and mapper instance. Sets up the use case ID and parameter bean array for the FUSV0061 service.

| # | Type | Code |
|---|------|------|
| 1 | SET | `paramMap = new HashMap<String, String>(16)` |
| 2 | SET | `paramMap.put(TELEGRAM_INFO_USECASE_ID, USECASE_ID_FUSV0061)` [-> `USECASE_ID_FUSV0061 = "FUSV0061"`] // Messaging list addition application use case |
| 3 | SET | `mapper = new FUSV0061_FUSV0061OPDBMapper()` |
| 4 | SET | `dataMap = new HashMap<String, Object>()` |
| 5 | SET | `paramBean = { bean, genCustKeiInfoBean, svcKeiInfoBean, seikyKeiInfoBean }` |
| 6 | SET | `functionCode = null` |

**Block 4** — [IF/ELSE] `CHEK_CFM.equals(isTarget)` [CHEK_CFM="cfm"] (L507)

> Determines the function code based on which button was pressed. Note: `"cfm"` (confirm) sets functionCode to `"2"`, while `"mskm"` (submit) sets it to `"1"` — an inversion used by downstream SCs to toggle between confirm display and actual write operations.

| # | Type | Code |
|---|------|------|
| 1 | IF | `CHEK_CFM.equals(isTarget)` [CHEK_CFM = "cfm"] |
| 2 | SET | `functionCode = JPCModelConstant.FUNC_CD_2` [-> FUNC_CD_2 = "2"] // Confirm mode |
| 3 | ELSE | |
| 4 | SET | `functionCode = JPCModelConstant.FUNC_CD_1` [-> FUNC_CD_1 = "1"] // Submit mode |

**Block 5** — [EXEC × 10] (L513-L527)

> Executes 10 sequential SC (Service Component) operations via the FUSV0061 mapper. These handle the full registration pipeline: application content acceptance, option service contract (ISP) registration and inquiry, termination, start, email target registration, progress registration, and post-processing inquiry. Then executes 2 CC (Common Component) operations for data transfer.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `mapper.setFUSV006101SC(paramBean, dataMap, functionCode)` // 申込内容承諾登録 (Application content acceptance registration) EKK0011D020 |
| 2 | CALL | `mapper.setFUSV006102SC(paramBean, dataMap, functionCode)` // オプションサービス契約<ISP>登録 EKK0361D010 |
| 3 | SET | `dataMap = mapper.setFUSV006108SC(paramBean, dataMap, functionCode)` // オプションサービス契約<ISP>照会 — returns updated dataMap |
| 4 | CALL | `mapper.setFUSV006103SC(paramBean, dataMap, functionCode)` // オプションサービス契約<ISP>照会 SC EKK0361C030 |
| 5 | CALL | `mapper.setFUSV006104SC(paramBean, dataMap, functionCode)` // オプションサービス契約<ISP>開始 EKK0361C040 |
| 6 | CALL | `mapper.setFUSV006105SC(paramBean, dataMap, functionCode)` // エイリアン登録 EZM0111D010 |
| 7 | CALL | `mapper.setFUSV006106SC(paramBean, dataMap, functionCode)` // 進捗登録 EKK1091D010 |
| 8 | CALL | `mapper.setFUSV006107SC(paramBean, dataMap, functionCode)` // 申請詳細照会・後続業務依頼 EKK0021C060 |
| 9 | CALL | `mapper.setFUSV006101CC(paramBean, dataMap, this)` // サービスIF結果データ移行CC |
| 10 | CALL | `mapper.setFUSV006102CC(paramBean, dataMap, functionCode)` // オーダー発行条件登録CC |

**Block 6** — [ASSIGN] (L530)

> Prepares the output map for search results and sets the service contract status before invoking the service.

| # | Type | Code |
|---|------|------|
| 1 | SET | `outputMap = new HashMap<Object, Object>()` |
| 2 | CALL | `JFUWebCommon.setSvcKeiStat(this, dataMap)` |

**Block 7** — [TRY-CATCH] (L535)

> Invokes the FUSV0061 CBS service and handles web service exceptions.

| # | Type | Code |
|---|------|------|
| 1 | TRY | |
| 2 | CALL | `invokeService(paramMap, dataMap, outputMap)` |
| 3 | CATCH | `catch (JCCWebServiceException se)` |
| 4 | CALL | `checkException(se, isTarget)` |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `isTarget` | Parameter | Button operation indicator — `"cfm"` for confirmation (確認), `"mskm"` for submit (申込) |
| `commoninfoBean` | Parameter | Shared form data bean containing the complete customer contract information tree |
| `functionCode` | Field | SC dispatch code — `"1"` for confirm mode (read/display), `"2"` for submit mode (write/register) |
| `CHEK_CFM` | Constant | Value `"cfm"` — identifies confirmation button processing |
| `CHEK_MSKM` | Constant | Value `"mskm"` — identifies submit button processing |
| `USECASE_ID_FUSV0061` | Constant | `"FUSV0061"` — messaging list addition application use case identifier |
| `WEB_CHG_INFO` | Constant | `"WEB変更情報"` — WEB change information, top-level container for WEB contract changes |
| `GEN_CUST_KEI_INFO` | Constant | `"現顧客契約情報"` — current customer contract information |
| `SVC_KEI_INFO` | Constant | `"サービス契約情報"` — service contract line item information |
| `SEIKY_KEI_INFO` | Constant | `"精算契約情報"` — settlement/billing contract line item information |
| `KOKAI_SET_LIST` | Constant | `"公開設定リスト"` — publication setting list (list of available publication configurations) |
| `CHOICE_KOKAI_SET_VALUE` | Constant | `"選択された公開設定(値)"` — the publication setting value selected by the user on screen |
| `CHOICE_KOKAI_SET_MEI` | Constant | `"選択された公開設定(表示名)"` — the display name for the user's selected publication setting |
| `KOKAI_SET_MEI_01` | Constant | `"公開設定(表示名)"` — publication setting display name field in the publication setting list |
| `KOKAI_SET_VALUE_01` | Constant | `"公開設定(値)"` — publication setting value field in the publication setting list |
| `FUNC_CD_1` | Constant | `"1"` — confirm/function code 1 (typically display/read operations in downstream SCs) |
| `FUNC_CD_2` | Constant | `"2"` — submit/function code 2 (typically write/registration operations in downstream SCs) |
| `FUSV0061` | Use case | Messaging List Addition Application — the CBS use case for registering/updating messaging lists for ISP email services |
| Messaging List | Business term | A list of sub-domain names for ISP email services that a customer can use; displayed and selected on the FUW02601 screen |
| Publication Setting | Business term | A configurable set of publication/display options for messaging lists, each with a display name and a matching value |
| Application Content Acceptance | Business term | The process of registering acceptance of application content details (申込内容承諾) — part of the subscription registration flow |
| Option Service Contract <ISP> | Business term | Option service contract for ISP services — manages ISP-related service subscriptions including registration, inquiry, termination, and start operations |
| Email Target Registration | Business term | Registration of email alias targets (エイリアン登録) — EZM0111D010 |
| Progress Registration | Business term | Registration of application progress status (進捗登録) — tracks where an application is in the processing pipeline |
| Application Detail Review | Business term | Post-application detail review and delegation to subsequent processes (申請詳細照会・後続業務依頼) |
| Order Issuance Condition | Business term | Conditions for generating orders (オーダー発行条件登録) — determines order generation parameters |
| FUSV0061_FUSV0061OPDBMapper | Component | Object-Relational mapping mapper for FUSV0061 — delegates to SCs (Service Components) and CCs (Common Components) for data operations |
| JFUWebCommon.setSvcKeiStat | Utility | Sets the service contract status field in the output data map |
| JCCWebServiceException | Exception | Web service exception thrown by the CBS service invocation layer |
| SC (Service Component) | Technical term | Service Component — a layer that handles business logic and data access operations (SC Code pattern: `EKK\d{4}[A-Z]\d{3}`) |
| CC (Common Component) | Technical term | Common Component — a shared utility component for cross-cutting operations like data transfer and condition registration |
