# Business Logic — JKKAdchgCancelHakkoSODCC.adchgOdrCtrl() [374 LOC]

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

## 1. Role

### JKKAdchgCancelHakkoSODCC.adchgOdrCtrl()

This method performs **usage location change order control processing** (利用場所変更オーダー制御処理) for FTTH (Fiber To The Home) subscription services within K-Opticom's order fulfillment system. It is invoked as part of the "cancellation and new registration" workflow — specifically when a customer's registered address is changed and the existing FTTH service must be terminated under the old address while a new service is provisioned at the new address.

The method implements a **delegation and sequential processing pattern**. It reads service order data (SOD) maps containing four distinct service agreement layers — the main service agreement (svc_kei_info), the service agreement sub-details (svc_kei_ucwk_info), the optional service agreement (opsvkei_info), and the equipment-provided service agreement (kktsvkei_info) — and then queries each layer through dedicated Service Component (SC) calls to retrieve current agreement consent details (同意照会).

The method handles **four independent service agreement data retrieval branches**: (1) post-change optional service agreement via EKK0351A010SC, (2) pre-change equipment-provided service agreement via EKK0341A010SC, (3) pre-change service agreement via EKK0081A010SC, and (4) prior (previous) service agreement via EKK0081A010SC. Each branch is guarded by null/blank checks on the service contract number and generation registration timestamp.

Blocks 6 through 8 contain **extensively commented-out logic** for post-change optional data check, pre-change equipment data check, and service agreement data check respectively — these handled legacy scenarios like multi-selection termination (B015), duplex access connection termination (B020), IPV6 termination (B070), BBR router termination (C014), and network authentication termination for non-mansion private customers. Only the active code path in blocks 9 (prior service agreement data check based on `isChgPlaceZumi`) executes in production.

As a shared utility method called from multiple entry points in the order issuance flow, it serves as a **dispatch hub** that ensures all relevant service agreements are retrieved and validated before downstream SOD (Service Order Data) creation proceeds.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["adchgOdrCtrl params"]) --> INIT["Initialize status code and hash maps"]
    INIT --> EXTRACT_MAPS["Extract info maps from sodMap: svc_kei_info, svc_kei_ucwk_info, opsvkei_info, kktsvkei_info"]
    EXTRACT_MAPS --> SHKKA["Call shkkaMap on each info map for initialization"]
    SHKKA --> EXTRACT_FIELDS["Extract fields: svc_kei_no, chbf_svc_kei_gene_add_dtm, saki_svc_kei_no, chaf_svc_kei_gene_add_dtm, svc_kei_ucwk_no, chbf_svc_kei_ucwk_gene_add_dtm, saki_svc_kei_ucwk_no, chaf_svc_kei_ucwk_gene_add_dtm, chaf_opsvkei_no, chaf_opsvkei_gene_add_dtm, chbf_kktsvkei_no, chbf_kktsvkei_gene_add_dtm"]
    EXTRACT_FIELDS --> CREATE_HASH["Create inHash and resultHash HashMaps"]
    CREATE_HASH --> CHECK_OP["Check: chaf_opsvkei_no and chaf_opsvkei_gene_add_dtm not blank?"]
    CHECK_OP -->|Yes| CALL_OPSC["Call callEKK0351A010SC with opsvkei info"]
    CALL_OPSC --> CHECK_OP_STATUS{statusCode == 0?}
    CHECK_OP_STATUS -->|No| THROW_OP["Throw CCException with SCCallException"]
    CHECK_OP_STATUS -->|Yes| STORE_OP["Store chafEKK0351A010SCHash from resultHash"]
    STORE_OP --> CHECK_EQUIP["Check: chbf_kktsvkei_no and chbf_kktsvkei_gene_add_dtm not blank?"]
    CHECK_OP -->|No| CHECK_EQUIP
    CHECK_EQUIP -->|Yes| CALL_EQUIPSC["Call callEKK0341A010SC with kktsvkei info"]
    CALL_EQUIPSC --> CHECK_EQUIP_STATUS{statusCode == 0?}
    CHECK_EQUIP_STATUS -->|No| THROW_EQUIP["Throw CCException with SCCallException"]
    CHECK_EQUIP_STATUS -->|Yes| STORE_EQUIP["Store chbfEKK0341A010SCHash from resultHash"]
    STORE_EQUIP --> CHECK_SVC["Check: svc_kei_no and chbf_svc_kei_gene_add_dtm not blank?"]
    CHECK_EQUIP -->|No| CHECK_SVC
    CHECK_SVC -->|Yes| CALL_SVCSERVICE["Call callEKK0081A010SC with svc_kei info"]
    CALL_SVCSERVICE --> CHECK_SVC_STATUS{statusCode == 0?}
    CHECK_SVC_STATUS -->|No| THROW_SVC["Throw CCException with SCCallException"]
    CHECK_SVC_STATUS -->|Yes| STORE_SVC["Store chbfEKK0081A010SCHash from resultHash"]
    STORE_SVC --> CHECK_SAKI["Check: saki_svc_kei_no and chaf_svc_kei_gene_add_dtm not blank?"]
    CHECK_SVC -->|No| CHECK_SAKI
    CHECK_SAKI -->|Yes| CALL_SAKISC["Call callEKK0081A010SC with saki_svc_kei_no"]
    CALL_SAKISC --> CHECK_SAKI_STATUS{statusCode == 0?}
    CHECK_SAKI_STATUS -->|No| THROW_SAKI["Throw CCException with SCCallException"]
    CHECK_SAKI_STATUS -->|Yes| STORE_SAKI["Store chafEKK0081A010SCHash from resultHash"]
    STORE_SAKI --> BLOCK6["Block 6: Post-change operation data check (commented out)"]
    CHECK_SAKI -->|No| BLOCK6
    BLOCK6 --> BLOCK7["Block 7: Pre-change equipment data check (commented out)"]
    BLOCK7 --> BLOCK8["Block 8: Service agreement data check (commented out)"]
    BLOCK8 --> CHECK_CHGPLACE{"isChgPlaceZumi == false?"}
    CHECK_CHGPLACE -->|Yes| GET_PCRS["Get pcrs_cd from chafEKK0081A010SCHash"]
    CHECK_CHGPLACE -->|No| RETURN_PARAM["Return param"]
    GET_PCRS --> CHECK_MANSION{isMansionPrvate == false?}
    CHECK_MANSION -->|Yes| GET_SAME_TRN["Call getSame_trn_no for transaction number"]
    CHECK_MANSION -->|No| UPDATE_WORKMAP1["Update HAKKOSODCCWORKMAP with saki_svc_kei_no and chaf_svc_kei_gene_add_dtm"]
    GET_SAME_TRN --> UPDATE_WORKMAP1
    UPDATE_WORKMAP1 --> SET_FIELD1["Set svc_kei_ucwk_no[0] = saki_svc_kei_ucwk_no"]
    SET_FIELD1 --> SET_FIELD2["Set svc_kei_ucwk_gadtm[0] = chaf_svc_kei_ucwk_gene_add_dtm"]
    SET_FIELD2 --> CALL_ADDSOD1["Call addSOD with ODR_NAIYO_CD_103 (FTTH auth termination)"]
    CALL_ADDSOD1 --> UPDATE_WORKMAP2["Update HAKKOSODCCWORKMAP with svc_kei_no and chbf_svc_kei_gene_add_dtm"]
    UPDATE_WORKMAP2 --> SET_CHGPLACE["Set isChgPlaceZumi = true"]
    SET_CHGPLACE --> RETURN_PARAM
```

**Constant Resolution:**

| Constant | Actual Value | Business Meaning |
|----------|-------------|------------------|
| `JKKHakkoSODConstCC.SVC_KEI_INFO` | `"svc_kei_info"` | Key for main service agreement info map in sodMap |
| `JKKHakkoSODConstCC.SVC_KEI_UCWK_INFO` | `"svc_kei_ucwk_info"` | Key for service agreement sub-details info map |
| `JKKHakkoSODConstCC.OPSVKEI_INFO` | `"opsvkei_info"` | Key for optional service agreement info map |
| `JKKHakkoSODConstCC.KKTSVKEI_INFO` | `"kktsvkei_info"` | Key for equipment-provided service agreement info map |
| `JKKHakkoSODConstCC.FUNC_CODE_1` | `"1"` | Function code for agreement consent inquiry (同意照会) |
| `JKKHakkoSODConstCC.ODR_NAIYO_CD_103` | (FTTH Auth Termination) | Order content code for FTTH authentication termination |
| `JKKHakkoSODConstCC.HAKKOSODCCWORKMAP` | `"hakkosodccworkmap"` | Work map key for order issuance SOD CC working data |

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `handle` | `SessionHandle` | Session management handle containing transaction context, database connections, and EJB session bean references used throughout the service order processing lifecycle. Carries the user's session identity and security context. |
| 2 | `param` | `IRequestParameterReadWrite` | Request parameter object containing the model group (multiple layered HashMaps for service data) and control map. Acts as the central data carrier — input SOD maps are extracted from it, and output work map data (e.g., HAKKOSODCCWORKMAP) is written to it. Modified in-place and returned. |
| 3 | `sodMap` | `HashMap<String, Object>` | Service Order Data map — a collection of four service agreement info maps (`svc_kei_info`, `svc_kei_ucwk_info`, `opsvkei_info`, `kktsvkei_info`) that describe the current service state, sub-details, optional services, and equipment-provided services. These are the authoritative source of truth for what the customer is currently subscribed to. |

**Instance fields read by this method:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `isChgPlaceZumi` | `boolean` | Flag indicating whether the usage location change has already been processed. When `false`, additional FTTH authentication termination SOD creation is triggered. |
| `pcrs_cd` | `String[]` | Price course code array — holds the pricing plan code from service agreement inquiry results. |
| `same_trn_no` | `String` | Same process number — a shared transaction number used to correlate related order operations (e.g., multi-selection, device, and IP operations under a single batch). |
| `op_svc_kei_no_mltise` | `String` | Optional service agreement number for multi-selection — used in commented-out code paths for multi-selection termination scenarios. |
| `op_gadtm_mltise` | `String` | Optional service agreement generation/addition datetime for multi-selection. |
| `kiki_seizo_no` | `String[0]` | Device manufacturing number array. |
| `taknkiki_model_cd` | `String[0]` | In-home device model code array. |
| `kktk_svc_kei_no` | `String[0]` | Equipment-provided service agreement number array. |
| `kktk_svc_kei_gadtm` | `String[0]` | Equipment-provided service agreement generation/addition datetime array. |
| `svc_kei_ucwk_no` | `String[0]` | Service agreement sub-details number array. |
| `svc_kei_ucwk_gadtm` | `String[0]` | Service agreement sub-details generation/addition datetime array. |

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `callEKK0351A010SC` | EKK0351A010SC | KK_T_OP_SVC_KEI (Optional Service Agreement Table) | Calls `callEKK0351A010SC` to retrieve optional service agreement agreement consent details (同意照会) for the post-change optional service. Returns a hash map containing OP_SVC_KEI_NO, GENE_ADD_DTM, OP_SVC_KEI_STAT, OP_SVC_CD, and PCRSCD. |
| R | `callEKK0341A010SC` | EKK0341A010SC | KK_T_KKT_SVC_KEI (Equipment-Provided Service Agreement Table) | Calls `callEKK0341A010SC` to retrieve equipment-provided service agreement agreement consent details for the pre-change equipment service. Returns hash map with KKT_SVC_CD, KKT_SVC_KEI_STAT, KIKI_SEIZO_NO, TAKNKIKI_MODEL_CD, and related fields. |
| R | `callEKK0081A010SC` | EKK0081A010SC | KK_T_SVC_KEI (Service Agreement Table) | Calls `callEKK0081A010SC` twice — once for pre-change service agreement and once for prior (previous) service agreement. Retrieves SVC_KEI_NO, GENE_ADD_DTM, SVC_KEI_STAT, SYSID, and PCRSCD from the main service agreement table. |
| R | `getSame_trn_no` | (Internal) | - | Retrieves the same process number (同一処理番号) — a shared transaction identifier used across related order operations. Called when processing non-mansion private customers. |
| C | `addSOD` | (Internal) | KK_T_ODR_HAKKO (Order Issuance Table) | Creates a new order issuance (SOD) record. In Block 9, calls `addSOD` with `ODR_NAIYO_CD_103` (FTTH authentication termination / FTTH認証の利用終了). |
| - | `shkkaMap` | (Internal) | - | Clears and reinitializes a HashMap — performs deep copy or defensive copy of the service agreement info maps. |
| - | `isBlank` | (Internal) | - | Null/blank check utility for String fields. |
| - | `isMansionPrvate` | (Internal) | - | Checks whether the customer resides in a mansion private building (determines special pricing/course handling). |
| - | `JBSbatAKKshkmRsltInfoTukiawsday.setData` | - | - | Sets data in the SOD result info map. |
| - | `JBSbatAKKshkmRsltInfoTukiaws.setData` | - | - | Sets data in the SOD result info map. |
| - | `JBSbatAKKshkmRsltInfoTukiawsRealSkh.setData` | - | - | Sets data in the SOD result info map. |
| - | `JBSbatAKKshkmRsltInfTkCvsNCnsl.setData` | - | - | Sets data in the SOD result info map. |
| R | `JBSbatDKNyukaFinAdd.getData` | - | - | Retrieves data from the registration completion info map. |
| - | `JBSbatKKGetCTITelno.setData` | - | - | Sets data for CIT telephone number retrieval. |
| R | `JFUeoTelOpTransferCC.getData` | - | - | Retrieves data from the end-of-life telephone operation transfer CC. |
| R | `JFUTransferCC.getData` | - | - | Retrieves data from the transfer CC. |
| R | `JFUTransferListToListCC.getData` | - | - | Retrieves data from the transfer list-to-list CC. |
| - | `JCCcomFileSearchUtil.clear` | - | - | Clears file search utility data. |
| - | `JZMAdEdit.clear` | - | - | Clears address edit data. |
| - | `KKA17101SFLogic.clear` | - | - | Clears logic data for step 17101. |
| - | `KKA17201SFLogic.clear` | - | - | Clears logic data for step 17201. |
| - | `KKA17401SFLogic.clear` | - | - | Clears logic data for step 17401. |
| R | `KKW12701SFLogic.getData` | - | - | Retrieves data from step 12701 logic. |

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | CBS: `JKKAdchgCancelHakkoSODCC` | `setParamChgPlaceOdr` -> `JKKAdchgCancelHakkoSODCC.adchgOdrCtrl` -> `opSetOdrCtrl` -> `kikiKeiKeepOdrCtrl` | `addSOD [C] KK_T_ODR_HAKKO`, `callEKK0351A010SC [R] KK_T_OP_SVC_KEI`, `callEKK0341A010SC [R] KK_T_KKT_SVC_KEI`, `callEKK0081A010SC [R] KK_T_SVC_KEI` |
| 2 | CBS: `JKKAdchgHakkoSODCC` | `setParamChgPlaceOdr` -> `JKKAdchgHakkoSODCC.adchgOdrCtrl` -> `JKKAdchgCancelHakkoSODCC.adchgOdrCtrl` -> `opSetOdrCtrl` | `addSOD [C] KK_T_ODR_HAKKO`, `callEKK0351A010SC [R] KK_T_OP_SVC_KEI`, `callEKK0341A010SC [R] KK_T_KKT_SVC_KEI`, `callEKK0081A010SC [R] KK_T_SVC_KEI` |

**Terminal operations from this method:**
- `addSOD [C] KK_T_ODR_HAKKO` — Creates an order issuance record for FTTH authentication termination (ODR_NAIYO_CD_103)
- `callEKK0351A010SC [R] KK_T_OP_SVC_KEI` — Reads optional service agreement data
- `callEKK0341A010SC [R] KK_T_KKT_SVC_KEI` — Reads equipment-provided service agreement data
- `callEKK0081A010SC [R] KK_T_SVC_KEI` — Reads service agreement data (both pre-change and prior)
- `getSame_trn_no [R] -` — Reads same process number for correlation
- `setData [-]` — Sets result data in SOD info maps
- `getData [R]` — Retrieves data from various logic and transfer maps

## 6. Per-Branch Detail Blocks

**Block 1** — [SET/INIT] Variable and data structure initialization (L21064)

> Initializes the processing state: status code, hash maps for SC result storage, and extracts the four service agreement info maps from the sodMap input parameter.

| # | Type | Code |
|---|------|------|
| 1 | SET | `statusCode = 0` // Service interface status code initialization |
| 2 | SET | `chafEKK0351A010SCHash = new HashMap<>()` // Post-change optional service agreement agreement consent result hash |
| 3 | SET | `chbfEKK0341A010SCHash = new HashMap<>()` // Pre-change equipment-provided service agreement agreement consent result hash |
| 4 | SET | `chbfEKK0081A010SCHash = new HashMap<>()` // Pre-change service agreement agreement consent result hash |
| 5 | SET | `chafEKK0081A010SCHash = new HashMap<>()` // Post-change service agreement agreement consent result hash |
| 6 | SET | `svc_kei_info_Map = (HashMap)sodMap.get(JKKHakkoSODConstCC.SVC_KEI_INFO)` // Service agreement info (map key: "svc_kei_info") |
| 7 | SET | `svc_kei_ucwk_info_Map = (HashMap)sodMap.get(JKKHakkoSODConstCC.SVC_KEI_UCWK_INFO)` // Service agreement sub-details info (map key: "svc_kei_ucwk_info") |
| 8 | SET | `opsvkei_info_Map = (HashMap)sodMap.get(JKKHakkoSODConstCC.OPSVKEI_INFO)` // Optional service agreement info (map key: "opsvkei_info") |
| 9 | SET | `kktsvkei_info_Map = (HashMap)sodMap.get(JKKHakkoSODConstCC.KKTSVKEI_INFO)` // Equipment-provided service agreement info (map key: "kktsvkei_info") |
| 10 | EXEC | `svc_kei_info_Map = shkkaMap(svc_kei_info_Map)` // Initialize/copy service agreement info |
| 11 | EXEC | `svc_kei_ucwk_info_Map = shkkaMap(svc_kei_ucwk_info_Map)` // Initialize/copy sub-details info |
| 12 | EXEC | `opsvkei_info_Map = shkkaMap(opsvkei_info_Map)` // Initialize/copy optional service info |
| 13 | EXEC | `kktsvkei_info_Map = shkkaMap(kktsvkei_info_Map)` // Initialize/copy equipment-provided service info |

**Block 2** — [SET] Field extraction from info maps (L21096)

> Extracts specific fields from each of the four info maps. These include service contract numbers, timestamps for before/after generation, prior service numbers, and optional service identifiers.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | SET | `func_cd = ""` | Function code (reserved/empty) |
| 2 | SET | `svc_kei_no = svc_kei_info_MAP.get(INFO_SVC_KEI_NO)` | Service contract number |
| 3 | SET | `chbf_svc_kei_gene_add_dtm = svc_kei_info_MAP.get(INFO_CHBF_SVC_KEI_GENE_ADD_DTM)` | Pre-change service contract generation registration timestamp |
| 4 | SET | `saki_svc_kei_no = svc_kei_info_MAP.get(INFO_SAKI_SVC_KEI_NO)` | Prior (previous) service contract number |
| 5 | SET | `chaf_svc_kei_gene_add_dtm = svc_kei_info_MAP.get(INFO_CHAF_SVC_KEI_GENE_ADD_DTM)` | Post-change service contract generation registration timestamp |
| 6 | SET | `svc_kei_ucwk_no = svc_kei_ucwk_info_MAP.get(INFO_SVC_KEI_UCWK_NO)` | Service agreement sub-details number |
| 7 | SET | `chbf_svc_kei_ucwk_gene_add_dtm = svc_kei_ucwk_info_MAP.get(INFO_CHBF_SVC_KEI_UCWK_GENE_ADD_DTM)` | Pre-change sub-details generation timestamp |
| 8 | SET | `saki_svc_kei_ucwk_no = svc_kei_ucwk_info_MAP.get(INFO_SAKI_SVC_KEI_UCWK_NO)` | Prior sub-details number |
| 9 | SET | `chaf_svc_kei_ucwk_gene_add_dtm = svc_kei_ucwk_info_MAP.get(INFO_CHAF_SVC_KEI_UCWK_GENE_ADD_DTM)` | Post-change sub-details generation timestamp |
| 10 | SET | `chaf_opsvkei_no = opsvkei_info_MAP.get(INFO_CHAF_OPSVKEI_NO)` | Post-change optional service agreement number |
| 11 | SET | `chaf_opsvkei_gene_add_dtm = opsvkei_info_MAP.get(INFO_CHAF_OPSVKEI_GENE_ADD_DTM)` | Post-change optional service agreement generation timestamp |
| 12 | SET | `chbf_kktsvkei_no = kktsvkei_info_MAP.get(INFO_CHBF_KKTSVKEI_NO)` | Pre-change equipment-provided service agreement number |
| 13 | SET | `chbf_kktsvkei_gene_add_dtm = kktsvkei_info_MAP.get(INFO_CHBF_KKTSVKEI_GENE_ADD_DTM)` | Pre-change equipment-provided service generation timestamp |

**Block 3** — [SET] Working HashMap creation (L21117)

| # | Type | Code |
|---|------|------|
| 1 | SET | `inHash = new HashMap<>()` // Input parameter map for SC calls |
| 2 | SET | `resultHash = new HashMap<>()` // Result storage map for SC calls |

**Block 4** — [IF] (1) Post-change optional service agreement data retrieval (L21123)

> Retrieves the post-change optional service agreement agreement consent details via EKK0351A010SC. This is triggered when both the post-change optional service number and its generation timestamp are present.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | EXEC | `inHash.clear()` | Clear input parameter map |
| 2 | EXEC | `resultHash.clear()` | Clear result storage map |
| 3 | SET | `inHash.put(OP_SVC_KEI_NO, chaf_opsvkei_no)` // Optional service agreement number |
| 4 | SET | `inHash.put(GENE_ADD_DTM, chaf_opsvkei_gene_add_dtm)` // Post-change generation timestamp |
| 5 | CALL | `statusCode = callEKK0351A010SC(param, handle, inHash, resultHash, JKKHakkoSODConstCC.FUNC_CODE_1)` // EKK0351A010 - Optional service agreement agreement consent inquiry (同意照会). FUNC_CODE_1 = "1" |
| 6 | SET | `chafEKK0351A010SCHash = (HashMap)resultHash.get(TEMPLATE_ID_EKK0351A010)` // Store optional service agreement result hash |

**Block 4.1** — [IF] Error check (L21133)

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | SET | `if (0 != statusCode)` // Non-zero indicates error |
| 2 | EXEC | `throw new CCException("", new SCCallException("", String.valueOf(statusCode), statusCode))` // Throw service call exception with status code |

**Block 5** — [IF] (2) Pre-change equipment service data retrieval (L21142)

> Retrieves the pre-change equipment-provided service agreement agreement consent details via EKK0341A010SC. Triggered when both the pre-change equipment-provided service number and its generation timestamp are present.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | EXEC | `inHash.clear()` // Clear input parameter map |
| 2 | EXEC | `resultHash.clear()` // Clear result storage map |
| 3 | SET | `inHash.put(KKTK_SVC_KEI_NO, chbf_kktsvkei_no)` // Equipment-provided service agreement number |
| 4 | SET | `inHash.put(GENE_ADD_DTM, chbf_kktsvkei_gene_add_dtm)` // Pre-change generation timestamp |
| 5 | CALL | `statusCode = callEKK0341A010SC(param, handle, inHash, resultHash, FUNC_CODE_1)` // EKK0341A010 - Equipment-provided service agreement agreement consent inquiry |
| 6 | SET | `chbfEKK0341A010SCHash = (HashMap)resultHash.get(TEMPLATE_ID_EKK0341A010)` // Store result hash |

**Block 5.1** — [IF] Error check (L21152)

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | SET | `if (0 != statusCode)` // Error check |
| 2 | EXEC | `throw new CCException("", new SCCallException("", String.valueOf(statusCode), statusCode))` // Throw exception |

**Block 6** — [IF] (3) Pre-change service agreement data retrieval (L21163)

> Retrieves the pre-change service agreement agreement consent details via EKK0081A010SC. Triggered when both the service contract number and pre-change generation timestamp are present.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | EXEC | `inHash.clear()` // Clear input map |
| 2 | EXEC | `resultHash.clear()` // Clear result map |
| 3 | SET | `inHash.put(SVC_KEI_NO, svc_kei_no)` // Service contract number |
| 4 | SET | `inHash.put(GENE_ADD_DTM, chbf_svc_kei_gene_add_dtm)` // Pre-change generation timestamp |
| 5 | CALL | `statusCode = callEKK0081A010SC(param, handle, inHash, resultHash, FUNC_CODE_1)` // EKK0081A010 - Service agreement agreement consent inquiry |
| 6 | SET | `chbfEKK0081A010SCHash = (HashMap)resultHash.get(TEMPLATE_ID_EKK0081A010)` // Store result hash |

**Block 6.1** — [IF] Error check (L21173)

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | SET | `if (0 != statusCode)` // Error check |
| 2 | EXEC | `throw new CCException("", new SCCallException("", String.valueOf(statusCode), statusCode))` // Throw exception |

**Block 7** — [IF] (4) Prior service agreement data retrieval (L21183)

> Retrieves the prior (previous) service agreement agreement consent details via EKK0081A010SC. This handles the case where the customer's service was previously registered under a different contract number (e.g., due to address migration). Triggered when both the prior service contract number and the post-change generation timestamp are present.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | EXEC | `inHash.clear()` // Clear input map |
| 2 | EXEC | `resultHash.clear()` // Clear result map |
| 3 | SET | `inHash.put(SVC_KEI_NO, saki_svc_kei_no)` // Prior service contract number |
| 4 | SET | `inHash.put(GENE_ADD_DTM, chaf_svc_kei_gene_add_dtm)` // Post-change generation timestamp |
| 5 | CALL | `statusCode = callEKK0081A010SC(param, handle, inHash, resultHash, FUNC_CODE_1)` // EKK0081A010 - Service agreement agreement consent inquiry (for prior contract) |
| 6 | SET | `chafEKK0081A010SCHash = (HashMap)resultHash.get(TEMPLATE_ID_EKK0081A010)` // Store result hash |

**Block 7.1** — [IF] Error check (L21193)

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | SET | `if (0 != statusCode)` // Error check |
| 2 | EXEC | `throw new CCException("", new SCCallException("", String.valueOf(statusCode), statusCode))` // Throw exception |

**Block 8** — [COMMENT] (6) Post-change optional service data check (L21203)

> All code in this block is **commented out**. This block would have checked the post-change optional service agreement status for multi-selection (B015), duplex access (B020), and IPV6 termination scenarios. It would have queried optional service agreement lists, fetched the same process number, and created multiple termination SODs.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | COMMENT | // All code commented out | B015 Multi-selection, B020 Duplex access, B070 IPV6 scenarios |

**Block 9** — [COMMENT] (7) Pre-change equipment data check (L21281)

> All code is **commented out**. This block handled the case where the equipment-provided service was in active state (SVC_KEI_STAT_100) and the service code was BBR (C014). It would have created a router authentication ID registration SOD.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | COMMENT | // All code commented out (OM-2014-0001732 DEL) | BBR router authentication ID registration scenario |

**Block 10** — [COMMENT] (8) Service agreement data check (L21301)

> All code is **commented out**. This block would have checked the pre-change service agreement for non-mansion private customers and created FTTH authentication termination SODs.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | COMMENT | // All code commented out | FTTH authentication termination for non-mansion private customers |

**Block 11** — [IF] (9) Prior service agreement data check (L21314)

> **Active code block.** This is the only execution path that runs in production. When `isChgPlaceZumi` is `false` (meaning the usage location change has not yet been processed), it retrieves the price course code from the post-change service agreement, and for non-mansion private customers, it creates an FTTH authentication termination SOD under the prior service contract number.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | SET | `this.pcrs_cd = chafEKK0081A010SCHash.get(EKK0081A010CBSMsg1List.PCRS_CD)` // Get price course code from post-change service agreement result hash |
| 2 | SET | `if (!isMansionPrvate())` // Non-mansion private customer check |

**Block 11.1** — [IF] Non-mansion private check (L21322)

> For non-mansion private customers, the method generates an FTTH authentication termination order. It first acquires a shared transaction number (同一処理番号), then sets up work map data, and creates the SOD.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | SET | `if (isBlank(this.same_trn_no))` // Acquire same process number if not yet set |
| 2 | SET | `String[] sameTrnNo = new String[1]` // Buffer for same process number |
| 3 | CALL | `getSame_trn_no(param, handle, null, sameTrnNo)` // Acquire shared transaction number |
| 4 | SET | `this.same_trn_no = sameTrnNo[0]` // Store acquired same process number |
| 5 | SET | `dataMap = (HashMap)param.getData(JKKHakkoSODConstCC.HAKKOSODCCWORKMAP)` // Get work map from param |
| 6 | SET | `dataMap.put("svc_kei_no", saki_svc_kei_no)` // Set prior service contract number // 先サービス契約番号 |
| 7 | SET | `dataMap.put("svkei_gadtm", chaf_svc_kei_gene_add_dtm)` // Set post-change generation timestamp |
| 8 | EXEC | `param.setData(JKKHakkoSODConstCC.HAKKOSODCCWORKMAP, dataMap)` // Store work map back to param |
| 9 | SET | `this.svc_kei_ucwk_no[0] = saki_svc_kei_ucwk_no` // Set sub-details number (prior contract) |
| 10 | SET | `this.svc_kei_ucwk_gadtm[0] = chaf_svc_kei_ucwk_gene_add_dtm` // Set sub-details generation timestamp |
| 11 | CALL | `param = addSOD(handle, param, JKKHakkoSODConstCC.ODR_NAIYO_CD_103)` // Create FTTH authentication termination SOD // FTTH認証の利用終了 |
| 12 | SET | `dataMap = (HashMap)param.getData(JKKHakkoSODConstCC.HAKKOSODCCWORKMAP)` // Get work map again |
| 13 | SET | `dataMap.put("svc_kei_no", svc_kei_no)` // Set current service contract number // サービス契約番号 |
| 14 | SET | `dataMap.put("svkei_gadtm", chbf_svc_kei_gene_add_dtm)` // Set pre-change generation timestamp |
| 15 | EXEC | `param.setData(JKKHakkoSODConstCC.HAKKOSODCCWORKMAP, dataMap)` // Restore work map with current service |
| 16 | SET | `isChgPlaceZumi = true` // Mark usage location change as processed |

**Block 12** — [RETURN] (L21435)

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | RETURN | `return param` // Return the updated parameter object |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `svc_kei_info` | Field | Service agreement info map — the primary service contract data including contract number, status, and timestamps |
| `svc_kei_ucwk_info` | Field | Service agreement sub-details info map — detailed sub-line items within a service contract |
| `opsvkei_info` | Field | Optional service agreement info map — add-on services (multi-selection, IPV6, duplex access) attached to the main contract |
| `kktsvkei_info` | Field | Equipment-provided service agreement info map — services bundled with rented networking equipment (e.g., BBR router) |
| `svc_kei_no` | Field | Service contract number — the primary identifier for a FTTH service subscription |
| `saki_svc_kei_no` | Field | Prior service contract number — the contract number from a previous registration (e.g., before address migration) |
| `svc_kei_ucwk_no` | Field | Service agreement sub-details number — internal tracking ID for service contract line items |
| `chbf_*` | Field | "Change before" prefix — indicates data from the state before a modification was applied |
| `chaf_*` | Field | "Change after" prefix — indicates data from the state after a modification was applied |
| `gene_add_dtm` | Field | Generation registration timestamp — datetime when a service agreement version was created, used for optimistic locking and versioning |
| `op_svc_kei_no` | Field | Optional service agreement number — identifies add-on services like multi-selection, IPV6, duplex access |
| `kktsvkei_no` | Field | Equipment-provided service agreement number — identifies services tied to rented equipment |
| `pcrs_cd` | Field | Price course code — the pricing plan code determining the customer's rate plan (e.g., A47, A48, A49 for mansion private) |
| `isChgPlaceZumi` | Field | Location change completion flag — indicates whether the usage location change process has already been handled in this session |
| `same_trn_no` | Field | Same process number — a shared transaction identifier used to correlate multiple related order operations into a single batch |
| `ODR_NAIYO_CD_103` | Constant | Order content code 103 — FTTH authentication termination (FTTH認証の利用終了), cancels FTTH authentication for a migrated address |
| `ODR_NAIYO_CD_101` | Constant | Order content code 101 — FTTH registration (FTTH登録), creates new FTTH service at a new address |
| `ODR_NAIYO_CD_137` | Constant | Order content code 137 — Duplex access option termination (ダイアルアップ接続オプション解約) |
| `ODR_NAIYO_CD_138` | Constant | Order content code 138 — Duplex access option deletion (ダイアルアップ接続オプション削除) |
| `ODR_NAIYO_CD_145` | Constant | Order content code 145 — Multi-selection termination (マルチセクションの利用終了注文) |
| `ODR_NAIYO_CD_146` | Constant | Order content code 146 — Fixed global IP deletion (グローバルIP消去) |
| `ODR_NAIYO_CD_147` | Constant | Order content code 147 — Router authentication ID registration (ルーター認証IDの登録) |
| `ODR_NAIYO_CD_157` | Constant | Order content code 157 — IPV6 termination (IPV6解約) |
| `ODR_NAIYO_CD_158` | Constant | Order content code 158 — IPV6 deletion (IPV6消去) |
| `ODR_NAIYO_CD_163` | Constant | Order content code 163 — Router connection information change (ルーター接続情報変更) |
| HAKKOSODCCWORKMAP | Field | Work map for order issuance SOD CC processing — holds temporary data during the order creation workflow |
| SOD | Acronym | Service Order Data — the core entity representing an order issuance in the K-Opticom order fulfillment system |
| SC | Acronym | Service Component — a service layer module (e.g., EKK0351A010SC) that encapsulates business logic and database access |
| CBS | Acronym | CBS (Central Business System) — the core business processing engine in the K-Opticom system architecture |
| CC | Acronym | CC (Common Component / Control Class) — shared utility and coordination classes used across multiple screens and workflows |
| FTTH | Business term | Fiber To The Home — fiber-optic broadband internet service offered by K-Opticom |
| 同意照会 (Doui Shoukai) | Japanese term | Agreement consent inquiry — a CBS operation that retrieves current service agreement details for verification purposes |
| EKK0351A010SC | SC Code | Optional service agreement agreement consent inquiry SC — queries KK_T_OP_SVC_KEI (optional service agreement table) |
| EKK0341A010SC | SC Code | Equipment-provided service agreement agreement consent inquiry SC — queries KK_T_KKT_SVC_KEI (equipment-provided service table) |
| EKK0081A010SC | SC Code | Service agreement agreement consent inquiry SC — queries KK_T_SVC_KEI (main service agreement table) |
| KK_T_OP_SVC_KEI | DB | Optional service agreement table — stores optional/add-on service subscription records |
| KK_T_KKT_SVC_KEI | DB | Equipment-provided service agreement table — stores equipment-bundled service subscription records |
| KK_T_SVC_KEI | DB | Service agreement table — stores main FTTH service contract records |
| KK_T_ODR_HAKKO | DB | Order issuance table — stores order creation (SOD) records |
| KKTK_SVC_CD_BBR | Constant | Equipment-provided service code for BBR — identifies the BB Router service type (commented out in current code) |
| B015 | Scenario code | Multi-selection scenario — termination handling for multi-section add-on services |
| B020 | Scenario code | Duplex access scenario — termination handling for dial-up duplex access |
| B070 | Scenario code | IPV6 scenario — termination handling for IPV6 connectivity |
| C014 | Scenario code | BBR scenario — termination handling for BB Router service |
| マンションプライト | Business term | Mansion private — a building classification where the building owner holds the master service contract and individual units are sub-contractees (pricing codes A47, A48, A49) |
| 同一処理番号 (Daiichi Shori Bangou) | Japanese term | Same process number — a shared transaction ID that groups related order operations (e.g., termination + deletion + new registration) into a single batch |
| 利用場所変更 (Riyoubasho Henkou) | Japanese term | Usage location change — the business process of changing a customer's registered address while migrating their FTTH service from the old address to the new one |
| 住所変更登録 (Juusho Henkou Touroku) | Japanese term | Address change registration — the triggering event that causes this order control flow to execute |
| FUNC_CODE_1 | Constant | Function code "1" — indicates agreement consent inquiry (同意照会) mode for SC calls |
| isMansionPrvate() | Method | Mansion private check — determines whether the customer is in a mansion private building, which affects pricing and service handling |
| shkkaMap() | Method | Deep copy utility — creates a defensive copy of a HashMap to prevent unintended mutation of input data |
