# Business Logic — JKKHakkoSODCC.checkTakinoRT() [745 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | com.fujitsu.futurity.bp.custom.common.JKKHakkoSODCC |
| Layer | CC / Common Component |
| Module | common (Package: com.fujitsu.futurity.bp.custom.common) |

## 1. Role

### JKKHakkoSODCC.checkTakinoRT()

This method performs a comprehensive check on whether a multi-function router (多機能ルータ, "multi-function router" also called "Takino RT") is actively configured and in use for a given service contract. It is a central decision router that determines which order-modification workflow to invoke for router-related operations such as new registration, change orders, cancellation orders, or simultaneous cancellation.

The method handles multiple service types: network services (SVC_KIND_NET, code "01") and telephone services (SVC_KIND_TEL, code "02"). For network services, it checks for router functionality (KKOP_SVC_CD_RT). For telephone services, it checks for VA (Virtual Access) functionality which includes router capabilities (KKOP_SVC_CD_VA). It also handles the HGW (Home Gateway) device type as an extension (KKTK_SVC_CD_HGW).

The design pattern implemented is a multi-phase filtering and routing approach: the method executes in sequential phases — phase 1 acquires the service agreement details, phase 2 enumerates line-level service contract items to identify any tied multi-function router, phase 3 checks device provision services, phase 4 performs fallback queries for pending future-dated records (reservation state, equipment change numbers), and phase 5 evaluates equipment option service contracts to determine the final router status code. Each phase can short-circuit and return early.

Its role in the larger system is that of a shared utility / gateway called by 15+ order-control methods across the system. It acts as a gatekeeper determining what kind of order can be issued for a multi-function router attached to a service contract. The return values guide callers: return 0 means no valid router (cancelled/cancelled/unsupported), return 1 means router function only, return 2 means router configuration — cancellation/deletion order target, return 3 means router configuration — simultaneous cancellation target (multi-function router cancelled due to transfer), return 4 means router configuration — new/change order target, and return 9 means router configuration — new order not yet issued.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["checkTakinoRT"])
    START --> CHECK_PRG["Check: prc_grp_cd blank?"]

    CHECK_PRG -- Yes --> GET_SVC["getSvcKeiList"]
    GET_SVC --> SET_PRG["Set prc_grp_cd from result"]
    SET_PRG --> JDG_SVC["jdgSvcKind"]

    CHECK_PRG -- No --> JDG_SVC

    JDG_SVC --> CHECK_TEL["Check: svc_kind == SVC_KIND_TEL?"]

    CHECK_TEL -- Yes --> CHK_SVC_KEI["Check: svc_kei_ucwk_no valid?"]
    CHK_SVC_KEI -- Yes --> BUILD_INHASH["Build inHashUcwk with svc_kei_ucwk_no"]
    BUILD_INHASH --> PUT_GADTM["Put GENE_ADD_DTM if present"]
    PUT_GADTM --> CALL_EKK0191["callEKK0191A010SC FUNC_CODE_2"]
    CALL_EKK0191 --> CHK_STATUS["statusCode == 0?"]
    CHK_STATUS -- No --> THROW_E1["Throw CCException"]
    CHK_STATUS -- Yes --> GET_HASH1["Get eKK0191A010Hash from result"]
    GET_HASH1 --> GET_CHGNO["Extract va_kiki_chg_no"]

    CHK_SVC_KEI -- No --> BUILD_MAIN_IN
    CHECK_TEL -- No --> BUILD_MAIN_IN

    BUILD_MAIN_IN["Build inHashKisnUcwk"]
    GET_CHGNO --> BUILD_MAIN_IN

    BUILD_MAIN_IN --> PUT_SVC_KEI["Put SVC_KEI_NO from inMap or this.svc_kei_no1"]
    PUT_SVC_KEI --> CALL_EKK0251["callEKK0251B003SCCAAMsg FUNC_CODE_1"]
    CALL_EKK0251 --> CHK_STATUS2["statusCode == 0?"]
    CHK_STATUS2 -- No --> THROW_E2["Throw CCException"]
    CHK_STATUS2 -- Yes --> GET_MSG_LIST["Get CAANMsg[] from result"]

    GET_MSG_LIST --> LOOP_KISN["Loop msgListKisnUcwk"]
    LOOP_KISN --> CHECK_STAT["Check svc_kei_kaisen_ucwk_stat blank?"]
    CHECK_STAT -- Yes --> NEXT_KISN["Continue loop"]
    NEXT_KISN --> CHECK_BLANK["Check: takino_svc_kei_kaisen_ucwk_no blank?"]
    CHECK_BLANK -- Yes --> RET0["Return 0"]

    CHECK_STAT -- No --> EXTRACT_KISN["Extract takino_svc_kei_kaisen_ucwk_no, gadtm"]
    EXTRACT_KISN --> BREAK_KISN["Break loop"]

    BREAK_KISN --> CHECK_BLANK
    CHECK_BLANK -- No --> BUILD_KKTK_IN["Build inHashKktk with takino_svc_kei_kaisen_ucwk_no"]
    CHECK_BLANK -- No --> CALL_EKK0341B504["callEKK0341B504SC FUNC_CODE_1"]
    CHECK_BLANK -- No --> CHK_STATUS3["statusCode == 0?"]
    CHECK_BLANK -- No --> GET_KKTK_MSG["Get CAANMsg[] from result"]
    CALL_EKK0341B504 --> CHK_STATUS3

    CHK_STATUS3 -- No --> THROW_E3["Throw CCException"]
    CHK_STATUS3 -- Yes --> GET_KKTK_MSG

    GET_KKTK_MSG --> LOOP_KKTK["Loop msgListKktk"]
    LOOP_KKTK --> CHECK_SVC_CD["Check: kktk_svc_cd == MRT or HGW?"]
    CHECK_SVC_CD -- No --> NEXT_KKTK["Continue loop"]
    NEXT_KKTK --> CHECK_BLANK2["Check: takino_svc_kei_kaisen_ucwk_no blank?"]
    CHECK_BLANK2 -- No --> LOOP_KKTK

    CHECK_SVC_CD -- Yes --> CHECK_IDO["Check: svc_kind == TEL?"]
    CHECK_IDO -- Yes --> CALL_SHURI["getShuriKokanBfKiki if repair in progress"]
    CHECK_IDO -- Yes --> CHECK_UCWK_NO["Check: svc_kei_ucwk_no valid?"]
    CHECK_IDO -- No --> CHECK_KANSA

    CHECK_UCWK_NO -- Yes --> CHECK_CHG["Check: va_kiki_chg_no mismatch?"]
    CHECK_CHG -- Mismatch --> CHECK_KOKAN["Check: kokanBfKiki empty?"]
    CHECK_KOKAN -- Yes --> NEXT_KKTK
    CHECK_KOKAN -- No --> CHECK_KANSA

    CHECK_CHG -- Match --> CHECK_KANSA
    CHECK_UCWK_NO -- No --> CHECK_KANSA

    CHECK_KANSA["Check: kktk_svc_kei_stat == SVC_KEI_STAT_920?"]
    CHECK_KANSA -- Yes --> NEXT_KKTK

    CHECK_KANSA -- No --> CHECK_910["Check: kktk_svc_kei_stat == SVC_KEI_STAT_910?"]
    CHECK_910 -- No --> CHECK_020["Check: stat in 020, 030, 100, 210, 220?"]

    CHECK_910 -- Yes --> CHECK_MSKM["Check: mskm_dtl_no match AND ido_div in DSL,TEKKYO,KYOSEI,CANCEL?"]
    CHECK_910 -- Yes --> SET_DSL2["Set mrt_dsl_flg=2; extract kktk fields"]
    CHECK_910 -- No --> NEXT_KKTK

    CHECK_020 -- Yes --> CHECK_SEIZO["Check: KIKI_SEIZO_NO blank?"]
    CHECK_020 -- No --> NEXT_KKTK

    CHECK_SEIZO -- Yes --> CHECK_KOKAN2["Check: kokanBfKiki present?"]
    CHECK_SEIZO -- No --> SET_DSL1["Set mrt_dsl_flg=1; extract kktk fields"]

    CHECK_KOKAN2 -- Yes --> USE_KOKAN["Use kokanBfKiki as eKK0341B504Hash"]
    CHECK_KOKAN2 -- No --> RET9a["Return 9"]
    USE_KOKAN --> SET_DSL1

    SET_DSL1 --> CONT_DSL["Continue loop for more matches"]
    CONT_DSL --> NEXT_KKTK
    NEXT_KKTK --> LOOP_KKTK

    LOOP_KKTK --> CHECK_OM2016["OM-2016: mrt_dsl_flg==0 AND svc_kind==TEL AND va_kiki_chg_no not blank?"]
    CHECK_OM2016 -- Yes --> CALL_EKK0341B029["callEKK0341B029SC with va_kiki_chg_no"]
    CALL_EKK0341B029 --> CHECK_MSG_NULL["msgEKK0341B029 not null?"]
    CHECK_MSG_NULL -- No --> SKIP_OM2016
    CHECK_MSG_NULL -- Yes --> CHECK_SVC_CD2["Check: kktk_svc_cd == MRT or HGW?"]

    CHECK_SVC_CD2 -- Yes --> CHK_OM_STAT["Check: kktkSvcKeiStat?"]
    CHK_OM_STAT -- SVC_KEI_STAT_920 --> SKIP_OM2016
    CHK_OM_STAT -- SVC_KEI_STAT_910 --> CHECK_OM_MSKM["Check: mskm_dtl_no match AND ido_div in DSL,TEKKYO,KYOSEI,CANCEL?"]
    CHECK_OM_MSKM -- Yes --> SET_OM_DSL2["Set mrt_dsl_flg=2"]
    CHECK_OM_MSKM -- No --> SKIP_OM2016
    CHK_OM_STAT -- 020,030,100,210,220 --> CHECK_OM_SEIZO["Check: KIKI_SEIZO_NO set?"]
    CHECK_OM_SEIZO -- Yes --> SET_OM_DSL1["Set mrt_dsl_flg=1"]
    CHECK_OM_SEIZO -- No --> SET_OM0a["Set mrt_dsl_flg=0"]

    SET_OM_DSL2 --> SKIP_OM2016
    SET_OM_DSL1 --> SKIP_OM2016
    SET_OM0a --> SKIP_OM2016

    CHECK_OM2016 -- No --> CHECK_OM2018["OM-2018: mrt_dsl_flg==0 AND svc_kind==TEL AND va_kiki_chg_no not blank?"]

    CHECK_OM2018 -- Yes --> RECALL_EKK0191["callEKK0191A010SC FUNC_CODE_4"]
    RECALL_EKK0191 --> EXTRACT_VA2["Extract va_kiki_chg_no"]
    EXTRACT_VA2 --> CALL_EKK0341B029_2["callEKK0341B029SC again"]
    CALL_EKK0341B029_2 --> PROCESS_OM2018["Same stat checks as OM-2016 block"]

    PROCESS_OM2018 --> SET_OM2018["Set mrt_dsl_flg=1 or return 9"]
    SET_OM2018 --> SKIP_OM2018

    CHECK_OM2018 -- No --> CHECK_ANK3412["ANK-3412: mrt_dsl_flg==0 AND svc_kind==TEL AND va_kiki_chg_no not blank?"]

    CHECK_ANK3412 -- Yes --> CALL_EKK0341B021["callEKK0341B021SC reservation list"]
    CALL_EKK0341B021 --> LOOP_ANK3412["Loop msgEKK0341B021List"]
    LOOP_ANK3412 --> CHECK_ANK_SVC["Check: CUR_KKTK_SVC_CD == MRT/HGW AND va_kiki_chg_no == RSV_KIKI_CHG_NO?"]
    CHECK_ANK_SVC -- Yes --> CHECK_ANK_SEIZO["Check: RSV_KIKI_SEIZO_NO set?"]
    CHECK_ANK_SEIZO -- Yes --> SET_ANK_DSL["Set mrt_dsl_flg=1; extract fields; break"]
    CHECK_ANK_SEIZO -- No --> NEXT_ANK["Continue"]
    CHECK_ANK_SVC -- No --> NEXT_ANK
    NEXT_ANK --> LOOP_ANK3412

    SET_DSL2 --> RET_CHECK["Check: mrt_dsl_flg == 0?"]
    SET_OM_DSL2 --> RET_CHECK
    SET_OM_DSL1 --> RET_CHECK
    SET_OM2018 --> RET_CHECK
    SET_ANK_DSL --> RET_CHECK
    SKIP_OM2016 --> RET_CHECK
    SKIP_OM2018 --> RET_CHECK
    RET9a --> RET9["Return 9"]

    RET_CHECK -- Yes --> RET0F["Return 0"]

    RET_CHECK -- No --> CALL_EKK2811["callEKK2811B010SC KKOP list"]
    CALL_EKK2811 --> CHK_STATUS4["statusCode == 0?"]
    CHK_STATUS4 -- No --> THROW_E4["Throw CCException"]
    CHK_STATUS4 -- Yes --> GET_KKOP_MSG["Get CAANMsg[] from result"]

    GET_KKOP_MSG --> LOOP_KKOP["Loop msgListKkop"]
    LOOP_KKOP --> CHECK_KKOP_SVC["Check: NET+RT or TEL+VA?"]
    CHECK_KKOP_SVC -- No --> NEXT_KKOP["Continue loop"]
    CHECK_KKOP_SVC -- Yes --> CALL_EKK1041B["callEKK1041B001SC order settings"]

    CALL_EKK1041B --> CHECK_ODR_SET["resultOdrSet empty?"]
    CHECK_ODR_SET -- Yes --> RET9["Return 9"]
    CHECK_ODR_SET -- No --> CHECK_KKOP_STAT["Check kkop_svc_kei_stat 910 or 920?"]

    CHECK_KKOP_STAT -- Yes --> CHECK_MSKM2["Check: mskm_dtl_no match?"]
    CHECK_MSKM2 -- Yes --> CHECK_MRT_DSL["Check: mrt_dsl_flg?"]
    CHECK_MRT_DSL -- 1 --> RET4["Return 4"]
    CHECK_MRT_DSL -- 2 --> RET3["Return 3"]
    CHECK_MSKM2 -- No --> NEXT_KKOP

    CHECK_KKOP_STAT -- No --> CHECK_MRT2["Check: mrt_dsl_flg==2?"]
    CHECK_MRT2 -- Yes --> RET0a["Return 0"]
    CHECK_MRT2 -- No --> LOOP_ODR["Loop resultOdrSet"]

    LOOP_ODR --> CHECK_ODR_KKTK["Check: KKTk_SVC_KEI_NO matches takino_kktk?"]
    CHECK_ODR_KKTK -- No --> NEXT_ODR["Continue"]
    CHECK_ODR_KKTK -- Yes --> CALL_EKK1041A["callEKK1041A010SC"]

    CALL_EKK1041A --> CHECK_STATUS5["statusCode == 0?"]
    CHECK_STATUS5 -- No --> THROW_E5["Throw CCException"]
    CHECK_STATUS5 -- Yes --> GET_ODR_HASH["Get eKK1041A010Hash"]
    GET_ODR_HASH --> EXTRACT_ODR["Extract mrt_skbt_cd, yokyu_sbt_cd"]

    EXTRACT_ODR --> CHECK_YOK3["Check: yokyu_sbt_cd matches 0[24]?"]
    CHECK_YOK3 -- Yes --> CHECK_SVC_KIND["Check: svc_kind == TEL?"]
    CHECK_SVC_KIND -- Yes --> CHECK_MRT_SKBT["Check: mrt_skbt_cd blank or RT?"]
    CHECK_MRT_SKBT -- Yes --> RET1["Return 1"]
    CHECK_MRT_SKBT -- No --> RET4["Return 4"]
    CHECK_SVC_KIND -- No --> RET4

    CHECK_YOK3 -- No --> CHECK_YOK8["Check: yokyu_sbt_cd matches 0[38]?"]
    CHECK_YOK8 -- Yes --> RET2["Return 2"]
    CHECK_YOK8 -- No --> RET9["Return 9"]

    NEXT_KKOP --> LOOP_KKOP
    NEXT_ODR --> LOOP_ODR

    LOOP_KKOP --> CLEAR_KKOP["Clear kkop_svc_kei_no"]
    CLEAR_KKOP --> RET0F["Return 0"]

    RET0F(["Return 0"]) --> END(["End"])
    RET1(["Return 1"]) --> END
    RET2(["Return 2"]) --> END
    RET3(["Return 3"]) --> END
    RET4(["Return 4"]) --> END
    RET9(["Return 9"]) --> END
    THROW_E1 --> END
    THROW_E2 --> END
    THROW_E3 --> END
    THROW_E4 --> END
    THROW_E5 --> END
```

### Processing Flow Description

The method follows a **multi-phase progressive filtering** pattern with fallback mechanisms:

- **Phase 1 (L23107-23117)**: If `prc_grp_cd` is not yet set, the method fetches service agreement details via `getSvcKeiList` and extracts the pricing group code. This ensures subsequent routing decisions have the correct service classification context.
- **Phase 2 (L23120)**: Determines the service kind (network vs. telephone) via `jdgSvcKind()`. This drives all subsequent branching.
- **Phase 3a (L23142-23180)**: If service kind is telephone, fetches service agreement item details via `callEKK0191A010SC` (FUNC_CODE_2) to obtain the equipment change number (`va_kiki_chg_no`), which tracks equipment swap history.
- **Phase 3b (L23208-23229)**: Fetches line-level service contract items via `callEKK0251B003SCCAAMsg`. This identifies the cancellation line item number (`takino_svc_kei_kaisen_ucwk_no`) — the key identifier linking the router to its parent service contract.
- **Phase 4 (L23259-23263)**: If no cancellation line item number was found, returns 0 (no valid multi-function router).
- **Phase 5 (L23269-23486)**: Iterates through device provision service contracts, filtering by:
  - Device type MRT or HGW (multi-function router or Home Gateway)
  - Status 920 (cancelled) — skipped
  - Status 910 (cancellation in progress) — if mskm_dtl_no matches and `ido_div` is DSL/TEKKYO/KYOSEI/CANCEL, sets mrt_dsl_flg=2 (simultaneous cancellation)
  - Status 020/030/100/210/220 (confirmed/closed/under service/suspended/suspended) — sets mrt_dsl_flg=1 (active), or returns 9 if no manufacturing number
- **Phase 5a/5b/5c (OM-2016, OM-2018, ANK-3412 fallbacks)**: If mrt_dsl_flg is still 0 and service is telephone with a valid `va_kiki_chg_no`, the method performs three successive fallback queries:
  - `callEKK0341B029SC` — queries future-dated records (pending equipment change)
  - `callEKK0191A010SC` (FUNC_CODE_4) + `callEKK0341B029SC` — recalculates with applied reservation date for contracts-in-progress
  - `callEKK0341B021SC` — queries reserved/contract-change-in-progress records
- **Phase 6 (L23601-23611)**: If mrt_dsl_flg remains 0, returns 0 (no multi-function router found on the line).
- **Phase 7 (L23614-23832)**: If a router exists, evaluates equipment option service contracts:
  - Checks if the option service is router (NET+RT) or VA (TEL+VA)
  - Queries order settings via `callEKK1041B001SC`
  - If empty result, returns 9 (router retained but no order issued)
  - If status 910/920 and mskm_dtl_no matches, returns 4 (if mrt_dsl_flg=1) or 3 (if mrt_dsl_flg=2)
  - Otherwise iterates order settings, fetches details via `callEKK1041A010SC`, and checks `yokyu_sbt_cd`:
    - Matches 0[24] (new/change order) — returns 1 (router only) for TEL with mrt_skbt_cd blank/RT, otherwise returns 4
    - Matches 0[38] (cancellation/deletion order) — returns 2
    - Otherwise returns 9

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `handle` | `SessionHandle` | Session handle carrying session manager context — used to pass through all service component calls for database and transaction management. Represents the current user session and database connection context. |
| 2 | `param` | `IRequestParameterReadWrite` | Request parameter object containing model group data and control maps. Provides access to order-setting information via `getData(HAKKOSODCCWORKMAP)`, and is used as input/output for all SC calls. Carries the service detail work number and cancellation details for router identification. |

### Instance Fields Read

| Field | Type | Business Description |
|-------|------|---------------------|
| `prc_grp_cd` | `String` | Pricing group code — classifies the service by pricing tier (e.g., residential home, residential, metro, enterprise, etc.). Used to route service agreement lookups. |
| `svc_kei_no1` | `String` | Service contract number — the primary identifier for the service contract being checked. Used as input to multiple service calls. |
| `svc_kei_ucwk_no` | `String[]` | Service detail work number array — identifies line-level service contract items within the main service contract. Index 0 is used for most lookups. |
| `svc_kei_ucwk_gadtm` | `String[]` | Service detail work registration datetime array — the timestamp of when the service detail work was registered. Used for versioned lookups. |

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `JKKHakkoSODCC.getSvcKeiList` | EKK0081A010SC | KK_T_SVC_KEI (Service Agreement Item) | Retrieves service agreement item details to obtain pricing group code |
| R | `JKKHakkoSODCC.jdgSvcKind` | - | - | Determines service kind (NET/TEL/etc.) based on internal service classification logic |
| R | `JKKHakkoSODCC.callEKK0191A010SC` | EKK0191A010SC | KK_T_SVC_KEI (Service Agreement Item) | Fetches service agreement item details — first call (FUNC_CODE_2) gets equipment change number for telephone services; second call (FUNC_CODE_4) recalculates with reservation date applied |
| R | `JKKHakkoSODCC.callEKK0251B003SCCAAMsg` | EKK0251B003SC | KK_T_OPSVKEI (Operation Service Contract Line Item) | Retrieves line-level service contract items list (current active) to identify cancellation line item |
| R | `JKKHakkoSODCC.callEKK0341B504SC` | EKK0341B504SC | KK_T_DEV_SVC (Device Provision Service Contract) | Retrieves device provision service contract list to identify multi-function router records |
| R | `JKKHakkoSODCC.getShuriKokanBfKiki` | - | - | Retrieves equipment before/after repair exchange info when equipment is in repair status |
| R | `JKKHakkoSODCC.callEKK0341B029SC` | EKK0341B029SC | KK_T_DEV_SVC (Device Provision Service Contract) | Fallback query for future-dated/pending records (OM-2016, OM-2018) — queries by equipment change number |
| R | `JKKHakkoSODCC.callEKK0341B021SC` | EKK0341B021SC | KK_T_RESV_SVC (Reservation Service Contract) | ANK-3412 fallback — queries reserved/contract-change-in-progress device provision records |
| R | `JKKHakkoSODCC.callEKK2811B010SC` | EKK2811B010SC | KK_T_OPT_SVC (Option Service Contract) | Retrieves equipment option service contract list to determine router configuration status |
| R | `JKKHakkoSODCC.callEKK1041B001SC` | EKK1041B001SC | KK_T_ODR_SBT (Order Settings) | Fetches order settings list for multi-function router to evaluate order status |
| R | `JKKHakkoSODCC.callEKK1041A010SC` | EKK1041A010SC | KK_T_ODR_SBT (Order Settings) | Fetches detailed order settings record by order setting number to evaluate router function flag and Yokyu (transfer) sub-order code |

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | JKKHakkoSODCC | `dslOdrCtrl()` -> `checkTakinoRT(handle, param)` | `callEKK1041A010SC [R]`, `callEKK1041B001SC [R]`, `callEKK2811B010SC [R]`, `callEKK0341B021SC [R]`, `callEKK0341B029SC [R]`, `callEKK0191A010SC [R]`, `callEKK0251B003SC [R]`, `callEKK0341B504SC [R]` |
| 2 | JKKHakkoSODCC | `findZ1OrderAtKK1041()` -> `checkTakinoRT(handle, param)` | Same terminal operations |
| 3 | JKKHakkoSODCC | `findZ1OrderAtKK1041SvcKeiUcwk()` -> `checkTakinoRT(handle, param)` | Same terminal operations |
| 4 | JKKHakkoSODCC | `htelNoDslOdrCtrl()` -> `checkTakinoRT(handle, param)` | Same terminal operations |
| 5 | JKKHakkoSODCC | `htelNoInfoChgeOdrCtrl()` -> `checkTakinoRT(handle, param)` | Same terminal operations |
| 6 | JKKHakkoSODCC | `htelNoKaihkOdrCtrl()` -> `checkTakinoRT(handle, param)` | Same terminal operations |
| 7 | JKKHakkoSODCC | `jdgIpv6()` -> `checkTakinoRT(handle, param)` | Same terminal operations |
| 8 | JKKHakkoSODCC | `jdgOdr163()` -> `checkTakinoRT(handle, param)` | Same terminal operations |
| 9 | JKKHakkoSODCC | `kaihkOdrCtrl()` -> `checkTakinoRT(handle, param)` | Same terminal operations |
| 10 | JKKHakkoSODCC | `newNet()` -> `checkTakinoRT(handle, param)` | Same terminal operations |
| 11 | JKKHakkoSODCC | `opSetOdrCtrl()` -> `checkTakinoRT(handle, param)` | Same terminal operations |
| 12 | JKKHakkoSODCC | `setChgePWForRouterConInfo()` -> `checkTakinoRT(handle, param)` | Same terminal operations |
| 13 | JKKHakkoSODCC | `telNoChge()` -> `checkTakinoRT(handle, param)` | Same terminal operations |
| 14 | JKKHakkoSODCC | `vLanIdChgOdrCtrl()` -> `checkTakinoRT(handle, param)` | Same terminal operations |
| 15 | JKKHakkoSODCC | `wribInfoAddOdrCtrl()` -> `checkTakinoRT(handle, param)` | Same terminal operations |

## 6. Per-Branch Detail Blocks

**Block 1** — IF (condition) `isBlank(this.prc_grp_cd)` (L23107)

> If pricing group code is not yet set, fetch service agreement details to obtain it.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `eKK0081A010Element = getSvcKeiList(handle, param, this.svc_kei_no1)` // Fetch service agreement item |
| 2 | SET | `this.prc_grp_cd = (String)eKK0081A010Element.get(EKK0081A010CBSMsg1List.PRC_GRP_CD)` // Extract pricing group code [-> PRC_GRP_CD_NET="02", PRC_GRP_CD_NET_MZ="03", PRC_GRP_CD_NET_MT="04", PRC_GRP_CD_EACCESS="05", PRC_GRP_CD_FLETS="06", PRC_GRP_CD_MOB_WIFI="07", PRC_GRP_CD_MOB_EM="08", PRC_GRP_CD_MOB_UQ="09", PRC_GRP_CD_TEL="10"] |

**Block 2** — EXEC (L23120)

> Determine service kind (network vs. telephone vs. other)

| # | Type | Code |
|---|------|------|
| 1 | SET | `String svc_kind = jdgSvcKind()` // Determine service kind |
| 2 | SET | `int mrt_dsl_flg = 0` // Initialize multi-function router DSL flag: 0=none(cancelled), 1=active, 2=simultaneous cancellation |

**Block 3** — IF (condition) `JKKHakkoSODConstCC.SVC_KIND_TEL.equals(svc_kind) && svc_kei_ucwk_no != null && svc_kei_ucwk_no[0] != null` (L23142)

> For telephone services with a valid service detail work number, fetch service agreement item to get equipment change number.

| # | Type | Code |
|---|------|------|
| 1 | SET | `HashMap<String, Object> inHashUcwk = new HashMap<>()` // Build input hash for service agreement item lookup |
| 2 | SET | `inHashUcwk.put(JKKHakkoSODConstCC.SVC_KEI_UCWK_NO, svc_kei_ucwk_no[0])` // Put service detail work number |
| 3 | IF | `svc_kei_ucwk_gadtm != null && svc_kei_ucwk_gadtm.length != 0 && svc_kei_ucwk_gadtm[0] != null` (L23149) // Versioned lookup with registration datetime |
| 3.1 | SET | `inHashUcwk.put(JKKHakkoSODConstCC.GENE_ADD_DTM, svc_kei_ucwk_gadtm[0])` // Put service detail work registration datetime |
| 4 | EXEC | `statusCode = callEKK0191A010SC(param, handle, inHashUcwk, resultHashUcwk, JKKHakkoSODConstCC.FUNC_CODE_2)` // Call FUNC_CODE_2 |
| 5 | IF | `statusCode != 0` (L23162) // Error handling |
| 5.1 | EXEC | `throw new CCException("", new SCCallException("", String.valueOf(statusCode), statusCode))` // Throw on error |
| 6 | SET | `eKK0191A010Hash = (HashMap)resultHashUcwk.get(JKKHakkoSODConstCC.TEMPLATE_ID_EKK0191A010)` |
| 7 | SET | `va_kiki_chg_no = (String)eKK0191A010Hash.get(EKK0191A010CBSMsg1List.VA_KIKI_CHG_NO)` // Extract equipment change number |

**Block 4** — IF (condition) `inMap == null || !inMap.containsKey(JKKHakkoSODConstCC.SVC_KEI_NO)` (L23211)

> Determine source of service contract number for the line-item lookup.

| # | Type | Code |
|---|------|------|
| 1 | SET | `inHashKisnUcwk.put(JKKHakkoSODConstCC.SVC_KEI_NO, this.svc_kei_no1)` // Use instance field if inMap missing |
| 2 | ELSE-IF | `else` — use value from inMap |
| 2.1 | SET | `inHashKisnUcwk.put(JKKHakkoSODConstCC.SVC_KEI_NO, (String)inMap.get(JKKHakkoSODConstCC.SVC_KEI_NO))` // Use inMap value |
| 3 | EXEC | `statusCode = callEKK0251B003SCCAAMsg(param, handle, inHashKisnUcwk, resultHashKisnUcwk, JKKHakkoSODConstCC.FUNC_CODE_1)` |
| 4 | IF | `statusCode != 0` (L23226) // Error handling |
| 4.1 | EXEC | `throw new CCException("", new SCCallException("", String.valueOf(statusCode), statusCode))` |
| 5 | SET | `msgListKisnUcwk = (CAANMsg[])resultHashKisnUcwk.get(JKKHakkoSODConstCC.TEMPLATE_ID_EKK0251B003)` |

**Block 5** — FOR LOOP (L23231-23256)

> Iterate through line-level service contract items to find the cancellation line item number.

| # | Type | Code |
|---|------|------|
| 1 | SET | `eKK0251B003Hash = msgListKisnUcwk[i].getMsgData()` // Get message data for current item |
| 2 | SET | `svc_kei_kaisen_ucwk_stat = (String)eKK0251B003Hash.get(EKK0251B003CBSMsg1List.SVC_KEI_KAISEN_UCWK_STAT)` // Get line item status |
| 3 | IF | `isBlank(svc_kei_kaisen_ucwk_stat)` (L23237) // Skip blank status entries |
| 3.1 | EXEC | `continue` // Skip this item |
| 4 | ELSE | (non-blank status) |
| 4.1 | SET | `takino_svc_kei_kaisen_ucwk_no = (String)eKK0251B003Hash.get(EKK0251B003CBSMsg1List.SVC_KEI_KAISEN_UCWK_NO)` // Extract cancellation line item number |
| 4.2 | SET | `takino_svc_kei_kaisen_ucwk_gadtm = (String)eKK0251B003Hash.get(EKK0251B003CBSMsg1List.GENE_ADD_DTM)` // Extract registration datetime |
| 4.3 | EXEC | `break` // Found first valid item |

**Block 6** — IF (condition) `isBlank(takino_svc_kei_kaisen_ucwk_no)` (L23259)

> If no cancellation line item number found, the service contract only has cancelled line items — return 0.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return 0` // No valid multi-function router found |

**Block 7** — FOR LOOP (L23284-23482)

> Iterate through device provision service contracts to identify multi-function router records.

| # | Type | Code |
|---|------|------|
| 1 | SET | `eKK0341B504Hash = msgListKktk[i].getMsgData()` |
| 2 | SET | `kktk_svc_kei_stat = (String)eKK0341B504Hash.get(EKK0341B504CBSMsg1List.KKTK_SVC_KEI_STAT)` // Device provision service contract status |
| 3 | SET | `kktk_svc_cd = (String)eKK0341B504Hash.get(EKK0341B504CBSMsg1List.KKTK_SVC_CD)` // Device provision service code |
| 4 | IF | `JKKHakkoSODConstCC.KKTK_SVC_CD_MRT.equals(kktk_svc_cd) || JKKHakkoSODConstCC.KKTK_SVC_CD_HGW.equals(kktk_svc_cd)` (L23299) // Check for MRT or HGW device type |

**Block 7.1** — IF (nested) `JKKHakkoSODConstCC.SVC_KIND_TEL.equals(svc_kind)` (L23304)

> For telephone services, get equipment before/after repair exchange info.

| # | Type | Code |
|---|------|------|
| 1 | SET | `kokanBfKiki = getShuriKokanBfKiki(handle, param, this.svc_kei_no1, svcKeiUcwkNo, va_kiki_chg_no, ...)` // Get repair exchange info |

**Block 7.2** — IF (nested) `JKKHakkoSODConstCC.SVC_KIND_TEL.equals(svc_kind) && svc_kei_ucwk_no != null && svc_kei_ucwk_no[0] != null` (L23313)

> For telephone with valid service detail work number, check equipment change number mismatch.

| # | Type | Code |
|---|------|------|
| 1 | IF | `isBlank(va_kiki_chg_no) || !va_kiki_chg_no.equals((String)eKK0341B504Hash.get(EKK0341B504CBSMsg1List.KIKI_CHG_NO))` (L23323) // Equipment change number mismatch |
| 1.1 | IF | `kokanBfKiki == null || kokanBfKiki.isEmpty()` (L23328) // Repair exchange info missing |
| 1.1.1 | EXEC | `continue` // Skip this item |

**Block 7.3** — IF/ELSE-IF (nested) `JKKHakkoSODConstCC.SVC_KEI_STAT_920.equals(kktk_svc_kei_stat)` (L23338)

> Skip cancelled items.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `continue` // Skip cancelled items |

**Block 7.4** — ELSE-IF (nested) `JKKHakkoSODConstCC.SVC_KEI_STAT_910.equals(kktk_svc_kei_stat)` (L23343)

> Cancellation in progress (status 910). Check if mskm_dtl_no matches and ido_div triggers simultaneous cancellation.

| # | Type | Code |
|---|------|------|
| 1 | SET | `mskm_dtl_no_local = (String)eKK0341B504Hash.get(EKK0341B004CBSMsg1List.MSKM_DTL_NO)` |
| 2 | IF | `mskm_dtl_no.equals(mskm_dtl_no_local) && (IDO_DIV_DSL.equals(ido_div) || IDO_DIV_TEKKYODSL.equals(ido_div) || IDO_DIV_KYOSEIDSL.equals(ido_div) || IDO_DIV_CANCEL.equals(ido_div))` (L23358) // Simultaneous cancellation due to transfer |
| 2.1 | IF | `kokanBfKiki != null && !kokanBfKiki.isEmpty()` // Use repair exchange data |
| 2.1.1 | SET | `eKK0341B504Hash = (HashMap)kokanBfKiki` |
| 2.2 | SET | `takino_kktk_svc_kei_no = (String)eKK0341B504Hash.get(EKK0341B504CBSMsg1List.KKTK_SVC_KEI_NO)` // Device provision service contract number |
| 2.3 | SET | `takino_kktk_svc_kei_gadtm = (String)eKK0341B504Hash.get(EKK0341B504CBSMsg1List.GENE_ADD_DTM)` |
| 2.4 | SET | `taknkiki_model_cd_takino = (String)eKK0341B504Hash.get(EKK0341B504CBSMsg1List.TAKNKIKI_MODEL_CD)` // Home device model code |
| 2.5 | SET | `kiki_seizo_no_takino = (String)eKK0341B504Hash.get(EKK0341B504CBSMsg1List.KIKI_SEIZO_NO)` // Equipment manufacturing number |
| 2.6 | SET | `mrt_dsl_flg = 2` // Simultaneous cancellation flag |
| 3 | ELSE | `continue` // Other cases — not an order target |

**Block 7.5** — ELSE-IF (nested) `JKKHakkoSODConstCC.SVC_KEI_STAT_020.equals(kktk_svc_kei_stat) || SVC_KEI_STAT_030 || SVC_KEI_STAT_100 || SVC_KEI_STAT_210 || SVC_KEI_STAT_220` (L23383)

> Confirmed/closed/under service/suspended/suspended — active router status.

| # | Type | Code |
|---|------|------|
| 1 | IF | `isBlank((String)eKK0341B504Hash.get(EKK0341B504CBSMsg1List.KIKI_SEIZO_NO))` (L23393) // Manufacturing number blank |
| 1.1 | IF | `kokanBfKiki != null && !kokanBfKiki.isEmpty()` // Repair exchange data available |
| 1.1.1 | SET | `eKK0341B504Hash = (HashMap)kokanBfKiki` |
| 1.2 | ELSE | `return 9` // Router retained but no order issued |
| 2 | SET | `tmp_kktk_svc_kei_stat = kktk_svc_kei_stat` |
| 3 | SET | `takino_kktk_svc_kei_no = (String)eKK0341B504Hash.get(EKK0341B504CBSMsg1List.KKTK_SVC_KEI_NO)` |
| 4 | SET | `takino_kktk_svc_kei_gadtm = (String)eKK0341B504Hash.get(EKK0341B504CBSMsg1List.GENE_ADD_DTM)` |
| 5 | SET | `taknkiki_model_cd_takino = (String)eKK0341B504Hash.get(EKK0341B504CBSMsg1List.TAKNKIKI_MODEL_CD)` |
| 6 | SET | `kiki_seizo_no_takino = (String)eKK0341B504Hash.get(EKK0341B504CBSMsg1List.KIKI_SEIZO_NO)` |
| 7 | SET | `mrt_dsl_flg = 1` // Active router |

**Block 8** — IF (condition) `mrt_dsl_flg == 0 && SVC_KIND_TEL.equals(svc_kind) && !JKKStringUtil.isNullBlank(va_kiki_chg_no)` (L23490)

> OM-2016 fallback: mrt_dsl_flg still 0, service is telephone, and equipment change number exists. Query future-dated records via `callEKK0341B029SC`.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `msgEKK0341B029 = callEKK0341B029SC(handle, param, JPCModelConstant.FUNC_CD_3, null, va_kiki_chg_no, "20991231000000000")` // Query by equipment change number, MAX_DTM |
| 2 | IF | `msgEKK0341B029 != null` (L23498) |
| 3 | IF | `KKTK_SVC_CD_MRT.equals(msgEKK0341B029.getString(...KKTK_SVC_CD)) || KKTK_SVC_CD_HGW.equals(...)` (L23502) // MRT or HGW device |
| 3.1 | IF | `SVC_KEI_STAT_920.equals(kktkSvcKeiStat)` (L23509) // Cancelled — skip (implementation comment says should be same as 910 handling) |
| 3.2 | ELSE-IF | `SVC_KEI_STAT_910.equals(kktkSvcKeiStat)` (L23513) // Cancellation in progress |
| 3.2.1 | IF | `mskm_dtl_no.equals(mskm_dtl_no_local) && (IDO_DIV_DSL || IDO_DIV_TEKKYODSL || IDO_DIV_KYOSEIDSL || IDO_DIV_CANCEL)` (L23519) |
| 3.2.2 | SET | `takino_kktk_svc_kei_no = msgEKK0341B029.getString(...)` // Extract all kktk fields |
| 3.2.3 | SET | `mrt_dsl_flg = 2` |
| 3.3 | ELSE-IF | `SVC_KEI_STAT_020 || 030 || 100 || 210 || 220` (L23539) // Active statuses |
| 3.3.1 | IF | `!JKKStringUtil.isNullBlank(msgEKK0341B029.getString(KIKI_SEIZO_NO))` (L23550) // Manufacturing number set |
| 3.3.2 | SET | `mrt_dsl_flg = 1` // Active router |
| 3.3.3 | ELSE | `mrt_dsl_flg = 0` // No manufacturing number — router retained but not ordered (OM-2018 changed from return 9) |

**Block 9** — IF (condition) `mrt_dsl_flg == 0 && SVC_KIND_TEL.equals(svc_kind) && !JKKStringUtil.isNullBlank(va_kiki_chg_no)` (L23616)

> OM-2018 fallback: Recalculate with reservation date applied (FUNC_CODE_4) and query future-dated records again. This handles contracts-in-progress where the reservation date needs to be considered.

| # | Type | Code |
|---|------|------|
| 1 | SET | `inHashUcwk.put(JKKHakkoSODConstCC.SVC_KEI_UCWK_NO, svc_kei_ucwk_no[0])` // Rebuild input hash |
| 2 | IF | `svc_kei_ucwk_gadtm != null && svc_kei_ucwk_gadtm.length != 0` // Add datetime if present |
| 3 | SET | `inHashUcwk.put(JKKHakkoSODConstCC.GENE_ADD_DTM, svc_kei_ucwk_gadtm[0])` |
| 4 | EXEC | `statusCode = callEKK0191A010SC(param, handle, inHashUcwk, resultHashUcwk, JKKHakkoSODConstCC.FUNC_CODE_4)` // FUNC_CODE_4 — reservation date considered |
| 5 | SET | `va_kiki_chg_no = (String)eKK0191A010Hash.get(EKK0191A010CBSMsg1List.VA_KIKI_CHG_NO)` |
| 6 | EXEC | `msgEKK0341B029 = callEKK0341B029SC(handle, param, JPCModelConstant.FUNC_CD_3, null, va_kiki_chg_no, "20991231000000000")` // Re-query future-dated |
| 7 | IF | Same stat checks as Block 8 — if status 020/030/100/210/220 and manufacturing number set, `mrt_dsl_flg = 1`; else if manufacturing number blank, `return 9` |

**Block 10** — IF (condition) `mrt_dsl_flg == 0 && SVC_KIND_TEL.equals(svc_kind) && !JKKStringUtil.isNullBlank(va_kiki_chg_no)` (L23712)

> ANK-3412 fallback: Query reserved/contract-change-in-progress device provision records via `callEKK0341B021SC`.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `msgEKK0341B021List = callEKK0341B021SC(handle, param, JPCModelConstant.FUNC_CD_1, this.svc_kei_no1)` // Reservation list query |
| 2 | FOR | Loop through msgEKK0341B021List |
| 2.1 | IF | `KKTK_SVC_CD_MRT.equals(msg.getString(CUR_KKTK_SVC_CD)) || KKTK_SVC_CD_HGW.equals(...)` AND `va_kiki_chg_no.equals(msg.getString(RSV_KIKI_CHG_NO))` (L23722) |
| 2.2 | IF | `!JKKStringUtil.isNullBlank(msg.getString(RSV_KIKI_SEIZO_NO))` (L23727) // Manufacturing number set |
| 2.3 | SET | `takino_kktk_svc_kei_no = msg.getString(KKTK_SVC_KEI_NO)` // Extract fields from reservation |
| 2.4 | SET | `takino_kktk_svc_kei_gadtm = msg.getString(RSV_GENE_ADD_DTM)` |
| 2.5 | SET | `taknkiki_model_cd_takino = msg.getString(RSV_TAKNKIKI_MODEL_CD)` |
| 2.6 | SET | `kiki_seizo_no_takino = msg.getString(RSV_KIKI_SEIZO_NO)` |
| 2.7 | SET | `mrt_dsl_flg = 1` |
| 2.8 | EXEC | `break` // Found matching reservation |

**Block 11** — IF/ELSE (condition) `mrt_dsl_flg == 0` (L23803)

> If no multi-function router found on the line, return 0. Otherwise evaluate equipment option service contracts.

| # | Type | Code |
|---|------|------|
| 1 | IF | `mrt_dsl_flg == 0` (L23803) // No router found |
| 1.1 | RETURN | `return 0` |
| 2 | ELSE | (router exists) |
| 2.1 | SET | `inHashKkOP.put(JKKHakkoSODConstCC.KKTK_SVC_KEI_NO, takino_kktk_svc_kei_no)` // Put device provision service contract number |
| 2.2 | EXEC | `statusCode = callEKK2811B010SC(param, handle, inHashKkOP, resultHashKkOP, JKKHakkoSODConstCC.FUNC_CODE_1)` |

**Block 12** — FOR LOOP (L23606-23799)

> Iterate through equipment option service contracts.

| # | Type | Code |
|---|------|------|
| 1 | SET | `eKK2811B010Hash = msgListKkop[i].getMsgData()` |
| 2 | SET | `kkop_svc_cd = (String)eKK2811B010Hash.get(EKK2811B010CBSMsg1List.KKOP_SVC_CD)` // Equipment option service code |
| 3 | SET | `kkop_svc_kei_no = (String)eKK2811B010Hash.get(EKK2811B010CBSMsg1List.KKOP_SVC_KEI_NO)` |
| 4 | SET | `kkop_svc_kei_gadtm = (String)eKK2811B010Hash.get(EKK2811B010CBSMsg1List.GENE_ADD_DTM)` |
| 5 | IF | `(SVC_KIND_NET.equals(svc_kind) && KKOP_SVC_CD_RT.equals(kkop_svc_cd)) || (SVC_KIND_TEL.equals(svc_kind) && KKOP_SVC_CD_VA.equals(kkop_svc_cd))` (L23617) // Router (NET+RT) or VA (TEL+VA) |
| 5.1 | SET | `resultOdrSet = callEKK1041B001SC(param, handle, ORDER_SBT_CD_TEL, SVC_ORDER_CD_MRT, null, null, taknkiki_model_cd_takino, kiki_seizo_no_takino)` // Fetch order settings |
| 5.2 | IF | `resultOdrSet.size() == 0` (L23623) // No order settings — router retained but no order |
| 5.2.1 | RETURN | `return 9` |
| 5.3 | SET | `kkop_svc_kei_stat = (String)eKK2811B010Hash.get(EKK2811B010CBSMsg1List.KKOP_SVC_KEI_STAT)` |
| 5.4 | IF | `SVC_KEI_STAT_910.equals(kkop_svc_kei_stat) || SVC_KEI_STAT_920.equals(kkop_svc_kei_stat)` (L23630) |
| 5.4.1 | SET | `mskm_dtl_no_local = (String)eKK2811B010Hash.get(EKK2811B010CBSMsg1List.MSKM_DTL_NO)` |
| 5.4.2 | IF | `mskm_dtl_no.equals(mskm_dtl_no_local)` (L23632) // Same cancellation |
| 5.4.3 | IF | `mrt_dsl_flg == 1` (L23636) |
| 5.4.3.1 | RETURN | `return 4` // Router active + simultaneous cancellation |
| 5.4.4 | IF | `mrt_dsl_flg == 2` (L23641) |
| 5.4.4.1 | RETURN | `return 3` // Simultaneous cancellation + simultaneous cancellation |
| 5.5 | ELSE | (active status) |
| 5.5.1 | IF | `mrt_dsl_flg == 2` (L23653) |
| 5.5.1.1 | RETURN | `return 0` // Equipment dead but still in simultaneous cancellation state |
| 5.5.2 | FOR | Loop through resultOdrSet |
| 5.5.2.1 | SET | `odrSetNo = (String)odrSet.get(EKK1041B001CBSMsg1List.ODR_SET_NO)` |
| 5.5.2.2 | SET | `kktkSvcKeiNo = (String)odrSet.get(EKK1041B001CBSMsg1List.KKTK_SVC_KEI_NO)` |
| 5.5.2.3 | IF | `!takino_kktk_svc_kei_no.equals(kktkSvcKeiNo)` (L23667) // Mismatch — skip |
| 5.5.2.4 | EXEC | `statusCode = callEKK1041A010SC(param, handle, inHashOdrSet, resultHashOdrSet, FUNC_CODE_1)` |
| 5.5.2.5 | SET | `mrt_skbt_cd = (String)eKK1041A010Hash.get(EKK1041A010CBSMsg1List.TAKINORT_KINO_CD)` // Router function code |
| 5.5.2.6 | SET | `yokyu_sbt_cd = (String)eKK1041A010Hash.get(EKK1041A010CBSMsg1List.RCNT_YOKYU_SBT_CD)` // Yokyu sub-order code |
| 5.5.2.7 | IF | `yokyu_sbt_cd.matches("0[24]")` (L23681) // New/change order |
| 5.5.2.7.1 | IF | `SVC_KIND_TEL.equals(svc_kind)` (L23682) |
| 5.5.2.7.1.1 | IF | `isBlank(mrt_skbt_cd) || TAKINORT_KINO_CD_RT.equals(mrt_skbt_cd)` (L23685) |
| 5.5.2.7.1.2 | RETURN | `return 1` // Router function only |
| 5.5.2.7.2 | RETURN | `return 4` // New/change order |
| 5.5.2.8 | ELSE-IF | `yokyu_sbt_cd.matches("0[38]")` (L23696) // Cancellation/deletion order |
| 5.5.2.8.1 | RETURN | `return 2` |
| 5.5.2.9 | ELSE | `return 9` // OM-2016: changed from 0 to 9 — router retained, new order not issued |
| 6 | EXEC | `kkop_svc_kei_no = ""` (L23812) // Clear after processing |
| 7 | RETURN | `return 0` // Option service not tied to router |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| 多機能ルータ (Takino RT) | Business term | Multi-function router — a bundled telecommunications device providing routing capabilities, typically attached to telephone or internet service contracts |
| SVC_KIND_NET | Constant | Service kind = Network (code "01") |
| SVC_KIND_TEL | Constant | Service kind = Telephone (code "02") |
| SVC_KIND_MOB | Constant | Service kind = Mobile (code "4") |
| SVC_KIND_ADSL | Constant | Service kind = ADSL (code "5") |
| KKTK_SVC_CD_MRT | Constant | Equipment provision service code = Multi-function Router (code "C023") |
| KKTK_SVC_CD_HGW | Constant | Equipment provision service code = Home Gateway (code "C025") |
| KKTK_SVC_CD_TAKINO_ROUTER | Constant | Equipment provision service code = Takino Router (code "C024") |
| KKOP_SVC_CD_RT | Constant | Equipment option service code = Router function |
| KKOP_SVC_CD_VA | Constant | Equipment option service code = Virtual Access function |
| SVC_KEI_STAT_910 | Constant | Service detail status = Cancelled (code "910") |
| SVC_KEI_STAT_920 | Constant | Service detail status = Cancelled (code "920") — used in cancellation workflow |
| SVC_KEI_STAT_020 | Constant | Service detail status = Confirmed (code "020") |
| SVC_KEI_STAT_030 | Constant | Service detail status = Closed (code "030") |
| SVC_KEI_STAT_100 | Constant | Service detail status = Under service provision (code "100") |
| SVC_KEI_STAT_210 | Constant | Service detail status = Suspended/interrupted (code "210") |
| SVC_KEI_STAT_220 | Constant | Service detail status = Usage suspended (code "220") |
| IDO_DIV_DSL | Constant | Division/diversion = DSL (transfer type) |
| IDO_DIV_TEKKYODSL | Constant | Division/diversion = Telephone DSL (transfer type) |
| IDO_DIV_KYOSEIDSL | Constant | Division/diversion = Forced DSL (transfer type) |
| IDO_DIV_CANCEL | Constant | Division/diversion = Cancel (transfer type) |
| mrt_dsl_flg | Field | Multi-function router DSL flag — internal state variable: 0=none, 1=active, 2=simultaneous cancellation |
| svc_kei_no1 | Field | Service contract number — primary identifier for the service contract |
| svc_kei_ucwk_no | Field | Service detail work number — line-level identifier within the service contract |
| svc_kei_ucwk_gadtm | Field | Service detail work registration datetime — versioning timestamp for the service detail |
| prc_grp_cd | Field | Pricing group code — classifies service by pricing tier |
| takino_svc_kei_kaisen_ucwk_no | Field | Takino (multi-function router) service detail cancellation line item number — identifies the cancellation item for the router |
| takino_kktk_svc_kei_no | Field | Takino device provision service contract number — the contract number for the router's device provision service |
| takino_kktk_svc_kei_gadtm | Field | Takino device provision registration datetime |
| taknkiki_model_cd_takino | Field | Takino home device model code — model identifier for the multi-function router |
| kiki_seizo_no_takino | Field | Takino equipment manufacturing number — serial number of the router device |
| va_kiki_chg_no | Field | VA equipment change number — tracks equipment swap/exchange history for the virtual access device |
| mskm_dtl_no | Field | Menu detail number — internal identifier for cancellation details, used to match cancellation events across systems |
| mskm_dtl_no_local | Field | Local copy of menu detail number from query result |
| kkop_svc_kei_stat | Field | Equipment option service contract status |
| kkop_svc_cd | Field | Equipment option service code |
| mrt_skbt_cd | Field | Takino router function code — indicates router configuration (RT = router function only, blank = no router) |
| yokyu_sbt_cd | Field | Yokyu (transfer) sub-order code — classifies order type: 02/04 = new/change order, 03/08 = cancellation/deletion order |
| kokanBfKiki | Field | Repair-before/after equipment — map containing equipment details when equipment is in repair/exchange status |
| HAKKOSODCCWORKMAP | Constant | Work map key in parameter data — carries order-setting information |
| FUNC_CODE_1 | Constant | Function code 1 — standard query mode |
| FUNC_CODE_2 | Constant | Function code 2 — service agreement query mode |
| FUNC_CODE_4 | Constant | Function code 4 — reservation date considered mode (OM-2018) |
| EKK0191A010SC | SC Code | Service component for service agreement item inquiry |
| EKK0251B003SC | SC Code | Service component for service contract line-item list inquiry |
| EKK0341B504SC | SC Code | Service component for device provision service contract list inquiry |
| EKK0341B029SC | SC Code | Service component for future-dated device provision inquiry (by equipment change number) |
| EKK0341B021SC | SC Code | Service component for reserved device provision service contract inquiry |
| EKK2811B010SC | SC Code | Service component for equipment option service contract inquiry |
| EKK1041B001SC | SC Code | Service component for order settings list inquiry |
| EKK1041A010SC | SC Code | Service component for order settings detail inquiry |
| EKK0081A010SC | SC Code | Service component for service agreement item inquiry (pricing group) |
| SOD | Acronym | Service Order Data — telecom order fulfillment system entity |
| VA | Acronym | Virtual Access — a service that bundles telephone with router/internet functionality |
| RT | Acronym | Router — router function in the context of a multi-function router |
| HGW | Acronym | Home Gateway — a residential gateway device combining router, modem, and sometimes telephone functions |
| MRT | Acronym | Multi-function Router (Japanese: マルチ機能ルータ) |
| KKTK | Acronym | Equipment provision (機材提供) — prefix for equipment-related service codes |
| KKOP | Acronym | Equipment option (機材オプション) — prefix for equipment option service codes |
