# Business Logic — JKKAdchgCancelHakkoSODCC.htelNoDslOdrCtrl() [342 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `com.fujitsu.futurity.bp.custom.common.JKKAdchgCancelHakkoSODCC` |
| Layer | CC / Common Component (Custom Business Logic Controller) |
| Module | `common` (Package: `com.fujitsu.futurity.bp.custom.common`) |

## 1. Role

### JKKAdchgCancelHakkoSODCC.htelNoDslOdrCtrl()

This method implements the **lightning/electric phone number cancellation order control process** (??????????). It serves as the central orchestration method for canceling a fiber-optic (FTTH) subscriber's telephone service, coordinating the issuance of multiple Service Order Data (SOD) records covering every aspect of the disconnection workflow.

The method handles three distinct service categories: (1) **OLS (Optical Line System)** — the physical fiber termination equipment including VA (Virtual Access / e-Phone VA) devices and multi-function routers or home gateways; (2) **SIP (Session Initiation Protocol)** — the VoIP signaling layer for internet telephony; and (3) **ENUM (E.164 Number Mapping)** — an optional DNS-based telephone number resolution service activated when the phone number is a local carrier number (JISHA-ban). It also always handles the **emergency notification** (Kinkyuu Tsuhou) and **Radius authentication** teardowns.

The method implements a **delegation and builder pattern**: it reads the current state from the SOD map, queries external service components (SC) for VA device details, equipment provision contracts, and service contract line items, then dispatches `addSOD()` calls to create individual SOD records — each representing one discrete business operation such as "OLS setup/deregistration" or "SIP cancellation."

This method is called as a subordinate step within the larger order control flow, invoked from `htelNoDslOdrCtrl002` and the parent screen orchestration method `htelNoDslOdrCtrl001` in the same class. It acts as a **shared utility** for the FTTH cancellation scenario, specifically targeting cases where a phone number needs to be canceled during service changes or cancellations.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["htelNoDslOdrCtrl"])
    
    START --> EXTRACT["Extract SOD maps from sodMap"]
    EXTRACT --> SHKKA["Apply shkkaMap to all SOD maps"]
    SHKKA --> GETPARAMS["Extract sys_id, ido_div, svc_kei_no, svc_kei_ucwk_no"]
    GETPARAMS --> CHECKBLANK{"isBlank svc_kei_ucwk_no"}
    CHECKBLANK --> |true| EARLY_RETURN["Return param early"]
    CHECKBLANK --> |false| GETTRNNO["getSame_trn_no: acquire same processing number"]
    
    GETTRNNO --> CALL191["callEKK0191A010SC: VA port and device info lookup"]
    CALL191 --> CHECK191{"statusCode == 0"}
    CHECK191 --> |false| THROW191["Throw CCException"]
    CHECK191 --> |true| GETVAINFO["Extract VA port number, model code, serial, chg_no"]
    
    GETVAINFO --> CALL008["callEKK0341B008SC: equipment provision contract lookup"]
    CALL008 --> CHECK008{"statusCode == 0"}
    CHECK008 --> |false| THROW008["Throw CCException"]
    CHECK008 --> |true| BUILDKIKILIST["Build newKikiList from EKK0341B022SC results"]
    
    BUILDKIKILIST --> CALLMFR["getMfrInfoByEKK0341B019: get multi-function router info"]
    CALLMFR --> CALLA010["getDataFromA010Res: transform mfr data to match list format"]
    CALLA010 --> MERGE["Merge mfrKikiList into newKikiList"]
    
    MERGE --> LOOP["For each device in newKikiList"]
    LOOP --> CHECKVA{"isRegalVaKiki"}
    CHECKVA --> |true| GETVADETAILS["Extract kktkSvcKeiNo, kktkGeneAddDtm, vaKikiSeizoNo, tknkiki_sbt_cd"]
    CHECKVA --> |false| CHECKMFRD{"isRegalMfRouter"}
    CHECKMFRD --> |true| GETMFRDETAILS["Extract kktk details and svc_kei_kaisen_ucwk_no"]
    CHECKMFRD --> |false| SKIPDEVICE["Skip device: residential VA only"]
    
    GETVADETAILS --> SETFIELDS["Store fields: svc_kei_ucwk_no, svc_kei_ucwk_gadtm, kktk_svc_kei_no, taknkiki_model_cd, kiki_seizo_no"]
    GETMFRDETAILS --> SETFIELDS
    SKIPDEVICE --> SETFIELDS
    
    SETFIELDS --> CALL251B["getEKK0251B001SC: service contract line item list lookup"]
    CALL251B --> STORE251B["Store svc_kei_kaisen_ucwk_no and gadtm from EKK0251B001"]
    
    STORE251B --> CHECKVAKIKI{"va_kiki not blank AND not in va_kiki_list"}
    CHECKVAKIKI --> |false| SIPDSL["SIP deregistration flow"]
    CHECKVAKIKI --> |true| CHECKTELVA{"tknkiki_sbt_cd == 50 TELVA"}
    
    CHECKTELVA --> |true| OLS215["addSOD: ODR_NAIYO_CD_215 OLS setup deregistration"]
    OLS215 --> OLS216["addSOD: ODR_NAIYO_CD_216 OLS setup cancellation"]
    OLS216 --> CHECKMFRHGW{"tknkiki_sbt_cd is R0 MFR or S0 HGW"}
    
    CHECKMFRHGW --> |true| RUN2811["runEKK2811B010: equipment operation service contract list"]
    RUN2811 --> GETKKSVC["getKkOpSvcRec: get VA service record"]
    GETKKSVC --> CHECKNULL{"ekk2811b010Map != null"}
    
    CHECKNULL --> |true| GETADCHG["getAdchgDtlBySbtCd: change detail by sub code 09"]
    GETADCHG --> CHECKBBR{"bbrKkopMap != null"}
    CHECKBBR --> |true| LOOPADCHG["Loop adchgDtlKkop: check router kopExist"]
    LOOPADCHG --> SETKOPFIELDS["Set kkop_svc_kei_router, kkop_svc_kei_va, kkop_svc_kei_va_gadtm"]
    
    SETKOPFIELDS --> CHECKROUTER{"routerKkopExistFlg"}
    CHECKROUTER --> |true| RUN0341["runEKK0341A010CurrentOpedate: equipment provision agreement lookup"]
    RUN0341 --> STORECHBF["Store chbf_kktk_svc_kei_gadtm from current operatedate"]
    STORECHBF --> OLS417["addSOD: ODR_NAIYO_CD_417 multi-function router VA deregistration"]
    
    OLS417 --> RESTORECHBF["Restore tmp_kktk_svc_kei_gadtm"]
    CHECKROUTER --> |false| OLS421["addSOD: ODR_NAIYO_CD_422 multi-function router setup cancellation"]
    OLS421 --> OLS422["addSOD: ODR_NAIYO_CD_422 multi-function router setup cancellation"]
    
    CHECKTELVA --> |false| ADDKIKILIST["Add va_kiki to va_kiki_list"]
    ADDKIKILIST --> SIPDSL
    
    CHECKMFRHGW --> |false| SIPDSL
    
    SIPDSL --> ADDSOD229["addSOD: ODR_NAIYO_CD_229 SIP deregistration"]
    ADDSOD229 --> ADDSOD230["addSOD: ODR_NAIYO_CD_230 SIP cancellation"]
    
    ADDSOD230 --> CHECKMONAI{"isMonaiBmp JISHA equals 1"}
    CHECKMONAI --> |true| ADDSOD266["addSOD: ODR_NAIYO_CD_266 ENUM setup cancellation"]
    CHECKMONAI --> |false| URGENT252
    
    ADDSOD266 --> URGENT252["addSOD: ODR_NAIYO_CD_252 Emergency notification cancellation"]
    URGENT252 --> CHECKRADIUS{"isRadiusZumi"}
    CHECKRADIUS --> |false| ADDSOD204["addSOD: ODR_NAIYO_CD_204 Radius authentication deregistration"]
    CHECKRADIUS --> |true| RETURN["Return param"]
    
    ADDSOD204 --> SETRADIUS["Set isRadiusZumi = true"]
    SETRADIUS --> RETURN
    
    THROW191 --> END(["End"])
    THROW008 --> END
    EARLY_RETURN --> END
    RETURN --> END
```

**CRITICAL — Constant Resolution:**

| Constant | Resolved Value | Business Meaning |
|----------|---------------|------------------|
| `JKKHakkoSODConstCC.TAKNKIKI_SBT_CD_TELVA` | `"50"` | Domestic equipment type code for e-Phone VA (eo telephone VA) |
| `JKKHakkoSODConstCC.ODR_NAIYO_CD_215` | `"215"` | Order content: OLS setup/deregistration |
| `JKKHakkoSODConstCC.ODR_NAIYO_CD_216` | `"216"` | Order content: OLS setup/cancellation |
| `JKKHakkoSODConstCC.ODR_NAIYO_CD_229` | `"229"` | Order content: SIP/deregistration |
| `JKKHakkoSODConstCC.ODR_NAIYO_CD_230` | `"230"` | Order content: SIP/cancellation |
| `JKKHakkoSODConstCC.ODR_NAIYO_CD_252` | `"252"` | Order content: Emergency notification/cancellation |
| `JKKHakkoSODConstCC.ODR_NAIYO_CD_204` | `"204"` | Order content: Radius authentication/deregistration |
| `JKKHakkoSODConstCC.ODR_NAIYO_CD_266` | `"266"` | Order content: ENUM setup/cancellation |
| `JKKHakkoSODConstCC.ODR_NAIYO_CD_417` | `"417"` | Order content: Multi-function router setup/change (VA function/deregistration) |
| `JKKHakkoSODConstCC.ODR_NAIYO_CD_421` | `"421"` | Order content: Multi-function router setup/cancellation (VA function/deregistration) |
| `JKKHakkoSODConstCC.ODR_NAIYO_CD_422` | `"422"` | Order content: Multi-function router setup/cancellation (VA function/deregistration) |
| `TAKNKIKI_SBT_CD_MFR` | `"R0"` | Domestic equipment type code: multi-function router |
| `TAKNKIKI_SBT_CD_HGW` | `"S0"` | Domestic equipment type code: eo Home Gateway |
| `JKKStrConst.CD00189_JISHA` | `"1"` | Own number flag (JISHA flag) — indicates local carrier number |
| `JKKHakkoSODConstCC.FUNC_CODE_1` | `"1"` | Function code for service agreement lookup |

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `handle` | `SessionHandle` | Session manager handle carrying session context, connection pool, and transaction state — the gateway to database and external service access |
| 2 | `param` | `IRequestParameterReadWrite` | Request/response parameter object containing the model group and control map; carries business data between layers and accumulates SOD records created during processing |
| 3 | `fixedText` | `String` | User-defined arbitrary string — passed through to instance field `fixedText` for later use in device operation service processing; carries contextual notes for the order |
| 4 | `sodMap` | `HashMap<String, Object>` | Service Order Data map — the central data carrier containing SOD basic info, service contract info, and service contract detail info sub-maps; also carries `isCancelTelSvcOnly` flag and other cancellation context |

**Instance fields read by the method:**

| Field | Type | Business Meaning |
|-------|------|------------------|
| `va_kiki_list` | (collection) | Deduplication tracking — list of VA device identifiers already processed to prevent duplicate SOD issuance |
| `isRadiusZumi` | `boolean` | Radius authentication processing completion flag — prevents duplicate Radius deregistration within a single request scope |

**Instance fields written by the method:**

| Field | Type | Business Meaning |
|-------|------|------------------|
| `same_trn_no` | `String` | Same processing number — acquired via `getSame_trn_no`, used for transaction uniqueness within batch processing |
| `svc_kei_ucwk_no` | `String[]` | Service contract detail number (post-change) |
| `svc_kei_ucwk_gadtm` | `String[]` | Service contract detail generation registration datetime (post-change) |
| `kktk_svc_kei_no` | `String[]` | Equipment provision service contract number |
| `kktk_svc_kei_gadtm` | `String[]` | Equipment provision service contract generation registration datetime |
| `taknkiki_model_cd` | `String[]` | Domestic equipment model code |
| `kiki_seizo_no` | `String[]` | Equipment manufacturing serial number |
| `svc_kei_kaisen_ucwk_no` | `String` | Service contract line item detail number |
| `svc_kei_kaisen_ucwk_gadtm` | `String` | Service contract line item detail generation datetime |
| `kkop_svc_kei_router` | `String[]` | Equipment operation service contract number (router) |
| `kkop_svc_kei_router_gadtm` | `String[]` | Equipment operation service contract number registration date (router) |
| `kkop_svc_kei_va` | `String[]` | Equipment operation service contract number (VA) |
| `kkop_svc_kei_va_gadtm` | `String[]` | Equipment operation service contract number registration date (VA) |
| `fixedText` | `String` | User-defined arbitrary string — set from parameter for device operation service use |
| `chbf_kktk_svc_kei_gadtm` | `String[]` | Pre-change equipment provision service contract generation registration datetime |

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `JKKBatClarisAuthCrdt.isNullBlank` | - | - | Calls `isNullBlank` in `JKKBatClarisAuthCrdt` |
| R | `JKKBatClearPassBase.isNullBlank` | - | - | Calls `isNullBlank` in `JKKBatClearPassBase` |
| R | `JKKBatClearPassCrdt.isNullBlank` | - | - | Calls `isNullBlank` in `JKKBatClearPassCrdt` |
| R | `JBSbatACEoElectPrcInfoTrkm.isNullBlank` | - | - | Calls `isNullBlank` in `JBSbatACEoElectPrcInfoTrkm` |
| R | `JBSbatACTrgtSvcKeiMake.isNullBlank` | - | - | Calls `isNullBlank` in `JBSbatACTrgtSvcKeiMake` |
| C | `JKKAdchgCancelHakkoSODCC.addSOD` | - | KK_T_ODR_INF_SOD_WK | Calls `addSOD` in `JKKAdchgCancelHakkoSODCC` — registers a new SOD record with the given order content code |
| R | `JKKAdchgCancelHakkoSODCC.callEKK0191A010SC` | EKK0191A010SC | KK_T_VA_PORT / VA device tables | Calls `callEKK0191A010SC` in `JKKAdchgCancelHakkoSODCC` — looks up VA port number, VA home machine model code, VA device serial number |
| R | `JKKAdchgCancelHakkoSODCC.callEKK0341B008SC` | EKK0341B008SC | KK_T_KKTK_SVC_KEI / equipment provision service contract tables | Calls `callEKK0341B008SC` in `JKKAdchgCancelHakkoSODCC` — looks up equipment provision service contract list by service contract number |
| R | `JKKAdchgCancelHakkoSODCC.getAdchgDtlBySbtCd` | - | KK_T_ADCHG_DTL (change detail table) | Calls `getAdchgDtlBySbtCd` in `JKKAdchgCancelHakkoSODCC` — retrieves change detail records filtered by sub code |
| R | `JKKAdchgCancelHakkoSODCC.getDataFromA010Res` | - | - | Calls `getDataFromA010Res` in `JKKAdchgCancelHakkoSODCC` — transforms equipment list data from A010 response format to match list item format |
| R | `JKKAdchgCancelHakkoSODCC.getEKK0251B001SC` | EKK0251B001SC | KK_T_SVC_KEI_UCWK (service contract line item table) | Calls `getEKK0251B001SC` in `JKKAdchgCancelHakkoSODCC` — looks up service contract line item list by service contract number |
| R | `JKKAdchgCancelHakkoSODCC.getKkOpSvcRec` | - | - | Calls `getKkOpSvcRec` in `JKKAdchgCancelHakkoSODCC` — extracts a specific equipment operation service record from a list by service code |
| R | `JKKAdchgCancelHakkoSODCC.getMfrInfoByEKK0341B019` | EKK0341B019SC | KK_T_KKTK_SVC_KEI (equipment provision service) | Calls `getMfrInfoByEKK0341B019` in `JKKAdchgCancelHakkoSODCC` — gets multi-function router information |
| R | `JKKAdchgCancelHakkoSODCC.getSame_trn_no` | - | Same processing number sequence | Calls `getSame_trn_no` in `JKKAdchgCancelHakkoSODCC` — acquires a transaction number for same-batch processing |
| R | `JKKAdchgCancelHakkoSODCC.isBlank` | - | - | Calls `isBlank` in `JKKAdchgCancelHakkoSODCC` — checks if a string is null or blank |
| R | `JKKAdchgCancelHakkoSODCC.isMonaiBmp` | - | - | Calls `isMonaiBmp` in `JKKAdchgCancelHakkoSODCC` — checks if the phone number is a local carrier number (JISHA-ban) |
| R | `JKKAdchgCancelHakkoSODCC.isRegalMfRouter` | - | - | Calls `isRegalMfRouter` in `JKKAdchgCancelHakkoSODCC` — checks if device is a multi-function router |
| R | `JKKAdchgCancelHakkoSODCC.isRegalVaKiki` | - | - | Calls `isRegalVaKiki` in `JKKAdchgCancelHakkoSODCC` — checks if device is a VA (Virtual Access) device |
| R | `JKKAdchgCancelHakkoSODCC.runEKK0251A010` | EKK0251A010SC | KK_T_SVC_KEI_KAISEN_UCWK (service contract line item detail) | Calls `runEKK0251A010` in `JKKAdchgCancelHakkoSODCC` — looks up service contract line item detail for multi-function router |
| R | `JKKAdchgCancelHakkoSODCC.runEKK0341A010CurrentOpedate` | EKK0341A010SC | KK_T_KKTK_SVC_KEI (equipment provision service agreement) | Calls `runEKK0341A010CurrentOpedate` in `JKKAdchgCancelHakkoSODCC` — looks up equipment provision service agreement with current operated date |
| R | `JKKAdchgCancelHakkoSODCC.runEKK2811B010` | EKK2811B010SC | KK_T_KKOP_SVC_KEI (equipment operation service contract) | Calls `runEKK2811B010` in `JKKAdchgCancelHakkoSODCC` — looks up equipment operation service contract list |
| R | `JKKAdchgCancelHakkoSODCC.shkkaMap` | - | - | Calls `shkkaMap` in `JKKAdchgCancelHakkoSODCC` — clears and reinitializes a HashMap (safe map initialization) |

## 5. Dependency Trace

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

No screen/batch entry points found within 8 hops. Direct callers found: 2 methods.
Terminal operations from this method: `addSOD` [C], `addSOD` [C], `addSOD` [C], `isMonaiBmp` [-], `addSOD` [C], `addSOD` [C], `addSOD` [C], `addSOD` [C], `addSOD` [C], `runEKK0341A010CurrentOpedate` [-], `getKkOpSvcRec` [R], `getAdchgDtlBySbtCd` [R], `getKkOpSvcRec` [R], `runEKK2811B010` [-], `addSOD` [C], `addSOD` [C], `isNullBlank` [-], `isNullBlank` [-], `isNullBlank` [-], `isNullBlank` [-]

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Method: `htelNoDslOdrCtrl002` | `htelNoDslOdrCtrl002` (line 20930) -> calls `htelNoDslOdrCtrl` | `addSOD(handle, param, 215)` [C] KK_T_ODR_INF_SOD_WK |
| 2 | Method: `htelNoDslOdrCtrl001` | `htelNoDslOdrCtrl001` (line 20932) -> calls `htelNoDslOdrCtrl` | `addSOD(handle, param, 216)` [C] KK_T_ODR_INF_SOD_WK |

**Note:** Both callers (`htelNoDslOdrCtrl002` and `htelNoDslOdrCtrl001`) are private methods within `JKKAdchgCancelHakkoSODCC` itself, forming a cascade of cancellation order control processing. The actual screen entry points route through higher-level methods (e.g., `adchgOdrCtrl`, `htelNoDslOdrCtrl001`) which determine the call path based on the service change division judgment.

**Terminal CRUD endpoints from this method:**

| # | Method | CRUD | Entity / Table |
|---|--------|------|----------------|
| 1 | `addSOD(215)` — OLS setup/deregistration | C | KK_T_ODR_INF_SOD_WK |
| 2 | `addSOD(216)` — OLS setup/cancellation | C | KK_T_ODR_INF_SOD_WK |
| 3 | `addSOD(417)` — multi-function router VA deregistration | C | KK_T_ODR_INF_SOD_WK |
| 4 | `addSOD(421)` — multi-function router VA change No.2 | C | KK_T_ODR_INF_SOD_WK |
| 5 | `addSOD(422)` — multi-function router setup/cancellation | C | KK_T_ODR_INF_SOD_WK |
| 6 | `addSOD(229)` — SIP/deregistration | C | KK_T_ODR_INF_SOD_WK |
| 7 | `addSOD(230)` — SIP/cancellation | C | KK_T_ODR_INF_SOD_WK |
| 8 | `addSOD(266)` — ENUM setup/cancellation | C | KK_T_ODR_INF_SOD_WK |
| 9 | `addSOD(252)` — emergency notification/cancellation | C | KK_T_ODR_INF_SOD_WK |
| 10 | `addSOD(204)` — Radius authentication/deregistration | C | KK_T_ODR_INF_SOD_WK |
| 11 | `callEKK0191A010SC` — VA port info lookup | R | EKK0191A010CBS |
| 12 | `callEKK0341B008SC` — equipment provision contract | R | EKK0341B008CBS / EKK0341B022CBS |
| 13 | `getEKK0251B001SC` — service contract line item list | R | EKK0251B001CBS |
| 14 | `getMfrInfoByEKK0341B019` — multi-function router info | R | EKK0341B019CBS |
| 15 | `runEKK0251A010` — service contract line item detail | R | EKK0251A010CBS |
| 16 | `runEKK2811B010` — equipment operation service contract | R | EKK2811B010CBS |
| 17 | `runEKK0341A010CurrentOpedate` — equipment provision agreement | R | EKK0341A010CBS |
| 18 | `getAdchgDtlBySbtCd` — change detail by sub code | R | EKK2101B001CBS |

## 6. Per-Branch Detail Blocks

**Block 1** — [ASSIGN/EXTRACT] `(L9788)`

> Extract SOD maps from the sodMap and apply safe map initialization (shkkaMap).

| # | Type | Code |
|---|------|------|
| 1 | SET | `statusCode = 0` // service interval phase execution status |
| 2 | SET | `sod_kihon_info_Map = (HashMap) sodMap.get(SOD_KIHON_INFO)` // SOD basic info |
| 3 | SET | `svc_kei_info_Map = (HashMap) sodMap.get(SVC_KEI_INFO)` // service contract info |
| 4 | SET | `svc_kei_ucwk_info_Map = (HashMap) sodMap.get(SVC_KEI_UCWK_INFO)` // service contract detail info |
| 5 | EXEC | `sod_kihon_info_Map = shkkaMap(sod_kihon_info_Map)` |
| 6 | EXEC | `svc_kei_info_Map = shkkaMap(svc_kei_info_Map)` |
| 7 | EXEC | `svc_kei_ucwk_info_Map = shkkaMap(svc_kei_ucwk_info_Map)` |

**Block 2** — [EXTRACT] `(L9803–9809)`

> Extract key parameters from the SOD maps: SYSID, move division, service contract number, and service contract detail number.

| # | Type | Code |
|---|------|------|
| 1 | SET | `sys_id = (String) sod_kihon_info_Map.get(INFO_SYSID)` // SYSID |
| 2 | SET | `ido_div = (String) sod_kihon_info_Map.get(INFO_IDO_DIV)` // move division |
| 3 | SET | `svc_kei_no = (String) svc_kei_info_Map.get(INFO_SVC_KEI_NO)` // service contract number |
| 4 | SET | `svc_kei_ucwk_no = (String) svc_kei_ucwk_info_Map.get(INFO_SVC_KEI_UCWK_NO)` // post-change service contract detail number |
| 5 | SET | `chaf_svc_kei_ucwk_gene_add_dtm = (String) svc_kei_ucwk_info_Map.get(INFO_CHAF_SVC_KEI_UCWK_GENE_ADD_DTM)` // post-change registration datetime |

**Block 3** — [IF] `(isBlank(svc_kei_ucwk_no))` `(L9821)`

> Early return if the service contract detail number is blank — no cancellation processing needed. This acts as a guard clause when the SOD map lacks the required detail number.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return param;` |

**Block 4** — [ASSIGN] `(L9826–9829)`

> Acquire the same processing number for transaction uniqueness.

| # | Type | Code |
|---|------|------|
| 1 | SET | `sameTrnNo = new String[1]` |
| 2 | CALL | `getSame_trn_no(param, handle, null, sameTrnNo)` // acquire same processing number |
| 3 | SET | `this.same_trn_no = sameTrnNo[0]` |

**Block 5** — [ASSIGN] `(L9836–9848)`

> Query VA device information via EKK0191A010SC. Input: service contract detail number and generation datetime. Extracts VA port number, home machine model code, and device serial number.

| # | Type | Code |
|---|------|------|
| 1 | SET | `inHashUcwk = new HashMap()` |
| 2 | SET | `resultHashUcwk = new HashMap()` |
| 3 | SET | `inHashUcwk.put(SVC_KEI_UCWK_NO, svc_kei_ucwk_no)` |
| 4 | SET | `inHashUcwk.put(GENE_ADD_DTM, chaf_svc_kei_ucwk_gene_add_dtm)` |
| 5 | CALL | `statusCode = callEKK0191A010SC(param, handle, inHashUcwk, resultHashUcwk, FUNC_CODE_1="1")` |
| 6 | SET | `eKK0191A010Hash = (HashMap) resultHashUcwk.get(TEMPLATE_ID_EKK0191A010)` |
| 7 | SET | `vaPortNo = (String) eKK0191A010Hash.get(VA_PORT_NO)` // VA port number |
| 8 | SET | `vaTaknkikiModelCd = (String) eKK0191A010Hash.get(VA_TAKNKIKI_MODEL_CD)` // VA home machine model code |
| 9 | SET | `vaKikiSeizoNo = (String) eKK0191A010Hash.get(VA_KIKI_SEIZO_NO)` // VA device serial number |
| 10 | SET | `vaKikiChgNo = (String) eKK0191A010Hash.get(VA_KIKI_CHG_NO)` // VA device change number |

**Block 6** — [IF] `(0 != statusCode)` `(L9850)`

> Throw exception if VA info lookup failed.

| # | Type | Code |
|---|------|------|
| 1 | THROW | `throw new CCException("", new SCCallException("", String.valueOf(statusCode), statusCode))` |

**Block 7** — [ASSIGN] `(L9856–9861)`

> Query equipment provision service contract list via EKK0341B008SC.

| # | Type | Code |
|---|------|------|
| 1 | SET | `inHashKktk = new HashMap()` |
| 2 | SET | `resultHashKktk = new HashMap()` |
| 3 | SET | `inHashKktk.put(SVC_KEI_NO, svc_kei_no)` |
| 4 | CALL | `statusCode = callEKK0341B008SC(param, handle, inHashKktk, resultHashKktk, FUNC_CODE_1="1")` |
| 5 | SET | `msgEKK0341B022SCList = (CAANMsg[]) resultHashKktk.get(TEMPLATE_ID_EKK0341B022)` |

**Block 8** — [IF] `(0 != statusCode)` `(L9864)`

> Throw exception if equipment contract lookup failed.

| # | Type | Code |
|---|------|------|
| 1 | THROW | `throw new CCException("", new SCCallException("", String.valueOf(statusCode), statusCode))` |

**Block 9** — [FOR LOOP] `(for each device in newKikiList)` `(L9880–9937)`

> Iterate over combined VA device and multi-function router list. For each device, determine if it is a VA or multi-function router and extract relevant contract numbers and serial numbers.

| # | Type | Code |
|---|------|------|
| 1 | SET | `newKikiList = new ArrayList()` |
| 2 | EXEC | `for(i=0; i<msgEKK0341B022SCList.length; i++) newKikiList.add(msgEKK0341B022SCList[i].getMsgData())` |
| 3 | CALL | `mfrKikiList = getMfrInfoByEKK0341B019(param, handle, svc_kei_no)` |
| 4 | CALL | `mfrKikiListModed= getDataFromA010Res(mfrKikiList)` |
| 5 | EXEC | `newKikiList.addAll(mfrKikiListModed)` |
| 6 | EXEC | `for (HashMap eKK0341B022SCHash : newKikiList) { ... }` |

**Block 9.1** — [IF] `(isRegalVaKiki(eKK0341B022SCHash, vaTaknkikiModelCd, null, ido_div, vaKikiChgNo))` `(L9885)`

> If the device is a recognized VA (Virtual Access / e-Phone) device, extract its contract number, generation datetime, serial number, and equipment type code, then break to use these values.

| # | Type | Code |
|---|------|------|
| 1 | SET | `kktkSvcKeiNo = (String) eKK0341B022SCHash.get(KKTK_SVC_KEI_NO)` // equipment provision service contract number |
| 2 | SET | `kktkGeneAddDtm = (String) eKK0341B022SCHash.get(GENE_ADD_DTM)` // generation registration datetime |
| 3 | SET | `vaKikiSeizoNo = (String) eKK0341B022SCHash.get(KIKI_SEIZO_NO)` // device serial number |
| 4 | SET | `tknkiki_sbt_cd = (String) eKK0341B022SCHash.get(TAKNKIKI_SBT_CD)` // domestic equipment type code |
| 5 | EXEC | `break` |

**Block 9.2** — [ELSE IF] `(isRegalMfRouter(...))` `(L9907)`

> If the device is a multi-function router, extract the same fields plus the service contract line item detail number, then call `runEKK0251A010` to get the generation datetime for the line item detail.

| # | Type | Code |
|---|------|------|
| 1 | SET | `kktkSvcKeiNo = (String) eKK0341B022SCHash.get(KKTK_SVC_KEI_NO)` |
| 2 | SET | `kktkGeneAddDtm = (String) eKK0341B022SCHash.get(GENE_ADD_DTM)` |
| 3 | SET | `vaKikiSeizoNo = (String) eKK0341B022SCHash.get(KIKI_SEIZO_NO)` |
| 4 | SET | `tknkiki_sbt_cd = (String) eKK0341B022SCHash.get(TAKNKIKI_SBT_CD)` |
| 5 | SET | `svc_kei_kaisen_ucwk_no = (String) eKK0341B022SCHash.get(SVC_KEI_KAISEN_UCWK_NO)` // service contract line item detail number |
| 6 | CALL | `ekk0251a010Map = runEKK0251A010(param, handle, svc_kei_kaisen_ucwk_no)` |
| 7 | SET | `svc_kei_kaisen_ucwk_gadtm = (String) ekk0251a010Map.get(GENE_ADD_DTM)` |
| 8 | EXEC | `break` |

**Block 10** — [ASSIGN] `(L9941–9956)`

> Store extracted fields into instance fields wrapped in single-element arrays for later use by calling methods.

| # | Type | Code |
|---|------|------|
| 1 | SET | `this.svc_kei_ucwk_no = new String[1]; this.svc_kei_ucwk_no[0] = svc_kei_ucwk_no` |
| 2 | SET | `this.svc_kei_ucwk_gadtm = new String[1]; this.svc_kei_ucwk_gadtm[0] = chaf_svc_kei_ucwk_gene_add_dtm` |
| 3 | SET | `this.kktk_svc_kei_no = new String[1]; this.kktk_svc_kei_no[0] = kktkSvcKeiNo` |
| 4 | SET | `this.kktk_svc_kei_gadtm = new String[1]; this.kktk_svc_kei_gadtm[0] = kktkGeneAddDtm` |
| 5 | SET | `this.taknkiki_model_cd = new String[1]; this.taknkiki_model_cd[0] = vaTaknkikiModelCd` |
| 6 | SET | `this.kiki_seizo_no = new String[1]; this.kiki_seizo_no[0] = vaKikiSeizoNo` |

**Block 11** — [ASSIGN] `(L9960–9966)`

> Query service contract line item list via EKK0251B001SC and store the line item detail number and datetime into instance fields.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `eKK0251B001Hash = getEKK0251B001SC(param, handle, svc_kei_no, FUNC_CODE_1="1")` |
| 2 | SET | `this.svc_kei_kaisen_ucwk_no = (String) eKK0251B001Hash.get(SVC_KEI_KAISEN_UCWK_NO)` |
| 3 | SET | `this.svc_kei_kaisen_ucwk_gadtm = (String) eKK0251B001Hash.get(GENE_ADD_DTM)` |

**Block 12** — [IF] `(!isBlank(va_kiki) AND !va_kiki_list.contains(va_kiki))` `(L9969)`

> Process VA device operations only if the VA device identifier is not blank and not already processed (deduplication). The VA device identifier is a concatenation of model code and serial number.

**Block 12.1** — [IF] `(TKNKIKI_SBT_CD_TELVA="50" == tknkiki_sbt_cd)` `(L9974)`

> Handle e-Phone VA device: issue OLS setup/deregistration and OLS setup/cancellation SOD records.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `param = addSOD(handle, param, ODR_NAIYO_CD_215="215")` // OLS setup/deregistration |
| 2 | CALL | `param = addSOD(handle, param, ODR_NAIYO_CD_216="216")` // OLS setup/cancellation |

**Block 12.2** — [ELSE IF] `(TAKNKIKI_SBT_CD_MFR="R0" OR TAKNKIKI_SBT_CD_HGW="S0" == tknkiki_sbt_cd)` `(L9969)`

> Handle multi-function router or home gateway: query equipment operation service contracts, check for VA and BBR (BB-Router) services, and issue appropriate router SOD records.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `kkop_svc_kei_srch_list = runEKK2811B010(param, handle, kktk_svc_kei_no[0])` |
| 2 | CALL | `ekk2811b010Map = getKkOpSvcRec(kkop_svc_kei_srch_list, KKOP_SVC_CD_VA="G02", true)` |

**Block 12.2.1** — [IF] `(ekk2811b010Map != null)` `(L9987)`

> VA service record exists — proceed with router-specific processing including BBR detection and router contract number storage.

| # | Type | Code |
|---|------|------|
| 1 | SET | `this.fixedText = fixedText` |
| 2 | CALL | `adchgDtlKkop = getAdchgDtlBySbtCd(param, handle, "09")` // change detail by sub code |
| 3 | SET | `routerKkopExistFlg = false` |

**Block 12.2.1.1** — [IF] `(bbrKkopMap != null)` `(L9993)`

> BBR (BB-Router) equipment operation service exists. Loop through change detail records to check if the router function is being transferred to another device.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `bbrKkopMap = getKkOpSvcRec(kkop_svc_kei_srch_list, KKOP_SVC_CD_BBR="G01", true)` |
| 2 | SET | `bbrKkopSvcKeiNo = (String) bbrKkopMap.get(KKOP_SVC_KEI_NO)` |
| 3 | EXEC | `for (HashMap dtlMap : adchgDtlKkop) { ... }` |

**Block 12.2.1.1.1** — [IF] `(bbrKkopSvcKeiNo matches chbfSkbtNo OR isCancelTelSvcOnly=="1" && bbrKkopSvcKeiNo matches chafSkbtNo)` `(L10010–10022)`

> Router function transfer detected — either the pre-change identification matches the BBR service number, or in cancel-only mode the post-change identification matches. Sets `routerKkopExistFlg = true`.

| # | Type | Code |
|---|------|------|
| 1 | SET | `chbfSkbtNo = (String) dtlMap.get(CHBF_SKBT_NO)` // pre-change ID number |
| 2 | SET | `chafSkbtNo = (String) dtlMap.get(CHAF_SKBT_NO)` // post-change ID number |
| 3 | SET | `routerKkopExistFlg = true` |

**Block 12.2.1.2** — [ASSIGN] `(L10034–10043)`

> Store equipment operation service contract numbers for router, VA, and service contract line items.

| # | Type | Code |
|---|------|------|
| 1 | SET | `this.kkop_svc_kei_router[0] = ""` |
| 2 | SET | `this.kkop_svc_kei_router_gadtm[0] = ""` |
| 3 | SET | `this.kkop_svc_kei_va[0] = (String) ekk2811b010Map.get(KKOP_SVC_KEI_NO)` |
| 4 | SET | `this.kkop_svc_kei_va_gadtm[0] = (String) ekk2811b010Map.get(GENE_ADD_DTM)` |
| 5 | SET | `this.svc_kei_kaisen_ucwk_no = svc_kei_kaisen_ucwk_no` |
| 6 | SET | `this.svc_kei_kaisen_ucwk_gadtm = svc_kei_kaisen_ucwk_gadtm` |

**Block 12.2.1.3** — [IF] `(routerKkopExistFlg)` `(L10049)`

> Router function transfer detected — use the "417" order content code which handles router deregistration with current operated date tracking, and temporarily store/restore the pre-change equipment provision service contract generation datetime.

| # | Type | Code |
|---|------|------|
| 1 | SET | `tmp_kktk_svc_kei_gadtm = this.chbf_kktk_svc_kei_gadtm[0]` |
| 2 | CALL | `hktg_mfr_map = runEKK0341A010CurrentOpedate(param, handle, kktkSvcKeiNo)` |
| 3 | SET | `geneAddDtm = (String) hktg_mfr_map.get(GENE_ADD_DTM)` |
| 4 | SET | `this.chbf_kktk_svc_kei_gadtm = new String[1]; this.chbf_kktk_svc_kei_gadtm[0] = geneAddDtm` |
| 5 | CALL | `param = addSOD(handle, param, ODR_NAIYO_CD_417="417")` // multi-function router VA deregistration |
| 6 | SET | `this.chbf_kktk_svc_kei_gadtm = new String[1]; this.chbf_kktk_svc_kei_gadtm[0] = tmp_kktk_svc_kei_gadtm` |

**Block 12.2.1.4** — [ELSE] `(L10066)`

> No router function transfer — issue standard multi-function router setup/cancellation SOD records (421, 422).

| # | Type | Code |
|---|------|------|
| 1 | CALL | `param = addSOD(handle, param, ODR_NAIYO_CD_421="421")` // multi-function router setup/change VA chg No.2 |
| 2 | CALL | `param = addSOD(handle, param, ODR_NAIYO_CD_422="422")` // multi-function router setup/cancellation |

**Block 12.3** — [EXEC] `(L10071)`

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `va_kiki_list.add(va_kiki)` |

**Block 13** — [CALL] `(L10075–10078)`

> Issue SIP deregistration and cancellation SOD records unconditionally.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `param = addSOD(handle, param, ODR_NAIYO_CD_229="229")` // SIP/deregistration |
| 2 | CALL | `param = addSOD(handle, param, ODR_NAIYO_CD_230="230")` // SIP/cancellation |

**Block 14** — [IF] `(isMonaiBmp with JISHA="1")` `(L10082)`

> If the phone number is a local carrier number (JISHA-ban/own number), issue ENUM setup/cancellation SOD. ENUM resolves E.164 telephone numbers to URI via DNS.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `param = addSOD(handle, param, ODR_NAIYO_CD_266="266")` // ENUM setup/cancellation |

**Block 15** — [CALL] `(L10088)`

> Issue emergency notification/cancellation SOD record unconditionally.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `param = addSOD(handle, param, ODR_NAIYO_CD_252="252")` // emergency notification/cancellation |

**Block 16** — [IF] `(!isRadiusZumi)` `(L10090)`

> If Radius authentication deregistration has not yet been processed in this request scope, issue the deregistration SOD and mark as complete.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `param = addSOD(handle, param, ODR_NAIYO_CD_204="204")` // Radius authentication/deregistration |
| 2 | SET | `isRadiusZumi = true` |

**Block 17** — [RETURN] `(L10094)`

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return param` // returns the updated parameter with all SOD records |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `svc_kei_no` | Field | Service contract number — unique identifier for a subscriber's service contract |
| `svc_kei_ucwk_no` | Field | Service contract detail number (post-change) — tracking ID for service contract line items after change |
| `svc_kei_ucwk_gadtm` | Field | Service contract detail generation registration datetime — timestamp when the detail record was created |
| `svc_kei_kaisen_ucwk_no` | Field | Service contract line item detail number — internal tracking for service contract sub-items |
| `kktk_svc_kei_no` | Field | Equipment provision service contract number — contract number for equipment (VA/router) provisioning |
| `kktk_svc_kei_gadtm` | Field | Equipment provision service contract generation registration datetime |
| `taknkiki_model_cd` | Field | Domestic equipment model code — model identifier for in-home devices (VA, router, HGW) |
| `kiki_seizo_no` | Field | Equipment manufacturing serial number — unique hardware serial number |
| `chbf_kktk_svc_kei_gadtm` | Field | Pre-change equipment provision service contract generation registration datetime |
| `kkop_svc_kei_router` | Field | Equipment operation service contract number (router) — contract for router-based equipment operations |
| `kkop_svc_kei_va` | Field | Equipment operation service contract number (VA) — contract for VA-based equipment operations |
| `va_kiki_list` | Field | VA device list — deduplication tracking for VA devices already processed |
| `isRadiusZumi` | Field | Radius authentication completion flag — prevents duplicate Radius deregistration SOD issuance |
| `sodMap` | Field | Service Order Data map — central data carrier holding all SOD-related sub-maps (basic info, service contract info, service contract detail info) |
| SOD | Acronym | Service Order Data — the entity representing a service order record in the order management system |
| VA | Business term | Virtual Access / e-Phone VA — Fujitsu's voice access device for eo telephone (IP phone) service |
| OLS | Business term | Optical Line System — fiber-optic termination equipment including the optical terminal unit |
| SIP | Business term | Session Initiation Protocol — VoIP signaling protocol for internet telephony calls |
| ENUM | Business term | E.164 Number Mapping — DNS-based telephone number resolution service, used for local carrier numbers |
| FTTH | Business term | Fiber To The Home — fiber-optic broadband internet service |
| Radius | Business term | Remote Authentication Dial-In User Service — network authentication protocol for broadband access |
| JISHA-ban | Business term | Own number / local carrier number — a phone number assigned by the local telecommunications carrier (as opposed to a carrier-assigned number) |
| Kinkyuu Tsuhou | Business term | Emergency notification — public safety alerting service tied to the phone number |
| Hikari Denwa Kaiyaku | Business term | Fiber optic telephone cancellation — the overall business process this method implements |
| Kikiteikyou | Business term | Equipment provision — provisioning of in-home devices (VA, routers) as part of the service |
| Keiyaiuchu | Business term | Service contract detail — sub-item breakdown within a service contract |
| Keiyakukaiisen Uchu | Business term | Service contract line item detail — further breakdown of the service contract into specific line items |
| Henkougo | Business term | Post-change — state after a service modification |
| Henkoumae | Business term | Pre-change — state before a service modification |
| TAKNKIKI_SBT_CD_TELVA | Constant | Domestic equipment type code "50" — eo telephone VA device |
| TAKNKIKI_SBT_CD_MFR | Constant | Domestic equipment type code "R0" — multi-function router |
| TAKNKIKI_SBT_CD_HGW | Constant | Domestic equipment type code "S0" — eo Home Gateway |
| KKOP_SVC_CD_VA | Constant | Equipment operation service code "G02" — VA service |
| KKOP_SVC_CD_BBR | Constant | Equipment operation service code "G01" — BB-Router service |
| ODR_NAIYO_CD_204 | Constant | Order content code "204" — Radius authentication/deregistration |
| ODR_NAIYO_CD_215 | Constant | Order content code "215" — OLS setup/deregistration |
| ODR_NAIYO_CD_216 | Constant | Order content code "216" — OLS setup/cancellation |
| ODR_NAIYO_CD_229 | Constant | Order content code "229" — SIP/deregistration |
| ODR_NAIYO_CD_230 | Constant | Order content code "230" — SIP/cancellation |
| ODR_NAIYO_CD_252 | Constant | Order content code "252" — emergency notification/cancellation |
| ODR_NAIYO_CD_266 | Constant | Order content code "266" — ENUM setup/cancellation |
| ODR_NAIYO_CD_417 | Constant | Order content code "417" — multi-function router setup/change (VA function/deregistration) |
| ODR_NAIYO_CD_421 | Constant | Order content code "421" — multi-function router setup/cancellation (VA function/deregistration) |
| ODR_NAIYO_CD_422 | Constant | Order content code "422" — multi-function router setup/cancellation (VA function/deregistration) |
| KK_T_ODR_INF_SOD_WK | Table | SOD issuance waiting table — stores pending SOD records for transmission |
| EKK0191A010SC | SC Code | VA port and device information lookup service component |
| EKK0341B008SC | SC Code | Equipment provision service contract list lookup service component |
| EKK0251B001SC | SC Code | Service contract line item list lookup service component |
| EKK0341B019SC | SC Code | Multi-function router information lookup service component |
| EKK2811B010SC | SC Code | Equipment operation service contract list lookup service component |
| EKK0341A010SC | SC Code | Equipment provision service agreement lookup with operated date |
| EKK0251A010SC | SC Code | Service contract line item detail lookup service component |