# Business Logic — KKW02504SFLogic.storeGetDataInit() [126 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.KKW02504SF.KKW02504SFLogic` |
| Layer | Controller / Web View Logic (Package: `eo.web.webview.KKW02504SF`) |
| Module | `KKW02504SF` (My Homepage Information Change) |

## 1. Role

### KKW02504SFLogic.storeGetDataInit()

This method performs the **initial screen data bean setup** for the "My Homepage Information Change" screen in the K-Opticom customer contract management system. It is invoked by `actionInit()` immediately upon screen entry to populate all form fields with their current values and derive display-state flags from the application's data bean context. The method operates in two major business phases: first, it reads sub-option service status indicators — specifically whether the subscriber's **Homepage Capacity** has been added and whether **Access Analysis** is active — by inspecting update-datetime fields. Second, it branches on the **process division** (`trandiv`) to set up different display data: for **Change** (`OP_TRAN_DIV_CHGE = "03"`), it retrieves the previous capacity value, zero-pads it via `fillZero`, resolves the matching pulldown index for both capacity and access analysis, and ensures a domain name is set; for **Termination** (`OP_TRAN_DIV_DSL = "04"`), it fetches the operational date and extracts year, month, and day components to pre-fill the service end date fields. This method follows a **delegation and data bean routing pattern**, using `X31SDataBeanAccess.sendMessageString` for scalar values and `X31SDataBeanAccessArray.getDataBeanArray` for list-backed pulldown components.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["storeGetDataInit"])
    A["Get X31SDataBeanAccess bean from super.getServiceFormBean"] --> B["Get hp_capa_mryo = bean.sendMessageString(SVCTK_BUT_MRYO_VALUE, DATABEAN_GET_VALUE)"]
    B --> C["Initialize hp_capa_mryo_val = 0"]
    C --> D{"hp_capa_mryo != null && not empty?"}
    D -->|Yes| E["hp_capa_mryo_val = Integer.parseInt(hp_capa_mryo)"]
    D -->|No| F["Set sbop_hp_flg = false"]
    E --> F
    F --> G["Get upd_dtm_0170 = bean.sendMessageString(UPD_DTM_BF_0170, DATABEAN_GET_VALUE)"]
    G --> H{"upd_dtm_0170 != null && not empty?"}
    H -->|Yes| I["Set sbop_hp_flg = true (Homepage capacity addition in progress)"]
    H -->|No| J["Get upd_dtm_0440 = bean.sendMessageString(UPD_DTM_BF_0440, DATABEAN_GET_VALUE)"]
    I --> J
    J --> K["Set sbop_accs_flg = false"]
    K --> L{"upd_dtm_0440 != null && not empty?"}
    L -->|Yes| M["Set sbop_accs_flg = true (Access analysis in progress)"]
    L -->|No| N["Get access analysis list bean.getDataBeanArray(ACCSS_BNSK_INFO)"]
    M --> N
    N --> O["Get accsBean = accslist.getDataBean(0)"]
    O --> P["Create ArrayList accsParam"]
    P --> Q{"sbop_accs_flg true?"}
    Q -->|Yes - Has Access Analysis| R["getPulldownSelected(accsBean, UM_U, accsParam) - search for Yes index"]
    Q -->|No - No Access Analysis| S["getPulldownSelected(accsBean, UM_M, accsParam) - search for No index"]
    R --> T["Set ACCSS_BNSK value to accsParam.get(3)"]
    S --> T
    T --> U["Get trandiv = bean.sendMessageString(TRANDIV, DATABEAN_GET_VALUE)"]
    U --> V{"OP_TRAN_DIV_CHGE = 03?"}
    V -->|Yes - Change| W["Get capa_bf = bean.sendMessageString(CAPA, DATABEAN_GET_VALUE)"]
    W --> X["Initialize capa_bf_val = 0"]
    X --> Y{"capa_bf != null && not empty?"}
    Y -->|Yes| Z["capa_bf_val = Integer.parseInt(capa_bf)"]
    Y -->|No| AA["capa_bf_val = 0"]
    Z --> AB["capa_bf = capa_bf_val + '' (convert back to string)"]
    AA --> AB
    AB --> AC["capa_bf = JPCUtilCommon.fillZero(capa_bf, CAPA_ZERO_MASK=4, false)"]
    AC --> AD["Get capacity info array bean.getDataBeanArray(HP_CAPA_INFO)"]
    AD --> AE["Get chghpBean = chghplist.getDataBean(0)"]
    AE --> AF["Create ArrayList chghpParam"]
    AF --> AG["getPulldownSelected(chghpBean, capa_bf, chghpParam)"]
    AG --> AH["Set chghpBean INDEX_01 to chghpParam.get(0) (selected homepage capacity)"]
    AH --> AI["Set accsBean INDEX_01 to accsParam.get(0) (selected access analysis)"]
    AI --> AJ["Get domain = bean.sendMessageString(CHG_HPAD_DOMAIN, DATABEAN_GET_VALUE)"]
    AJ --> AK{"domain == null or empty?"}
    AK -->|Yes| AL["Get work_param_url_domain from WORK_PARAM_URL_DOMAIN"]
    AK -->|No| AM["End of Change block"]
    AL --> AN["Set CHG_HPAD_DOMAIN to work_param_url_domain"]
    AN --> AM
    V -->|No - Not Change| AO{"OP_TRAN_DIV_DSL = 04?"}
    AO -->|Yes - Termination| AP["Get opeDate = JCCWebCommon.getOpeDate(this, null)"]
    AP --> AQ["Set USE_ENDYMD_YEAR = opeDate.substring(0,4) (year)"]
    AQ --> AR["Set USE_ENDYMD_MON = opeDate.substring(4,6) (month)"]
    AR --> AS["Set USE_ENDYMD_DAY = opeDate.substring(6,8) (day)"]
    AS --> AM2(["Return / Next"])
    AO -->|No| AM2
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| - | (none) | - | This method takes no input parameters; it derives all data from the screen's data bean context via `super.getServiceFormBean()`. |
| - | `bean` (local) | `X31SDataBeanAccess` | The screen's form data bean, providing read/write access to all fields displayed on the My Homepage Information Change screen. |
| - | `hp_capa_mryo` (field) | `String` | Homepage capacity free-value string retrieved from the data bean; represents whether the homepage capacity feature is in a free (no-charge) state. |
| - | `hp_capa_mryo_val` (field) | `int` | Parsed integer value of `hp_capa_mryo`; used as an internal numeric representation. |
| - | `sbop_hp_flg` (field) | `boolean` | Sub-option service flag for Homepage Capacity; `true` indicates the subscriber has added homepage capacity. |
| - | `sbop_accs_flg` (field) | `boolean` | Sub-option service flag for Access Analysis; `true` indicates the subscriber has access analysis active. |
| - | `accslist` (local) | `X31SDataBeanAccessArray` | Array of access analysis data beans retrieved from the main data bean for pulldown index resolution. |
| - | `accsBean` (local) | `X31SDataBeanAccess` | The first access analysis data bean, used to look up pulldown selection indices. |
| - | `accsParam` (local) | `ArrayList<String>` | Temporary list holding resolved pulldown selection parameters for access analysis. |
| - | `trandiv` (local) | `String` | Process division code that determines which screen mode is active (Change, Termination, etc.). |
| - | `capa_bf` (local) | `String` | Previous (before) capacity value retrieved for the Change branch; used to pre-select the capacity pulldown. |
| - | `capa_bf_val` (local) | `int` | Parsed integer of `capa_bf`. |
| - | `chghplist` (local) | `X31SDataBeanAccessArray` | Array of change-mode homepage capacity data beans. |
| - | `chghpBean` (local) | `X31SDataBeanAccess` | The first change-mode homepage capacity data bean. |
| - | `chghpParam` (local) | `ArrayList<String>` | Temporary list holding resolved pulldown selection parameters for capacity in change mode. |
| - | `domain` (local) | `String` | Change-mode homepage domain field value; checked to determine if the business parameter URL domain should be set. |
| - | `work_param_url_domain` (local) | `String` | Business parameter URL domain string fetched as a fallback for the change-mode domain field. |
| - | `opeDate` (local) | `String` | Operational date string (YYYYMMDD format) used in the Termination branch to compute the service end date. |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `X31SDataBeanAccess.sendMessageString` | - | DataBean | Gets homepage capacity free-value string from the screen data bean [SVCTK_BUT_MRYO_VALUE] |
| R | `X31SDataBeanAccess.sendMessageString` | - | DataBean | Gets sub-option update datetime for Homepage Capacity (field suffix `_0170`) [UPD_DTM_BF_0170] |
| R | `X31SDataBeanAccess.sendMessageString` | - | DataBean | Gets sub-option update datetime for Access Analysis (field suffix `_0440`) [UPD_DTM_BF_0440] |
| R | `X31SDataBeanAccess.getDataBeanArray` | - | DataBean | Gets access analysis list array from the screen data bean [ACCSS_BNSK_INFO] |
| R | `X31SDataBeanAccess.sendMessageString` | - | DataBean | Gets process division code [TRANDIV] |
| R | `X31SDataBeanAccess.sendMessageString` | - | DataBean | Gets previous capacity value for change mode [CAPA] |
| R | `X31SDataBeanAccess.getDataBeanArray` | - | DataBean | Gets change-mode homepage capacity info array [HP_CAPA_INFO] |
| R | `X31SDataBeanAccess.sendMessageString` | - | DataBean | Gets change-mode homepage domain [CHG_HPAD_DOMAIN] |
| R | `X31SDataBeanAccess.sendMessageString` | - | DataBean | Gets business parameter URL domain [WORK_PARAM_URL_DOMAIN] |
| R | `JCCWebCommon.getOpeDate` | JCCWebCommon | - | Gets the current operational date in YYYYMMDD string format |
| - | `OneStopDataBeanAccess.sendMessageString` | - | DataBean | Sets access analysis field value (ACCSS_BNSK) using accsParam.get(3) |
| - | `OneStopDataBeanAccess.sendMessageString` | - | DataBean | Sets homepage capacity pulldown selected index [INDEX_01] |
| - | `OneStopDataBeanAccess.sendMessageString` | - | DataBean | Sets access analysis pulldown selected index [INDEX_01] |
| - | `OneStopDataBeanAccess.sendMessageString` | - | DataBean | Sets change-mode homepage domain field with business parameter URL domain |
| - | `KKW02504SFLogic.getPulldownSelected` | KKW02504SFLogic | - | Resolves pulldown selected index and populates parameter ArrayList |
| - | `JPCUtilCommon.fillZero` | JPCUtilCommon | - | Zero-pads capacity string to specified width (CAPA_ZERO_MASK=4) |
| - | `String.substring` | - | - | Extracts year/month/day substrings from the YYYYMMDD operational date |

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | `KKW02504SFLogic` | `KKW02504SFLogic.actionInit` -> `storeGetDataInit` | `sendMessageString [R] DataBean`, `fillZero [-]`, `getOpeDate [R]` |

**Notes:** This method is called directly from `KKW02504SFLogic.actionInit()` (line 336) as the initialization routine when the My Homepage Information Change screen first loads. There are no external screen entry points (e.g., `KKSV*` screens) within 8 hops — the caller is internal to the same logic class. The method's terminal operations are all data bean reads/writes and utility calls (no direct database or SC invocations).

## 6. Per-Branch Detail Blocks

**Block 1** — [SET] (L1084)

> Retrieve the screen's data bean context.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `bean = super.getServiceFormBean()` // Get X31SDataBeanAccess |

**Block 2** — [SET] (L1087)

> Get the homepage capacity free-value string from the data bean.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `hp_capa_mryo = bean.sendMessageString(SVCTK_BUT_MRYO_VALUE, DATABEAN_GET_VALUE)` |

**Block 3** — [IF] `hp_capa_mryo != null && not empty` (L1089)

> Parse the free-value string into a numeric capacity value.

| # | Type | Code |
|---|------|------|
| 1 | SET | `hp_capa_mryo_val = 0` // Initialize |
| 2 | SET | `hp_capa_mryo_val = Integer.parseInt(hp_capa_mryo)` // Parse [-> hp_capa_mryo_val] |

**Block 4** — [SET] (L1096)

> Initialize sub-option homepage flag to false, then check if Homepage Capacity addition is in progress.

| # | Type | Code |
|---|------|------|
| 1 | SET | `sbop_hp_flg = false` |
| 2 | CALL | `upd_dtm_0170 = bean.sendMessageString(UPD_DTM_BF_0170, DATABEAN_GET_VALUE)` // Get sub-option update datetime |

**Block 5** — [IF] `upd_dtm_0170 != null && not empty` (L1098)

> If Homepage Capacity update datetime exists, set the flag to indicate homepage capacity addition is in progress.

| # | Type | Code |
|---|------|------|
| 1 | SET | `sbop_hp_flg = true` // Homepage capacity addition in progress |

**Block 6** — [SET] (L1104)

> Initialize sub-option access analysis flag, then check if Access Analysis is in progress.

| # | Type | Code |
|---|------|------|
| 1 | SET | `sbop_accs_flg = false` |
| 2 | CALL | `upd_dtm_0440 = bean.sendMessageString(UPD_DTM_BF_0440, DATABEAN_GET_VALUE)` // Get sub-option update datetime |

**Block 7** — [IF] `upd_dtm_0440 != null && not empty` (L1106)

> If Access Analysis update datetime exists, set the flag to indicate access analysis is in progress.

| # | Type | Code |
|---|------|------|
| 1 | SET | `sbop_accs_flg = true` // Access analysis in progress |

**Block 8** — [SET] (L1112)

> Retrieve the access analysis data bean list from the screen data bean.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `accslist = bean.getDataBeanArray(ACCSS_BNSK_INFO)` // Get access analysis info |
| 2 | CALL | `accsBean = accslist.getDataBean(0)` // Get first element |
| 3 | SET | `accsParam = new ArrayList<String>()` // Create temporary parameter list |

**Block 9** — [IF/ELSE] `sbop_accs_flg` (L1114)

> Determine which pulldown index to search for based on whether access analysis is active.

| # | Type | Code |
|---|------|------|
| 1 | IF | `sbop_accs_flg == true` |
|   | CALL | `getPulldownSelected(accsBean, UM_U, accsParam)` // UM_U="1" (Yes) — search for "Yes" index |
| 2 | ELSE | `sbop_accs_flg == false` |
|   | CALL | `getPulldownSelected(accsBean, UM_M, accsParam)` // UM_M="0" (No) — search for "No" index |

**Block 10** — [SET] (L1119)

> Set the access analysis field value on the data bean using the resolved pulldown index.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `bean.sendMessageString(ACCSS_BNSK, DATABEAN_SET_VALUE, accsParam.get(3))` // Set access analysis field (uses index 3, not 2 — per fix IT1-2013-0001438) |

**Block 11** — [SET] (L1122)

> Get the process division code from the data bean.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `trandiv = bean.sendMessageString(TRANDIV, DATABEAN_GET_VALUE)` // Get process division |

**Block 12** — [IF] `OP_TRAN_DIV_CHGE = "03"` (L1124)

> Change (Henne) mode — handle homepage capacity change fields.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `capa_bf = bean.sendMessageString(CAPA, DATABEAN_GET_VALUE)` // Get previous capacity |
| 2 | SET | `capa_bf_val = 0` |
| 3 | IF | `capa_bf != null && not empty` |
|   | SET | `capa_bf_val = Integer.parseInt(capa_bf)` |
|   | ELSE | `capa_bf_val = 0` |
| 4 | SET | `capa_bf = capa_bf_val + ""` // Convert back to string |
| 5 | CALL | `capa_bf = JPCUtilCommon.fillZero(capa_bf, CAPA_ZERO_MASK=4, false)` // Zero-pad to 4 digits |
| 6 | CALL | `chghplist = bean.getDataBeanArray(HP_CAPA_INFO)` // Get change-mode capacity info array |
| 7 | CALL | `chghpBean = chghplist.getDataBean(0)` |
| 8 | SET | `chghpParam = new ArrayList<String>()` |
| 9 | CALL | `getPulldownSelected(chghpBean, capa_bf, chghpParam)` // Resolve capacity pulldown index |
| 10 | CALL | `chghpBean.sendMessageString(INDEX_01, DATABEAN_SET_VALUE, chghpParam.get(0))` // Set selected capacity |
| 11 | CALL | `accsBean.sendMessageString(INDEX_01, DATABEAN_SET_VALUE, accsParam.get(0))` // Set selected access analysis |
| 12 | CALL | `domain = bean.sendMessageString(CHG_HPAD_DOMAIN, DATABEAN_GET_VALUE)` // Get domain field |
| 13 | IF | `domain == null || empty` |
|    | CALL | `work_param_url_domain = bean.sendMessageString(WORK_PARAM_URL_DOMAIN, DATABEAN_GET_VALUE)` |
|    | CALL | `bean.sendMessageString(CHG_HPAD_DOMAIN, DATABEAN_SET_VALUE, work_param_url_domain)` // Set domain from business parameter |

**Block 13** — [ELSE-IF] `OP_TRAN_DIV_DSL = "04"` (L1146)

> Termination (Kaijo) mode — set the service end date (riyo shuryo-bi) fields from the operational date.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `opeDate = JCCWebCommon.getOpeDate(this, null)` // Get current operational date (YYYYMMDD) |
| 2 | CALL | `bean.sendMessageString(USE_ENDYMD_YEAR, DATABEAN_SET_VALUE, opeDate.substring(0, 4))` // Set end date year |
| 3 | CALL | `bean.sendMessageString(USE_ENDYMD_MON, DATABEAN_SET_VALUE, opeDate.substring(4, 6))` // Set end date month |
| 4 | CALL | `bean.sendMessageString(USE_ENDYMD_DAY, DATABEAN_SET_VALUE, opeDate.substring(6, 8))` // Set end date day |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `SVCTK_BUT_MRYO_VALUE` | Constant | Service provision free value — data bean key for the homepage capacity free/charge flag |
| `UPD_DTM_BF_0170` | Constant | Update datetime before (Sub-option Service: Homepage Capacity) — timestamp of the last homepage capacity sub-option change |
| `UPD_DTM_BF_0440` | Constant | Update datetime before (Sub-option Service: Access Analysis) — timestamp of the last access analysis sub-option change |
| `ACCSS_BNSK_INFO` | Constant | Access Analysis Info — data bean key for the access analysis data list |
| `ACCSS_BNSK` | Constant | Access Analysis — data bean key for the access analysis field value |
| `TRANDIV` | Constant | Process Division — data bean key for the transaction type code |
| `CAPA` | Constant | Capacity — data bean key for the homepage capacity value |
| `HP_CAPA_INFO` | Constant | Homepage Capacity Info — data bean key for the change-mode capacity info array |
| `CHG_HPAD_DOMAIN` | Constant | Change Info Homepage Domain — data bean key for the homepage domain field in change mode |
| `WORK_PARAM_URL_DOMAIN` | Constant | Business Parameter URL Domain — data bean key for the fallback URL domain from business parameters |
| `INDEX_01` | Constant | Index — data bean key for pulldown selected index fields |
| `USE_ENDYMD_YEAR` | Constant | Service End Date (Year) — data bean key for the year component of the service end date |
| `USE_ENDYMD_MON` | Constant | Service End Date (Month) — data bean key for the month component of the service end date |
| `USE_ENDYMD_DAY` | Constant | Service End Date (Day) — data bean key for the day component of the service end date |
| `OP_TRAN_DIV_CHGE` | Constant | Process Division = "03" (Change/Henne) — transaction type code for service contract modification |
| `OP_TRAN_DIV_DSL` | Constant | Process Division = "04" (Termination/Kaijo) — transaction type code for service contract termination |
| `UM_U` | Constant | = "1" (Yes/Ari) — presence indicator for "has value" |
| `UM_M` | Constant | = "0" (No/Muna) — presence indicator for "does not have value" |
| `CAPA_ZERO_MASK` | Constant | = 4 — zero-padding width for capacity values |
| `sbop_hp_flg` | Field | Sub-option service Homepage flag — indicates whether homepage capacity sub-option has been added |
| `sbop_accs_flg` | Field | Sub-option service Access Analysis flag — indicates whether access analysis sub-option is active |
| `hp_capa_mryo` | Field | Homepage capacity free-value — string indicating if homepage capacity is in a no-charge state |
| `hp_capa_mryo_val` | Field | Homepage capacity free-value (integer) — parsed numeric form of hp_capa_mryo |
| KKW02504SF | Module | My Homepage Information Change — screen module for modifying My Homepage settings |
| FTTH | Business term | Fiber To The Home — fiber-optic broadband service offered by K-Opticom |
| My Homepage | Business term | K-Opticom's customer self-service web portal where subscribers manage their account settings |
| Sub-option Service | Business term | Optional add-on services attached to the base service contract (e.g., Homepage Capacity, Access Analysis) |
| Access Analysis | Business term | Web traffic analysis sub-option service for My Homepage subscribers |
| Homepage Capacity | Business term | Storage/upload capacity allocation for the subscriber's My Homepage |
| Process Division | Business term | Transaction type classifier — determines whether the screen is in Change, Termination, Registration, etc. mode |
| JCCWebCommon | Component | Common web utility class providing operational date retrieval and other cross-module helpers |
| JPCUtilCommon | Component | Common string utility class providing zero-padding and string editing functions |
