# Business Logic — JKKAdchgHakkoSODCC.htelNoChgeOdrCtrlBfSvcStart() [357 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `com.fujitsu.futurity.bp.custom.common.JKKAdchgHakkoSODCC` |
| Layer | CC / Common Component (Shared business logic controller for service order changes) |
| Module | `common` (Package: `com.fujitsu.futurity.bp.custom.common`) |

## 1. Role

### JKKAdchgHakkoSODCC.htelNoChgeOdrCtrlBfSvcStart()

This method implements the **pre-service-start telephone number change** business operation for the eo Hikari Net (fiber-to-the-home) service platform. It is invoked during address change processing (住所変更) when a customer's telephone number needs to be changed before the new service officially starts.

The method handles two primary **service categories**: (1) standard OLS (Optical Line Service) telephone number changes, and (2) multi-function router (multi-func router) telephone number changes with VA (virtual appliance) function integration. When the customer has a multi-function router (indicated by the `takino_flg` flag), it routes to a different order content code (409) vs. standard OLS (210).

The method follows a **gate-and-route** design pattern: it first checks whether a Z1 order (a primary fiber service order) is pending processing (via `findZ1OrderAtKK1041`). If a Z1 order exists (Z1 count >= 4), the method proceeds through a multi-phase processing flow: (a) pre-processor queries, (b) before-change detail retrieval, (c) SIP cancellation and deletion, (d) ENUM configuration (conditional on number port status), (e) new SIP registration, and (f) emergency notification registration. If no Z1 order exists, the method silently skips all processing and returns the original parameters unchanged.

Its **role in the larger system** is as a shared utility method within the `JKKAdchgHakkoSODCC` change-order controller component. It is called from within the same class during the broader address change order control flow, where it dispatches the correct sequence of SOD (Service Order Data) creation calls to register all necessary order content codes for the telephone number change scenario.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["htelNoChgeOdrCtrlBfSvcStart"])

    START --> EXTRACT["Extract svc_kei_info_Map, svc_kei_ucwk_info_Map, kktsvkei_info_Map from sodMap"]
    EXTRACT --> NORMALIZE["Normalize maps via shkkaMap"]
    NORMALIZE --> FIELDS["Extract fields: svc_kei_no, svc_kei_ucwk_no, chaf_svc_kei_ucwk_gene_add_dtm, chaf_kktsvkei_no, chaf_kktsvkei_gene_add_dtm"]
    FIELDS --> Z1CHECK["findZ1OrderAtKK1041 - Count Z1 orders"]
    Z1CHECK --> Z1CONDITION{Is Z1 ordered?}

    Z1CONDITION -- "true (Z1 ordered)" --> PRE1["getSame_trn_no - Get same transaction number"]
    PRE1 --> EKK0251["getEKK0251B001SC - Service contract route info"]
    EKK0251 --> EKK0191_1["callEKK0191A010SC func_code 1 - Service contract detail"]
    EKK0191_1 --> CHECKKKTSVKEI{Has chaf_kktsvkei_no AND chaf_kktsvkei_gene_add_dtm?}

    CHECKKKTSVKEI -- "true" --> EKK0341["callEKK0341A010SC - Equipment provider service contract"]
    EKK0341 --> TAKINOFCOND{Is takino_flg 0?}
    CHECKKKTSVKEI -- "false" --> TAKINOFCOND

    TAKINOFCOND -- "yes (not multi-func router)" --> ADD210["addSOD ODR_NAIYO_CD_210 OLS phone change"]
    TAKINOFCOND -- "no (multi-func router)" --> ADD409["addSOD ODR_NAIYO_CD_409 Multi-func router VA phone change"]

    ADD210 --> BFCHGDETAIL["Call EKK0191A010SC with chbfSvcKeiUcwkNo"]
    ADD409 --> BFCHGDETAIL
    BFCHGDETAIL --> SIPCANCEL["addSOD ODR_NAIYO_CD_229 SIP cancel"]
    SIPCANCEL --> SIPDEL["addSOD ODR_NAIYO_CD_230 SIP deletion"]
    SIPDEL --> BFCHGENUM["Call EKK0191A010SC for before-change ENUM check"]
    BFCHGENUM --> CHBFENUM{Is chbfTelno self monai bmp?}

    CHBFENUM -- "true" --> ENUMDEL["addSOD ODR_NAIYO_CD_266 ENUM deletion"]
    CHBFENUM -- "false" --> EMERGENCYDEL["addSOD ODR_NAIYO_CD_252 Emergency notif deletion"]
    ENUMDEL --> EMERGENCYDEL
    EMERGENCYDEL --> RESETTRN["Reset same_trn_no to empty"]

    RESETTRN --> SIPREG["addSOD ODR_NAIYO_CD_218 SIP registration"]
    SIPREG --> BMPUM{Is chafBmpUm 1?}

    BMPUM -- "true" --> BMPREG["addSOD ODR_NAIYO_CD_225 Number port info registration"]
    BMPUM -- "false" --> EMERGENCYREG["addSOD ODR_NAIYO_CD_250 Emergency notif registration"]

    BMPREG --> TAJGS{Is other company phone?}

    TAJGS -- "true" --> ENUMREG["addSOD ODR_NAIYO_CD_265 ENUM registration"]
    TAJGS -- "false" --> ENUMDEL2["addSOD ODR_NAIYO_CD_266 ENUM deletion"]

    ENUMREG --> EMERGENCYREG
    ENUMDEL2 --> EMERGENCYREG

    EMERGENCYREG --> Z1NONE["Z1 not ordered - skip all processing"]

    Z1CONDITION -- "false (Z1 not ordered)" --> Z1NONE
    Z1NONE --> END_NODE(["Return param"])
```

**CRITICAL — Constant Resolution:**

| Constant | Actual Value | Business Meaning |
|----------|-------------|-----------------|
| `FUNC_CODE_1` | `"1"` | After-change processing function code |
| `FUNC_CODE_2` | `"2"` | Before-change processing function code |
| `ODR_NAIYO_CD_210` | `"210"` | OLS setting / phone number change |
| `ODR_NAIYO_CD_218` | `"218"` | SIP / registration |
| `ODR_NAIYO_CD_225` | `"225"` | SIP / number port info registration |
| `ODR_NAIYO_CD_229` | `"229"` | SIP / cancellation (解約) |
| `ODR_NAIYO_CD_230` | `"230"` | SIP / deletion (消去) |
| `ODR_NAIYO_CD_250` | `"250"` | Emergency notification / registration |
| `ODR_NAIYO_CD_252` | `"252"` | Emergency notification / deletion (消去) |
| `ODR_NAIYO_CD_265` | `"265"` | ENUM setting / registration (設定・登録) |
| `ODR_NAIYO_CD_266` | `"266"` | ENUM setting / deletion (消去) |
| `ODR_NAIYO_CD_409` | `"409"` | Multi-function router setting / change (VA func phone change) |
| `CD00001_1` | `"1"` | ENUM enabled flag (number port has port) |
| `CD00189_JISHA` | `"1"` | Self company flag (not other carrier) |
| `BMP_UM_ARI` | `"1"` | Number port exists (banpo-ari) |

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `handle` | `SessionHandle` | Session manager handle carrying the database and business context for the current operation. Used for all service calls and SOD creation. |
| 2 | `param` | `IRequestParameterReadWrite` | Request parameter object containing model groups and control maps. Accumulates SOD entries through `addSOD()` calls and is returned at the end with all order content codes registered. |
| 3 | `fixedText` | `String` | User-specified arbitrary string. Passed as a parameter but not actively used within this method (preserved for caller interface consistency). |
| 4 | `sodMap` | `HashMap<String, Object>` | Service Order Data map containing three nested HashMaps: `svc_kei_info` (service contract info), `svc_kei_ucwk_info` (service contract detail info with before/after change fields), and `kktsvkei_info` (equipment provider service contract info). |

**Instance fields read/set by this method:**

| Field | Business Meaning |
|-------|-----------------|
| `this.same_trn_no` | Same transaction number — used for grouping related orders |
| `this.svc_kei_ucwk_no[]` | Service contract detail number array (set with after-change or before-change value) |
| `this.svc_kei_ucwk_gadtm[]` | Service contract detail registration date/time array |
| `this.svc_kei_kaisen_ucwk_no` | Service contract route detail number (from EKK0251B001SC query) |
| `this.svc_kei_kaisen_ucwk_gadtm` | Service contract route detail registration date/time |
| `this.kktk_svc_kei_no[]` | Equipment provider service contract number |
| `this.kktk_svc_kei_gadtm[]` | Equipment provider service contract registration date/time |
| `this.taknkiki_model_cd[]` | Home device model code (VA indoor equipment model) |
| `this.kiki_seizo_no[]` | Equipment manufacturing serial number |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `JKKAdchgHakkoSODCC.findZ1OrderAtKK1041` | KK1041 | - | Count Z1 orders to determine if primary fiber order is pending |
| R | `JKKAdchgHakkoSODCC.getSame_trn_no` | - | - | Retrieve the same transaction number for order grouping |
| R | `JKKAdchgHakkoSODCC.getEKK0251B001SC` | EKK0251B001SC | Service contract route detail | Query service contract route info list by service contract number |
| R | `JKKAdchgHakkoSODCC.callEKK0191A010SC` | EKK0191A010SC | Service contract detail | Query service contract detail info (called 4 times: 2x func_code=1 after-change, 2x func_code=2 before-change) |
| R | `JKKAdchgHakkoSODCC.callEKK0341A010SC` | EKK0341A010SC | Equipment provider service contract | Query equipment provider service contract agreement for device provisioning data |
| C | `JKKAdchgHakkoSODCC.addSOD` | - | SOD (Service Order Data) | Create order data entries with specified order content codes — called 9-11 times |
| - | `JKKAdchgHakkoSODCC.isBlank` | - | - | Utility: check if a string is null or blank |
| - | `JKKAdchgHakkoSODCC.isTajgsTelNo` | - | - | Utility: determine if the phone number belongs to another carrier |
| - | `JKKAdchgHakkoSODCC.isMonaiBmp` | - | - | Utility: check if the before-change phone number is a self monai (internal) number port |
| - | `JKKAdchgHakkoSODCC.shkkaMap` | - | - | Utility: normalize/clean a HashMap (shkka = scrub) |

### Detailed CRUD analysis per method call:

| # | CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|---|------|----------|---------|-------------|----------------------|
| 1 | R | `JKKAdchgHakkoSODCC.findZ1OrderAtKK1041` | KK1041 | Order data (Z1 filter) | Count pending Z1 orders to gate processing |
| 2 | R | `JKKAdchgHakkoSODCC.getSame_trn_no` | - | Transaction table | Get same transaction number for order grouping |
| 3 | R | `JKKAdchgHakkoSODCC.getEKK0251B001SC` | EKK0251B001SC | Service contract route (KK_SVC_KEI route table) | Retrieve service contract route detail list by service contract number |
| 4 | R | `JKKAdchgHakkoSODCC.callEKK0191A010SC` | EKK0191A010SC | Service contract detail (KK_SVC_KEI_UCWK) | Query after-change service contract detail (func_code=1), extract VA device model code, change number, and ENUM presence flag |
| 5 | R | `JKKAdchgHakkoSODCC.callEKK0341A010SC` | EKK0341A010SC | Equipment provider service contract (KK_KKTSVKEI) | Query equipment provider service contract agreement to extract contract number, registration date/time, and device serial number |
| 6 | C | `JKKAdchgHakkoSODCC.addSOD` | - | SOD (Service Order Data) | Register "OLS setting / phone number change" (210) or "Multi-func router VA phone change" (409) |
| 7 | R | `JKKAdchgHakkoSODCC.callEKK0191A010SC` | EKK0191A010SC | Service contract detail (KK_SVC_KEI_UCWK) | Query before-change service contract detail (func_code=2) to retrieve old registration date/time |
| 8 | C | `JKKAdchgHakkoSODCC.addSOD` | - | SOD | Register "SIP / cancellation" (229) |
| 9 | C | `JKKAdchgHakkoSODCC.addSOD` | - | SOD | Register "SIP / deletion" (230) |
| 10 | R | `JKKAdchgHakkoSODCC.callEKK0191A010SC` | EKK0191A010SC | Service contract detail (KK_SVC_KEI_UCWK) | Query before-change data to extract ENUM number port flag and phone number |
| 11 | C | `JKKAdchgHakkoSODCC.addSOD` | - | SOD | Register "ENUM setting / deletion" (266) if before-change phone is self monai number port |
| 12 | C | `JKKAdchgHakkoSODCC.addSOD` | - | SOD | Register "Emergency notification / deletion" (252) |
| 13 | C | `JKKAdchgHakkoSODCC.addSOD` | - | SOD | Register "SIP / registration" (218) |
| 14 | C | `JKKAdchgHakkoSODCC.addSOD` | - | SOD | Register "SIP / number port info registration" (225) if after-change ENUM is enabled |
| 15 | C | `JKKAdchgHakkoSODCC.addSOD` | - | SOD | Register "ENUM setting / registration" (265) if other company phone, or "ENUM deletion" (266) if self company phone |
| 16 | C | `JKKAdchgHakkoSODCC.addSOD` | - | SOD | Register "Emergency notification / registration" (250) |

## 5. Dependency Trace

The method is **private** and called from within `JKKAdchgHakkoSODCC` itself. The sole direct caller found is:

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Internal: JKKAdchgHakkoSODCC | `address change order control` -> `htelNoChgeOdrCtrlBfSvcStart` | `addSOD [C] SOD` (9-11 times with codes: 210, 218, 225, 229, 230, 250, 252, 265, 266, 409) |
| 2 | Internal: JKKAdchgHakkoSODCC | (same) -> ... -> `callEKK0191A010SC [R] KK_SVC_KEI_UCWK` | 4 calls (2 after-change, 2 before-change) |
| 3 | Internal: JKKAdchgHakkoSODCC | (same) -> ... -> `callEKK0341A010SC [R] KK_KKTSVKEI` | 1 call (equipment provider contract) |
| 4 | Internal: JKKAdchgHakkoSODCC | (same) -> ... -> `getEKK0251B001SC [R] KK_SVC_KEI route` | 1 call (service contract route) |
| 5 | Internal: JKKAdchgHakkoSODCC | (same) -> ... -> `findZ1OrderAtKK1041 [R] Z1 order data` | 1 call (Z1 count check) |

**Terminal operations reached from this method (CRUD endpoints):**

| Terminal | Type | Entity/DB |
|----------|------|-----------|
| `addSOD(210)` | C | SOD (OLS phone change) |
| `addSOD(218)` | C | SOD (SIP registration) |
| `addSOD(225)` | C | SOD (Number port info registration) |
| `addSOD(229)` | C | SOD (SIP cancellation) |
| `addSOD(230)` | C | SOD (SIP deletion) |
| `addSOD(250)` | C | SOD (Emergency notification registration) |
| `addSOD(252)` | C | SOD (Emergency notification deletion) |
| `addSOD(265)` | C | SOD (ENUM registration) |
| `addSOD(266)` | C | SOD (ENUM deletion) |
| `addSOD(409)` | C | SOD (Multi-func router VA phone change) |
| `callEKK0191A010SC` | R | KK_SVC_KEI_UCWK (service contract detail) |
| `callEKK0341A010SC` | R | KK_KKTSVKEI (equipment provider service contract) |
| `getEKK0251B001SC` | R | KK_SVC_KEI route (service contract route) |
| `findZ1OrderAtKK1041` | R | Order data (Z1 filter) |

## 6. Per-Branch Detail Blocks

**Block 1** — INIT / EXTRACT (L1509)

> Extract and normalize the three map objects from sodMap, then extract individual fields.

| # | Type | Code |
|---|------|------|
| 1 | SET | `statusCode = 0;` // Service interface execution status |
| 2 | SET | `svc_kei_info_Map = (HashMap)sodMap.get(JKKHakkoSODConstCC.SVC_KEI_INFO);` // Service contract info [-> "svc_kei_info"] |
| 3 | SET | `svc_kei_ucwk_info_Map = (HashMap)sodMap.get(JKKHakkoSODConstCC.SVC_KEI_UCWK_INFO);` // Service contract detail info [-> "svc_kei_ucwk_info"] |
| 4 | SET | `kktsvkei_info_Map = (HashMap)sodMap.get(JKKHakkoSODConstCC.KKTSVKEI_INFO);` // Equipment provider service contract info [-> "kktsvkei_info"] |
| 5 | EXEC | `svc_kei_info_Map = shkkaMap(svc_kei_info_Map);` // Normalize the map |
| 6 | EXEC | `svc_kei_ucwk_info_Map = shkkaMap(svc_kei_ucwk_info_Map);` // Normalize the map |
| 7 | EXEC | `kktsvkei_info_Map = shkkaMap(kktsvkei_info_Map);` // Normalize the map |
| 8 | SET | `svc_kei_no = (String)svc_kei_info_Map.get(JKKHakkoSODConstCC.INFO_SVC_KEI_NO);` // Service contract number [-> "svc_kei_no"] |
| 9 | SET | `svc_kei_ucwk_no = (String)svc_kei_ucwk_info_Map.get(JKKHakkoSODConstCC.INFO_SVC_KEI_UCWK_NO);` // After-change service contract detail number [-> "svc_kei_ucwk_no"] |
| 10 | SET | `chbf_svc_kei_ucwk_gene_add_dtm = (String)svc_kei_ucwk_info_Map.get(JKKHakkoSODConstCC.INFO_CHBF_SVC_KEI_UCWK_GENE_ADD_DTM);` // Before-change registration date/time [-> "chbf_svc_kei_ucwk_gene_add_dtm"] |
| 11 | SET | `chaf_svc_kei_ucwk_gene_add_dtm = (String)svc_kei_ucwk_info_Map.get(JKKHakkoSODConstCC.INFO_CHAF_SVC_KEI_UCWK_GENE_ADD_DTM);` // After-change registration date/time [-> "chaf_svc_kei_ucwk_gene_add_dtm"] |
| 12 | SET | `chbfSvcKeiUcwkNo = (String)svc_kei_ucwk_info_Map.get("moto_svc_kei_ucwk_no");` // Before-change service contract detail number |
| 13 | SET | `chaf_kktsvkei_no = (String)kktsvkei_info_Map.get(JKKHakkoSODConstCC.INFO_CHAF_KKTSVKEI_NO);` // After-change equipment provider service contract number [-> "chaf_kktsvkei_no"] |
| 14 | SET | `chaf_kktsvkei_gene_add_dtm = (String)kktsvkei_info_Map.get(JKKHakkoSODConstCC.INFO_CHAF_KKTSVKEI_GENE_ADD_DTM);` // After-change registration date/time [-> "chaf_kktsvkei_gene_add_dtm"] |

**Block 2** — CONDITION [Z1 order gate check] (L1544)

> Check if a Z1 order (primary fiber order) is pending. If Z1 count >= 4, proceed with full processing; otherwise skip entirely.

| # | Type | Code |
|---|------|------|
| 1 | SET | `nOrderedZ1 = findZ1OrderAtKK1041(param, handle, svc_kei_no);` // Count Z1 orders |
| 2 | SET | `isZ1Ordered = (4 <= nOrderedZ1);` // Z1 is considered ordered when count >= 4 |

**Block 2.1** — IF [Z1 ordered] (L1548)

> Branch 1: Z1 order exists. Execute the full telephone number change processing pipeline.

| # | Type | Code |
|---|------|------|
| 1 | SET | `sameTrnNo = new String[1];` // Holder for same transaction number |
| 2 | CALL | `getSame_trn_no(param, handle, null, sameTrnNo);` // Get same transaction number |
| 3 | SET | `this.same_trn_no = sameTrnNo[0];` // Store in instance field |
| 4 | SET | `this.svc_kei_ucwk_no = new String[1];` // Initialize array |
| 5 | SET | `this.svc_kei_ucwk_no[0] = svc_kei_ucwk_no;` // Set after-change detail number |
| 6 | SET | `this.svc_kei_ucwk_gadtm = new String[1];` // Initialize array |
| 7 | SET | `this.svc_kei_ucwk_gadtm[0] = chaf_svc_kei_ucwk_gene_add_dtm;` // Set after-change date/time |
| 8 | CALL | `eKK0251B001Hash = getEKK0251B001SC(param, handle, svc_kei_no, FUNC_CODE_1="1");` // Query service contract route |
| 9 | SET | `this.svc_kei_kaisen_ucwk_no = eKK0251B001Hash.get(EKK0251B001CBSMsg1List.SVC_KEI_KAISEN_UCWK_NO);` // Route detail number |
| 10 | SET | `this.svc_kei_kaisen_ucwk_gadtm = eKK0251B001Hash.get(EKK0251B001CBSMsg1List.GENE_ADD_DTM);` // Route date/time |

**Block 2.1.1** — PROCESSING [After-change detail query] (L1573)

> Query the after-change service contract detail via EKK0191A010SC.

| # | Type | Code |
|---|------|------|
| 1 | SET | `inHashUcwk = new HashMap<String, Object>();` |
| 2 | SET | `resultHashUcwk = new HashMap<String, Object>();` |
| 3 | SET | `inHashUcwk.put(JKKHakkoSODConstCC.SVC_KEI_UCWK_NO, svc_kei_ucwk_no);` // After-change detail number |
| 4 | SET | `inHashUcwk.put(JKKHakkoSODConstCC.GENE_ADD_DTM, chaf_svc_kei_ucwk_gene_add_dtm);` // After-change date/time |
| 5 | CALL | `statusCode = callEKK0191A010SC(param, handle, inHashUcwk, resultHashUcwk, FUNC_CODE_1="1");` |
| 6 | IF | `if (0 != statusCode)` → throw CCException with SCCallException |
| 7 | SET | `eKK0191A010Hash = resultHashUcwk.get(JKKHakkoSODConstCC.TEMPLATE_ID_EKK0191A010);` |
| 8 | SET | `vaTaknkikiModelCd = eKK0191A010Hash.get(EKK0191A010CBSMsg1List.VA_TAKNKIKI_MODEL_CD);` // VA device model |
| 9 | SET | `vaKikiChgNo = eKK0191A010Hash.get(EKK0191A010CBSMsg1List.VA_KIKI_CHG_NO);` // VA device change number |
| 10 | SET | `chafBmpUm = eKK0191A010Hash.get(EKK0191A010CBSMsg1List.BMP_UM);` // ENUM presence flag |

**Block 2.1.2** — CONDITION [Equipment provider data exists] (L1615)

> Check if after-change equipment provider contract data is available.

| # | Type | Code |
|---|------|------|
| 1 | IF | `!isBlank(chaf_kktsvkei_no) && !isBlank(chaf_kktsvkei_gene_add_dtm)` [chaf_kktsvkei_no != blank AND chaf_kktsvkei_gene_add_dtm != blank] |

**Block 2.1.2.1** — IF [Equipment provider data present] (L1617)

> Process equipment provider service contract agreement and register the phone change order.

| # | Type | Code |
|---|------|------|
| 1 | SET | `chbfEKK0341A010SCHash = new HashMap<String, Object>();` // Before-change agreement result hash |
| 2 | SET | `inHash = new HashMap<String, Object>();` |
| 3 | SET | `resultHash = new HashMap<String, Object>();` |
| 4 | EXEC | `inHash.clear();` |
| 5 | EXEC | `resultHash.clear();` |
| 6 | SET | `inHash.put(JKKHakkoSODConstCC.KKTK_SVC_KEI_NO, chaf_kktsvkei_no);` // After-change equipment provider contract number |
| 7 | SET | `inHash.put(JKKHakkoSODConstCC.GENE_ADD_DTM, chaf_kktsvkei_gene_add_dtm);` // After-change date/time |
| 8 | CALL | `statusCode = callEKK0341A010SC(param, handle, inHash, resultHash, FUNC_CODE_1="1");` |
| 9 | IF | `if (0 != statusCode)` → throw CCException |
| 10 | SET | `chbfEKK0341A010SCHash = resultHash.get(JKKHakkoSODConstCC.TEMPLATE_ID_EKK0341A010);` |
| 11 | SET | `kktkSvcKeiNo = chbfEKK0341A010SCHash.get(EKK0341A010CBSMsg1List.KKTK_SVC_KEI_NO);` // Equipment provider contract number |
| 12 | SET | `kktkGeneAddDtm = chbfEKK0341A010SCHash.get(EKK0341A010CBSMsg1List.GENE_ADD_DTM);` // Registration date/time |
| 13 | SET | `kktkKikiSeizoNo = chbfEKK0341A010SCHash.get(EKK0341A010CBSMsg1List.KIKI_SEIZO_NO);` // Device serial number |
| 14 | SET | `this.kktk_svc_kei_no = new String[1]; this.kktk_svc_kei_no[0] = kktkSvcKeiNo;` |
| 15 | SET | `this.kktk_svc_kei_gadtm = new String[1]; this.kktk_svc_kei_gadtm[0] = kktkGeneAddDtm;` |
| 16 | SET | `this.taknkiki_model_cd = new String[1]; this.taknkiki_model_cd[0] = vaTaknkikiModelCd;` |
| 17 | SET | `this.kiki_seizo_no = new String[1]; this.kiki_seizo_no[0] = kktkKikiSeizoNo;` |

**Block 2.1.2.1.1** — CONDITION [Multi-function router check] (L1639)

> Determine whether the customer has a multi-function router (which changes the order content code).

| # | Type | Code |
|---|------|------|
| 1 | SET | `takino_flg = kktsvkei_info_Map.get("takino_flg");` // Multi-function router flag |
| 2 | IF | `"0".equals(takino_flg)` [takino_flg = "0" (not a multi-function router)] |

**Block 2.1.2.1.1.1** — IF [Not multi-func router] (L1642)

> Standard OLS phone number change.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `param = addSOD(handle, param, ODR_NAIYO_CD_210="210");` // OLS setting / phone number change |

**Block 2.1.2.1.1.2** — ELSE [Multi-func router] (L1645)

> Multi-function router VA function phone change.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `param = addSOD(handle, param, ODR_NAIYO_CD_409="409");` // Multi-func router setting / change (VA func phone change) |

**Block 2.1.3** — PROCESSING [Before-change detail query] (L1656)

> Query the before-change service contract detail (using chbfSvcKeiUcwkNo) via EKK0191A010SC with func_code="2".

| # | Type | Code |
|---|------|------|
| 1 | SET | `inHashUcwk = new HashMap<String, Object>();` |
| 2 | SET | `resultHashUcwk = new HashMap<String, Object>();` |
| 3 | SET | `inHashUcwk.put(JKKHakkoSODConstCC.SVC_KEI_UCWK_NO, chbfSvcKeiUcwkNo);` // Before-change detail number |
| 4 | CALL | `statusCode = callEKK0191A010SC(param, handle, inHashUcwk, resultHashUcwk, FUNC_CODE_2="2");` // Before-change mode |
| 5 | IF | `if (0 != statusCode)` → throw CCException |
| 6 | SET | `chbfEKK0191A010Map = resultHashUcwk.get(JKKHakkoSODConstCC.TEMPLATE_ID_EKK0191A010);` |
| 7 | SET | `chbf_svc_kei_ucwk_gene_add_dtm = chbfEKK0191A010Map.get(EKK0191A010CBSMsg1List.GENE_ADD_DTM);` // Before-change date/time |

**Block 2.1.4** — ASSIGN [Set before-change instance fields] (L1670)

| # | Type | Code |
|---|------|------|
| 1 | SET | `this.svc_kei_ucwk_no[0] = chbfSvcKeiUcwkNo;` // Set before-change detail number |
| 2 | SET | `this.svc_kei_ucwk_gadtm[0] = chbf_svc_kei_ucwk_gene_add_dtm;` // Set before-change date/time |

**Block 2.1.5** — PROCESSING [SIP cancellation and deletion] (L1674-L1675)

> Cancel and delete the existing SIP service (before-change).

| # | Type | Code |
|---|------|------|
| 1 | CALL | `param = addSOD(handle, param, ODR_NAIYO_CD_229="229");` // SIP / cancellation (解約) |
| 2 | CALL | `param = addSOD(handle, param, ODR_NAIYO_CD_230="230");` // SIP / deletion (消去) |

**Block 2.1.6** — PROCESSING [Before-change ENUM check] (L1679)

> Query the before-change service contract for ENUM-related data.

| # | Type | Code |
|---|------|------|
| 1 | SET | `bfInHashUcwk = new HashMap<String, Object>();` |
| 2 | SET | `bfResultHashUcwk = new HashMap<String, Object>();` |
| 3 | SET | `bfInHashUcwk.put(JKKHakkoSODConstCC.SVC_KEI_UCWK_NO, chbfSvcKeiUcwkNo);` // Before-change detail number |
| 4 | SET | `bfInHashUcwk.put(JKKHakkoSODConstCC.GENE_ADD_DTM, chbf_svc_kei_ucwk_gene_add_dtm);` // Before-change date/time |
| 5 | CALL | `statusCode = callEKK0191A010SC(param, handle, bfInHashUcwk, bfResultHashUcwk, FUNC_CODE_1="1");` |
| 6 | IF | `if (0 != statusCode)` → throw CCException |
| 7 | SET | `bfEKK0191A010Hash = bfResultHashUcwk.get(JKKHakkoSODConstCC.TEMPLATE_ID_EKK0191A010);` |
| 8 | SET | `chbfBmpUm = ""` // Before-change ENUM presence flag |
| 9 | SET | `chbfTelno = ""` // Before-change phone number |
| 10 | IF | `if (bfEKK0191A010Hash != null)` → extract chbfBmpUm and chbfTelno from hash |

**Block 2.1.7** — CONDITION [Self monai number port check] (L1713)

> Determine if the before-change phone number is a self monai (internal) number port. Added in ANK-4494 STEP2 (2024).

| # Type | Code |
|---|------|
| 1 | IF | `isMonaiBmp(handle, param, chbfTelno, CD00189_JISHA="1")` [Self company monai BMP flag check] |

**Block 2.1.7.1** — IF [Self monai number port] (L1716)

> Since the before-change number is a self number port, deregister ENUM.

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

**Block 2.1.8** — PROCESSING [Emergency notification deletion] (L1723)

| # | Type | Code |
|---|------|------|
| 1 | CALL | `param = addSOD(handle, param, ODR_NAIYO_CD_252="252");` // Emergency notification / deletion (消去) |

**Block 2.1.9** — PROCESSING [Reset same_trn_no and SIP registration] (L1728-L1733)

> Reset the same transaction number and register the new SIP service (after-change).

| # | Type | Code |
|---|------|------|
| 1 | SET | `this.same_trn_no = ""` // Clear same transaction number for new order |
| 2 | SET | `this.svc_kei_ucwk_no[0] = svc_kei_ucwk_no;` // Restore after-change detail number |
| 3 | SET | `this.svc_kei_ucwk_gadtm[0] = chaf_svc_kei_ucwk_gene_add_dtm;` // Restore after-change date/time |
| 4 | CALL | `param = addSOD(handle, param, ODR_NAIYO_CD_218="218");` // SIP / registration (登録) |

**Block 2.1.10** — CONDITION [After-change ENUM enabled] (L1735)

> Check if the after-change service has ENUM (number port) enabled.

| # | Type | Code |
|---|------|------|
| 1 | IF | `CD00001_1="1".equals(chafBmpUm)` [After-change ENUM enabled (banpo-ari)] |

**Block 2.1.10.1** — IF [ENUM enabled] (L1738)

> Register number port info, then determine ENUM registration based on carrier.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `param = addSOD(handle, param, ODR_NAIYO_CD_225="225");` // SIP / number port info registration (番号Port情報登録) |
| 2 | IF | `isTajgsTelNo(handle, param, eKK0191A010Hash.get(TELNO))` [Other company phone number check] |

**Block 2.1.10.1.1** — IF [Other company phone] (L1744)

> Register ENUM for the new external number port.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `param = addSOD(handle, param, ODR_NAIYO_CD_265="265");` // ENUM setting / registration |

**Block 2.1.10.1.2** — ELSE [Self company phone] (L1750)

> Deregister ENUM since it is a self-company phone (not external port).

| # | Type | Code |
|---|------|------|
| 1 | CALL | `param = addSOD(handle, param, ODR_NAIYO_CD_266="266");` // ENUM setting / deletion (消去) |

**Block 2.1.11** — ELSE [No Z1 order, skip all] (L1761)

> No Z1 order is pending, so skip all processing. This is an intentional no-op.

| # | Type | Code |
|---|------|------|
| 1 | - | // Z1 order not processed — do nothing (Z1オーダーが処理されていないので何もしない) |

**Block 3** — RETURN (L1764)

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return param;` // Return accumulated request parameter with all SOD entries |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `svc_kei_no` | Field | Service contract number — the unique identifier for a customer's service agreement line |
| `svc_kei_ucwk_no` | Field | Service contract detail number — internal ID for a specific service contract line item / detail |
| `chbf_svc_kei_ucwk_gene_add_dtm` | Field | Before-change service contract detail registration date/time — timestamp when the old detail was registered |
| `chaf_svc_kei_ucwk_gene_add_dtm` | Field | After-change service contract detail registration date/time — timestamp when the new detail was registered |
| `chbfSvcKeiUcwkNo` | Field | Before-change service contract detail number (moto = original) — the old detail number before address change |
| `chaf_kktsvkei_no` | Field | After-change equipment provider service contract number — the new equipment provider contract number |
| `chaf_kktsvkei_gene_add_dtm` | Field | After-change equipment provider service contract registration date/time |
| `chbfBmpUm` / `chafBmpUm` | Field | Before/After-change BMP_UM (banpo-um — number port presence flag) — indicates whether ENUM (number port) is enabled |
| `takino_flg` | Field | Takino (multi-function router) flag — indicates whether the customer has a multi-function router device |
| `same_trn_no` | Field | Same transaction number — used for grouping related orders in the same transaction batch |
| `taknkiki_model_cd` | Field | Indoor equipment model code — the model code of the VA (virtual appliance) home device |
| `kiki_seizo_no` | Field | Equipment manufacturing serial number — the serial number of the provider's equipment |
| `ido_div` | Field | Difference classification — internal flag for distinguishing change scenarios |
| SOD | Acronym | Service Order Data — the core business entity representing a service order request in the fulfillment system |
| Z1 order | Business term | Primary fiber service order — the main order type for eo Hikari Net fiber installation/service activation |
| OLS | Business term | Optical Line Service — Fujitsu's fiber-to-the-home broadband service brand |
| SIP | Business term | Session Initiation Protocol — the VoIP telephony service registered on top of the fiber connection |
| ENUM | Acronym | E.164 Number Mapping — DNS-based telephone number mapping service enabling IP-based phone calls (PSTN migration target) |
| VA | Acronym | Virtual Appliance — home gateway equipment with additional functions (router, WiFi, etc.) |
| Multi-function router | Business term | A home gateway device combining router, WiFi access point, and VA functions — the upgrade path from basic OLS gateways |
| ODR_NAIYO_CD | Field | Order content code — classifies the type of order action (e.g., phone change, SIP registration, ENUM deletion) |
| EKK0191A010SC | SC Code | Service contract detail query service component — retrieves detailed service contract information |
| EKK0251B001SC | SC Code | Service contract route info list service component — retrieves route detail information for a service contract |
| EKK0341A010SC | SC Code | Equipment provider service contract agreement service component — queries equipment provider contract data |
| KK_SVC_KEI_UCWK | Table | Service contract detail table — stores service contract line item / detail records |
| KK_KKTSVKEI | Table | Equipment provider service contract table — stores equipment provider contract information |
| KK_SVC_KEI | Table | Service contract table — stores top-level service agreement records |
| chbf | Abbreviation | Change Before — prefix indicating data from before the address change |
| chaf | Abbreviation | Change After — prefix indicating data from after the address change |
| gene_add_dtm | Field | Generation registration date/time — the timestamp when a service record was created/registered |
| kktsvkei | Field | Equipment provider service — contracted third-party equipment provider service information |
| monai | Abbreviation | Self (company) — Japanese "自社" (jisha) meaning the company's own service |
| tajgs | Abbreviation | Other company (他社) — Japanese "他社" (tasha) meaning a competitor carrier's service |
| banpo | Abbreviation | Number port (番号ポ — short for 番号ポート) — telephone number portability / number porting |
| FUNC_CODE_1 | Constant | "1" — After-change processing mode for service contract queries |
| FUNC_CODE_2 | Constant | "2" — Before-change processing mode for service contract queries |
| BMP_UM | Field | Banpo Um (number port presence) — flag indicating whether ENUM/number port is active |
| `moto_svc_kei_ucwk_no` | Field | Original service contract detail number — the pre-change detail number stored in sodMap |
| 住所変更 | Japanese term | Address change — the broader business operation during which telephone number change is handled |
| サービス開始前番号変更 | Japanese term | Pre-service-start number change — the specific scenario where the phone number is changed before the new service officially starts |
| 番ポ追加申込 | Japanese term | Number port additional application — mode 1 variant for adding a number port |
| 緊急通報 | Japanese term | Emergency notification — a service that enables emergency calls (requires registration and deregistration) |
| 解約 | Japanese term | Cancellation / contract termination — the business action of cancelling a service (SIP, ENUM, etc.) |
| 消去 | Japanese term | Deletion / erasure — the business action of completely removing a service record from the system |
| 登録 | Japanese term | Registration — the business action of registering a new service in the system |
| 設定 | Japanese term | Setting / configuration — often paired with 登録 for ENUM setup operations |
| パートアウト | Japanese term | Port-out — the action of ending a number port (deregistering) |
