# Business Logic — KKW02410SFLogic.setDataInit() [25 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.KKW02410SF.KKW02410SFLogic` |
| Layer | Controller (Web presentation layer — SF/Screen Flow Logic class) |
| Module | `KKW02410SF` (Package: `eo.web.webview.KKW02410SF`) |

## 1. Role

### KKW02410SFLogic.setDataInit()

This method initializes the screen DataBean for the **Femtocell Operation Update** screen (KKW02410SF), which allows operators to perform cancellation (解約) or activation (復活) of femtocell service contracts within a telecom order management system. Specifically, it performs **two initialization tasks**: (1) it retrieves the operation date (`unyo_ymd`) from the DataBean, and if the processing division indicates a cancellation, it copies that operation date into the **use end date** field (`USE_ENDYMD`), effectively setting the contract termination date to the current operation date; (2) it sets the **progress special item 1** field (`PRG_TKJK_1`) to a label that identifies the screen context — either "Femtocell Information + Cancellation" for cancellation processing or "Femtocell Information + Activation" for non-cancellation (activation) processing. The method implements a **conditional dispatch pattern** based on the `trandiv` (processing division) parameter, branching on whether the operation is a cancellation (`OP_TRAN_DIV_DSL = "04"`) or not. It serves as the **data preparation step** within the screen's entry point flow (`actionInit`), bridging service retrieval and final screen rendering by ensuring all initial DataBean values are correctly populated for both cancellation and activation scenarios.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["setDataInit start"])
    A["Get unyo_ymd from paramBean[0]"] --> B{Is trandiv = DSL?}
    B -- Yes --> C["Set USE_ENDYMD to unyo_ymd"]
    B -- Yes --> D{Is trandiv = DSL again?}
    B -- No --> E["Set PRG_TKJK_1 to FEMTSEL_INFO + KAIHK"]
    C --> D
    D -- Yes --> F["Set PRG_TKJK_1 to FEMTSEL_INFO + DSL"]
    D -- No --> G["Return"]
    E --> G
    F --> G
    END(["Return / Next"])
    G --> END
```

**CRITICAL — Constant Resolution:**
The method branches on `JKKCommonConst.OP_TRAN_DIV_DSL` which resolves to `"04"` — the **Cancellation** (解約) processing division code. See [-> JKKCommonConst.OP_TRAN_DIV_DSL="04" (JKKCommonConst.java:2510)] for source location.

Additional constants resolved:
- `KKW02410SFConst.USE_YMD` = "運用年月日" (Operation Date) — [-> KKW02410SFConst.USE_YMD="運用年月日" (KKW02410SFConst.java:94)]
- `KKW02410SFConst.USE_ENDYMD` = "利用終了日" (Use End Date) — [-> KKW02410SFConst.USE_ENDYMD="利用終了日" (KKW02410SFConst.java:60)]
- `KKW02410SFConst.PRG_TKJK_1` = "進捗特記事項１" (Progress Special Item 1) — [-> KKW02410SFConst.PRG_TKJK_1="進捗特記事項１" (KKW02410SFConst.java:152)]
- `FEMTSEL_INFO` = "フェムセル情報" (Femtocell Information) — [-> KKW02410SFLogic.FEMTSEL_INFO="フェムセル情報" (KKW02410SFLogic.java:54)]
- `DSL` = "解約" (Cancellation) — [-> KKW02410SFLogic.DSL="解約" (KKW02410SFLogic.java:55)]
- `KAIHK` = "復活" (Activation/Restoration) — [-> KKW02410SFLogic.KAIHK="復活" (KKW02410SFLogic.java:56)]
- `JKKCommonConst.OP_TRAN_DIV_DSL` = "04" (Cancellation) — [-> JKKCommonConst.OP_TRAN_DIV_DSL="04" (JKKCommonConst.java:2510)]
- `X31CWebConst.DATABEAN_GET_VALUE` — used to retrieve DataBean value
- `X31CWebConst.DATABEAN_SET_VALUE` — used to set DataBean value

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `paramBean` | `X31SDataBeanAccess[]` | Array of DataBean access objects carrying screen field values. The first element `paramBean[0]` is the primary screen form bean that holds all input/output fields for the Femtocell Operation Update screen, including operational date, service contract numbers, and progress tracking fields. |
| 2 | `trandiv` | `String` | Processing division code that determines the type of operation being performed on the femtocell service contract. Possible values include `"04"` (Cancellation/解約) and `"05"` (Activation/復活) as defined in `JKKCommonConst`. This parameter controls which initialization branches are executed — specifically whether the use end date is populated and whether the progress label shows "Cancellation" or "Activation". |

**Instance fields read:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `FEMTSEL_INFO` | `private static final String` | Static label "フェムセル情報" (Femtocell Information) — prefix used when building the progress special item display string. |
| `DSL` | `private static final String` | Static label "解約" (Cancellation) — appended to `FEMTSEL_INFO` when processing a cancellation. |
| `KAIHK` | `private static final String` | Static label "復活" (Activation/Restoration) — appended to `FEMTSEL_INFO` when processing non-cancellation (activation) scenarios. |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| U | `OneStopDataBeanAccess.sendMessageString` (×4 calls) | OneStopDataBeanAccess | - | DataBean field access — retrieves and sets screen DataBean values directly. No database CRUD; operates on the in-memory form bean. |

**CRUD Classification Rationale:**
- `sendMessageString` with `DATABEAN_GET_VALUE` is a **Read** operation on the screen DataBean (pulling the operation date from the form).
- `sendMessageString` with `DATABEAN_SET_VALUE` is an **Update** operation on the screen DataBean (writing the use end date and progress special item fields).
- All operations are in-memory DataBean access — no external SC (Service Component) or CBS (Common Business Service) calls are made within this method. No database tables are directly queried or modified.

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `sendMessageString(DATABEAN_GET_VALUE)` | OneStopDataBeanAccess | - | Read operation date (`運用年月日`) from the screen DataBean for later use in cancellation processing. |
| U | `sendMessageString(DATABEAN_SET_VALUE, unyo_ymd)` | OneStopDataBeanAccess | - | Update the use end date field (`利用終了日`) with the operation date when processing a cancellation. |
| U | `sendMessageString(DATABEAN_SET_VALUE, FEMTSEL_INFO + DSL)` | OneStopDataBeanAccess | - | Update the progress special item 1 field with "Femtocell Information + Cancellation" for cancellation processing. |
| U | `sendMessageString(DATABEAN_SET_VALUE, FEMTSEL_INFO + KAIHK)` | OneStopDataBeanAccess | - | Update the progress special item 1 field with "Femtocell Information + Activation" for non-cancellation processing. |

## 5. Dependency Trace

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

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Screen: KKW02410SF (Femtocell Operation Update) | `KKW02410SFLogic.actionInit` -> `KKW02410SFLogic.setDataInit` | `sendMessageString [R/U] DataBean` |

**Caller details:**

`KKW02410SFLogic.actionInit()` is the public entry point method that orchestrates the full screen initialization flow for the Femtocell Operation Update screen. It:
1. Calls `JCCWebCommon.getScreenInfo(this)` to retrieve screen context information.
2. Obtains the `X31SDataBeanAccess` service form bean.
3. Calls `setHktgiBean(paramBean)` to set inherited customer contract data.
4. Calls `executeInitSvc(paramBean)` to fetch initial service data from the backend.
5. Reads the `TRAN_DIV` (processing division) field from the form bean.
6. Calls `setDataInit(paramBean, trandiv)` — this method — to initialize operation-date-dependent fields.
7. Displays an appropriate message based on whether the processing division is cancellation (`"04"`) or activation (`"05"`).

## 6. Per-Branch Detail Blocks

**Block 1** — [EXEC] `(L167)` // 運用年月日取得 (Get operation date)

Retrieves the operation date (`unyo_ymd`) from the first DataBean element using the `USE_YMD` key.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `String unyo_ymd = paramBean[0].sendMessageString(KKW02410SFConst.USE_YMD, X31CWebConst.DATABEAN_GET_VALUE)` // Retrieve operation date from DataBean [-> KKW02410SFConst.USE_YMD="運用年月日" (KKW02410SFConst.java:94), -> JKKCommonConst.OP_TRAN_DIV_DSL="04" (JKKCommonConst.java:2510)] |

**Block 2** — [IF] `(JKKCommonConst.OP_TRAN_DIV_DSL.equals(trandiv))` [OP_TRAN_DIV_DSL="04"] (L170) // 処理区分が解約の場合 (If processing division is cancellation)

If the processing division is "04" (Cancellation/解約), this block copies the operation date to the **use end date** field. This effectively sets the contract termination date to the same date as the operation date, which is the standard behavior for cancellation processing.

**Block 2.1** — [EXEC] (nested within Block 2, L173) // 運用年月日→利用終了日 (Operation date → Use end date)

Sets the use end date (`利用終了日`) in the DataBean to the retrieved operation date value.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `paramBean[0].sendMessageString(KKW02410SFConst.USE_ENDYMD, X31CWebConst.DATABEAN_SET_VALUE, unyo_ymd)` // Copy operation date to use end date for cancellation [-> KKW02410SFConst.USE_ENDYMD="利用終了日" (KKW02410SFConst.java:60)] |

**Block 3** — [IF] `(JKKCommonConst.OP_TRAN_DIV_DSL.equals(trandiv))` [OP_TRAN_DIV_DSL="04"] (L178) // 進捗補足事項編集対応 — 処理区分が解約の場合 (Progress supplementary item edit support — If processing division is cancellation)

A second conditional branch (independent from Block 2) that sets the **progress special item 1** display label. If the processing division is "04" (Cancellation), it concatenates the static "Femtocell Information" prefix with the "Cancellation" suffix. This is part of the [ANK-1223-00-00] progress supplementary item edit support enhancement added on 2012/11/05.

**Block 3.1** — [EXEC] (nested within Block 3, L180) // 進捗特記事項１ (Progress special item 1)

Sets the progress special item 1 field to "Femtocell Information + Cancellation".

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `paramBean[0].sendMessageString(KKW02410SFConst.PRG_TKJK_1, X31CWebConst.DATABEAN_SET_VALUE, FEMTSEL_INFO + DSL)` // Set progress label to "Femtocell Information" + "Cancellation" [-> KKW02410SFConst.PRG_TKJK_1="進捗特記事項１" (KKW02410SFConst.java:152), -> FEMTSEL_INFO="フェムセル情報" (KKW02410SFLogic.java:54), -> DSL="解約" (KKW02410SFLogic.java:55)] |

**Block 4** — [ELSE] (L182) // 処理区分が解約以外の場合 (If processing division is not cancellation)

If the processing division is NOT "04" (i.e., it is "05" Activation/復活 or any other value), this block sets the progress special item 1 to "Femtocell Information + Activation".

**Block 4.1** — [EXEC] (nested within Block 4, L184) // 進捗特記事項１ (Progress special item 1)

Sets the progress special item 1 field to "Femtocell Information + Activation".

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `paramBean[0].sendMessageString(KKW02410SFConst.PRG_TKJK_1, X31CWebConst.DATABEAN_SET_VALUE, FEMTSEL_INFO + KAIHK)` // Set progress label to "Femtocell Information" + "Activation" [-> KKW02410SFConst.PRG_TKJK_1="進捗特記事項１" (KKW02410SFConst.java:152), -> KAIHK="復活" (KKW02410SFLogic.java:56)] |

**Block 5** — [RETURN] `(L188)` // No explicit return (void method)

Method completes. Control returns to `actionInit()` which proceeds to display a message (if cancellation or activation) and then renders the screen.

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `unyo_ymd` | Field | Operation date — the date on which the operator is performing the femtocell service contract operation (cancellation or activation). YYYYMMDD format. |
| `USE_YMD` | Constant | Operation date (運用年月日) — DataBean key used to retrieve the current operation date from the screen form. |
| `USE_ENDYMD` | Constant | Use end date (利用終了日) — DataBean key for the service contract termination date. For cancellations, this is set to the operation date. |
| `PRG_TKJK_1` | Constant | Progress special item 1 (進捗特記事項１) — DataBean key for a display field that shows contextual progress information on the screen. |
| `FEMTSEL_INFO` | Constant | "Femtocell Information" (フェムセル情報) — Static prefix string used when building the progress label for the femtocell operation screen. |
| `DSL` | Constant | "Cancellation" (解約) — Static suffix appended to `FEMTSEL_INFO` when the processing division is cancellation (code "04"). |
| `KAIHK` | Constant | "Activation/Restoration" (復活) — Static suffix appended to `FEMTSEL_INFO` when the processing division is NOT cancellation (typically code "05" for activation). |
| `OP_TRAN_DIV_DSL` | Constant | Processing division code "04" — Cancellation (解約). Defines the cancellation operation type within the common processing division enum. |
| `OP_TRAN_DIV_KAIHK` | Constant | Processing division code "05" — Activation (復活). Used by the caller (`actionInit`) to display the activation message. |
| `trandiv` | Parameter | Processing division (処理区分) — String code indicating the type of operation. "04" = Cancellation, "05" = Activation. |
| `paramBean` | Parameter | DataBean array — Container for screen form field values. `paramBean[0]` is the primary form bean for the femtocell operation screen. |
| KKW02410SF | Screen module | Femtocell Operation Update — a screen in the K-Opticom contract management system for managing femtocell (indoor small-cell base station) service contract lifecycle operations including cancellation and activation. |
| X31SDataBeanAccess | Component | OneStopDataBeanAccess — the framework's DataBean access class providing `sendMessageString()` for getting/setting screen field values via a message-passing protocol. |
| DATABEAN_GET_VALUE | Constant | Flag value for `sendMessageString` indicating a Read operation on the DataBean. |
| DATABEAN_SET_VALUE | Constant | Flag value for `sendMessageString` indicating a Write operation on the DataBean. |
| JKKCommonConst | Component | Shared common constants class defining standard processing division codes and other cross-screen constants. |
| KKW02410SFConst | Component | Module-specific constants class defining DataBean field keys and label strings for the KKW02410SF screen module. |
| ANK-1223-00-00 | Ticket | Enhancement request for progress supplementary item edit support — added the progress special item 1 field to the femtocell operation screen on 2012/11/05. |
| Femtocell | Business term | A low-power cellular base station (indoor small cell) deployed to improve indoor mobile coverage. In this system, femtocell service contracts can be created, cancelled, and reactivated. |
