---
# Business Logic — KKW02510SFLogic.storeDataBeanInitsrv() [92 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.KKW02510SF.KKW02510SFLogic` |
| Layer | Controller (webview logic layer) |
| Module | `KKW02510SF` (Package: `eo.web.webview.KKW02510SF`) |

## 1. Role

### KKW02510SFLogic.storeDataBeanInitsrv()

This method performs the **initial display data save processing** (初期表示Data保存処理) for the Multi-Session Information Update screen (KKW02510SF). Its primary purpose is to prepare and initialize the DataBean state when a customer first opens the multi-session service update screen, whether they are viewing an existing contract, changing it, canceling it, recovering it from a canceled state, or managing a reservation cancellation.

The method follows a **delegation + state initialization** design pattern. It first delegates to six read operations (`getKKSV007101SC` through `getKKSV007106SC`) via the `KKSV0071_KKSV0071OPDBMapper` to load existing customer service contract data into the parameter beans. After data retrieval, it populates the DataBean with initialization values: an update-ability flag, a session count tracker, authentication credentials (multi-session auth ID and initial password), and processing-division-specific date fields.

The method branches by **processing division code** (TRAN_DIV) to handle five distinct business operations: contract cancellation (`"04"` / 解約) — where it splits the operational date (unyo_ymd) into year, month, and day components; change (`"03"` / 変更) — where it copies the service end date; and promotion (`"00"` / 照会), recovery (`"05"` / 回復), or reservation cancellation (`"06"` / 予約取消) — where it also copies the service end date. A previously active cancellation date initialization block was commented out and replaced with a more robust format-validated date-splitting approach (IT1-2012-0001599).

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["storeDataBeanInitsrv params"])
    CHECK_OUTPUT["outputMap != null"]
    MAPPER["mapper = new KKSV0071_KKSV0071OPDBMapper"]
    READ_01["mapper.getKKSV007101SC"]
    READ_02["mapper.getKKSV007102SC"]
    READ_03["mapper.getKKSV007103SC"]
    READ_04["mapper.getKKSV007104SC"]
    READ_05["mapper.getKKSV007105SC"]
    READ_06["mapper.getKKSV007106SC"]
    CHG_FLAG["Set CHG_KAHI_FLG = true"]
    SESSION_CNT["Set CHG_SESSION_CNT from CUR_SESSION_CNT"]
    AUTH_ID["Set NINSHO_ID from MLTISE_NINSHO_ID"]
    INIT_PWD["Set SHK_PWD from MLTISE_SHK_NINSHO_ID_PWD"]
    GET_TRANS_DIV["Get TRAN_DIV from paramBean"]
    DSL_BRANCH["OP_TRAN_DIV_DSL equals"]
    CHGE_BRANCH["OP_TRAN_DIV_CHGE equals"]
    SHOKAI_BRANCH["OP_TRAN_DIV_SHOKAI or KAIHK or RSV_CL equals"]
    DSL_DATE_CHECK["unyo_ymd valid length"]
    DSL_SET_YEAR["Set USE_ENDYMD_YEAR"]
    DSL_SET_MON["Set USE_ENDYMD_MON"]
    DSL_SET_DAY["Set USE_ENDYMD_DAY"]
    CHGE_SET_END["Set USE_ENDYMD from SVC_END_YMD"]
    SHOKAI_SET_END["Set USE_ENDYMD from SVC_END_YMD"]
    END_NODE(["Return"])

    START --> CHECK_OUTPUT
    CHECK_OUTPUT -->|true| MAPPER
    CHECK_OUTPUT -->|false| END_NODE
    MAPPER --> READ_01
    READ_01 --> READ_02
    READ_02 --> READ_03
    READ_03 --> READ_04
    READ_04 --> READ_05
    READ_05 --> READ_06
    READ_06 --> CHG_FLAG
    CHG_FLAG --> SESSION_CNT
    SESSION_CNT --> AUTH_ID
    AUTH_ID --> INIT_PWD
    INIT_PWD --> GET_TRANS_DIV
    GET_TRANS_DIV --> DSL_BRANCH
    DSL_BRANCH -->|true| DSL_DATE_CHECK
    DSL_BRANCH -->|false| CHGE_BRANCH
    CHGE_BRANCH -->|true| CHGE_SET_END
    CHGE_BRANCH -->|false| SHOKAI_BRANCH
    SHOKAI_BRANCH -->|true| SHOKAI_SET_END
    SHOKAI_BRANCH -->|false| END_NODE
    DSL_DATE_CHECK -->|true| DSL_SET_YEAR
    DSL_DATE_CHECK -->|false| END_NODE
    DSL_SET_YEAR --> DSL_SET_MON
    DSL_SET_MON --> DSL_SET_DAY
    DSL_SET_DAY --> END_NODE
    CHGE_SET_END --> END_NODE
    SHOKAI_SET_END --> END_NODE
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `paramBean` | `X31SDataBeanAccess[]` | Array of DataBean accessors representing the multi-session service update screen state. `paramBean[0]` is the primary access handle used for all get/set operations. It carries the processing division code (TRAN_DIV) which determines the business operation type, along with operational date data (unyo_ymd) for cancellation processing, service end date (SVC_END_YMD) for change/promotion/recovery/cancellation operations, and holds initialized values like auth IDs, passwords, and session counts. |
| 2 | `outputMap` | `HashMap<String, Object>` | Output information map used to carry service-side output data. When `outputMap != null`, the method delegates to six mapper read methods to populate the paramBean with existing customer service contract data. When `null`, the method performs only the dataBean initialization and returns without any data retrieval. |

**External/Instance Fields Read:** None directly — the method instantiates its own local `KKSV0071_KKSV0071OPDBMapper` and operates solely through the parameter objects.

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `JKKAdEditCC.substring` | JKKAdEditCC | - | Calls `substring` in `JKKAdEditCC` |
| - | `JKKAdEdit.substring` | JKKAdEdit | - | Calls `substring` in `JKKAdEdit` |
| - | `JKKTelnoInfoAddMapperCC.substring` | JKKTelnoInfoAddMapperCC | - | Calls `substring` in `JKKTelnoInfoAddMapperCC` |
| - | `JDKejbStringEdit.substring` | JDKejbStringEdit | - | Calls `substring` in `JDKejbStringEdit` |
| - | `OneStopDataBeanAccess.sendMessageString` | OneStopDataBeanAccess | - | Calls `sendMessageString` in `OneStopDataBeanAccess` |
| R | `KKSV0071_KKSV0071OPDBMapper.getKKSV007101SC` | KKSV0071_KKSV0071OPDBMapper | - | Calls `getKKSV007101SC` in `KKSV0071_KKSV0071OPDBMapper` |
| R | `KKSV0071_KKSV0071OPDBMapper.getKKSV007102SC` | KKSV0071_KKSV0071OPDBMapper | - | Calls `getKKSV007102SC` in `KKSV0071_KKSV0071OPDBMapper` |
| R | `KKSV0071_KKSV0071OPDBMapper.getKKSV007103SC` | KKSV0071_KKSV0071OPDBMapper | - | Calls `getKKSV007103SC` in `KKSV0071_KKSV0071OPDBMapper` |
| R | `KKSV0071_KKSV0071OPDBMapper.getKKSV007104SC` | KKSV0071_KKSV0071OPDBMapper | - | Calls `getKKSV007104SC` in `KKSV0071_KKSV0071OPDBMapper` |
| R | `KKSV0071_KKSV0071OPDBMapper.getKKSV007105SC` | KKSV0071_KKSV0071OPDBMapper | - | Calls `getKKSV007105SC` in `KKSV0071_KKSV0071OPDBMapper` |
| R | `KKSV0071_KKSV0071OPDBMapper.getKKSV007106SC` | KKSV0071_KKSV0071OPDBMapper | - | Calls `getKKSV007106SC` in `KKSV0071_KKSV0071OPDBMapper` |

## 5. Dependency Trace

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

No screen/batch entry points found within 8 hops. Direct callers found: 2 methods.
Terminal operations from this method: `sendMessageString` [-], `sendMessageString` [-], `sendMessageString` [-], `sendMessageString` [-], `sendMessageString` [-], `sendMessageString` [-], `sendMessageString` [-], `sendMessageString` [-], `sendMessageString` [-], `sendMessageString` [-], `substring` [-], `substring` [-], `substring` [-], `substring` [-], `sendMessageString` [-], `sendMessageString` [-], `substring` [-], `substring` [-], `substring` [-], `substring` [-]

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | `KKW02510SFLogic.actionClear()` | `actionClear()` -> `storeDataBeanInitsrv(paramBean, outputMap)` | `sendMessageString [-]` (re-initializes the screen by calling storeDataBeanInitsrv on clear) |
| 2 | `KKW02510SFLogic.actionInit()` | `actionInit()` -> `storeDataBeanInitsrv(paramBean, outputMap)` | `sendMessageString [-]`, `getKKSV007101SC` through `getKKSV007106SC` (reads 6 sets of customer service contract data on init) |

## 6. Per-Branch Detail Blocks

**Block 1** — IF `(outputMap != null)` (L768)

> Gate: only proceed with data retrieval and initialization if outputMap is non-null.

| # | Type | Code |
|---|------|------|
| 1 | SET | `mapper = new KKSV0071_KKSV0071OPDBMapper()` |
| 2 | CALL | `mapper.getKKSV007101SC(paramBean, outputMap)` — Read customer service contract data (set 1) |
| 3 | CALL | `mapper.getKKSV007102SC(paramBean, outputMap)` — Read customer service contract data (set 2) |
| 4 | CALL | `mapper.getKKSV007103SC(paramBean, outputMap)` — Read customer service contract data (set 3) |
| 5 | CALL | `mapper.getKKSV007104SC(paramBean, outputMap)` — Read customer service contract data (set 4) |
| 6 | CALL | `mapper.getKKSV007105SC(paramBean, outputMap)` — Read customer service contract data (set 5) |
| 7 | CALL | `mapper.getKKSV007106SC(paramBean, outputMap)` — Read customer service contract data (set 6) |
| 8 | EXEC | `paramBean[0].sendMessageBoolean(CHG_KAHI_FLG, DATABEAN_SET_VALUE, true)` — Sets the update-ability flag to true (更新状態可否フラグを更新可能にする: make update state flag update-able) [-> KKW02510SFConst.CHG_KAHI_FLG="更新可否"] |
| 9 | EXEC | `paramBean[0].sendMessageString(CHG_SESSION_CNT, DATABEAN_SET_VALUE, paramBean[0].sendMessageString(CUR_SESSION_CNT, DATABEAN_GET_VALUE))` — Sets session count from the pre-update session count (セッション数: session count) [-> KKW02510SFConst.CHG_SESSION_CNT="セッション数"] |
| 10 | EXEC | `paramBean[0].sendMessageString(NINSHO_ID, DATABEAN_SET_VALUE, paramBean[0].sendMessageString(MLTISE_NINSHO_ID, DATABEAN_GET_VALUE))` — Sets authentication ID from multi-session auth ID (認証ID: auth ID) [-> KKW02510SFConst.NINSHO_ID="認証ID"] |
| 11 | EXEC | `paramBean[0].sendMessageString(SHK_PWD, DATABEAN_SET_VALUE, paramBean[0].sendMessageString(MLTISE_SHK_NINSHO_ID_PWD, DATABEAN_GET_VALUE))` — Sets initial password from multi-session initial auth ID password (初期パスワード: initial password) [-> KKW02510SFConst.SHK_PWD="初期パスワード"] |
| 12 | SET | `trans_div = paramBean[0].sendMessageString(TRAN_DIV, DATABEAN_GET_VALUE)` — Gets the processing division code from paramBean [-> KKW02510SFConst.TRAN_DIV="処理区分"] |
| 13 | IF | See Block 1.1 (branch on trans_div value) |

**Block 1.1** — IF `[JKKCommonConst.OP_TRAN_DIV_DSL = "04" (Contract Cancellation / 解約)]` (L788)

> Branch: processing division is "contract cancellation" (解約). The method splits the operational date (unyo_ymd) into year, month, and day components. A previous implementation that simply cleared the cancellation date fields for "解約" was removed (IT1-2012-0001599 Delete Start/End). A new approach was added (IT1-2012-0001599 Add Start/End) that validates the unyo_ymd format and splits it using substring operations.

| # | Type | Code |
|---|------|------|
| 1 | SET | `unyo_ymd = paramBean[0].sendMessageString(UNYO_YMD, DATABEAN_GET_VALUE)` — Gets operational date (運用年月日: operational year-month-day) |
| 2 | IF | See Block 1.1.1 (unyo_ymd validation) |

**Block 1.1.1** — IF `(unyo_ymd != null && !"".equals(unyo_ymd) && 8 == unyo_ymd.length())` (L798)

> Validates that the operational date is non-empty and is exactly 8 characters long (YYYYMMDD format) before splitting it into year, month, and day components.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `paramBean[0].sendMessageString(USE_ENDYMD_YEAR, DATABEAN_SET_VALUE, unyo_ymd.substring(0, 4))` — Sets cancellation date year (利用終了日（年）: service end date (year)) [-> KKW02510SFConst.USE_ENDYMD_YEAR="利用終了日（年）"] |
| 2 | EXEC | `paramBean[0].sendMessageString(USE_ENDYMD_MON, DATABEAN_SET_VALUE, unyo_ymd.substring(4, 6))` — Sets cancellation date month (利用終了日（月）: service end date (month)) [-> KKW02510SFConst.USE_ENDYMD_MON="利用終了日（月）"] |
| 3 | EXEC | `paramBean[0].sendMessageString(USE_ENDYMD_DAY, DATABEAN_SET_VALUE, unyo_ymd.substring(6, 8))` — Sets cancellation date day (利用終了日（日）: service end date (day)) [-> KKW02510SFConst.USE_ENDYMD_DAY="利用終了日（日）"] |

**Block 1.2** — ELSE-IF `[JKKCommonConst.OP_TRAN_DIV_CHGE = "03" (Change / 変更)]` (L809)

> Branch: processing division is "change" (変更). Copies the service end date (SVC_END_YMD) to the cancellation date field (USE_ENDYMD). A previously active dynamic/static IP determination block was commented out (動的・静的の判定は固定グローバルIPアドレスのオプションの有無で判定: dynamic/static determination is based on whether fixed global IP address option exists).

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `paramBean[0].sendMessageString(USE_ENDYMD, DATABEAN_SET_VALUE, paramBean[0].sendMessageString(SVC_END_YMD, DATABEAN_GET_VALUE))` — Sets cancellation date (利用終了日: service end date) from service end year-month-day [-> KKW02510SFConst.USE_ENDYMD="利用終了日"] |

**Block 1.3** — ELSE-IF `[JKKCommonConst.OP_TRAN_DIV_SHOKAI = "00" (Promotion / 照会) OR JKKCommonConst.OP_TRAN_DIV_KAIHK = "05" (Recovery / 回復) OR JKKCommonConst.OP_TRAN_DIV_RSV_CL = "06" (Reservation Cancellation / 予約取消)]` (L816)

> Branch: processing division is one of "promotion", "recovery", or "reservation cancellation". In all three cases, the same initialization is performed: copy the service end date to the cancellation date field.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `paramBean[0].sendMessageString(USE_ENDYMD, DATABEAN_SET_VALUE, paramBean[0].sendMessageString(SVC_END_YMD, DATABEAN_GET_VALUE))` — Sets cancellation date (利用終了日: service end date) from service end year-month-day. Handles all three operation types identically. |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `TRAN_DIV` | Field | Processing division code — classifies the type of operation: 00=Promotion (照会), 03=Change (変更), 04=Contract Cancellation (解約), 05=Recovery (回復), 06=Reservation Cancellation (予約取消) |
| `OP_TRAN_DIV_DSL` | Constant | Processing division code for "Contract Cancellation" (解約) — value `"04"` |
| `OP_TRAN_DIV_CHGE` | Constant | Processing division code for "Change" (変更) — value `"03"` |
| `OP_TRAN_DIV_SHOKAI` | Constant | Processing division code for "Promotion" (照会) — value `"00"` |
| `OP_TRAN_DIV_KAIHK` | Constant | Processing division code for "Recovery" (回復) — value `"05"` |
| `OP_TRAN_DIV_RSV_CL` | Constant | Processing division code for "Reservation Cancellation" (予約取消) — value `"06"` |
| `CHG_KAHI_FLG` | Field | Update-ability flag (更新可否フラグ) — indicates whether the data is in an update-able state |
| `CHG_SESSION_CNT` | Field | Session count (セッション数) — number of sessions for the current operation |
| `CUR_SESSION_CNT` | Field | Pre-update session count (更新前セッション数) — session count before the update |
| `NINSHO_ID` | Field | Authentication ID (認証ID) — user authentication identifier displayed on screen |
| `SHK_PWD` | Field | Initial password (初期パスワード) — initial password value shown to user |
| `MLTISE_NINSHO_ID` | Field | Multi-session authentication ID (マルチセッション用認証ID) — auth ID used for multi-session operations |
| `MLTISE_SHK_NINSHO_ID_PWD` | Field | Multi-session initial auth ID password (マルチセッション用初期認証IDパスワード) — initial password for multi-session auth |
| `USE_ENDYMD` | Field | Service end date (利用終了日) — the date when the service contract ends |
| `USE_ENDYMD_YEAR` | Field | Service end date year (利用終了日（年）) — year component of the cancellation date |
| `USE_ENDYMD_MON` | Field | Service end date month (利用終了日（月）) — month component of the cancellation date |
| `USE_ENDYMD_DAY` | Field | Service end date day (利用終了日（日）) — day component of the cancellation date |
| `UNYO_YMD` | Field | Operational date (運用年月日) — full operational date in YYYYMMDD format used in cancellation processing |
| `SVC_END_YMD` | Field | Service end year-month-day (サービス終了年月日) — full service end date string used for change/promotion/recovery/reservation cancellation |
| `KKSV0071_KKSV0071OPDBMapper` | Class | Database mapper for KKW02510SF — delegates to six read service calls (getKKSV007101SC through getKKSV007106SC) to retrieve customer service contract data |
| X31SDataBeanAccess | Class | DataBean access wrapper — provides `sendMessageString` and `sendMessageBoolean` methods for reading/writing dataBean fields by key |
| Multi-Session | Business term | A feature allowing multiple concurrent sessions for a single customer's service contract, requiring separate authentication IDs and passwords per session |
