# Business Logic — JKKTelnoInfoAddCC.executeHtelTelnoChg() [730 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `com.fujitsu.futurity.bp.custom.common.JKKTelnoInfoAddCC` |
| Layer | Common Component (CC) — Shared business logic layer |
| Module | `common` (Package: `com.fujitsu.futurity.bp.custom.common`) |

## 1. Role

### JKKTelnoInfoAddCC.executeHtelTelnoChg()

This method implements the **Hikari Phone (Fiber Phone) Number Change Business Process** for the K-Opticom customer core system. It is the central orchestrator for all operations triggered when a customer requests a change to their Hikari Phone (Fujitsu Hikari Denwa) telephone number, or when a number is added to an existing service contract. The method handles four distinct business scenarios based on the functional code and service detail contract status: (1) **Immediate number switch** (FUNC_CD_1, SVC_KEI_STAT_100) — the standard case for active customers changing their number immediately, involving cancellation of the old service detail, registration of a new one, and SOD (Service Order Data) issuance; (2) **Pending-switch number change** (FUNC_CD_1, SVC_KEI_STAT_020/030) — contract is under review or bundled, requiring cancellation or dissolution of the old detail before creating a new one; (3) **BMP (Banchi Phone工事/Line Work) transition** — handling all four combinations of presence/absence of line work before and after the change, including BK (line work) cancellation notification for non-processed work items; (4) **Kojin/Hojin (Individual/Corporate) code update** — updating the telephone number personal/corporate identifier field in the phone number management table. The method uses a **delegation/dispatch pattern**, calling specialized private helper methods (addTelno, updTelno, dslSvcKeiUcwk, addSvcKeiUcwk, chgBmpNonToAri, chgBmpAriToAri, runChgTelSvc, copyAndSwitchOptionServices, updateTelnoKojinHojin) for each sub-task, and relies on a "work" HashMap as an internal data bus to pass state across the processing chain.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["executeHtelTelnoChg"])
    INIT["init param, fixedText"]
    GET_DATA["Get trgtData, funcCode, svcKeiNo, svcKeiUcwkNo, bmpUm, idoDiv"]
    CHECK_RESET["check_tel_status = ERR_NASI"]
    
    SVC_CBS_1["EKK0081A010 - Service Contract Agreement"]
    SVC_CBS_2["EKK0161A010 - Service Detail Agreement"]
    SVC_CBS_3["EKK0191A010 - Service Detail Agreement eoHikariPhone"]
    SVC_CBS_4["EZM0301A010 - Office Agreement"]
    SVC_CBS_5["EKK0251B003 - Service Contract Line Details List"]
    SVC_CBS_6["EZM0091A010 - Location Number Division Agreement"]
    SVC_CBS_BF["EZM0301A010 - Office Agreement before"]
    
    WORK_MAP["Create work map with before/after data"]
    MONAI_CHECK["isMonaiBmpAri before/after"]
    INPUT_CHECK["checkHtelTelnoChg"]
    
    SVC_CBS_7["EKK0011D020 - Order Acceptance Registration"]
    
    BMP_AF["bmpUmAf == \"1\""]
    ADD["addTelno / updTelno"]
    KOJIN["updateTelnoKojinHojin -> KOJIN"]
    
    STAT_100["svcKeiUcwkStat == \"100\""]
    DSL["dslSvcKeiUcwk cancel"]
    ADD_SVC["addSvcKeiUcwk KEIZK_1"]
    
    FUNC1["funcCode == FUNC_CD_1"]
    
    STAT_020["svcKeiUcwkStat == \"020\""]
    CANCEL["cancelSvcKeiUcwk"]
    
    STAT_030["svcKeiUcwkStat == \"030\""]
    DSL_030["dslSvcKeiUcwk"]
    
    ADD_SVC_0["addSvcKeiUcwk KEIZK_0"]
    
    UM_TRANS1["chgBmpNonToAri"]
    UM_TRANS2["chgBmpAriToAri"]
    
    ADD_JMTE["addJmte + EKK0021C060"]
    ADD_PRG["addPrgTelnoChg"]
    TW_CHOK["chgTelTwChokTchiCd"]
    
    HAKKSO["hakkkoSodCc"]
    
    KOJAN["executeKojiAnken"]
    KOJIN_BF["updateTelnoKojinHojin -> HOJIN"]
    
    END_NODE["Return param"]
    
    START --> INIT --> GET_DATA --> CHECK_RESET
    CHECK_RESET --> SVC_CBS_1
    SVC_CBS_1 --> SVC_CBS_2
    SVC_CBS_2 --> SVC_CBS_3
    SVC_CBS_3 --> SVC_CBS_4
    SVC_CBS_4 --> SVC_CBS_5
    SVC_CBS_5 --> SVC_CBS_6
    SVC_CBS_6 --> WORK_MAP
    WORK_MAP --> MONAI_CHECK
    MONAI_CHECK --> INPUT_CHECK
    
    INPUT_CHECK -->|error| END_NODE
    INPUT_CHECK -->|ok| SVC_CBS_7
    
    SVC_CBS_7 --> BMP_AF
    
    BMP_AF -->|true| ADD
    ADD --> KOJIN
    
    KOJIN --> STAT_100
    
    STAT_100 -->|true| DSL
    DSL --> ADD_SVC
    ADD_SVC --> FUNC1
    
    FUNC1 -->|true| ADD_JMTE
    ADD_JMTE --> ADD_PRG
    ADD_PRG --> TW_CHOK
    TW_CHOK --> HAKKSO
    HAKKSO --> KOJAN
    KOJAN --> KOJIN_BF
    KOJIN_BF --> END_NODE
    
    STAT_100 -->|false| CANCEL
    CANCEL --> STAT_030
    STAT_030 -->|true| DSL_030
    DSL_030 --> ADD_SVC_0
    ADD_SVC_0 --> FUNC1_ELS
    
    FUNC1 -->|false| FUNC1_ELS
    FUNC1_ELS --> UM_TRANS1
    UM_TRANS1 --> UM_TRANS2
    
    UM_TRANS2 --> END_NODE
```

**Processing Phases:**

1. **Initialization & Data Extraction** — Reads request parameters from the work data HashMap.
2. **Pre-change Service Agreements** — Calls 6 Service Component (SC) agreements in sequence to fetch current contract state (service contract status, service detail status, before-state phone number, office info, location number division).
3. **Before-state Snapshot** — Re-calls the office agreement with the *before* phone number to get the pre-change location number division code.
4. **Work Map Population** — Creates an internal work HashMap capturing before/after state of all key fields.
5. **Network Phone Number Availability Check** — Checks both before and after phone numbers against the network phone number (net telephone) presence via `isMonaiBmpAri`.
6. **Input Validation** — Delegates to `checkHtelTelnoChg`; if errors found, returns early.
7. **Order Content Acceptance Registration** — Registers the order content (contract detail change request) via EKK0011D020.
8. **BMP (Line Work) Handling** — Depending on `bmpUmAf`:
   - If `1` (BMP present) and no warning: `addTelno` (register phone number); if warning: `updTelno` (update phone number)
   - If `1` (BMP present) and after-network-phone-available: `updateTelnoKojinHojin` with `HOJIN_KOJIN_CD_KOJIN` (individual)
9. **Contract Status Branch (svcKeiUcwkStat == "100" = Active)** — Cancel old service detail, register new one, run number switch sub-parts, copy/switch option services, issue SOD.
10. **Contract Status Branch (svcKeiUcwkStat != "100")** — Cancel or dissolve old detail based on status (020=under review -> cancel; 030=bundled -> dissolve), then register new detail.
11. **BMP Transition Handling** — Handles four BMP before/after combinations.
12. **Post-Registration Processing** — Registration document, order detail forwarding, SOD issuance, work project update, and HOJIN (corporate) code update.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `handle` | `SessionHandle` | Session management handle carrying session context, database connection pool, and transaction scope information. Passed to all service calls. |
| 2 | `param` | `IRequestParameterReadWrite` | Parameter object wrapping the business data (model group) and control maps. Contains the target data HashMap under the `fixedText` key, and is returned with updated results and error information. |
| 3 | `fixedText` | `String` | User-defined arbitrary string used as the key to retrieve the target data HashMap from the parameter object, and as a context tag for sub-component calls (e.g., number switch invocation). |

### Instance Fields / External State Referenced

| Field | Type | Business Meaning |
|-------|------|------------------|
| `telInfoMapper` | `JKKTelnoInfoAddMapperCC` (inherited base class) | Mapper CC for building request maps, calling templates, and invoking SCs. Holds template mappings for all CBS operations. |
| `check_tel_status` | `String` | Telephone status check result, initialized to `ERR_NASI` ("not error"). Set to `WARNING_ARI` ("warning exists") by `checkTelno()` when pre-change phone number conditions require attention. |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `telInfoMapper.editInMsgEKK0081A010 -> callSvcInter` | EKK0081A010SC | KK_T_SVC_KEI (service contract) | Service Contract Agreement — fetches current service contract status |
| R | `telInfoMapper.editInMsgEKK0161A010 -> callSvcInter` | EKK0161A010SC | KK_T_SVC_KEI_UCWK (service detail contract) | Service Detail Agreement — fetches current service detail status and generation registration datetime |
| R | `telInfoMapper.editInMsgEKK0191A010 -> callSvcInter` | EKK0191A010SC | KK_T_SVC_KEI_UCWK_HIKARI (service detail eo Hikari Phone) | Service Detail <eo Hikari Phone> Agreement — fetches before-state phone number and BMP (line work) presence |
| R | `telInfoMapper.editInMsgEZM0301A010 -> callSvcInter` | EZM0301A010SC | KK_T_KYOKU_NO (office number table) | Office Agreement — validates office number (first 6 digits of phone number) |
| R | `telInfoMapper.editInMsgEKK0251B003 -> callSvcInter` | EKK0251B003SC | KK_T_SVC_KEI_KAISEN (service contract line details) | Service Contract Line Details List (currently in use) — fetches KAISEN_PLACE_AD_CD and VLAN_ID_FIX_FLG |
| R | `telInfoMapper.editInMsgEZM0091A010 -> callSvcInter` | EZM0091A010SC | M_M_CHI_ID (location/target number division) | Location Target Number Division Agreement — validates location and number division codes |
| R | `telInfoMapper.editInMsgEZM0301A010 -> callSvcInter` (before) | EZM0301A010SC | KK_T_KYOKU_NO (office number table) | Office Agreement (before phone number) — fetches pre-change NO_KUKAKU_CD |
| R | `telInfoMapper.editInMsgEKK0011D020 -> callSvcInter` | EKK0011D020SC | KK_T_MSKM_DTL (order detail table) | Order Content Acceptance Registration — registers contract detail change request, returns MSKM_NO, MSKM_DTL_NO, UPD_DTM |
| R | `telInfoMapper.editInMsgEKK0021C060 -> callSvcInter` | EKK0021C060SC | KK_T_MSKM (order table), KK_T_JMTE (registration document) | Order detail forwarding/delegation — forwards order detail for sales channel processing |
| C | `JKKAdchgTelnoInfoAddCC.addTelno` | EKM0121D010CBS / EKU0121D010CBS | KK_T_TELNO_MANAGE, KK_T_TELNO_MANAGE_HIKARI | Phone number registration — registers new phone number |
| U | `JKKAdchgTelnoInfoAddCC.updTelno` | EKM0121C010CBS / EKU0121C010CBS | KK_T_TELNO_MANAGE, KK_T_TELNO_MANAGE_HIKARI | Phone number update — updates existing phone number |
| U | `JKKAdchgTelnoInfoAddCC.updateTelnoKojinHojin` (KOJIN) | EZM0121A010CBS, EZM0121C010CBS, EZM0121D010CBS | ZM_T_TELNO (phone number management table) | Phone number Individual/Corporate code update (Individual) — updates the telno Kojin/Hojin field to "1" (individual) |
| U | `JKKAdchgTelnoInfoAddCC.updateTelnoKojinHojin` (HOJIN) | EZM0121A010CBS, EZM0121C010CBS, EZM0121D010CBS | ZM_T_TELNO (phone number management table) | Phone number Individual/Corporate code update (Corporate) — updates the telno Kojin/Hojin field to "2" (corporate) |
| D | `JKKAdchgTelnoInfoAddCC.dslSvcKeiUcwk` | EKK0161D020CBS (cancellation) / EKK0161D180CBS (dissolution) | KK_T_SVC_KEI_UCWK | Service detail cancellation/dissolution — cancels or dissolves the old service detail contract |
| C | `JKKAdchgTelnoInfoAddCC.addSvcKeiUcwk` | EKK0191D010CBS | KK_T_SVC_KEI_UCWK_HIKARI | Service detail registration — registers new service detail with eo Hikari Phone |
| C | `JKKAdchgTelnoInfoAddCC.cancelSvcKeiUcwk` | EKK0161C160CBS | KK_T_SVC_KEI_UCWK | Service detail cancellation — cancels under review service detail (reason: 01 = request cancellation) |
| R | `JKKAddBmpTaiorrki.addTaiorrk` | EKK0191DXXXCBS | KK_T_ADHAI (accommodation/record table) | BK cancellation notification — registers BK (line work) cancellation record |
| D | `JKKCancelBmpkj.cancelBmpkj` | ETU0011C021CBS | KK_T_BMP_KOJI (BK construction table) | BK work cancellation request — cancels pending BK line work |
| C | `JKKAdchgTelnoInfoAddCC.addJmte` | EKK0191DXXXCBS | KK_T_JMTE (registration document table) | Registration document registration |
| - | `JKKSIFETU0011Mapper.getMappedTemplateETU0011B017` | ETU0011B017CBS | - | BK construction service details list retrieval |
| - | `JKKSvcConst.UM_ARI` | - | - | Constant: "1" (presence/yes) |
| - | `JKKSvcConst.UM_NASI` | - | - | Constant: "0" (absence/no) |
| - | `JKKSvcConst.SVC_KEI_STAT_100` | - | - | Constant: "100" (contract active/service in progress) |
| - | `JKKSvcConst.SVC_KEI_STAT_020` | - | - | Constant: "020" (contract under review) |
| - | `JKKSvcConst.SVC_KEI_STAT_030` | - | - | Constant: "030" (contract bundled/bundled) |
| - | `JKKSvcConst.HOJIN_KOJIN_CD_KOJIN` | - | - | Constant: "1" (Individual customer) |
| - | `JKKSvcConst.HOJIN_KOJIN_CD_HOJIN` | - | - | Constant: "2" (Corporate customer) |
| - | `JKKSvcConst.SVC_CANCEL_RSN_CD_01` | - | - | Constant: "01" (cancellation reason: request cancellation) |
| - | `JKKSvcConst.MSKM_SBT_CD_00035` | - | - | Constant: "00035" (order subtype: contract detail change request) |
| - | `JKKSvcConst.BMP_KOJI_STAT_KOJIFIN` | - | - | Constant: "050" (BK construction status: completed) |
| - | `JKKSvcConst.BMP_KOJI_STAT_KOJICL` | - | - | Constant: "090" (BK construction status: cancelled) |
| - | `JKKTelnoInfoAddConstCC.FUNC_CODE` | - | - | Constant: "func_code" (data map key for functional code) |
| - | `JKKTelnoInfoAddConstCC.IDO_DIV` | - | - | Constant: "ido_div" (data map key for migration division) |
| - | `JKKCancelBmpkjConst.CANCEL_TCHI` | - | - | Constant: "02" (registration type: BK cancellation notification) |
| - | `JPCModelConstant.FUNC_CD_1` | - | - | Constant: "1" (functional code: number switch) |
| - | `JPCModelConstant.FUNC_CD_2` | - | - | Constant: "2" (functional code: review/bundling) |

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Screen:KKSV0213 | `KKSV0213OPOperation.run()` -> `target3.setBeanFactory` -> `getBPMOperator().run(target3, param)` -> `JKKTelnoInfoAddCC.executeHtelTelnoChg(handle, param, fixedText)` | `EKK0081A010 [R] KK_T_SVC_KEI`, `EKK0161A010 [R] KK_T_SVC_KEI_UCWK`, `EKK0191A010 [R] KK_T_SVC_KEI_UCWK_HIKARI`, `EZM0301A010 [R] KK_T_KYOKU_NO`, `EKK0251B003 [R] KK_T_SVC_KEI_KAISEN`, `EZM0091A010 [R] M_M_CHI_ID`, `EKK0011D020 [C] KK_T_MSKM_DTL`, `EKK0191D010 [C] KK_T_SVC_KEI_UCWK_HIKARI`, `EKK0161C160 [D] KK_T_SVC_KEI_UCWK`, `EKK0191DXXX [D/C] KK_T_SVC_KEI_UCWK`, `EZM0121CBS [U] ZM_T_TELNO`, `ETU0011C021 [D] KK_T_BMP_KOJI` |

## 6. Per-Branch Detail Blocks

**Block 1** — [INITIALIZATION] (L5651)

Initializes the method, extracts all input data from the parameter object.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `init(param, fixedText)` |
| 2 | SET | `trgtData = (HashMap) param.getData(fixedText)` |
| 3 | SET | `funcCode = trgtData.get(JKKTelnoInfoAddConstCC.FUNC_CODE)` |
| 4 | SET | `svcKeiNo = trgtData.get(JKKTelnoInfoAddConstCC.SVC_KEI_NO)` [-> "svc_kei_no"] |
| 5 | SET | `svcKeiUcwkNobf = trgtData.get(JKKTelnoInfoAddConstCC.SVC_KEI_UCWK_NO)` [-> "svc_kei_ucwk_no"] |
| 6 | SET | `bmpUm = trgtData.get(JKKTelnoInfoAddConstCC.BMP_UM)` [-> "bmp_um"] |
| 7 | SET | `kk0081UpdDtm = trgtData.get(JKKTelnoInfoAddConstCC.KK0081_UPD_DTM)` |
| 8 | SET | `afterTelno = trgtData.get(JKKTelnoInfoAddConstCC.TELNO)` [-> "telno"] |
| 9 | SET | `idoDiv = trgtData.get(JKKTelnoInfoAddConstCC.IDO_DIV)` [-> "ido_div"] |
| 10 | SET | `check_tel_status = ERR_NASI` [-> "error not present"] |

**Block 2** — [CALL EKK0081A010 - Service Contract Agreement] (L5687)

| # | Type | Code |
|---|------|------|
| 1 | CALL | `telInfoMapper.editInMsgEKK0081A010(param, svcKeiNo)` -> `callSvcInter(handle, param, inMap)` |
| 2 | SET | `svcKeiStat = getRsltMsgListValue(outMap, EKK0081A010CBSMsg1List.SVC_KEI_STAT)` |

**Block 3** — [CALL EKK0161A010 - Service Detail Agreement] (L5697)

| # | Type | Code |
|---|------|------|
| 1 | CALL | `telInfoMapper.editInMsgEKK0161A010(param, svcKeiUcwkNobf, null, JCCBPCommon.getOpeDate(null), JPCModelConstant.FUNC_CD_2)` |
| 2 | CALL | `callSvcInter(handle, param, inMap)` |
| 3 | SET | `svcKeiUcwkStat = getRsltMsgListValue(outMap, EKK0161A010CBSMsg1List.SVC_KEI_UCWK_STAT)` |

**Block 4** — [CALL EKK0191A010 - Service Detail <eo Hikari Phone> Agreement] (L5711)

| # | Type | Code |
|---|------|------|
| 1 | CALL | `telInfoMapper.editInMsgEKK0191A010(param, svcKeiUcwkNobf)` |
| 2 | CALL | `callSvcInter(handle, param, inMap)` |
| 3 | SET | `bfTelno = getRsltMsgListValue(outMap, EKK0191A010CBSMsg1List.TELNO)` |
| 4 | SET | `bfBmpUm = getRsltMsgListValue(outMap, EKK0191A010CBSMsg1List.BMP_UM)` |

**Block 5** — [CALL EZM0301A010 - Office Agreement] (L5724)

| # | Type | Code |
|---|------|------|
| 1 | SET | `kyokuNo = trgtData.get(JKKTelnoInfoAddConstCC.TELNO)` |
| 2 | IF | `!isNull(kyokuNo)` [L5727] |
|   | 1 | SET | `kyokuNo = kyokuNo.substring(0, 6)` |
| 3 | CALL | `telInfoMapper.editInMsgEZM0301A010(param, kyokuNo)` -> `callSvcInter(...)` |

**Block 6** — [CALL EKK0251B003 - Service Contract Line Details List] (L5750)

| # | Type | Code |
|---|------|------|
| 1 | CALL | `telInfoMapper.editInMsgEKK0251B003(param, svcKeiNo)` -> `callSvcInter(...)` |

**Block 7** — [CALL EZM0301A010 (before) + EZM0091A010] (L5756)

| # | Type | Code |
|---|------|------|
| 1 | SET | `kaisenAdCd = getRsltMsgListValue(outMap, EKK0251B003CBSMsg1List.KAISEN_PLACE_AD_CD)` |
| 2 | SET | `noKukakuCd = getRsltMsgListValue(outMap, EZM0301A010CBSMsg1List.NO_KUKAKU_CD)` |
| 3 | SET | `bfkyokuNo = bfTelno.substring(0, 6)` (if !isNull) |
| 4 | CALL | `telInfoMapper.editInMsgEZM0301A010(param, bfkyokuNo)` -> `callSvcInter(...)` (before office agreement) |
| 5 | SET | `bfnoKukakuCd = getRsltMsgListValue(outMap, EZM0301A010CBSMsg1List.NO_KUKAKU_CD)` |
| 6 | SET | `trgtData.put(JKKStrConst.MA_CD, bfnoKukakuCd)` |
| 7 | CALL | `telInfoMapper.editInMsgEZM0091A010(param, kaisenAdCd, noKukakuCd)` -> `callSvcInter(...)` |

**Block 8** — [WORK MAP CREATION] (L5794)

Creates an internal data bus HashMap populated with before/after state.

| # | Type | Code |
|---|------|------|
| 1 | SET | `work = new HashMap<String, Object>()` |
| 2 | SET | `work.put(SVC_KEI_NO, svcKeiNo)` |
| 3 | SET | `work.put(SVC_KEI_STAT, svcKeiStat)` |
| 4 | SET | `work.put(SVC_KEI_UCWK_NO_BF, svcKeiUcwkNobf)` |
| 5 | SET | `work.put(TELNO_AF, afterTelno)` |
| 6 | SET | `work.put(TELNO_BF, bfTelno)` |
| 7 | SET | `work.put(BMP_UM_BF, bfBmpUm)` |
| 8 | SET | `work.put(BMP_UM_AF, bmpUm)` |
| 9 | SET | `work.put(BMP_KOJI_KIBO_YMDH, trgtData.get(JKKTelnoInfoAddConstCC.BMP_KOJI_KIBO_YMDH))` |
| 10 | SET | `work.put(SVC_KEI_UCWK_STAT, svcKeiUcwkStat)` |
| 11 | SET | `work.put(KK0081_UPD_DTM, kk0081UpdDtm)` |
| 12 | SET | `work.put(VLAN_ID_FIX_FLG, getRsltMsgListValue(..., EKK0251B003CBSMsg1List.VLAN_ID_FIX_FLG))` |
| 13 | SET | `work.put(KK0191_GENE_ADD_DTM_BF, getRsltMsgListValue(..., EKK0191A010CBSMsg1List.GENE_ADD_DTM))` |
| 14 | SET | `work.put(VA_KIKI_CHG_NO, getRsltMsgListValue(..., EKK0191A010CBSMsg1List.VA_KIKI_CHG_NO))` |
| 15 | CALL | `bfMonaiBmp = isMonaiBmpAri(handle, param, bfTelno)` |
| 16 | CALL | `afMonaiBmp = isMonaiBmpAri(handle, param, afterTelno)` |

**Block 9** — [INPUT CHECK] (L5847)

| # | Type | Code |
|---|------|------|
| 1 | IF | `checkHtelTelnoChg(handle, param, trgtData, work, outMapEZM0091A010)` [L5847] |
|   | 1 | RETURN | `return param` (early return on validation error) |

**Block 10** — [ORDER ACCEPTANCE REGISTRATION EKK0011D020] (L5856)

| # | Type | Code |
|---|------|------|
| 1 | CALL | `telInfoMapper.editInMsgEKK0011D020(param, trgtData, JKKSvcConst.MSKM_SBT_CD_00035)` [-> "00035": Contract detail change request] |
| 2 | CALL | `callSvcInter(handle, param, inMap)` |
| 3 | SET | `kk0011UpdDtm = outMapEKK0011D020.getString(EKK0011D020CBSMsg.UPD_DTM)` |
| 4 | SET | `work.put(MSKM_NO, outMapEKK0011D020.getString(EKK0011D020CBSMsg.MSKM_NO))` |
| 5 | SET | `work.put(MSKM_DTL_NO, getRsltMsgListValue(outMap, EKK0011D020CBSMsg1List.MSKM_DTL_NO))` |

**Block 11** — [BMP (Line Work) Presence Branch: After = "1"] (L5868)

`if (JKKSvcConst.UM_ARI.equals((String)work.get(BMP_UM_AF)))` [-> `if ("1".equals(bmpUmAf))]`

| # | Type | Code |
|---|------|------|
| 1 | IF | `!WARNING_ARI.equals(check_tel_status)` [L5872] (no warning) |
|   | 1 | CALL | `addTelno(handle, param, trgtData, outMapEZM0301A010)` — Register new phone number |
| 2 | ELSE-IF | `WARNING_ARI.equals(check_tel_status)` [L5879] (warning exists) |
|   | 1 | CALL | `updTelno(handle, param, trgtData, (String)work.get(TELNO_AF))` — Update existing phone number |
| 3 | IF | `JKKSvcConst.UM_ARI.equals(bmpUm) && afMonaiBmp` [L5887] (BMP present AND after-network-phone-available) |
|   | 1 | CALL | `updateTelnoKojinHojin(handle, param, trgtData, work, afterTelno, JKKSvcConst.HOJIN_KOJIN_CD_KOJIN)` [-> `"1"`: Individual] — Update Individual/Corporate code to Individual |

**Block 12** — [Contract Status Branch: svcKeiUcwkStat == "100" (Active)] (L5897)

`if (JKKSvcConst.SVC_KEI_STAT_100.equals(svcKeiUcwkStat))` [-> `if ("100".equals(svcKeiUcwkStat))]`

**Block 12.1** — [DSL SVC_KEI_UCWK] (L5907)

| # | Type | Code |
|---|------|------|
| 1 | CALL | `dslSvcKeiUcwk(handle, param, trgtData, fixedText, funcCode, work, outMapEKK0161A010_bf, outMapEKK0191A010_bf, idoDiv)` |

**Block 12.2** — [ADD SVC_KEI_UCWK] (L5918)

| # | Type | Code |
|---|------|------|
| 1 | CALL | `addSvcKeiUcwk(handle, param, trgtData, fixedText, funcCode, work, outMapEKK0161A010_bf, outMapEKK0191A010_bf, idoDiv, JKKSvcConst.KEIZK_AF_KEI_FLG_1)` [-> `"1"`: With continuation] |

**Block 12.3** — [FUNC_CD_1 Branch: Number Switch] (L5930)

`if (JPCModelConstant.FUNC_CD_1.equals(funcCode))`

| # | Type | Code |
|---|------|------|
| 1 | IF | `JKKSvcConst.UM_NASI.equals((String)work.get(BMP_UM_AF))` [-> `if ("0".equals(bmpUmAf))]` |
|   | 1 | CALL | `runChgTelSvc(handle, param, work, fixedText, idoDiv)` |
|   | 2 | SET | `work.put(SVC_KEI_UCWK_STAT_AF, JKKSvcConst.SVC_KEI_STAT_100)` [-> "100"] |
| 2 | IF | `JPCModelConstant.FUNC_CD_1.equals(funcCode)` [L5943] |
|   | 1 | SET | `ucwkMapBf = telInfoMapper.createNewMapForCopyAndSwitchOptionServices(svcKeiUcwkNobf, svcKeiUcwkStat)` |
|   | 2 | SET | `ucwkMapAf = telInfoMapper.createNewMapForCopyAndSwitchOptionServices(svcKeiUcwkNoaf, svcKeiUcwkStataf)` |
|   | 3 | IF | `JKKSvcConst.UM_ARI.equals((String)work.get(BMP_UM_AF))` [L5954] |
|   |   | SET | `copyFlg = true, switchFlg = false` — Copy only (no switch, because BMP present) |
|   | 4 | ELSE | `copyFlg = true, switchFlg = true` — Copy AND switch (BMP absent) |
|   | 5 | CALL | `this.copyAndSwitchOptionServices(handle, param, trgtData, work, ucwkMapBf, ucwkMapAf, copyFlg, switchFlg, funcCode)` |
|   | 6 | CALL | `copyAndSwitchTelSelectOpPackServices(handle, param, trgtData, work, OpPackBfMap, OpPackAfMap, copyFlg, switchFlg, funcCode)` — Phone Select Option Pack |

**Block 13** — [ELSE Branch: svcKeiUcwkStat != "100"] (L5970)

| # | Type | Code |
|---|------|------|
| 1 | IF | `JKKSvcConst.SVC_KEI_STAT_020.equals(svcKeiUcwkStat)` [-> `if ("020".equals(svcKeiUcwkStat))]` (Under review) |
|   | 1 | SET | `cancelRsnCd = JKKSvcConst.SVC_CANCEL_RSN_CD_01` [-> "01": Request cancellation] |
|   | 2 | CALL | `cancelSvcKeiUcwk(handle, param, work, outMapEKK0161A010_bf, idoDiv, cancelRsnCd, funcCode)` |
| 2 | ELSE-IF | `JKKSvcConst.SVC_KEI_STAT_030.equals(svcKeiUcwkStat)` [-> `if ("030".equals(svcKeiUcwkStat))]` (Bundled) |
|   | 1 | CALL | `dslSvcKeiUcwk(handle, param, trgtData, fixedText, funcCode, work, outMapEKK0161A010_bf, outMapEKK0191A010_bf, idoDiv)` |
| 3 | [ADD_SVC_KEI_UCWK] (L6006) |
|   | 1 | CALL | `addSvcKeiUcwk(handle, param, trgtData, fixedText, funcCode, work, outMapEKK0161A010_bf, outMapEKK0191A010_bf, idoDiv, JKKSvcConst.KEIZK_AF_KEI_FLG_0)` [-> "0": No continuation] |
| 4 | [FUNC_CD_1 Branch for Number Switch & Option Services] (L6025) |
|   | 1 | IF | `JPCModelConstant.FUNC_CD_1.equals(funcCode)` |
|   |   | CALL | `runChgTelSvc(handle, param, work, fixedText, idoDiv)` |
|   |   | CALL | `this.copyAndSwitchOptionServices(handle, param, trgtData, work, ucwkMapBf, ucwkMapAf, true, true, funcCode)` — Always copy + switch |
|   |   | CALL | `copyAndSwitchTelSelectOpPackServices(...)` — Phone Select Option Pack |

**Block 14** — [BMP Transition: Before="1" (BMP present)] (L6049)

`if (JPCModelConstant.FUNC_CD_1.equals(funcCode) && JKKSvcConst.UM_ARI.equals((String)work.get(BMP_UM_BF)))`

| # | Type | Code |
|---|------|------|
| 1 | CALL | `mapperETU0011.getMappedTemplateETU0011B017(svcKeiUcwkNobf, "1")` — Get BK service list |
| 2 | CALL | `mapperETU0011.createNewSIFRequestMap(param)` |
| 3 | CALL | `callSvcInter(handle, param, sIFRequest)` — Get BK construction service list |
| 4 | FOR | `bmpKojiSvc : bmpKojiSvcList` |
|   | 1 | SET | `bmpKojiSvcStat = bmpKojiSvc.getString(ETU0011B017CBSMsg1List.BMP_KOJI_STAT)` |
|   | 2 | SET | `bmpKojiTelNo = bmpKojiSvc.getString(ETU0011B017CBSMsg1List.TA_JGYOSHA_UR_NO)` |
|   | 3 | IF | `!(JKKSvcConst.BMP_KOJI_STAT_KOJIFIN.equals(bmpKojiSvcStat) \|\| JKKSvcConst.BMP_KOJI_STAT_KOJICL.equals(bmpKojiSvcStat))` [-> NOT ("050" OR "090")] |
|   |   | 1 | CALL | `addTaiorrk(handle, param, fixedText, CANCEL_TCHI, sysid, null, mskmYmd, nttUkNo, null, null, svcKeiNo, null, funcCode)` — Register BK cancellation notification |
|   | 4 | SET | `cancelBmpkj = new JKKCancelBmpkj()` |
|   | 5 | SET | `inMap.put(JKKCancelBmpkjConst.SVC_KEI_NO, svcKeiNo)` |
|   | 6 | SET | `inMap.put(JKKCancelBmpkjConst.BMP_TELNO, bmpKojiTelNo)` |
|   | 7 | SET | `inMap.put(JKKCancelBmpkjConst.SVC_KEI_UCWK_NO, svcKeiUcwkNobf)` |
|   | 8 | CALL | `cancelBmpkj.cancelBmpkj(handle, param, "", inMap)` |

**Block 15** — [BMP Before/After Combination Transitions] (L6063)

| # | Type | Code |
|---|------|------|
| 1 | IF | `JKKSvcConst.UM_NASI.equals(work.get(BMP_UM_BF)) && JKKSvcConst.UM_NASI.equals(work.get(BMP_UM_AF))` [-> `if ("0"==before && "0"==after)`] — No change case |
|   | (empty) | — No action needed |
| 2 | ELSE-IF | `JKKSvcConst.UM_NASI.equals(work.get(BMP_UM_BF)) && JKKSvcConst.UM_ARI.equals(work.get(BMP_UM_AF))` [-> `if ("0"==before && "1"==after)`] |
|   | 1 | CALL | `chgBmpNonToAri(handle, param, trgtData, fixedText, funcCode, work, outMapEZM0301A010)` |
| 3 | ELSE-IF | `JKKSvcConst.UM_ARI.equals(work.get(BMP_UM_BF)) && JKKSvcConst.UM_NASI.equals(work.get(BMP_UM_AF))` [-> `if ("1"==before && "0"==after)`] |
|   | (empty) | — No action |
| 4 | ELSE-IF | `JKKSvcConst.UM_ARI.equals(work.get(BMP_UM_BF)) && JKKSvcConst.UM_ARI.equals(work.get(BMP_UM_AF)) && isChgTelno(trgtData, outMapEKK0191A010_bf)` |
|   | 1 | CALL | `chgBmpAriToAri(handle, param, trgtData, fixedText, funcCode, work, outMapEKK0191A010_bf, outMapEZM0301A010)` |

**Block 16** — [Post-Registration Processing: FUNC_CD_1] (L6095)

`if (JPCModelConstant.FUNC_CD_1.equals(funcCode))`

| # | Type | Code |
|---|------|------|
| 1 | CALL | `addJmte(handle, param, trgtData, outMapEKK0081A010, (String)work.get(MSKM_DTL_NO), (String)work.get(SVC_KEI_UCWK_NO_AF))` — Registration document registration |
| 2 | CALL | `telInfoMapper.editInMsgEKK0021C060(param, trgtData, (String)work.get(MSKM_DTL_NO), kk0011UpdDtm)` -> `callSvcInter(...)` — Order detail forwarding |

**Block 17** — [Progress Registration + Post-Processing] (L6110)

| # | Type | Code |
|---|------|------|
| 1 | CALL | `addPrgTelnoChg(handle, param, trgtData, work)` — Progress registration |
| 2 | IF | `JPCModelConstant.FUNC_CD_1.equals(funcCode)` |
|   | 1 | IF | `JKKSvcConst.SVC_KEI_STAT_100.equals(svcKeiUcwkStat)` |
|   |   | CALL | `chgTelTwChokTchiCd(handle, param, trgtData, work)` — Change telephone combo notification code |

**Block 18** — [SOD Issuance + Work Project] (L6129)

`if (JPCModelConstant.FUNC_CD_1.equals(funcCode))`

| # | Type | Code |
|---|------|------|
| 1 | IF | `JKKSvcConst.SVC_KEI_STAT_100.equals(svcKeiUcwkStat)` [L6133] |
|   | 1 | IF | `JKKSvcConst.UM_NASI.equals((String)work.get(BMP_UM_AF))` [-> `if ("0".equals(bmpUmAf))]` |
|   |   | CALL | `hakkkoSodCc(handle, param, trgtData, work, svcKeiUcwkNoAf, null, KK0191_GENE_ADD_DTM, null, null, null, null, null, null, false)` |
| 2 | ELSE | (stat != "100") |
|   | 1 | CALL | `hakkkoSodCc(handle, param, trgtData, work, svcKeiUcwkNoAf, KK0191_GENE_ADD_DTM_BF, KK0191_GENE_ADD_DTM, null, null, null, null, null, null, false)` |
| 3 | CALL | `executeKojiAnken(handle, param, trgtData, (String)work.get(MSKM_NO), (String)work.get(MSKM_DTL_NO), false, null)` |
| 4 | IF | `JKKSvcConst.UM_NASI.equals(bmpUm) && bfMonaiBmp` [L6169] (before=no BMP AND before-network-phone-available) |
|   | 1 | CALL | `updateTelnoKojinHojin(handle, param, trgtData, work, bfTelno, JKKSvcConst.HOJIN_KOJIN_CD_HOJIN)` [-> "2": Corporate] |

**Block 19** — [FINAL RETURN] (L6177)

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

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `executeHtelTelnoChg` | Method | Hikari Phone (Fiber Phone) Telephone Number Change Business Process |
| Hikari Phone / eo Hikari Phone | Business term | Fujitsu Hikari Denwa — a fiber-optic telephone service provided by K-Opticom |
| `funcCode` | Field | Functional code — determines the operation type: "1" = number switch, "2" = review/bundling |
| `svc_kei_no` | Field | Service contract number — the main K-Opticom customer service contract identifier |
| `svc_kei_ucwk_no` | Field | Service detail work number — internal tracking ID for a service contract line item (e.g., a specific Hikari Phone subscription) |
| `svc_kei_ucwk_stat` | Field | Service detail contract status — current state of the service detail work |
| `svc_kei_stat` | Field | Service contract status — current state of the top-level service contract |
| `bmp_um` | Field | BMP presence/absence — whether line work (Banchi Koushi) is required ("1"=yes, "0"=no) |
| `ido_div` | Field | Migration division — classifies the type of change (e.g., "00041" = Hikari Phone/number addition) |
| `afterTelno` | Field | Post-change telephone number — the new phone number the customer wants |
| `bfTelno` | Field | Before-change telephone number — the current phone number before the change |
| `kyokuNo` | Field | Office number — the NTT telephone office prefix (first 6 digits of the phone number) |
| `noKukakuCd` | Field | Number division code — the postal/number division code for the address |
| `kaisenAdCd` | Field | Line detail address code — address code for the service contract line |
| `work` | Field | Internal work data HashMap — passes state between processing blocks |
| `SVC_KEI_STAT_100` | Constant | "100" — Contract active / service in progress |
| `SVC_KEI_STAT_020` | Constant | "020" — Contract under review (pending approval) |
| `SVC_KEI_STAT_030` | Constant | "030" — Contract bundled/bundled together |
| `UM_ARI` / `UM_NASI` | Constant | "1" (presence/yes) / "0" (absence/no) — generic yes/no flags |
| `HOJIN_KOJIN_CD_KOJIN` | Constant | "1" — Individual customer classification |
| `HOJIN_KOJIN_CD_HOJIN` | Constant | "2" — Corporate customer classification |
| `SVC_CANCEL_RSN_CD_01` | Constant | "01" — Cancellation reason: request cancellation (申出によるキャンセル) |
| `MSKM_SBT_CD_00035` | Constant | "00035" — Order subtype: contract detail change request (契約内容変更申込) |
| `BMP_KOJI_STAT_KOJIFIN` | Constant | "050" — BK (line work) construction status: completed |
| `BMP_KOJI_STAT_KOJICL` | Constant | "090" — BK (line work) construction status: cancelled |
| `CANCEL_TCHI` | Constant | "02" — Registration type: BK cancellation notification |
| `KEIZK_AF_KEI_FLG_1` | Constant | "1" — With continuation flag (contract continues after switch) |
| `KEIZK_AF_KEI_FLG_0` | Constant | "0" — No continuation flag |
| `FUNC_CD_1` / `FUNC_CD_2` | Constant | "1" = number switch / "2" = review/bundling functional code |
| SOD | Acronym | Service Order Data — telecom order fulfillment data for external network provisioning |
| EKK | Prefix | E-KOPTICOM service component / CBS codes (service contract domain) |
| EZM | Prefix | E-KOPTICOM master data management CBS codes (office/location data) |
| ETU | Prefix | E-KOPTICOM BK (construction) service CBS codes |
| CBS | Acronym | Component Business System — backend business logic component in the Fujitsu Futurity BPM framework |
| SC | Acronym | Service Component — a thin SC wrapper layer that calls the CBS |
| CAANMsg | Technical | Fujitsu message object used for SC request/response data exchange |
| BK (Banchi Koushi) | Business term | Banchi Koushi — physical line work/installation work at customer premises for telecom services |
| Kojin / Hojin | Business term | Japanese corporate classification: "1" = individual (個人), "2" = corporate (法人) |
| `check_tel_status` | Instance field | Telephone status check flag — "ERR_NASI" = no error, "WARNING_ARI" = warning exists |
| `isMonaiBmpAri` | Method | Network phone number availability check — determines if a phone number is available for network use |
| VLAN-ID FIX FLAG | Field | Indicates whether VLAN-ID has been fixed for the line detail contract |
| VOICE SELECT OPTION PACK | Business term | Option service pack for VoIP/phone features — copied/switched during number change |
| MSKM_NO / MSKM_DTL_NO | Field | Order number / order detail number — returned from order acceptance registration |
| MSKM_SBT_CD | Field | Order subtype code |
| UPD_DTM | Field | Update datetime — timestamp of the last modification |
| LINE DETAIL | Business term | Service detail contract (SVC_KEI_UCWK) — a specific service line under a customer contract |
| SLAVE LINE DETAIL | Business term | Service detail for "eo Hikari Phone" (SVC_KEI_UCWK_HIKARI) — separate from the main service detail |

---

*Document generated from source file: `source/koptBp/ejbModule/com/fujitsu/futurity/bp/custom/common/JKKTelnoInfoAddCC.java`, lines 5651–6380 (730 LOC).*
