# Business Logic - KKW04202SFLogic.getTekkyoDiv() [1658 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.KKW04202SF.KKW04202SFLogic` |
| Layer | Logic / Web Application (Service Logic Layer) |
| Module | `KKW04202SF` (Package: `eo.web.webview.KKW04202SF`) |

## 1. Role

### KKW04202SFLogic.getTekkyoDiv()

The `getTekkyoDiv()` method is the central business-logic dispatcher that determines the **Removal Classification (Tekkyo Bun - 撤去区分)** for equipment involved in a move (transferred address) scenario. In the context of NTT East's telecom service change system, when a customer moves residences, the system must decide which removal options (tekyo div) to present for each currently-used piece of equipment.

The method receives a suite of input parameters describing the equipment type (`use_kiki_div`), the service change type (`svc_chg_div` - continuation, change, hold, or cancellation), the removal scope (`kj_scope_div` - all, partial, IP-only, TV-only), and whether additional use is available (`use_kh_div`). It then applies a multi-dimensional decision matrix to determine the exact `tekkyo_div` result and the set of dropdown options (`tekkyo_pdn_array`) that the UI should present.

The method uses the **Router/Dispatcher pattern**, branching by `use_kiki_div` constant into 15 distinct equipment-specific logic blocks. Each block further branches by `svc_chg_div` into up to 4 service change categories, and often sub-branches by additional flags (`use_kh_div`, `kiki_tk_div`, `kiki_scope_div`, `owner_Cd`, `isMansion`).

Its role in the larger system is to set two fields in the screen's data bean: `USE_KIKI_TEKKYO_DIV_05` (the selected removal classification) and `USE_KIKI_TEKKYO_PDN_05` (the list of dropdown options). This directly drives the UI behavior on the move service change screen, controlling which removal actions the user can select for each piece of equipment.

---

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["getTekkyoDiv start"])
    GET_BEAN["Get svcFormBean, create paramBean"]
    CHECK_MANSION["Check if mansion: pre/post move == MANSION?"]
    GET_OWNER_CD["Get owner_Cd from bean"]

    CHECK_DIV["use_kiki_div ?"]

    BLOCK_D0["Block D0: ONU
(work company cannot transfer, rental only)"]
    BLOCK_E0["Block E0: V-ONU
(work company cannot transfer, rental only)"]
    BLOCK_50["Block 50: Telephone VA
(work company can transfer, rental only)"]
    BLOCK_80["Block 80: Network VA
(work company cannot transfer, purchase/rental/hold)"]
    BLOCK_60["Block 60: Modem
(work company cannot transfer, purchase/rental/hold)"]
    BLOCK_70["Block 70: Splitter
(work company cannot transfer, purchase/rental/hold)"]
    BLOCK_90["Block 90: Infotv
(work company cannot transfer, purchase only)"]
    BLOCK_F0["Block F0: Router
(work company can transfer, rental only)"]
    BLOCK_G0["Block G0: PLC Modem
(work company can transfer, rental only)"]
    BLOCK_M0["Block M0: Other equipment
(coaxial cable, distribution)"]
    BLOCK_P0["Block P0: Tablet
(work company cannot transfer, purchase only)"]
    BLOCK_L1["Block L1: Credit reader (for tablet)"]
    BLOCK_Q0["Block Q0: IP-STB"]
    BLOCK_R0["Block R0: Multi-function router
(delegated to getTekkyoDivMultiRouter)"]
    BLOCK_S0["Block S0: HGW"]

    SET_RESULT["Set tekkyo_div and tekkyo_pdn_array to bean"]
    END_NODE(["Return"])

    START --> GET_BEAN --> CHECK_MANSION --> GET_OWNER_CD --> CHECK_DIV

    CHECK_DIV -->|"D0 (TAKNKIKI_SBT_D0) = ONU"| BLOCK_D0
    CHECK_DIV -->|"E0 (TAKNKIKI_SBT_E0) = V-ONU"| BLOCK_E0
    CHECK_DIV -->|"50 (TAKNKIKI_SBT_50) = Tel VA"| BLOCK_50
    CHECK_DIV -->|"80 (TAKNKIKI_SBT_80) = Net VA"| BLOCK_80
    CHECK_DIV -->|"60 (TAKNKIKI_SBT_60) = Modem"| BLOCK_60
    CHECK_DIV -->|"70 (TAKNKIKI_SBT_70) = Splitter"| BLOCK_70
    CHECK_DIV -->|"90 (TAKNKIKI_SBT_90) = Infotv"| BLOCK_90
    CHECK_DIV -->|"F0 (TAKNKIKI_SBT_F0) = Router"| BLOCK_F0
    CHECK_DIV -->|"G0 (TAKNKIKI_SBT_G0) = PLC Modem"| BLOCK_G0
    CHECK_DIV -->|"M0 (TAKNKIKI_SBT_M0) = Other"| BLOCK_M0
    CHECK_DIV -->|"P0 (TAKNKIKI_SBT_P0) = Tablet"| BLOCK_P0
    CHECK_DIV -->|"L1 (TAKNKIKI_SBT_L1) = Credit Reader"| BLOCK_L1
    CHECK_DIV -->|"Q0 (TAKNKIKI_SBT_Q0) = IP-STB"| BLOCK_Q0
    CHECK_DIV -->|"R0 (TAKNKIKI_SBT_R0) = Multi-Router"| BLOCK_R0
    CHECK_DIV -->|"S0 (TAKNKIKI_SBT_S0) = HGW"| BLOCK_S0

    BLOCK_D0 --> SET_RESULT
    BLOCK_E0 --> SET_RESULT
    BLOCK_50 --> SET_RESULT
    BLOCK_80 --> SET_RESULT
    BLOCK_60 --> SET_RESULT
    BLOCK_70 --> SET_RESULT
    BLOCK_90 --> SET_RESULT
    BLOCK_F0 --> SET_RESULT
    BLOCK_G0 --> SET_RESULT
    BLOCK_M0 --> SET_RESULT
    BLOCK_P0 --> SET_RESULT
    BLOCK_L1 --> SET_RESULT
    BLOCK_Q0 --> SET_RESULT
    BLOCK_R0 --> SET_RESULT
    BLOCK_S0 --> SET_RESULT

    SET_RESULT --> END_NODE
```

**Key design decisions embedded in the flow:**

1. **Mansion Check:** Before routing to equipment-specific blocks, the method checks whether the move involves a mansion property (either pre-move or post-move mansion code equals `MANSION_BUKKEN_CD_MANSION`). This affects which equipment can support "Inheritance" (HTG - 引継) — for example, telephone VA and router blocks skip the "inheritance" option when the customer is in a mansion because NTT East construction work cannot be performed.

2. **Owner Flag:** For modem block (S0), the `owner_Cd == "1"` flag (control-owner equipment flag) determines whether the customer owns the equipment, which affects dropdown options and removal classification outcomes.

3. **Auto-Change Router Check:** For telephone VA (50), router (F0), and multi-function router (R0) blocks, the method checks whether automatic router exchange is occurring (`isAutoChgRouterOrVA` or bean flag), which locks the removal classification to "Transfer (Multi)" with a fixed dropdown set.

4. **DSL/Network New Work Check:** For VA-eligible equipment (telephone VA, router, PLC modem), the method checks `isDslNewKojiAri(svcFormBean, svcCd)` to determine if there is construction work (removal + new installation). If true and not in a mansion, "Inheritance" (HTG) is included as a dropdown option.

---

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `use_kiki_div` | `String` | Equipment type code identifying the type of currently-used equipment. Values: `"50"` (Telephone VA), `"60"` (Modem), `"70"` (Splitter), `"80"` (Network VA), `"90"` (Infotv), `"D0"` (ONU), `"E0"` (V-ONU), `"F0"` (Router), `"G0"` (PLC Modem), `"M0"` (Other equipment: coaxial cable/distribution), `"P0"` (Tablet), `"L1"` (Credit reader for tablet), `"Q0"` (IP-STB), `"R0"` (Multi-function router), `"S0"` (HGW). Determines which of the 15 routing blocks executes. |
| 2 | `svc_chg_div` | `String` | Service change division code: `"0"` (Continuation / 継続), `"1"` (Change / 変更), `"2"` (Hold / 保留), `"3"` (Cancellation / 解約). Drives the inner branching within each equipment block. |
| 3 | `kj_scope_div` | `String` | Removal scope division — determines which services are subject to removal. Values include `"A"` (All removal / 全撤去), `"B"` (Partial removal / 残留撤去), `"C"` (IP-only removal / IPのみ撤去), `"D"` (TV-only removal / TVのみ撤去), and `KOJI_FUYO` (No removal). Only relevant for ONU (D0), V-ONU (E0), and HGW (S0) blocks. |
| 4 | `use_kh_div` | `String` | Additional use permission flag. `"1"` (`KH_PSG`) means additional use is available (plus use available). Non-`"1"` means additional use is not available. Affects change operation outcomes for multi-service equipment. |
| 5 | `kiki_tk_div` | `String` | Equipment provision division code. `"02"` (`KIKI_TK_SBT_02`) means rental. Used for Network VA (80), Modem (60), and Splitter (70) blocks to distinguish rental vs. purchase/own equipment. |
| 6 | `use_kiki_pcrs_cd` | `String` | Equipment purchase code (PCRS_CD). Values include `PCRS_CD_MODEM_RENT` (Modem rental) and `PCRS_CD_MODEM_BUY` (Modem purchase). Only referenced in commented/legacy code for the Modem block. |
| 7 | `use_kiki_bean` | `X31SDataBeanAccess` | Data bean access object for the currently-used equipment. Used to: (a) check the auto-change router flag via `USE_KIKI_KIKI_AUTO_KOKAN_TG_UM_05`, (b) write the final `tekkyo_div` result via `USE_KIKI_TEKKYO_DIV_05`, and (c) write the final dropdown list via `copyPdnList`. |

**Instance fields / external state read by the method:**
- `svcFormBean` — obtained from `super.getServiceFormBean()`, used for `isDslNewKojiAri()` and `isAutoChgRouterOrVA()` checks.
- `owner_Cd` — obtained from the bean via `sendMessageString(KKW04202SFConst.CTRL_OWNR_KIKI_FLG, ...)`. Value `"1"` means the customer owns the control-owner equipment (e.g., modem).

---

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `OneStopDataBeanAccess.sendMessageString` | OneStopDataBeanAccess | - | Reads mansion bukken code (pre/post move), owner flag, and auto-change flag from bean |
| - | `KKW04202SFLogic.copyPdnList` | KKW04202SFLogic | - | Copies the determined `tekkyo_pdn_array` to the bean as dropdown options |
| R | `KKW04202SFLogic.getTekkyoDivMultiRouter` | KKW04202SFLogic | - | For multi-function router (R0), delegates removal classification determination |
| - | `KKW04202SFLogic.isAutoChgRouterOrVA` | KKW04202SFLogic | - | Checks if automatic router exchange is occurring for VA or router equipment |
| - | `KKW04202SFLogic.isDslNewKojiAri` | KKW04202SFLogic | - | Checks if construction work (removal + new installation) exists for DSL/network service. Reads mansion codes, line codes, and service change divisions from bean. |
| - | `KKW04202SFLogic.isKojiScopeALL` | KKW04202SFLogic | - | Checks if `kj_scope_div` equals "all removal" scope |
| - | `KKW04202SFLogic.isKojiScopeIP` | KKW04202SFLogic | - | Checks if `kj_scope_div` equals "IP-only removal" scope |
| - | `KKW04202SFLogic.isKojiScopeTanmatsu` | KKW04202SFLogic | - | Checks if `kj_scope_div` equals "partial removal" scope |
| - | `KKW04202SFLogic.isKojiScopeTV` | KKW04202SFLogic | - | Checks if `kj_scope_div` equals "TV-only removal" scope |
| - | `JFUKyokaIpAdActionChkUtil.toArray` | JFUKyokaIpAdActionChk | - | Utility conversion in `copyPdnList` |

**No direct database or entity CRUD operations** are performed in this method. It is purely a decision/translation layer that reads data bean fields and writes computed results back. All service calls are internal logic helpers.

---

## 5. Dependency Trace

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

No screen/batch entry points found within 8 hops. Direct callers found: 3 methods.
Terminal operations from this method: `copyPdnList` [-], `sendMessageString` [-], `getTekkyoDivMultiRouter` [R], `isDslNewKojiAri` [-], `isAutoChgRouterOrVA` [-], `isKojiScopeTV` [-], `isKojiScopeTanmatsu` [-], `isKojiScopeIP` [-], `isKojiScopeALL` [-], `toArray` [-]

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | `KKW04202SFLogic.setKikiTekkyoDiv` | `setKikiTekkyoDiv` -> `getTekkyoDiv` | `sendMessageString` (bean write) -> `copyPdnList` (bean write) |
| 2 | `KKW04202SFLogic.setKikiTekkyoDivOnuOrVonu` | `setKikiTekkyoDivOnuOrVonu` -> `getTekkyoDiv` | `sendMessageString` (bean write) -> `copyPdnList` (bean write) |
| 3 | `KKW04202SFLogic.setTekkyoDivPdnList` | `setTekkyoDivPdnList` -> `getTekkyoDiv` | `sendMessageString` (bean write) -> `copyPdnList` (bean write) |

**Call chain description:**
- The method is called by three internal `KKW04202SFLogic` helper methods that prepare equipment-specific parameters and delegate to `getTekkyoDiv()` for the core decision logic.
- `setKikiTekkyoDiv()` — Sets removal classification for general equipment types (telephone VA, modem, splitter, network VA, infotv, router, PLC modem, other equipment, tablet, credit reader).
- `setKikiTekkyoDivOnuOrVonu()` — Sets removal classification for ONU (D0) and V-ONU (E0) equipment with scope-based branching.
- `setTekkyoDivPdnList()` — Sets removal dropdown options for each equipment type.

---

## 6. Per-Branch Detail Blocks

**Block 1** — INITIALIZATION (L20016)

> Get service form bean and detect if the move involves a mansion property.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `svcFormBean = super.getServiceFormBean()` |
| 2 | SET | `paramBean = {svcFormBean}` |
| 3 | SET | `isMansion = false` |
| 4 | EXEC | `s_itens_mansion_bukken_cd_bf = paramBean[0].sendMessageString(MANSION_BUKKEN_CD_BF, GET_VALUE)` // Pre-move mansion code |
| 5 | EXEC | `s_itens_mansion_bukken_cd_af = paramBean[0].sendMessageString(MANSION_BUKKEN_CD_AF, GET_VALUE)` // Post-move mansion code |
| 6 | IF | `MANSION_BUKKEN_CD_MANSION.equals(s_itens_mansion_bukken_cd_bf) OR MANSION_BUKKEN_CD_MANSION.equals(s_itens_mansion_bukken_cd_af)` -> `isMansion = true` [CONSTANT: MANSION_BUKKEN_CD_MANSION = "Mansion code value"] |

**Block 2** — GET OWNER FLAG (L20073)

> Retrieve the control-owner equipment flag from the bean.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `owner_Cd = paramBean[0].sendMessageString(CTRL_OWNR_KIKI_FLG, GET_VALUE)` |
| 2 | SET | `tekkyo_div = ""` // Initialize removal classification |
| 3 | SET | `tekkyo_pdn_array = new String[]{}` // Initialize dropdown array |

**Block 3** — ONU BLOCK: TAKNKIKI_SBT_D0 = "D0" (L20080)

> Equipment: ONU (optical network unit). Work company cannot transfer, rental only. Handles scope-based removal classification.

| # | Type | Code |
|---|------|------|
| 1 | IF | `TAKNKIKI_SBT_D0.equals(use_kiki_div)` = "D0" (ONU) |
| 2 | SET | `tekkyo_pdn_array = {TEKKYO_DIV_TEK, TEKKYO_DIV_ZAN, TEKKYO_DIV_KOKAN}` // Dropdown: Removal, Retain, Exchange |

**Block 3.1** — Scope: All Removal or IP-only Removal (L20089)

> `isKojiScopeALL(kj_scope_div) OR isKojiScopeIP(kj_scope_div) OR KOJI_FUYO.equals(kj_scope_div)`

| # | Type | Code |
|---|------|------|
| 1 | IF | `USE_SVC_CHG_DIV_CON.equals(svc_chg_div)` = "0" (Continuation) |
| 2 | SET | `tekkyo_div = TEKKYO_DIV_KOKAN` // Exchange |
| 3 | ELSE-IF | `USE_SVC_CHG_DIV_CHG.equals(svc_chg_div)` = "1" (Change) |
| 4 | IF | `KH_PSG.equals(use_kh_div)` = "1" (Additional use available) |
| 5 | SET | `tekkyo_div = TEKKYO_DIV_KOKAN` // Exchange |
| 6 | ELSE | SET `tekkyo_div = TEKKYO_DIV_TEK` // Removal |
| 7 | ELSE-IF | `USE_SVC_CHG_DIV_HOR.equals(svc_chg_div)` = "2" (Hold) |
| 8 | SET | `tekkyo_div = TEKKYO_DIV_ZAN` // Retain |
| 9 | ELSE-IF | `USE_SVC_CHG_DIV_DSL.equals(svc_chg_div)` = "3" (Cancellation) |
| 10 | SET | `tekkyo_div = TEKKYO_DIV_TEK` // Removal |

**Block 3.2** — Scope: Partial Removal or TV-only Removal (L20115)

> `isKojiScopeTanmatsu(kj_scope_div) OR isKojiScopeTV(kj_scope_div)`

| # | Type | Code |
|---|------|------|
| 1 | SET | `tekkyo_div = TEKKYO_DIV_ZAN` // Retain (always) |

**Block 3.3** — Else (Default scope) — OM-2018-0001106 ADD (L20122)

> For any other scope (not all/IP, not partial/TV), re-apply the full continuation/change/hold/cancellation logic.

| # | Type | Code |
|---|------|------|
| 1 | IF | Same as Block 3.1: Continuation -> Exchange, Change+available -> Exchange, Change+unavailable -> Removal, Hold -> Retain, Cancellation -> Removal |

**Block 4** — V-ONU BLOCK: TAKNKIKI_SBT_E0 = "E0" (L20150)

> Equipment: V-ONU (video optical network unit). Work company cannot transfer, rental only. Similar to ONU but scope branches are inverted: all removal includes TV-only (not IP-only).

| # | Type | Code |
|---|------|------|
| 1 | IF | `TAKNKIKI_SBT_E0.equals(use_kiki_div)` = "E0" (V-ONU) |
| 2 | SET | `tekkyo_pdn_array = {TEKKYO_DIV_TEK, TEKKYO_DIV_ZAN, TEKKYO_DIV_KOKAN}` // Dropdown: Removal, Retain, Exchange |

**Block 4.1** — Scope: All Removal or TV-only Removal (L20159)

> `isKojiScopeALL(kj_scope_div) OR isKojiScopeTV(kj_scope_div) OR KOJI_FUYO.equals(kj_scope_div)`

| # | Type | Code |
|---|------|------|
| 1 | IF | Continuation -> Exchange (`TEKKYO_DIV_KOKAN`) |
| 2 | ELSE-IF | Change + available -> Exchange, Change + unavailable -> Removal |
| 3 | ELSE-IF | Hold -> Retain (`TEKKYO_DIV_ZAN`) |
| 4 | ELSE-IF | Cancellation -> Removal (`TEKKYO_DIV_TEK`) |

**Block 4.2** — Scope: Partial Removal or IP-only Removal (L20185)

> `isKojiScopeTanmatsu(kj_scope_div) OR isKojiScopeIP(kj_scope_div)`

| # | Type | Code |
|---|------|------|
| 1 | SET | `tekkyo_div = TEKKYO_DIV_ZAN` // Always Retain |

**Block 4.3** — Else (Default scope) — OM-2018-0001106 ADD (L20192)

> Same full logic as Block 4.1.

**Block 5** — TELEPHONE VA BLOCK: TAKNKIKI_SBT_50 = "50" (L20224)

> Equipment: Telephone Voice Adapter (VA). Work company CAN transfer, rental only. This block handles the most complex decision matrix including mansion checks and auto-change router detection.

| # | Type | Code |
|---|------|------|
| 1 | IF | `TAKNKIKI_SBT_50.equals(use_kiki_div)` = "50" (Telephone VA) |

**Block 5.1** — Service Change: Continuation (L20232)

> Under ANK-1664-00-00: The old mansion/dslNewKojiAri logic was replaced with a simplified approach. The removal classification is always set to "Transfer (Multi)".

| # | Type | Code |
|---|------|------|
| 1 | SET | `tekkyo_div = TEKKYO_DIV_KOKAN_MULTI` // Transfer (Multi) |
| 2 | IF | `isAutoChgRouterOrVA(svcFormBean)` OR `autoFlg.equals("1")` |
| 3 | SET | `tekkyo_pdn_array = {TEKKYO_DIV_KOKAN_MULTI}` // Auto-change: fixed dropdown |
| 4 | ELSE | IF `isDslNewKojiAri(svcFormBean, SVC_CD_02) && !isMansion` |
| 5 | SET | `tekkyo_pdn_array = TEKKYO_PDN_LIST_TEL_VA` // Inheritance + Transfer (Multi) |
| 6 | ELSE | SET `tekkyo_pdn_array = TEKKYO_PDN_LIST_TEL_VA_NON_HTG` // Removal + Transfer (Multi) |

**Block 5.2** — Service Change: Change (L20290)

> Similar structure to continuation: always set `tekkyo_div` to "Transfer (Multi)", dropdown varies by auto-change/new-work/mansion.

| # | Type | Code |
|---|------|------|
| 1 | SET | `tekkyo_div = TEKKYO_DIV_KOKAN_MULTI` |
| 2 | IF | Auto-change flag = "1" |
| 3 | SET | `tekkyo_pdn_array = {TEKKYO_DIV_KOKAN_MULTI}` |
| 4 | ELSE | IF `isDslNewKojiAri(svcFormBean, SVC_CD_02) && !isMansion` |
| 5 | SET | `tekkyo_pdn_array = TEKKYO_PDN_LIST_TEL_VA` |
| 6 | ELSE | SET `tekkyo_pdn_array = {TEKKYO_DIV_KOKAN_MULTI}` // Mansion or no work: Transfer (Multi) only |

**Block 5.3** — Service Change: Hold (L20337)

| # | Type | Code |
|---|------|------|
| 1 | SET | `tekkyo_div = TEKKYO_DIV_ZAN` // Retain |
| 2 | SET | `tekkyo_pdn_array = {TEKKYO_DIV_HTG, TEKKYO_DIV_TEK, TEKKYO_DIV_ZAN}` // Inheritance, Removal, Retain |

**Block 5.4** — Service Change: Cancellation (L20343)

| # | Type | Code |
|---|------|------|
| 1 | SET | `tekkyo_div = TEKKYO_DIV_TEK` // Removal |
| 2 | SET | `tekkyo_pdn_array = {TEKKYO_DIV_HTG, TEKKYO_DIV_TEK, TEKKYO_DIV_ZAN}` // Inheritance, Removal, Retain |

**Block 6** — NETWORK VA BLOCK: TAKNKIKI_SBT_80 = "80" (L20350)

> Equipment: Network Voice Adapter (VA). Work company cannot transfer, purchase/rental/hold. Uses `kiki_tk_div` to distinguish rental from non-rental.

| # | Type | Code |
|---|------|------|
| 1 | IF | `TAKNKIKI_SBT_80.equals(use_kiki_div)` = "80" (Network VA) |
| 2 | IF | `KIKI_TK_SBT_02.equals(kiki_tk_div)` = "02" (Rental) |
| 3 | SET | `tekkyo_pdn_array = {TEKKYO_DIV_TEK, TEKKYO_DIV_ZAN, TEKKYO_DIV_KOKAN}` |
| 4 | ELSE | SET `tekkyo_pdn_array = {TEKKYO_DIV_HTG, TEKKYO_DIV_ZAN, TEKKYO_DIV_DSL}` |

**Block 6.1** — Continuation (L20366)

| # | Type | Code |
|---|------|------|
| 1 | IF | `KIKI_TK_SBT_02.equals(kiki_tk_div)` = Rental |
| 2 | SET | `tekkyo_div = TEKKYO_DIV_KOKAN` // Exchange |
| 3 | ELSE | SET `tekkyo_div = TEKKYO_DIV_HTG` // Inheritance |

**Block 6.2** — Change (L20376)

| # | Type | Code |
|---|------|------|
| 1 | IF | `KH_PSG.equals(use_kh_div)` = "1" (Additional use available) |
| 2 | IF | `KIKI_TK_SBT_02.equals(kiki_tk_div)` = Rental |
| 3 | SET | `tekkyo_div = TEKKYO_DIV_KOKAN` // Exchange |
| 4 | ELSE | SET `tekkyo_div = TEKKYO_DIV_HTG` // Inheritance |
| 5 | ELSE | (Additional use unavailable) |
| 6 | IF | `KIKI_TK_SBT_02.equals(kiki_tk_div)` = Rental |
| 7 | SET | `tekkyo_div = TEKKYO_DIV_TEK` // Removal |
| 8 | ELSE | SET `tekkyo_div = TEKKYO_DIV_DSL` // Cancellation |

**Block 6.3** — Hold (L20406)

| # | Type | Code |
|---|------|------|
| 1 | SET | `tekkyo_div = TEKKYO_DIV_ZAN` // Retain |

**Block 6.4** — Cancellation (L20411)

| # | Type | Code |
|---|------|------|
| 1 | IF | `KIKI_TK_SBT_02.equals(kiki_tk_div)` = Rental |
| 2 | SET | `tekkyo_div = TEKKYO_DIV_TEK` // Removal |
| 3 | ELSE | SET `tekkyo_div = TEKKYO_DIV_DSL` // Cancellation |

**Block 7** — MODEM BLOCK: TAKNKIKI_SBT_60 = "60" (L20422)

> Equipment: Modem. Work company cannot transfer, purchase/rental/hold. Uses `owner_Cd` and `kiki_tk_div` for decision logic.

| # | Type | Code |
|---|------|------|
| 1 | IF | `TAKNKIKI_SBT_60.equals(use_kiki_div)` = "60" (Modem) |
| 2 | IF | `KIKI_TK_SBT_02.equals(kiki_tk_div)` = "02" (Rental) |
| 3 | SET | `tekkyo_pdn_array = {TEKKYO_DIV_TEK, TEKKYO_DIV_ZAN}` // Removal, Retain (ANK-2094: Exchange removed) |
| 4 | ELSE | IF `owner_Cd.equals("1")` (Customer owns equipment) |
| 5 | SET | `tekkyo_pdn_array = {TEKKYO_DIV_ZAN, TEKKYO_DIV_DSL}` // Retain, Cancellation |
| 6 | ELSE | SET `tekkyo_pdn_array = {TEKKYO_DIV_HTG, TEKKYO_DIV_ZAN, TEKKYO_DIV_DSL}` // Inheritance, Retain, Cancellation |

**Block 7.1** — Continuation (L20446)

| # | Type | Code |
|---|------|------|
| 1 | IF | `owner_Cd.equals("1")` (Owner) |
| 2 | IF | `KIKI_TK_SBT_02.equals(kiki_tk_div)` = Rental |
| 3 | SET | `tekkyo_div = TEKKYO_DIV_TEK` // Removal |
| 4 | ELSE | SET `tekkyo_div = TEKKYO_DIV_DSL` // Cancellation |
| 5 | ELSE | (Non-owner) |
| 6 | IF | `KIKI_TK_SBT_02.equals(kiki_tk_div)` = Rental |
| 7 | SET | `tekkyo_div = TEKKYO_DIV_TEK` // Removal (ANK-2094: was KOKAN) |
| 8 | ELSE | SET `tekkyo_div = TEKKYO_DIV_HTG` // Inheritance |

**Block 7.2** — Change (L20473)

| # | Type | Code |
|---|------|------|
| 1 | IF | `KH_PSG.equals(use_kh_div)` = "1" (Additional use available) |
| 2 | IF | `owner_Cd.equals("1")` (Owner) |
| 3 | IF | `KIKI_TK_SBT_02.equals(kiki_tk_div)` = Rental |
| 4 | SET | `tekkyo_div = TEKKYO_DIV_TEK` // Removal |
| 5 | ELSE | SET `tekkyo_div = TEKKYO_DIV_DSL` // Cancellation |
| 6 | ELSE | (Non-owner) |
| 7 | IF | `KIKI_TK_SBT_02.equals(kiki_tk_div)` = Rental |
| 8 | SET | `tekkyo_div = TEKKYO_DIV_TEK` // Removal (ANK-2094: was KOKAN) |
| 9 | ELSE | SET `tekkyo_div = TEKKYO_DIV_HTG` // Inheritance |
| 10 | ELSE | (Additional use unavailable) |
| 11 | IF | `KIKI_TK_SBT_02.equals(kiki_tk_div)` = Rental |
| 12 | SET | `tekkyo_div = TEKKYO_DIV_TEK` // Removal |
| 13 | ELSE | SET `tekkyo_div = TEKKYO_DIV_DSL` // Cancellation |

**Block 7.3** — Hold (L20514)

| # | Type | Code |
|---|------|------|
| 1 | SET | `tekkyo_div = TEKKYO_DIV_ZAN` // Retain |

**Block 7.4** — Cancellation (L20519)

| # | Type | Code |
|---|------|------|
| 1 | IF | `KIKI_TK_SBT_02.equals(kiki_tk_div)` = Rental |
| 2 | SET | `tekkyo_div = TEKKYO_DIV_TEK` // Removal |
| 3 | ELSE | SET `tekkyo_div = TEKKYO_DIV_DSL` // Cancellation |

**Block 8** — SPLITTER BLOCK: TAKNKIKI_SBT_70 = "70" (L20530)

> Equipment: Splitter. Work company cannot transfer, purchase/rental/hold. Same decision matrix as Network VA (Block 6).

| # | Type | Code |
|---|------|------|
| 1 | IF | `TAKNKIKI_SBT_70.equals(use_kiki_div)` = "70" (Splitter) |
| 2 | IF | `KIKI_TK_SBT_02.equals(kiki_tk_div)` = "02" (Rental) |
| 3 | SET | `tekkyo_pdn_array = {TEKKYO_DIV_TEK, TEKKYO_DIV_ZAN, TEKKYO_DIV_KOKAN}` |
| 4 | ELSE | SET `tekkyo_pdn_array = {TEKKYO_DIV_HTG, TEKKYO_DIV_ZAN, TEKKYO_DIV_DSL}` |
| 5 | (Continuation/Change/Hold/Cancellation logic identical to Block 6) | |

**Block 9** — INFOTV BLOCK: TAKNKIKI_SBT_90 = "90" (L20590)

> Equipment: Infotv. Work company cannot transfer, purchase only. No rental option — uses a fixed dropdown.

| # | Type | Code |
|---|------|------|
| 1 | IF | `TAKNKIKI_SBT_90.equals(use_kiki_div)` = "90" (Infotv) |
| 2 | SET | `tekkyo_pdn_array = {TEKKYO_DIV_HTG, TEKKYO_DIV_ZAN, TEKKYO_DIV_DSL}` |

**Block 9.1** — Continuation / Change / Hold / Cancellation

| # | Type | Code |
|---|------|------|
| 1 | IF | Continuation -> `tekkyo_div = TEKKYO_DIV_HTG` (Inheritance) |
| 2 | ELSE-IF | Change + available -> `TEKKYO_DIV_HTG` (Inheritance) |
| 3 | ELSE-IF | Change + unavailable -> `TEKKYO_DIV_DSL` (Cancellation) |
| 4 | ELSE-IF | Hold -> `TEKKYO_DIV_ZAN` (Retain) |
| 5 | ELSE-IF | Cancellation -> `TEKKYO_DIV_DSL` (Cancellation) |

**Block 10** — ROUTER BLOCK: TAKNKIKI_SBT_F0 = "F0" (L20614)

> Equipment: Router. Work company CAN transfer, rental only. Complex logic including mansion check and auto-change router detection, similar to telephone VA.

| # | Type | Code |
|---|------|------|
| 1 | IF | `TAKNKIKI_SBT_F0.equals(use_kiki_div)` = "F0" (Router) |

**Block 10.1** — Continuation (L20620)

> Under ANK-1664: Always sets `tekkyo_div` to "Transfer (Multi)". Dropdown depends on auto-change and new-work flags.

| # | Type | Code |
|---|------|------|
| 1 | SET | `tekkyo_div = TEKKYO_DIV_KOKAN_MULTI` |
| 2 | IF | `isAutoChgRouterOrVA(svcFormBean)` |
| 3 | SET | `tekkyo_pdn_array = TEKKYO_PDN_LIST_ROUTER_NON_HTG` // No inheritance |
| 4 | ELSE | IF `isDslNewKojiAri(svcFormBean, SVC_CD_NET) && !isMansion` |
| 5 | SET | `tekkyo_pdn_array = TEKKYO_PDN_LIST_ROUTER` // Inheritance possible |
| 6 | ELSE | SET `tekkyo_pdn_array = TEKKYO_PDN_LIST_ROUTER_NON_HTG` // No inheritance |

**Block 10.2** — Change (L20646)

> Same structure as continuation.

| # | Type | Code |
|---|------|------|
| 1 | SET | `tekkyo_div = TEKKYO_DIV_KOKAN_MULTI` |
| 2 | IF | Auto-change flag |
| 3 | SET | `tekkyo_pdn_array = TEKKYO_PDN_LIST_ROUTER_NON_HTG` |
| 4 | ELSE | IF `isDslNewKojiAri(svcFormBean, SVC_CD_NET) && !isMansion` |
| 5 | SET | `tekkyo_pdn_array = TEKKYO_PDN_LIST_ROUTER` |
| 6 | ELSE | SET `tekkyo_pdn_array = TEKKYO_PDN_LIST_ROUTER_NON_HTG` |

**Block 10.3** — Hold / Cancellation

| # | Type | Code |
|---|------|------|
| 1 | IF | Hold -> `tekkyo_div = TEKKYO_DIV_ZAN`, pdn = {HTG, TEK, ZAN} |
| 2 | ELSE-IF | Cancellation -> `tekkyo_div = TEKKYO_DIV_TEK`, pdn = {HTG, TEK, ZAN} |

**Block 11** — PLC MODEM BLOCK: TAKNKIKI_SBT_G0 = "G0" (L20675)

> Equipment: PLC (Power Line Communication) Modem. Work company CAN transfer, rental only.

| # | Type | Code |
|---|------|------|
| 1 | IF | `TAKNKIKI_SBT_G0.equals(use_kiki_div)` = "G0" (PLC Modem) |

**Block 11.1** — Continuation (L20681)

> Under ANK-4315: Always sets `tekkyo_div` to "Exchange" and includes all four dropdown options.

| # | Type | Code |
|---|------|------|
| 1 | IF | `isDslNewKojiAri(svcFormBean, SVC_CD_NET) && !isMansion` |
| 2 | SET | `tekkyo_div = TEKKYO_DIV_KOKAN` // Exchange |
| 3 | SET | `tekkyo_pdn_array = {TEKKYO_DIV_KOKAN, TEKKYO_DIV_HTG, TEKKYO_DIV_TEK, TEKKYO_DIV_ZAN}` // Exchange, Inheritance, Removal, Retain |
| 4 | ELSE | SET `tekkyo_div = TEKKYO_DIV_KOKAN`, pdn = {TEK, ZAN, KOKAN} |

**Block 11.2** — Change (L20699)

> Same logic as continuation — always sets `tekkyo_div = TEKKYO_DIV_KOKAN`.

**Block 11.3** — Hold / Cancellation

| # | Type | Code |
|---|------|------|
| 1 | IF | Hold -> `tekkyo_div = TEKKYO_DIV_ZAN`, pdn = {HTG, TEK, ZAN} |
| 2 | ELSE-IF | Cancellation -> `tekkyo_div = TEKKYO_DIV_TEK`, pdn = {HTG, TEK, ZAN} |

**Block 12** — OTHER EQUIPMENT BLOCK: TAKNKIKI_SBT_M0 = "M0" (L20727)

> Equipment: Other (coaxial cable, distribution equipment). Work company cannot transfer, purchase/own only.

| # | Type | Code |
|---|------|------|
| 1 | IF | `TAKNKIKI_SBT_M0.equals(use_kiki_div)` = "M0" (Other) |
| 2 | SET | `tekkyo_pdn_array = {TEKKYO_DIV_HTG, TEKKYO_DIV_ZAN, TEKKYO_DIV_DSL}` |

**Block 12.1** — Continuation / Change / Hold / Cancellation

| # | Type | Code |
|---|------|------|
| 1 | IF | Continuation -> `TEKKYO_DIV_HTG` (Inheritance) |
| 2 | ELSE-IF | Change + available -> `TEKKYO_DIV_HTG` (Inheritance) |
| 3 | ELSE-IF | Change + unavailable -> `TEKKYO_DIV_DSL` (Cancellation) |
| 4 | ELSE-IF | Hold -> `TEKKYO_DIV_ZAN` (Retain) |
| 5 | ELSE-IF | Cancellation -> `TEKKYO_DIV_DSL` (Cancellation) |

**Block 13** — TABLET BLOCK: TAKNKIKI_SBT_P0 = "P0" (L20759)

> Equipment: Tablet (for home automation). Work company cannot transfer, purchase only. Same decision matrix as Other equipment.

| # | Type | Code |
|---|------|------|
| 1 | IF | `TAKNKIKI_SBT_P0.equals(use_kiki_div)` = "P0" (Tablet) |
| 2 | SET | `tekkyo_pdn_array = {TEKKYO_DIV_HTG, TEKKYO_DIV_ZAN, TEKKYO_DIV_DSL}` |
| 3 | (Continuation/Change/Hold/Cancellation identical to Block 12) | |

**Block 14** — CREDIT READER BLOCK: TAKNKIKI_SBT_L1 = "L1" (L20789)

> Equipment: Credit reader (for tablet). Work company cannot transfer, purchase only. Same decision matrix as Other equipment.

| # | Type | Code |
|---|------|------|
| 1 | IF | `TAKNKIKI_SBT_L1.equals(use_kiki_div)` = "L1" (Credit Reader) |
| 2 | SET | `tekkyo_pdn_array = {TEKKYO_DIV_HTG, TEKKYO_DIV_ZAN, TEKKYO_DIV_DSL}` |
| 3 | (Continuation/Change/Hold/Cancellation identical to Block 12) | |

**Block 15** — IP-STB BLOCK: TAKNKIKI_SBT_Q0 = "Q0" (L20818)

> Equipment: IP-STB (Set-Top Box). Work company cannot transfer, rental only. Under ANK-3987: dropdown changed to {HTG, ZAN, DSL} and logic follows the same pattern as Other/Tablet blocks.

| # | Type | Code |
|---|------|------|
| 1 | IF | `TAKNKIKI_SBT_Q0.equals(use_kiki_div)` = "Q0" (IP-STB) |
| 2 | SET | `tekkyo_pdn_array = {TEKKYO_DIV_HTG, TEKKYO_DIV_ZAN, TEKKYO_DIV_DSL}` |
| 3 | (Continuation/Change/Hold/Cancellation identical to Block 12) | |

**Block 16** — MULTI-FUNCTION ROUTER BLOCK: TAKNKIKI_SBT_R0 = "R0" (L20848)

> Equipment: Multi-function router. Uses delegation to `getTekkyoDivMultiRouter()` for the removal classification logic.

| # | Type | Code |
|---|------|------|
| 1 | IF | `TAKNKIKI_SBT_R0.equals(use_kiki_div)` = "R0" (Multi-function router) |
| 2 | SET | `pdnList = new ArrayList<String>()` |
| 3 | CALL | `tekkyo_div = getTekkyoDivMultiRouter(pdnList, use_kiki_bean)` |
| 4 | EXEC | `tekkyo_pdn_array = (String[])pdnList.toArray(new String[0])` |

**Block 17** — HGW BLOCK: TAKNKIKI_SBT_S0 = "S0" (L20857)

> Equipment: HGW (Home Gateway). Work company cannot transfer, rental only. Same scope-based logic as ONU and V-ONU, with HGW-specific removal classification codes (`TEKKYO_DIV_KOKAN_ONU` instead of `TEKKYO_DIV_KOKAN`).

| # | Type | Code |
|---|------|------|
| 1 | IF | `TAKNKIKI_SBT_S0.equals(use_kiki_div)` = "S0" (HGW) |
| 2 | SET | `tekkyo_pdn_array = {TEKKYO_DIV_TEK, TEKKYO_DIV_ZAN, TEKKYO_DIV_KOKAN_ONU}` |

**Block 17.1** — Scope: All Removal or IP-only Removal (L20865)

> `isKojiScopeALL(kj_scope_div) OR isKojiScopeIP(kj_scope_div) OR KOJI_FUYO.equals(kj_scope_div)`

| # | Type | Code |
|---|------|------|
| 1 | IF | Continuation -> `TEKKYO_DIV_KOKAN_ONU` (Exchange) |
| 2 | ELSE-IF | Change + available -> `TEKKYO_DIV_KOKAN_ONU` (Exchange) |
| 3 | ELSE-IF | Change + unavailable -> `TEKKYO_DIV_TEK` (Removal) |
| 4 | ELSE-IF | Hold -> `TEKKYO_DIV_ZAN` (Retain) |
| 5 | ELSE-IF | Cancellation -> `TEKKYO_DIV_TEK` (Removal) |

**Block 17.2** — Scope: Partial Removal or TV-only Removal (L20891)

| # | Type | Code |
|---|------|------|
| 1 | SET | `tekkyo_div = TEKKYO_DIV_ZAN` // Always Retain |

**Block 17.3** — Else (Default scope) — OM-2018-0001106 ADD (L20898)

> Same full logic as Block 17.1.

**Block 18** — FINAL RESULTS SETTING (L20926)

> Write the computed `tekkyo_div` and `tekkyo_pdn_array` back to the data bean.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `use_kiki_bean.sendMessageString(USE_KIKI_TEKKYO_DIV_05, SET_VALUE, tekkyo_div)` |
| 2 | EXEC | `copyPdnList(use_kiki_bean, USE_KIKI_TEKKYO_PDN_05, svcFormBean, WK_TEKKYO_PDN, Arrays.asList(tekkyo_pdn_array))` |

---

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `use_kiki_div` | Field | Currently-used equipment type classification code — identifies which piece of customer-owned equipment the removal decision applies to |
| `svc_chg_div` | Field | Service change division code — the type of service modification being performed (continuation, change, hold, cancellation) |
| `kj_scope_div` | Field | Removal scope division — specifies which service categories are subject to removal (all, partial, IP-only, TV-only) |
| `use_kh_div` | Field | Additional use permission flag — indicates whether additional service use is available alongside the current service |
| `kiki_tk_div` | Field | Equipment provision division — whether the equipment is provided via rental (`"02"`) or other means (purchase/ownership) |
| `use_kiki_pcrs_cd` | Field | Equipment purchase code — distinguishes between rental and purchase of modem equipment (legacy) |
| `use_kiki_bean` | Field | Data bean access object for currently-used equipment — holds and retrieves removal classification state |
| `TEKKYO_DIV_TEK` | Constant | Removal (撤去) — the equipment will be removed |
| `TEKKYO_DIV_ZAN` | Constant | Retain (残留) — the equipment will remain |
| `TEKKYO_DIV_KOKAN` | Constant | Exchange (交換) — the equipment will be exchanged |
| `TEKKYO_DIV_KOKAN_MULTI` | Constant | Transfer (Multi) — multi-function equipment transfer option |
| `TEKKYO_DIV_KOKAN_ONU` | Constant | Exchange (HGW-specific) — HGW-specific exchange classification |
| `TEKKYO_DIV_DSL` | Constant | Cancellation (解約) — the service will be cancelled |
| `TEKKYO_DIV_HTG` | Constant | Inheritance (引継) — the service/equipment will be inherited at the new address |
| `TEKKYO_DIV_KOKAN` | Constant | Exchange (KOKAN) — equipment exchange |
| `TAKNKIKI_SBT_D0` | Constant | ONU equipment type code = `"D0"` |
| `TAKNKIKI_SBT_E0` | Constant | V-ONU equipment type code = `"E0"` |
| `TAKNKIKI_SBT_50` | Constant | Telephone VA equipment type code = `"50"` |
| `TAKNKIKI_SBT_60` | Constant | Modem equipment type code = `"60"` |
| `TAKNKIKI_SBT_70` | Constant | Splitter equipment type code = `"70"` |
| `TAKNKIKI_SBT_80` | Constant | Network VA equipment type code = `"80"` |
| `TAKNKIKI_SBT_90` | Constant | Infotv equipment type code = `"90"` |
| `TAKNKIKI_SBT_F0` | Constant | Router equipment type code = `"F0"` |
| `TAKNKIKI_SBT_G0` | Constant | PLC Modem equipment type code = `"G0"` |
| `TAKNKIKI_SBT_M0` | Constant | Other equipment (coaxial cable/distribution) code = `"M0"` |
| `TAKNKIKI_SBT_P0` | Constant | Tablet equipment type code = `"P0"` |
| `TAKNKIKI_SBT_L1` | Constant | Credit reader for tablet equipment code = `"L1"` |
| `TAKNKIKI_SBT_Q0` | Constant | IP-STB (Set-Top Box) equipment type code = `"Q0"` |
| `TAKNKIKI_SBT_R0` | Constant | Multi-function router equipment type code = `"R0"` |
| `TAKNKIKI_SBT_S0` | Constant | HGW (Home Gateway) equipment type code = `"S0"` |
| `KH_PSG` | Constant | Additional use available flag = `"1"` |
| `KIKI_TK_SBT_02` | Constant | Rental provision type = `"02"` |
| `SVC_CD_NET` | Constant | Network service code = `"01"` |
| `SVC_CD_02` | Constant | Telephone service code = `"02"` |
| `SVC_CD_TV` | Constant | Television service code = `"03"` |
| `KOJI_FUYO` | Constant | No removal scope code — used when no removal work is needed |
| VA | Acronym | Voice Adapter — a telecommunications endpoint device for voice services |
| ONU | Acronym | Optical Network Unit — fiber-optic endpoint device connecting to the NTT fiber network |
| V-ONU | Acronym | Video Optical Network Unit — ONU supporting video services |
| HGW | Acronym | Home Gateway — a combined modem/router device provided by NTT East |
| PLC | Acronym | Power Line Communication — technology using electrical wiring for data transmission |
| STB | Acronym | Set-Top Box — equipment for receiving and decoding television signals |
| NTT East | Business term | Nippon Telegraph and Telephone East Corporation — one of Japan's largest fixed-line telecom operators |
| Tekkyo (撤去) | Japanese term | Removal — the act of removing equipment from a residence during a move |
| Zanyu (残留) | Japanese term | Retain — keeping equipment in place at the current or new address |
| Koushin (引継) | Japanese term | Inheritance — transferring service/equipment to the new address without interruption |
| Kouten (交換) | Japanese term | Exchange — swapping equipment for a different model/type |
| Keiyaku (解約) | Japanese term | Cancellation — terminating the service contract for the equipment |
| Mansion (マンション) | Japanese term | Apartment building/condominium — used as a property type flag affecting available service options |
