---

# Business Logic — KKW00191SFLogic.editServiceFormBean() [72 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.KKW00191SF.KKW00191SFLogic` |
| Layer | Service Component (Web) |
| Module | `KKW00191SF` (Package: `eo.web.webview.KKW00191SF`) |

## 1. Role

### KKW00191SFLogic.editServiceFormBean()

The `editServiceFormBean` method serves as a **data transfer and formatting bridge** between service-layer response data and screen-display-ready form data. Its Javadoc states: "Transfers and transforms data from service display for screen presentation" (サービスの情報から画面表示用にデータ移し変え).

The method reads structured data from three distinct inquiry result categories stored within the incoming `X31SDataBeanAccess` object: (1) Application Detail Match Inquiry results (申込明細一致照会), (2) Service Contract Match Inquiry results (サービス契約一致照会), and (3) Service Contract Common Information List Inquiry results (サービス契約共通情報一覧照会). For each category, it extracts the first record from a data bean array and maps its fields to the form bean for display.

Specifically, it performs two critical formatting operations: (a) it converts raw date strings from an 8-digit compact format (`yyyyMMdd`) into a human-readable slash-separated format (`yyyy/MM/dd`) for both the application date (MSKM_YMD) and the service review date (SHOSA_YMD); (b) it transfers plain text identifiers and names such as application number, service code name, pricing plan code name, and mansion (apartment/condominium) identification data.

The design pattern implemented is a **sequential data mapping/dispatch pattern** — the method acts as a pure data transformer with no conditional branching, no database operations, and no business decision logic. It is a **shared utility called by the screen logic entry point** (`KKW00191SFLogic.invokeService()`), providing the presentation layer with pre-formatted data ready for rendering on the edit/service confirmation screen.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["editServiceFormBean svcFormBean"])
    
    START --> INIT["Declare beanArray, bean, ymd"]
    
    INIT --> SECTION1["Section 1: Application Detail Match Inquiry"]
    
    SECTION1 --> GET_DTL["beanArray = svcFormBean.getDataBeanArray(MSKM_DTL_LIST)"]
    GET_DTL --> GET_YMD["ymd = beanArray.getDataBean(0).sendMessageString(MSKM_YMD_02, GET_VALUE)"]
    GET_YMD --> FORMAT_YMD["Format ymd: substring(0,4) + '/' + substring(4,6) + '/' + substring(6,8)"]
    FORMAT_YMD --> SET_YMD["svcFormBean.sendMessageString(MSKM_YMD, SET_VALUE, formattedYmd)"]
    
    SET_YMD --> GET_SHO_NO["beanArray.getDataBean(0).sendMessageString(MSKMSHO_NO_02, GET_VALUE)"]
    GET_SHO_NO --> SET_SHO_NO["svcFormBean.sendMessageString(MSKMSHO_NO, SET_VALUE, shonyuNo)"]
    
    SET_SHO_NO --> SECTION2["Section 2: Service Contract Match Inquiry"]
    
    SECTION2 --> GET_SVC_LIST["beanArray = svcFormBean.getDataBeanArray(SVC_KEI_LIST)"]
    GET_SVC_LIST --> GET_SHOSA_YMD["ymd = beanArray.getDataBean(0).sendMessageString(SHOSA_YMD_01, GET_VALUE)"]
    GET_SHOSA_YMD --> FORMAT_SHOSA["Format shosaYmd: substring(0,4) + '/' + substring(4,6) + '/' + substring(6,8)"]
    FORMAT_SHOSA --> SET_SHOSA_YMD["svcFormBean.sendMessageString(SHOSA_YMD, SET_VALUE, formattedShosaYmd)"]
    
    SET_SHOSA_YMD --> GET_SVC_CD_NM["beanArray.getDataBean(0).sendMessageString(SVC_CD_NM, GET_VALUE)"]
    GET_SVC_CD_NM --> SET_SVC_CD_NM["svcFormBean.sendMessageString(SVC_CD_NM, SET_VALUE, svcCdNm)"]
    
    SET_SVC_CD_NM --> GET_PPLAN["beanArray.getDataBean(0).sendMessageString(PPLAN_CD_NM_01, GET_VALUE)"]
    GET_PPLAN --> SET_PPLAN["svcFormBean.sendMessageString(PPLAN_CD_NM, SET_VALUE, pplanCdNm)"]
    
    SET_PPLAN --> SECTION3["Section 3: Service Contract Common Info List Inquiry"]
    
    SECTION3 --> GET_COM_LIST["beanArray = svcFormBean.getDataBeanArray(SVC_KEI_COM_LIST)"]
    GET_COM_LIST --> GET_MANSION_ID["beanArray.getDataBean(0).sendMessageString(MANSION_ID_03, GET_VALUE)"]
    GET_MANSION_ID --> SET_MANSION_ID["svcFormBean.sendMessageString(MANSION_ID, SET_VALUE, mansionId)"]
    
    SET_MANSION_ID --> GET_MANSION_NM["beanArray.getDataBean(0).sendMessageString(MANSION_NM_03, GET_VALUE)"]
    GET_MANSION_NM --> SET_MANSION_NM["svcFormBean.sendMessageString(MANSION_NM, SET_VALUE, mansionNm)"]
    
    SET_MANSION_NM --> END_NODE(["Return void / Next"])
```

**No conditional branches** exist in this method. The processing is a strictly linear sequence of data extraction and mapping operations across three logical sections.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `svcFormBean` | `X31SDataBeanAccess` | The service response data container holding structured inquiry results from three distinct service-layer data bean arrays: Application Detail Match List (`MSKM_DTL_LIST`), Service Contract List (`SVC_KEI_LIST`), and Service Contract Common Information List (`SVC_KEI_COM_LIST`). The method reads from these arrays and writes formatted display values back into this same bean for screen rendering. |

**Instance fields / external state read:** None. This method is stateless with respect to class-level instance fields; it operates entirely on the parameter `svcFormBean` and local variables.

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `OneStopDataBeanAccessArray.getDataBeanArray` | OneStopDataBeanAccessArray | - | Reads a named data bean array from the service bean container (key: `MSKM_DTL_LIST` / `SVC_KEI_LIST` / `SVC_KEI_COM_LIST`) |
| R | `OneStopDataBeanAccess.getDataBean` | OneStopDataBeanAccess | - | Reads the first element (index 0) from a data bean array |
| R | `OneStopDataBeanAccess.sendMessageString` | OneStopDataBeanAccess | - | Reads a string value from a data bean field (mode: `DATABEAN_GET_VALUE`) |
| - | `OneStopDataBeanAccess.sendMessageString` | OneStopDataBeanAccess | - | Writes a formatted string value into a data bean field (mode: `DATABEAN_SET_VALUE`) |
| - | `KKKAdEditCC.substring` | KKKAdEditCC | - | Calls `substring` for date string formatting |
| - | `JKKAdEdit.substring` | JKKAdEdit | - | Calls `substring` for date string formatting |

**CRUD classification:** This method performs **zero direct CRUD operations** against the database. It is a pure presentation-layer data transformer that restructures and reformat data already loaded into memory by the service layer. All data access is mediated through `X31SDataBeanAccess` / `X31SDataBeanAccessArray` objects, which serve as in-memory data containers. The actual database reads (R) for the three inquiry result sets are performed upstream by the service components that populate these bean arrays before this method is invoked.

## 5. Dependency Trace

### Callers

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | `KKW00191SFLogic.invokeService()` | `KKW00191SFLogic.invokeService` -> `KKW00191SFLogic.editServiceFormBean` | `sendMessageString` [-], `getDataBeanArray` [R], `getDataBean` [R] |

### Callers from code graph

No screen/batch entry points found within 8 hops. Direct callers found: 1 method.
Terminal operations from this method: `sendMessageString` [-], `sendMessageString` [-], `sendMessageString` [-], `sendMessageString` [-], `getDataBean` [R], `getDataBean` [R], `getDataBean` [R], `getDataBean` [R], `getDataBeanArray` [R], `sendMessageString` [-], `sendMessageString` [-], `sendMessageString` [-], `sendMessageString` [-], `getDataBean` [R], `getDataBean` [R], `getDataBeanArray` [R], `sendMessageString` [-], `sendMessageString` [-], `sendMessageString` [-]

## 6. Per-Branch Detail Blocks

This method has no conditional branches (no if/else, switch, loops, or try/catch). The entire flow is a single linear path divided into three logical sections. Each section follows the same pattern: retrieve a data bean array by key, extract the first record, and map its fields to the form bean.

---

**Block 1** — LOCAL VARIABLES (declaration) (L229)

> Declares local variables used throughout the method: a reusable data bean array accessor, a data bean accessor (unused), and a string buffer for date values.

| # | Type | Code |
|---|------|------|
| 1 | SET | `beanArray = null` // `X31SDataBeanAccessArray beanArray` — reusable array holder |
| 2 | SET | `bean = null` // `X31SDataBeanAccess bean` — unused (declared but never assigned) |
| 3 | SET | `ymd = null` // `String ymd` — buffer for extracting and formatting date strings |

---

**Block 2** — SECTION: Application Detail Match Inquiry (申込明細一致照会) (L234)

> Retrieves the application detail match inquiry result list. The comment "申込明細一致照会" translates to "Application Detail Match Inquiry" — this section deals with the matched application detail records returned by the service layer, specifically the application date and application number.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `beanArray = svcFormBean.getDataBeanArray(KKW00191SFConst.MSKM_DTL_LIST)` // Retrieves the Application Detail Match List from the service bean container |
| 2 | EXEC | `ymd = beanArray.getDataBean(0).sendMessageString(KKW00191SFConst.MSKM_YMD_02, X31CWebConst.DATABEAN_GET_VALUE)` // Extracts the raw 8-digit application date (`yyyyMMdd`) from the first record of the detail list |
| 3 | EXEC | `svcFormBean.sendMessageString(KKW00191SFConst.MSKM_YMD, X31CWebConst.DATABEAN_SET_VALUE, ymd.substring(0, 4) + "/" + ymd.substring(4, 6) + "/" + ymd.substring(6, 8))` // Formats the date from `yyyyMMdd` to `yyyy/MM/dd` and writes it to the form bean under key `MSKM_YMD` |
| 4 | EXEC | `svcFormBean.sendMessageString(KKW00191SFConst.MSKMSHO_NO, X31CWebConst.DATABEAN_SET_VALUE, beanArray.getDataBean(0).sendMessageString(KKW00191SFConst.MSKMSHO_NO_02, X31CWebConst.DATABEAN_GET_VALUE))` // Retrieves the application number (`shonyu`) from the detail list and writes it to the form bean under key `MSKMSHO_NO` |

---

**Block 3** — SECTION: Service Contract Match Inquiry (サービス契約一致照会) (L248)

> Retrieves the service contract match inquiry result list. The comment "サービス契約一致照会" translates to "Service Contract Match Inquiry" — this section deals with matched service contract records, extracting the review date, service code name, and pricing plan code name for display.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `beanArray = svcFormBean.getDataBeanArray(KKW00191SFConst.SVC_KEI_LIST)` // Retrieves the Service Contract List from the service bean container |
| 2 | EXEC | `ymd = beanArray.getDataBean(0).sendMessageString(KKW00191SFConst.SHOSA_YMD_01, X31CWebConst.DATABEAN_GET_VALUE)` // Extracts the raw 8-digit review date (`yyyyMMdd`) from the first record |
| 3 | EXEC | `svcFormBean.sendMessageString(KKW00191SFConst.SHOSA_YMD, X31CWebConst.DATABEAN_SET_VALUE, ymd.substring(0, 4) + "/" + ymd.substring(4, 6) + "/" + ymd.substring(6, 8))` // Formats the date to `yyyy/MM/dd` and writes it to the form bean under key `SHOSA_YMD` |
| 4 | EXEC | `svcFormBean.sendMessageString(KKW00191SFConst.SVC_CD_NM, X31CWebConst.DATABEAN_SET_VALUE, beanArray.getDataBean(0).sendMessageString(KKW00191SFConst.SVC_CD_NM, X31CWebConst.DATABEAN_GET_VALUE))` // Retrieves and writes the service code name (`svc_cd_nm`) — read from and written to the same key name |
| 5 | EXEC | `svcFormBean.sendMessageString(KKW00191SFConst.PPLAN_CD_NM, X31CWebConst.DATABEAN_SET_VALUE, beanArray.getDataBean(0).sendMessageString(KKW00191SFConst.PPLAN_CD_NM_01, X31CWebConst.DATABEAN_GET_VALUE))` // Retrieves the pricing plan code name from `PPLAN_CD_NM_01` and writes it to `PPLAN_CD_NM` on the form bean |

---

**Block 4** — SECTION: Service Contract Common Information List Inquiry (サービス契約共通情報一覧照会) (L262)

> Retrieves the service contract common information list. The comment "サービス契約共通情報一覧照会" translates to "Service Contract Common Information List Inquiry" — this section extracts apartment/condominium (mansion) identification and name data used across service contracts.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `beanArray = svcFormBean.getDataBeanArray(KKW00191SFConst.SVC_KEI_COM_LIST)` // Retrieves the Service Contract Common Information List from the service bean container |
| 2 | EXEC | `svcFormBean.sendMessageString(KKW00191SFConst.MANSION_ID, X31CWebConst.DATABEAN_SET_VALUE, beanArray.getDataBean(0).sendMessageString(KKW00191SFConst.MANSION_ID_03, X31CWebConst.DATABEAN_GET_VALUE))` // Retrieves the mansion (apartment/condominium) ID from the common info list and writes it to the form bean under `MANSION_ID` |
| 3 | EXEC | `svcFormBean.sendMessageString(KKW00191SFConst.MANSION_NM, X31CWebConst.DATABEAN_SET_VALUE, beanArray.getDataBean(0).sendMessageString(KKW00191SFConst.MANSION_NM_03, X31CWebConst.DATABEAN_GET_VALUE))` // Retrieves the mansion name from the common info list and writes it to the form bean under `MANSION_NM` |

---

**Block 5** — RETURN (L275)

> The method returns `void`. No explicit return statement exists (void methods implicitly return after the closing brace). The transformed data is now available in `svcFormBean` for the screen to render.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | (implicit — void method ends here) |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `MSKM_DTL_LIST` | Constant | Application Detail Match List key — the data bean array containing matched application detail records from the service layer |
| `MSKM_YMD` | Constant | Application date display key — the `yyyy/MM/dd` formatted application date written to the form bean for screen display |
| `MSKM_YMD_02` | Constant | Application date source key — the raw 8-digit `yyyyMMdd` format date read from the application detail data bean |
| `MSKMSHO_NO` | Constant | Application number display key — the application/shonyu number written to the form bean |
| `MSKMSHO_NO_02` | Constant | Application number source key — the application number read from the application detail data bean |
| `SVC_KEI_LIST` | Constant | Service Contract List key — the data bean array containing matched service contract records |
| `SHOSA_YMD_01` | Constant | Review date source key — the raw `yyyyMMdd` format review/shosa date read from the service contract data bean |
| `SHOSA_YMD` | Constant | Review date display key — the formatted `yyyy/MM/dd` review date written to the form bean |
| `SVC_CD_NM` | Constant | Service code name — the human-readable service code / service category name from the contract |
| `PPLAN_CD_NM_01` | Constant | Pricing plan code name source key — the pricing plan code name read from the service contract data bean |
| `PPLAN_CD_NM` | Constant | Pricing plan code name display key — the pricing plan name written to the form bean |
| `SVC_KEI_COM_LIST` | Constant | Service Contract Common Information List key — the data bean array containing shared/common contract metadata |
| `MANSION_ID_03` | Constant | Mansion ID source key — the apartment/condominium identification code read from the common info list |
| `MANSION_ID` | Constant | Mansion ID display key — the mansion ID written to the form bean for screen display |
| `MANSION_NM_03` | Constant | Mansion name source key — the apartment/condominium name read from the common info list |
| `MANSION_NM` | Constant | Mansion name display key — the mansion name written to the form bean |
| `X31SDataBeanAccess` | Class | Service-layer data bean access wrapper — the interface for reading/writing structured data between service and presentation layers |
| `X31SDataBeanAccessArray` | Class | Service-layer data bean array accessor — provides indexed access to arrays of data beans within the service response |
| `X31CWebConst.DATABEAN_GET_VALUE` | Constant | Data bean get mode — flag indicating a read operation on a data bean field |
| `X31CWebConst.DATABEAN_SET_VALUE` | Constant | Data bean set mode — flag indicating a write operation on a data bean field |
| 申込明細一致照会 | Japanese term | Application Detail Match Inquiry — a service-layer query that matches and returns application detail records |
| サービス契約一致照会 | Japanese term | Service Contract Match Inquiry — a service-layer query that matches and returns service contract records |
| サービス契約共通情報一覧照会 | Japanese term | Service Contract Common Information List Inquiry — a service-layer query that retrieves shared metadata for service contracts |
| shonyu (申込) | Japanese term | Application — the act of submitting an application; the application number identifies a specific submitted order |
| shosa (照会) | Japanese term | Inquiry / lookup — a read-only query operation; in this system, refers to service-layer data retrieval calls |
| svc_kei (サービス種別) | Japanese term | Service type/category — classifies the type of service being contracted (e.g., FTTH, mail, ENUM) |
| ymd | Abbreviation | Year-Month-Day — a date value stored as an 8-digit integer/string in `yyyyMMdd` format |
| KKWT00191SF | Module | The screen module code — KKW series modules handle web-based service contract / order management operations |

---
