---

# Business Logic — FUW02101SFLogic.getCommoninfoBeanInfo() [119 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.FUW02101SF.FUW02101SFLogic` |
| Layer | Service (Frontend Logic / SF layer) |
| Module | `FUW02101SF` (Package: `eo.web.webview.FUW02101SF`) |

## 1. Role

### FUW02101SFLogic.getCommoninfoBeanInfo()

This method extracts, resolves, and assembles the shared form bean information required by the FUW02101SF screen (a customer/servic contract inquiry or modification screen in the K-Opticom web front-end system). It receives a root `X31SDataBeanAccess` containing a nested hierarchy of contract and customer data, then drills down through the bean tree to collect individual sub-beans: SSO (Single Sign-On) identity info, current customer contract, service contract, service contract detail, billing contract, option service contract, and sub-option service contract.

The core business operation of this method is **option service contract resolution**: it iterates through the option service contract array to locate the single active option contract tied to the current SSO session (matching POPID) and, if the service type is Mail (CD00136_B001 = "B001"). Among those matching, it prefers status "100: In Service" (CD00037_100), falling back to "020: Paused" (CD00037_020) and "030: Suspended" (CD00037_030). If an active option contract is found, it further resolves the sub-option service contract, specifically targeting capacity add-on work (CD00137_D02 = "D02") while filtering out terminated (CD00037_910) and cancelled (CD00037_920) sub-options.

This method follows a **builder/traversal pattern**: it navigates a nested data-bean structure, resolves the appropriate option and sub-option contracts via conditional iteration, and packages all resolved beans into a single flat `Map<String, Object>` for downstream screen logic. It acts as a shared utility called by the screen's cfm (confirmation), init (initialization), and mskm (masking) methods, meaning every screen entry path for FUW02101SF depends on this bean info extraction.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["getCommoninfoBeanInfo(commoninfoBean)"])
    START --> INIT["Initialize resultMap (HashMap)"]
    INIT --> WEBCHG["Extract WEB Chg Info Bean from commoninfoBean"]
    WEBCHG --> SSOINFO["Extract SSO Info Bean from WEB Chg Info"]
    SSOINFO --> SSOID["Get SSO SYSID and POPID from SSO Info Bean"]
    SSOID --> GENCUST["Extract Current Customer Contract Info Bean"]
    GENCUST --> SVCINFO["Extract Service Contract Info Bean from Customer Contract Info"]
    SVCINFO --> SVCUCWK["Extract Service Contract Detail Info Bean"]
    SVCUCWK --> SEIKY["Extract Billing Contract Info Bean from Service Contract Info"]
    SEIKY --> OPINIT["Initialize opSvcKeiInfoBean = null"]
    OPINIT --> OPARR["Get Option Service Contract Info Array"]
    OPARR --> FORLOOP1["Loop: iterate through Option Service Contract Info Array"]
    FORLOOP1 --> OPOPID["Extract POPID from current Option Bean"]
    OPOPID --> OPSVCD["Extract Option Service Code"]
    OPSVCD --> OPSTAT["Extract Option Service Contract Status"]
    OPSTAT --> OPCOND{"Option Status is 020/030/100?
CD00037_020=020, CD00037_030=030, CD00037_100=100"}
    OPCOND --> |Yes| INNERCOND{"Status=100 AND POPID matches SSO POPID AND Service Code=B001?"}
    OPCOND --> |No| FORCONT1["continue (skip this iteration)"]
    INNERCOND --> |Yes| OPCONFIRM["Confirm opSvcKeiInfoBean = current Option Bean"]
    INNERCOND --> |No| FORCONT1
    OPCONFIRM --> INITSBOP["Initialize sbopSvcKeiInfoBean = null"]
    FORCONT1 --> OPNULL{"opSvcKeiInfoBean != null?"}
    OPNULL --> |No| MAPSET["Set all beans into resultMap"]
    OPNULL --> |Yes| OPNO["Get Option Service Contract No"]
    OPNO --> OPNOCHK{"Option Service Contract No is null?"}
    OPNOCHK --> |Yes| THROW["Throw JCCBusinessException (System Error: No Option Contract No)"]
    OPNOCHK --> |No| SBOPARR["Get Sub-Option Service Contract Info Array from first Option Bean"]
    SBOPARR --> FORLOOP2["Loop: iterate through Sub-Option Service Contract Info Array"]
    FORLOOP2 --> SUBNO["Extract Sub-Option Service Contract No"]
    SUBNO --> SUBSTAT["Extract Sub-Option Service Contract Status"]
    SUBSTAT --> SUBSVCD["Extract Sub-Option Service Code"]
    SUBSVCD --> SUBCOND{"Sub-Option Status is 910/920?
CD00037_910=910, CD00037_920=920"}
    SUBCOND --> |Yes| FORCONT2["continue (skip terminated/cancelled)"]
    SUBCOND --> |No| SUBINNERCOND{"Contract No matches AND Service Code=D02?"}
    SUBINNERCOND --> |Yes| SUBCONFIRM["Confirm sbopSvcKeiInfoBean = current Sub-Option Bean"]
    SUBINNERCOND --> |No| FORCONT2
    SUBCONFIRM --> FORCONT2
    FORCONT2 --> MAPSET
    THROW --> MAPSET
    MAPSET --> RETURN["Return resultMap with all extracted beans and IDs"]
    RETURN --> END(["End"])
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `commoninfoBean` | `X31SDataBeanAccess` | The root shared form bean containing the full nested hierarchy of customer, contract, and option service data for the current screen session. It is the entry point to a tree of data beans that includes WEB change info, SSO identity, current customer contract, service contract, billing contract, option service contracts, and sub-option service contracts. This bean is populated by prior screen initialization and carries all the context needed for the FUW02101SF screen to render and process. |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `OneStopDataBeanAccessArray.getDataBeanArray` | - | - | Reads the WEB change info nested bean array from the root `commoninfoBean` |
| R | `OneStopDataBeanAccess.getDataBean` | - | - | Extracts individual nested data beans (SSO info, customer contract info, service contract info, etc.) from the bean hierarchy |
| R | `OneStopDataBeanAccess.sendMessageString(String, String)` | - | - | Reads scalar field values (SYSID, POPID, service code, status, contract numbers) from data beans via `DATABEAN_GET_VALUE` |
| R | `OneStopDataBeanAccessArray.getCount` | - | - | Iterates over the option service contract info and sub-option service contract info arrays |
| - | `JFUWebCommon.isNull` | - | - | Null-check on the option service contract number (validation, not CRUD) |

This method is a **pure read/traversal** method — it does not perform any database CRUD operations. It navigates the in-memory data-bean tree, reads scalar values and nested sub-beans, performs conditional matching logic, and assembles results into a map. All data originates from beans pre-populated by prior screen initialization calls.

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | `FUW02101SFLogic.cfm()` | `cfm()` -> `getCommoninfoBeanInfo(commoninfoBean)` | `sendMessageString` [R], `getDataBeanArray` [R], `getDataBean` [R] |
| 2 | `FUW02101SFLogic.init()` | `init()` -> `getCommoninfoBeanInfo(commoninfoBean)` | `sendMessageString` [R], `getDataBeanArray` [R], `getDataBean` [R] |
| 3 | `FUW02101SFLogic.mskm()` | `mskm()` -> `getCommoninfoBeanInfo(commoninfoBean)` | `sendMessageString` [R], `getDataBeanArray` [R], `getDataBean` [R] |

All three callers are methods within `FUW02101SFLogic` itself. No external screen or batch entry points were found within 8 hops. This method operates purely in-memory against the bean hierarchy provided by its caller.

## 6. Per-Branch Detail Blocks

**Block 1** — [SET] Initialize resultMap (L721)

| # | Type | Code |
|---|------|------|
| 1 | SET | `resultMap = new HashMap<String, Object>()` // Initialize the result container map |

**Block 2** — [EXEC] Extract WEB Chg Info Bean (L724)

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `webChgInfoBean = commoninfoBean.getDataBeanArray(WEB_CHG_INFO).getDataBean(0)` // Extract WEB change info (WEB変更情報) nested bean |

**Block 3** — [EXEC] Extract SSO Info Bean (L726)

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `ssoInfoBean = webChgInfoBean.getDataBeanArray(SSO_INFO).getDataBean(0)` // Extract SSO info (SSO情報) nested bean |

**Block 4** — [EXEC] SSO Info Retrieval (L729–730)

| # | Type | Code |
|---|------|------|
| 1 | SET | `ssoInfoSysid = ssoInfoBean.sendMessageString(SYSID_21, DATABEAN_GET_VALUE)` // Get SSO system ID (SSO情報取得 — SSO情報取得) |
| 2 | SET | `ssoInfoPopid = ssoInfoBean.sendMessageString(POP_ID_21, DATABEAN_GET_VALUE)` // Get SSO POP ID |

**Block 5** — [EXEC] Extract Current Customer, Service Contract, Service Detail, Billing Contract Beans (L733–740)

| # | Type | Code |
|---|------|------|
| 1 | SET | `genCustKeiInfoBean = webChgInfoBean.getDataBeanArray(GEN_CUST_KEI_INFO).getDataBean(0)` // Extract current customer contract info (現顧客情報) |
| 2 | SET | `svcKeiInfoBean = genCustKeiInfoBean.getDataBeanArray(SVC_KEI_INFO).getDataBean(0)` // Extract service contract info (サービス契約情報) |
| 3 | SET | `svcKeiUcwkInfoBean = svcKeiInfoBean.getDataBeanArray(SVC_KEI_UCWK_INFO).getDataBean(0)` // Extract service contract detail info (サービス契約内訳情報) |
| 4 | SET | `seikyKeiInfoBean = svcKeiInfoBean.getDataBeanArray(SEIKY_KEI_INFO).getDataBean(0)` // Extract billing contract info (請求契約情報) |

**Block 6** — [SET] Initialize Option Service Contract Info Bean (L743)

| # | Type | Code |
|---|------|------|
| 1 | SET | `opSvcKeiInfoBean = null` // Initialize option service contract info (オプションサービス契約情報) as null — will be resolved if matching contract found |

**Block 7** — [EXEC] Get Option Service Contract Info Array (L746)

| # | Type | Code |
|---|------|------|
| 1 | SET | `opSvcKeiInfoArray = svcKeiUcwkInfoBean.getDataBeanArray(OP_SVC_KEI_INFO)` // Get option service contract info array (オプションサービス契約情報（配列）) |

**Block 8** — [FOR] Iterate through Option Service Contract Info Array (L748–781)

| # | Type | Code |
|---|------|------|
| 1 | FOR | `for (int m = 0; m < opSvcKeiInfoArray.getCount(); m++)` // Iterate through option service contracts |
| 2 | SET | `tmpOpSvcKeiInfoBean = opSvcKeiInfoArray.getDataBean(m)` // Temporary option bean for current iteration (オプションサービス契約情報（作業用）) |
| 3 | SET | `popId = tmpOpSvcKeiInfoBean.sendMessageString(POP_ID_28, DATABEAN_GET_VALUE)` // Extract POP ID |
| 4 | SET | `opSvCd = tmpOpSvcKeiInfoBean.sendMessageString(OP_SVC_CD_28, DATABEAN_GET_VALUE)` // Extract option service code (オプションサービスコード) |
| 5 | SET | `opSvcKeiStat = tmpOpSvcKeiInfoBean.sendMessageString(OP_SVC_KEI_STAT_28, DATABEAN_GET_VALUE)` // Extract option service contract status (オプションサービス契約ステータス) |

**Block 8.1** — [IF] Option Status Filter (L752–767) `[CD00037_020="020" (Paused), CD00037_030="030" (Suspended), CD00037_100="100" (In Service)]` (L752)

> Only option service contracts with status "020: Paused" (照咲済), "030: Suspended" (結済), or "100: In Service" (サービス提供中) are eligible for selection.

| # | Type | Code |
|---|------|------|
| 1 | IF | `CD00037_020.equals(opSvcKeiStat) || CD00037_030.equals(opSvcKeiStat) || CD00037_100.equals(opSvcKeiStat)` |

**Block 8.1.1** — [IF] Inner Match Condition: Status=100 AND POPID match AND Service Code B001 (L757) (L757)

> If the option service contract status is "100: In Service", the POPID must match the SSO POPID and the service code must be "B001: Mail" (Eメール). All three conditions must be true simultaneously.

| # | Type | Code |
|---|------|------|
| 1 | IF | `ssoInfoPopid.equals(popId) && CD00136_B001.equals(opSvCd)` // Status=100 AND POPID matches SSO POPID AND Service Code=B001 (Eメール) |

**Block 8.1.1.1** — [SET] Confirm Option Service Contract (L759) (L759)

| # | Type | Code |
|---|------|------|
| 1 | SET | `opSvcKeiInfoBean = tmpOpSvcKeiInfoBean` // Confirm the matching option service contract (オプションサービス契約情報（確定）) |

**Block 8.2** — [IF-ELSE] Option Service Contract Bean Exists Check (L770) (L770)

| # | Type | Code |
|---|------|------|
| 1 | IF | `opSvcKeiInfoBean != null` // An active option service contract was found |

**Block 8.2.1** — [EXEC] Validate Option Service Contract Number (L773–780) (L773)

| # | Type | Code |
|---|------|------|
| 1 | SET | `opInfoOpSvcKeiNo = opSvcKeiInfoBean.sendMessageString(OP_SVC_KEI_NO_28, DATABEAN_GET_VALUE)` // Get option service contract number (オプションサービス契約番号) |
| 2 | IF | `JFUWebCommon.isNull(opInfoOpSvcKeiNo)` // [IF] Contract number is null |

**Block 8.2.1.1** — [IF] Null Contract Number -> Throw Error (L775–778) (L775)

> If the confirmed option service contract has no contract number set, this is a system error condition. A debug log is written and a business exception with error code `CD000002` is thrown.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `JSSWebLog.DEBUG_LOG.debug("[オプション契約番号未設定エラー]")` // Debug log: [Option Contract Number Not Set Error] |
| 2 | THROW | `throw new JCCBusinessException(JFUStrConst.ERROR_CODE_0002)` // System error — Option service contract number is not set (システムエラーをスロー) |

**Block 8.2.2** — [EXEC] Get Sub-Option Service Contract Info Array (L782–783) (L782)

| # | Type | Code |
|---|------|------|
| 1 | SET | `sbopSvcKeiInfoArray = opSvcKeiInfoArray.getDataBean(0).getDataBeanArray(SBOP_SVC_KEI_INFO)` // Get sub-option service contract info array from the first option bean (サブオプションサービス契約情報（配列）) |

**Block 8.2.3** — [FOR] Iterate through Sub-Option Service Contract Info Array (L785–811) (L785)

| # | Type | Code |
|---|------|------|
| 1 | FOR | `for (int n = 0; n < sbopSvcKeiInfoArray.getCount(); n++)` // Iterate through sub-option service contracts |
| 2 | SET | `tmpSbopSvcKeiInfoBean = sbopSvcKeiInfoArray.getDataBean(n)` // Temporary sub-option bean (サブオプションサービス契約情報（作業用）) |
| 3 | SET | `opSvcKeiNo = tmpSbopSvcKeiInfoBean.sendMessageString(OP_SVC_KEI_NO_29, DATABEAN_GET_VALUE)` // Extract sub-option service contract number (オプションサービス契約番号) |
| 4 | SET | `sbopSvcKeiStat = tmpSbopSvcKeiInfoBean.sendMessageString(SBOP_SVC_KEI_STAT_29, DATABEAN_GET_VALUE)` // Extract sub-option service contract status (サブオプションサービス契約ステータス) |
| 5 | SET | `sbopSvCd = tmpSbopSvcKeiInfoBean.sendMessageString(SBOP_SVC_CD_29, DATABEAN_GET_VALUE)` // Extract sub-option service code (サブオプションサービスコード) |

**Block 8.2.3.1** — [IF] Skip Terminated/Cancelled Sub-Options (L795–799) `[CD00037_910="910" (Terminated), CD00037_920="920" (Cancelled)]` (L795)

> Sub-option service contracts with status "910: Terminated" (解約済) or "920: Cancelled" (キャンセル済) are skipped.

| # | Type | Code |
|---|------|------|
| 1 | IF | `CD00037_910.equals(sbopSvcKeiStat) || CD00037_920.equals(sbopSvcKeiStat)` |
| 2 | EXEC | `continue` // Skip terminated or cancelled sub-option service contracts (スキップ) |

**Block 8.2.3.2** — [IF] Sub-Option Inner Match: Contract No Match AND Service Code D02 (L802–807) `[CD00137_D02="D02" (Mail Capacity Add-On)]` (L802)

> If the sub-option service contract number matches the confirmed option service contract number and the service code is "D02: Mail capacity add-on" (メール容量追加の場合), this sub-option is selected.

| # | Type | Code |
|---|------|------|
| 1 | IF | `opInfoOpSvcKeiNo.equals(opSvcKeiNo) && CD00137_D02.equals(sbopSvCd)` // Contract No matches AND Service Code=D02 (Mail Capacity Add-On) |

**Block 8.2.3.2.1** — [SET] Confirm Sub-Option Service Contract (L804) (L804)

| # | Type | Code |
|---|------|------|
| 1 | SET | `sbopSvcKeiInfoBean = tmpSbopSvcKeiInfoBean` // Confirm the sub-option service contract (サブオプションサービス契約情報（確定）) |

**Block 9** — [SET] Populate resultMap with All Beans (L815–826)

> The final assembly step. All extracted sub-beans and scalar values are placed into the result map using the same constant keys used throughout the CommonInfoCF framework.

| # | Type | Code |
|---|------|------|
| 1 | SET | `resultMap.put(SYSID_21, ssoInfoSysid)` |
| 2 | SET | `resultMap.put(POP_ID_21, ssoInfoPopid)` |
| 3 | SET | `resultMap.put(SSO_INFO, ssoInfoBean)` // SSO info (SSO情報) |
| 4 | SET | `resultMap.put(GEN_CUST_KEI_INFO, genCustKeiInfoBean)` // Current customer contract info (現顧客情報) |
| 5 | SET | `resultMap.put(SVC_KEI_INFO, svcKeiInfoBean)` // Service contract info (サービス契約情報) |
| 6 | SET | `resultMap.put(SVC_KEI_UCWK_INFO, svcKeiUcwkInfoBean)` // Service contract detail info (サービス契約内訳情報) |
| 7 | SET | `resultMap.put(SEIKY_KEI_INFO, seikyKeiInfoBean)` // Billing contract info (請求契約情報) |
| 8 | SET | `resultMap.put(OP_SVC_KEI_INFO, opSvcKeiInfoBean)` // Option service contract info (オプションサービス契約情報) — may be null if no match |
| 9 | SET | `resultMap.put(SBOP_SVC_KEI_INFO, sbopSvcKeiInfoBean)` // Sub-option service contract info (サブオプションサービス契約情報) — may be null if no match |

**Block 10** — [RETURN] Return resultMap (L828) (L828)

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return resultMap` // Return the assembled map of all bean info (共有フォームBeanの情報を取得します。) |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `commoninfoBean` | Field | Shared form bean root — the top-level data bean carrying the complete nested contract and customer data hierarchy for the current screen session |
| `SYSID_21` | Constant | System ID field key — the system identifier for the SSO session, used to correlate the current user's SSO context |
| `POP_ID_21` / `POP_ID_28` | Constant | POP ID field key — the Point of Presence ID, representing the network access point associated with a service contract; used to match SSO context to a specific option contract |
| SSO | Acronym | Single Sign-On — the authentication/session mechanism; SSO info bean carries the logged-in user's identity (SYSID, POPID) |
| WEB Chg Info (WEB変更情報) | Field | WEB Change Info — the top-level container for all WEB screen modification data, including SSO info and customer/contract hierarchies |
| GEN_CUST_KEI_INFO (現顧客情報) | Field | Current Customer Contract Info — the existing customer's contract record, serving as the root for all service contract relationships |
| SVC_KEI_INFO (サービス契約情報) | Field | Service Contract Info — the main service contract record associated with the current customer |
| SVC_KEI_UCWK_INFO (サービス契約内訳情報) | Field | Service Contract Detail Info — the breakdown/detail lines within a service contract, containing option service contract sub-arrays |
| SEIKY_KEI_INFO (請求契約情報) | Field | Billing Contract Info — the billing-related contract information associated with a service contract |
| OP_SVC_KEI_INFO (オプションサービス契約情報) | Field | Option Service Contract Info — additional services (e.g., Mail, FTTH) that can be attached to a base service contract |
| SBOP_SVC_KEI_INFO (サブオプションサービス契約情報) | Field | Sub-Option Service Contract Info — secondary option services attached to an option service contract, e.g., capacity add-ons |
| `CD00037_020` = "020" | Constant | Service contract status: Paused (照咲済) — the service is temporarily suspended but not terminated |
| `CD00037_030` = "030" | Constant | Service contract status: Suspended (結済) — the service has been formally suspended |
| `CD00037_100` = "100" | Constant | Service contract status: In Service (サービス提供中) — the service is actively running; this is the preferred status for contract matching |
| `CD00037_210` = "210" | Constant | Service contract status: Pause (休止中) — service pause state |
| `CD00037_220` = "220" | Constant | Service contract status: Stop (停止) — service stop state |
| `CD00037_910` = "910" | Constant | Service contract status: Terminated (解約済) — the contract has been terminated; these are filtered out from sub-option selection |
| `CD00037_920` = "920" | Constant | Service contract status: Cancelled (キャンセル済) — the contract has been cancelled; these are filtered out from sub-option selection |
| `CD00136_B001` = "B001" | Constant | Option service code: Mail (Eメール) — the service type indicating a Mail service option; used to narrow option contract selection to Mail services |
| `CD00137_D02` = "D02" | Constant | Sub-option service code: Mail Capacity Add-On (メール容量追加の場合) — the sub-option type indicating an additional mail capacity purchase |
| `ERROR_CODE_0002` | Constant | System error code — thrown when the option service contract number is not set despite an active contract being found |
| DATABEAN_GET_VALUE | Constant | Data bean access constant — the operation code used to retrieve a scalar field value from an `X31SDataBeanAccess` bean via `sendMessageString()` |
| X31SDataBeanAccess | Class | Shared data bean access class — a framework class for navigating nested bean hierarchies in the K-Opticom web front-end, supporting `getDataBean()`, `getDataBeanArray()`, and `sendMessageString()` operations |
| X31SDataBeanAccessArray | Class | Shared data bean access array class — represents an array of data beans, supporting `getCount()` and `getDataBean(int)` for iteration |
| JCCBusinessException | Class | Common business exception class — the standard framework exception for business rule violations and system errors in the SF layer |
| opSvCd | Field | Option service code — identifies the type of option service (e.g., "B001" = Mail) |
| opSvcKeiStat | Field | Option service contract status — the current state of an option service contract |
| opInfoOpSvcKeiNo | Field | Option service contract number — the unique identifier for an option service contract |
| sbopSvCd | Field | Sub-option service code — identifies the type of sub-option service |
| sbopSvcKeiStat | Field | Sub-option service contract status — the current state of a sub-option service contract |
| `opSvcKeiInfoBean` | Field | Resolved option service contract bean — null initially, set to the matching active option contract if found |
| `sbopSvcKeiInfoBean` | Field | Resolved sub-option service contract bean — null initially, set to the matching sub-option contract if found |
| resultMap | Field | The output map containing all extracted bean references and scalar values, keyed by CommonInfoCF constant strings |

---
