# Business Logic — JKKKyoseiDslRunCC.executeKyoseiDslProc() [334 LOC]

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

## 1. Role

### JKKKyoseiDslRunCC.executeKyoseiDslProc()

This method implements the core forced cancellation (強制解約) business process for K-Opticom telecommunications service contracts. It orchestrates the end-to-end forced termination of a customer's service agreements, handling multiple contract types within a single invocation. The method implements a **pipeline/delegation pattern**: it performs initial validation, queries related data (charge prefixes, mansion info), dispatches type-specific cancellation operations (service, option, sub-option, equipment-provided, invoice option), executes ONU/terminal cancellation on the network side, registers instruction/notice data (指示書) for downstream processing, invokes customer exit procedures, and sends service control management cancellation requests.

The method serves as the **shared entry point** called from `executeKyoseiDsl()` within `JKKKyoseiDslRunCC` — it is the central orchestrator for the forced DSL cancellation batch job. It handles conditional branches based on billing group codes (prc_grp_cd) to skip processing for specific service types such as mansion parent contracts, au/minne (MINEO) billing group, and electric power services. A possibility check (`kyoseiDslFukaCheck`) acts as a filter to prevent cancellation of contracts that cannot be forcibly terminated. The method returns 0 on success (normal or skipped processing) or a non-zero error code when any called operation fails.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["executeKyoseiDslProc start"])
    
    START --> INIT["Initialize local variables"]
    
    INIT --> GET_SVC["Get prm_svc_kei_no from requestParam"]
    
    GET_SVC --> CHECK_SVC{"prm_svc_kei_no is null or empty?"}
    
    CHECK_SVC -->|Yes| EARLY_RET1["Return 0 - no service contract"]
    
    EARLY_RET1 --> END_RET1(["Return early"])
    
    CHECK_SVC -->|No| CALL_0081["callEKK0081A010SC: Service Agreement Consultation"]
    
    CALL_0081 --> CHECK_STATUS1{"statusCode != 0?"}
    
    CHECK_STATUS1 -->|Yes| EARLY_RET2["Return statusCode"]
    
    CHECK_STATUS1 -->|No| GET_RESULT["Get eKK0081A010Hash from resultHash"]
    
    GET_RESULT --> GET_PRC["Get prc_grp_cd from eKK0081A010Hash"]
    
    GET_PRC --> CHECK_MANSION{"prc_grp_cd is 99?"}
    
    CHECK_MANSION -->|Yes| RETURN_MANSION["Return 0 - Mansion parent skip"]
    
    CHECK_MANSION -->|No| CHECK_MINEO{"prc_grp_cd is 51?"}
    
    CHECK_MINEO -->|Yes| RETURN_MINEO["Return 0 - au minne billing skip"]
    
    CHECK_MINEO -->|No| CHECK_EODENKI{"prc_grp_cd is 17?"}
    
    CHECK_EODENKI -->|Yes| RETURN_EODENKI["Return 0 - Electric power skip"]
    
    CHECK_EODENKI -->|No| CHECK_FUKA["kyoseiDslFukaCheck: Forced cancellation possibility"]
    
    CHECK_FUKA --> FUKA_TRUE{"Fuka check returned true?"}
    
    FUKA_TRUE -->|Yes| SET_FUKA["wk_Fuka_flg = true; Return 0"]
    
    FUKA_TRUE -->|No| RUN_HICHRG["runHiChrgJdgUtil: Overcharge decision for service"]
    
    SET_FUKA --> END_FUKA(["Return 0"])
    
    RUN_HICHRG --> CALL_B002["callEKK0321B002SC: Charge-prefix list query"]
    
    CALL_B002 --> CHECK_STATUS_B002{"statusCode != 0?"}
    
    CHECK_STATUS_B002 -->|Yes| EARLY_RET3["Return statusCode"]
    
    CHECK_STATUS_B002 -->|No| CALL_B002_861["callEKK0861B002SC: Mansion info list query"]
    
    CALL_B002_861 --> CHECK_STATUS_861{"statusCode != 0?"}
    
    CHECK_STATUS_861 -->|Yes| EARLY_RET4["Return statusCode"]
    
    CHECK_STATUS_861 -->|No| LOOP_START["Loop over eKK0321B002HashList"]
    
    LOOP_START --> LOOP_SVC{"svc_kei_no present?"}
    
    LOOP_SVC -->|Yes| CALL_SVCDSL["svcKei_KyoseiDsl: Service forced cancellation"]
    
    LOOP_SVC -->|No| LOOP_OP_SVC{"op_svc_kei_no present and sbop absent?"}
    
    CALL_SVCDSL --> CALL_OPDSL{"opSvcKei_KyoseiDsl"}
    
    CALL_OPDSL --> SBOP_CHECK{"sbop_svc_kei_no present?"}
    
    SBOP_CHECK -->|Yes| CALL_SBOPDSL["sbOpSvcKei_KyoseiDsl: Sub-option forced cancellation"]
    
    SBOP_CHECK -->|No| KKTK_CHECK{"kktk_svc_kei_no present?"}
    
    CALL_SBOPDSL --> KKTK_CHECK
    
    KKTK_CHECK -->|Yes| CALL_KKTKDSL["kktkSvcKei_KyoseiDsl: Equipment-provided forced cancellation"]
    
    KKTK_CHECK -->|No| SEIOP_CHECK{"seiop_svc_kei_no present?"}
    
    CALL_KKTKDSL --> SEIOP_CHECK
    
    SEIOP_CHECK -->|Yes| COLLECT_SEIOP["Add seiop_svc_kei_no to seiop_svc_kei_no_list"]
    
    SEIOP_CHECK -->|No| NEXT_LOOP_ITEM{More items?}
    
    COLLECT_SEIOP --> NEXT_LOOP_ITEM
    
    NEXT_LOOP_ITEM -->|Yes| LOOP_START
    
    NEXT_LOOP_ITEM -->|No| DSL_TRGT["dslTrgtByKaisuckw: ONU cancellation or cancel"]
    
    DSL_TRGT --> NET_CHECK{"svc_cd is 01 and seiop list has items?"}
    
    NET_CHECK -->|No| PRE_INSTR["Set AxM linkage data"]
    
    NET_CHECK -->|Yes| CALL_SEIKYU["callSEIKYUSC: Invoice service list query"]
    
    CALL_SEIKYU --> CHECK_STATUS_SEIKYU{"statusCode != 0?"}
    
    CHECK_STATUS_SEIKYU -->|Yes| EARLY_RET5["Return statusCode"]
    
    CHECK_STATUS_SEIKYU -->|No| CHECK_SEIKYU_STAT["Check all eKK0081B526 SVC_KEI_STAT is 910 or 930"]
    
    CHECK_SEIKYU_STAT --> B_FLG_TRUE{"All stats are 910 or 930?"}
    
    B_FLG_TRUE -->|No| SKIP_SEIOP["Skip seiop cancellation"]
    
    B_FLG_TRUE -->|Yes| SEIOP_LOOP["Loop over seiop_svc_kei_no_list"]
    
    SEIOP_LOOP --> SEIOP_CALL["seiOpSvcKei_KyoseiDsl for each seiop_svc_kei_no"]
    
    SEIOP_CALL --> SEIOP_STATUS{"statusCode != 0?"}
    
    SEIOP_STATUS -->|Yes| EARLY_RET_SEIOP["Return statusCode"]
    
    SEIOP_STATUS -->|No| SEIOP_NEXT{More seiop items?}
    
    SEIOP_NEXT -->|Yes| SEIOP_CALL
    
    SEIOP_NEXT -->|No| PRE_INSTR
    
    SKIP_SEIOP --> PRE_INSTR
    
    PRE_INSTR --> CALL_CUS["callCusTaikaiCmnKino: Customer exit common info"]
    
    CALL_CUS --> CALL_SVCCTL["svcCtlKyoKaiReq: Service control forced cancellation request"]
    
    CALL_SVCCTL --> CHECK_STATUS_SVCCTL{"statusCode != 0?"}
    
    CHECK_STATUS_SVCCTL -->|Yes| EARLY_RET_SVCCTL["Return statusCode"]
    
    CHECK_STATUS_SVCCTL -->|No| ADD_SJISHO["JKKAddSjishoCC.addSjisho: Register instructions"]
    
    ADD_SJISHO --> CHECK_NET_MINEO{"prc_grp_cd is 02 or 03 or 04?"}
    
    CHECK_NET_MINEO -->|Yes| ADD_NET_LIST["Add svc_kei_no to netKaiTaiLst"]
    
    ADD_NET_LIST --> END_PROC(["Return 0 - normal completion"])
    
    CHECK_NET_MINEO -->|No| END_PROC
    
    EARLY_RET1 --> END_RET1
    EARLY_RET2 --> END_RET2(["Return error code"])
    EARLY_RET3 --> END_RET2
    EARLY_RET4 --> END_RET2
    EARLY_RET5 --> END_RET2
    EARLY_RET_SEIOP --> END_RET2
    EARLY_RET_SVCCTL --> END_RET2
    RETURN_MANSION --> END_RET1
    RETURN_MINEO --> END_RET1
    RETURN_EODENKI --> END_RET1
    SET_FUKA --> END_FUKA
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `handle` | `SessionHandle` | Session handle carrying session management context used by database and service component calls. Used throughout to maintain transaction and connection state. |
| 2 | `param` | `IRequestParameterReadWrite` | Request parameter object containing the model group and control map. Used to read/write request data, set linkage instruction data (AxM連携情報), and pass through to called service methods. |
| 3 | `requestParam` | `HashMap<String, Object>` | Request parameter map carrying business keys including `svc_kei_no` (service contract number), `seiop_svc_kei_no` (invoice option service contract number), and other dynamic parameters used by called methods. |
| 4 | `fixedText` | `String` | User-defined arbitrary string (ユーザ任意文字列) — a custom text field attached to the forced cancellation processing, passed through to service control and cancellation methods for traceability. |
| 5 | `kksv016701CC` | `HashMap<String, Object>` | Forced cancellation map (強制解約マップ) — context data populated by the pre-screen component (KKSV016701CC) containing forced cancellation eligibility information. Read but not directly modified by this method. |
| 6 | `fukaKaiTaiLst` | `ArrayList<HashMap<String, Object>>` | Forced cancellation exclusion list (強制解約不可リスト) — a list of service contracts that cannot be forcibly terminated (e.g., under dispute, active payment plan). Used by `kyoseiDslFukaCheck()` to filter out ineligible contracts. |
| 7 | `netKaiTaiLst` | `ArrayList<HashMap<String, String>>` | Network cancellation list (回線解約リスト) — populated at the end of this method with service contract numbers for internet service contracts matching specific billing group codes (02, 03, 04). Passed to callers for subsequent ONU/terminal management. |

**Instance fields read by this method:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `wk_Fuka_flg` | `boolean` | Processing result flag (処理結果フラグ) — set to `true` when a contract is found to be ineligible for forced cancellation. |
| `svcKeiUpdDtm` | `String` | Service contract update date-time (サービス契約更新年月日时分秒) — populated from the last update timestamp of the service agreement consultation result. |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `callEKK0081A010SC` | EKK0081A010SC | KK_T_SVC_KEI (implied) | Reads service agreement details — service contract number, status, billing group code, service code, SYSID, update timestamp |
| R | `callEKK0321B002SC` | EKK0321B002SC | KK_T_KAKINS (implied) | Reads charge-prefix (課金先) list — retrieves list of charge-prefix entries for the service contract |
| R | `callEKK0861B002SC` | EKK0861B002SC | KK_T_MANSION_INFO (implied) | Reads mansion (マンション) information list — retrieves mansion details associated with the service contract |
| R | `callEKK0321A010SC` | EKK0321A010SC | KK_T_SVC_KEI_ISP (implied) | Reads charge-prefix agreement details — contract number, service contract number, option service contract number, sub-option, equipment-provided service contract number, invoice option service contract number |
| R | `callSEIKYUSC` | EKK0081B526SC | KK_T_SVC_KEI (implied) | Reads invoice option service (請求オプションサービス) list — retrieves invoice option service contracts with their status |
| C | `runHiChrgJdgUtil` | (Utility) | - | Executes overcharge decision utility for service contract line items (非課金判定 utility) |
| C | `svcKei_KyoseiDsl` | (Internal) | - | Service contract forced cancellation processing — processes the core service agreement termination |
| C | `opSvcKei_KyoseiDsl` | (Internal) | - | Option service contract forced cancellation processing |
| C | `sbOpSvcKei_KyoseiDsl` | (Internal) | - | Sub-option service contract forced cancellation processing |
| C | `kktkSvcKei_KyoseiDsl` | (Internal) | - | Equipment-provided service contract forced cancellation processing |
| C | `seiOpSvcKei_KyoseiDsl` | (Internal) | - | Invoice option service contract cancellation processing |
| - | `dslTrgtByKaisuckw` | (Internal) | - | ONU (Optical Network Unit) cancellation or cancel processing on the network side (回線に繋がっている機器ONUの解約orキャンセル) |
| - | `kyoseiDslFukaCheck` | (Internal) | - | Forced cancellation possibility check — determines whether any contracts in the exclusion list make forced cancellation impossible |
| - | `callCusTaikaiCmnKino` | (Internal) | - | Customer exit common information processing (お客様退会共用情報) — handles post-cancellation customer exit procedures |
| C | `svcCtlKyoKaiReq` | (Internal) | - | Service control management forced cancellation request (サービス制御管理S強制解約要求処理) |
| - | `JKKBpCommon.putAxMRenkeiDataKbn` | JKKBpCommon | AxM linkage data | Updates AxM (AxM連携情報) linkage data — sets linkage category 02 (回線契約にかかるサービス契約番号とSYSIDとの紐付け情報) with TRN_KBN_UPD |
| - | `JKKBpCommon.putAxMRenkeiDataKbn07` | JKKBpCommon | AxM linkage data | Sets AxM linkage data category 07 (回線契約に紐づく各種サービス契約の情報) with TRN_KBN_DEL |
| C | `JKKAddSjishoCC.addSjisho` | JKKAddSjishoCC | KK_T_SJISHO (指示書) | Registers instruction data (指示書登録) — creates instruction/notice records for downstream processing |

### How CRUs are classified:

- **Reads (R)**: Methods prefixed with `callEKK...SC` are service component invocations that query data from the database.
- **Creates (C)**: Methods with `*KyoseiDsl`, `addSjisho`, `*Req` suffixes perform write operations — cancelling services, creating instructions, sending requests.
- **Utility/Processing (-)**: Internal methods that coordinate data flow without direct DB access.

## 5. Dependency Trace

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

No screen/batch entry points found within 8 hops. Direct callers found: 1 method.

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Caller: `JKKKyoseiDslRunCC.executeKyoseiDsl()` | `executeKyoseiDsl()` -> `executeKyoseiDslProc(handle, param, requestParam, fixedText, kksv016701CC, fukaKaiTaiLst, netKaiTaiLst)` | `addSjisho [C] KK_T_SJISHO`, `svcKei_KyoseiDsl [C] KK_T_SVC_KEI`, `opSvcKei_KyoseiDsl [C] KK_T_OP_SVC_KEI`, `sbOpSvcKei_KyoseiDsl [C] KK_T_SBOP_SVC_KEI`, `kktkSvcKei_KyoseiDsl [C] KK_T_KKTK_SVC_KEI`, `seiOpSvcKei_KyoseiDsl [C] KK_T_SEIOP_SVC_KEI`, `svcCtlKyoKaiReq [C] KK_T_SVC_CTL`, `callEKK0081A010SC [R] KK_T_SVC_KEI`, `callEKK0321B002SC [R] KK_T_KAKINS`, `callEKK0321A010SC [R] KK_T_SVC_KEI_ISP`, `callEKK0861B002SC [R] KK_T_MANSION`, `callSEIKYUSC [R] KK_T_SVC_KEI`, `putAxMRenkeiDataKbn [C] AxM_LINKAGE_DATA`, `putAxMRenkeiDataKbn07 [C] AxM_LINKAGE_DATA`, `callCusTaikaiCmnKino [-] CUSTOMER_EXIT_INFO`, `dslTrgtByKaisuckw [-] KK_T_OPU_EQUIP` |

**Notes:**
- This method is a private implementation detail called only from `executeKyoseiDsl()` within the same class `JKKKyoseiDslRunCC`.
- The actual screen/batch entry point is external to this file — typically a batch job (強制解約バッチ実行) scheduled for forced cancellations.
- Terminal operations span service cancellation (C), data queries (R), linkage data updates (C), instruction registration (C), and customer exit processing.

## 6. Per-Branch Detail Blocks

**Block 1** — [SET] `(initialize local variables)` (L1136)

The method initializes three local variables and reads the service contract number from the request parameter.

| # | Type | Code |
|---|------|------|
| 1 | SET | `resultHash = new HashMap<String, Object>()` |
| 2 | SET | `eKK0321B002HashList = null` |
| 3 | SET | `statusCode = 0` |
| 4 | SET | `prm_svc_kei_no = (String) requestParam.get(SVC_KEI_NO)` |

**Block 2** — [IF] `(prm_svc_kei_no is null or empty)` (L1140)

Early return when no service contract number exists — skips all processing.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `"".equals(prm_svc_kei_no)` — null check combined with empty string check |
| 2 | RETURN | `return 0` — return early, no processing |

**Block 3** — [CALL + IF] `(callEKK0081A010SC: Service Agreement Consultation)` (L1146)

Invokes the service agreement consultation SC (EKK0081A010SC) to retrieve the current service contract details.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `statusCode = callEKK0081A010SC(param, handle, requestParam, resultHash)` |
| 2 | IF | `if (statusCode != 0)` — error check on consultation result |

**Block 3.1** — [IF] `(statusCode != 0 — error from EKK0081A010SC)` (L1148)

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return statusCode` — propagate error code |

**Block 3.2** — [IF] `(statusCode == 0 — success)` (L1148)

| # | Type | Code |
|---|------|------|
| 1 | SET | `eKK0081A010Hash = (HashMap<String, Object>) resultHash.get(TEMPLATE_ID_EKK0081A010)` — extract consultation result |
| 2 | SET | `prc_grp_cd = (String) eKK0081A010Hash.get(EKK0081A010CBSMsg1List.PRC_GRP_CD)` — extract billing group code |

**Block 4** — [IF] `(prc_grp_cd == PRC_GRP_CD_MANSION_OYA = "99")` (L1153)

Mansion parent contract skip. If the billing group code is "99" (mansion parent/collective contract), the method returns immediately without further processing. This prevents forced cancellation on mansion parent contracts, which require special handling.

| # | Type | Code |
|---|------|------|
| 1 | IF | `PRC_GRP_CD_MANSION_OYA.equals(prc_grp_cd)` |
| 2 | RETURN | `return 0` |

**Constant Resolution:**
- `PRC_GRP_CD_MANSION_OYA = "99"` — Billing group code for mansion parent (collective) contracts

**Block 5** — [IF] `(prc_grp_cd == PRC_GRP_CD_MINEO = "51")` (L1160)

au/minne billing group skip. If the billing group code is "51", processing is skipped. This handles the au/minne (MINEO) MVNO service billing arrangement.

| # | Type | Code |
|---|------|------|
| 1 | IF | `PRC_GRP_CD_MINEO.equals(prc_grp_cd)` |
| 2 | RETURN | `return 0` |

**Constant Resolution:**
- `PRC_GRP_CD_MINEO = "51"` — Billing group code for au/minne (MINEO) MVNO service

**Block 6** — [IF] `(prc_grp_cd == PRC_GRP_CD_EODENKI = "17")` (L1170)

Electric power service skip. If the billing group code is "17", processing is skipped. Added for electric power対応 (New electric power service) support.

| # | Type | Code |
|---|------|------|
| 1 | IF | `PRC_GRP_CD_EODENKI.equals(prc_grp_cd)` |
| 2 | RETURN | `return 0` |

**Constant Resolution:**
- `PRC_GRP_CD_EODENKI = "17"` — Billing group code for electric power service

**Block 7** — [CALL + IF] `(kyoseiDslFukaCheck: Forced cancellation possibility)` (L1178)

Calls the forced cancellation possibility check utility. If any contract in the exclusion list (`fukaKaiTaiLst`) prevents forced cancellation, the method sets the flag and returns 0.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `kyoseiDslFukaCheck(fukaKaiTaiLst, requestParam, resultHash)` — returns boolean |
| 2 | IF | `if (kyoseiDslFukaCheck(...))` — true means cancellation is NOT possible |

**Block 7.1** — [IF] `(Fuka check returned true)` (L1178)

| # | Type | Code |
|---|------|------|
| 1 | SET | `wk_Fuka_flg = true` — set the processing result flag |
| 2 | RETURN | `return 0` — return normally, no cancellation executed |

**Block 7.2** — [ELSE] `(Fuka check returned false — cancellation is possible)` (L1178)

Proceed with processing. Set the service contract update timestamp and call the overcharge decision utility.

| # | Type | Code |
|---|------|------|
| 1 | SET | `this.svcKeiUpdDtm = (String) eKK0081A010Hash.get(EKK0081A010CBSMsg1List.LAST_UPD_DTM)` |
| 2 | CALL | `jdgHiChrgMapSvcKei = runHiChrgJdgUtil(handle, param, requestParam, resultHash, eKK0081A010Hash, null, null, null, DSL_SBT_FLG_SVC_KEI_DSL)` |

**Constant Resolution:**
- `DSL_SBT_FLG_SVC_KEI_DSL = "1"` — DSL sub-type flag for service contract DSL processing

**Block 8** — [CALL + IF] `(callEKK0321B002SC: Charge-prefix list query)` (L1196)

Reads the charge-prefix (課金先) list for the service contract number.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `statusCode = callEKK0321B002SC(param, handle, requestParam, resultHash)` |
| 2 | IF | `if (statusCode != 0)` |

**Block 8.1** — [IF] `(statusCode != 0)` (L1198)

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

**Block 9** — [CALL + IF] `(callEKK0861B002SC: Mansion info list query)` (L1205)

Reads mansion (マンション) information list.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `statusCode = callEKK0861B002SC(param, handle, requestParam, resultHash)` |
| 2 | IF | `if (statusCode != 0)` |

**Block 9.1** — [IF] `(statusCode != 0)` (L1207)

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

**Block 10** — [FOR] `(Loop over eKK0321B002HashList — charge-prefix entries)` (L1217)

Iterates over each charge-prefix entry. For each entry, reads contract numbers for different service types and dispatches type-specific forced cancellation processing.

| # | Type | Code |
|---|------|------|
| 1 | SET | `eKK0321B002HashList = (ArrayList<HashMap<String, Object>>) resultHash.get(TEMPLATE_ID_EKK0321B002)` |
| 2 | SET | `seiop_svc_kei_no_list = new ArrayList<String>()` — initialize invoice option list |
| 3 | SET | `eKK0321B002Hash = eKK0321B002HashList.get(i)` |
| 4 | CALL | `statusCode = callEKK0321A010SC(param, handle, eKK0321B002Hash, resultHash)` — charge-prefix agreement consultation |
| 5 | IF | `if (statusCode != 0)` — error check |
| 6 | SET | `eKK0321A010Hash = (HashMap<String, Object>) resultHash.get(TEMPLATE_ID_EKK0321A010)` |
| 7 | IF | `if (eKK0321A010Hash == null) continue` — skip if no result |
| 8 | SET | `svc_kei_no = (String) eKK0321A010Hash.get(EKK0321A010CBSMsg1List.SVC_KEI_NO)` |
| 9 | SET | `kktk_svc_kei_no = (String) eKK0321A010Hash.get(EKK0321A010CBSMsg1List.KKTK_SVC_KEI_NO)` |
| 10 | SET | `op_svc_kei_no = (String) eKK0321A010Hash.get(EKK0321A010CBSMsg1List.OP_SVC_KEI_NO)` |
| 11 | SET | `sbop_svc_kei_no = (String) eKK0321A010Hash.get(EKK0321A010CBSMsg1List.SBOP_SVC_KEI_NO)` |
| 12 | SET | `seiop_svc_kei_no = (String) eKK0321A010Hash.get(EKK0321A010CBSMsg1List.SEIOPSVC_KEI_NO)` |

**Block 10.1** — [IF] `(svc_kei_no is not null and not empty)` (L1252)

Service contract forced cancellation processing for the main service agreement.

| # | Type | Code |
|---|------|------|
| 1 | IF | `svc_kei_no != null && !"".equals(svc_kei_no)` |
| 2 | CALL | `statusCode = svcKei_KyoseiDsl(handle, param, requestParam, resultHash)` |
| 3 | IF | `if (statusCode != 0)` → `return statusCode` |

**Block 10.2** — [IF] `(op_svc_kei_no is present AND sbop_svc_kei_no is absent)` (L1263)

Option service contract forced cancellation. Only processes when an option service contract exists but no sub-option contract exists (mutual exclusivity logic).

| # | Type | Code |
|---|------|------|
| 1 | IF | `(op_svc_kei_no != null && !"".equals(op_svc_kei_no)) && (sbop_svc_kei_no == null || "".equals(sbop_svc_kei_no))` |
| 2 | CALL | `statusCode = opSvcKei_KyoseiDsl(handle, param, requestParam, resultHash, jdgHiChrgMapSvcKei)` |
| 3 | IF | `if (statusCode != 0)` → `return statusCode` |

**Block 10.3** — [IF] `(sbop_svc_kei_no is not null and not empty)` (L1277)

Sub-option service contract forced cancellation processing.

| # | Type | Code |
|---|------|------|
| 1 | IF | `sbop_svc_kei_no != null && !"".equals(sbop_svc_kei_no)` |
| 2 | CALL | `statusCode = sbOpSvcKei_KyoseiDsl(handle, param, requestParam, resultHash, jdgHiChrgMapSvcKei)` |
| 3 | IF | `if (statusCode != 0)` → `return statusCode` |

**Block 10.4** — [IF] `(kktk_svc_kei_no is not null and not empty)` (L1288)

Equipment-provided service contract forced cancellation processing (e.g., router/set-top box rental contracts).

| # | Type | Code |
|---|------|------|
| 1 | IF | `kktk_svc_kei_no != null && !"".equals(kktk_svc_kei_no)` |
| 2 | CALL | `statusCode = kktkSvcKei_KyoseiDsl(handle, param, requestParam, resultHash, fixedText)` |
| 3 | IF | `if (statusCode != 0)` → `return statusCode` |

**Block 10.5** — [IF] `(seiop_svc_kei_no is not null and not empty)` (L1300)

Collects invoice option service contract numbers for later processing. These are processed separately after the main loop based on service code and status checks.

| # | Type | Code |
|---|------|------|
| 1 | IF | `seiop_svc_kei_no != null && !"".equals(seiop_svc_kei_no)` |
| 2 | EXEC | `seiop_svc_kei_no_list.add(seiop_svc_kei_no)` |

**Block 11** — [CALL] `(dslTrgtByKaisuckw: ONU cancellation/cancel)` (L1309)

Executes ONU (Optical Network Unit) cancellation or cancel processing for network-side equipment. This handles the case where the charge-prefix differs.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `dslTrgtByKaisuckw(handle, param, requestParam, resultHash)` |

**Block 12** — [IF] `(Internet service with invoice option contracts)` (L1314)

For internet service contracts (`svc_cd == "01"`) that have invoice option service contracts, this block queries the invoice service list, validates statuses, and executes invoice option cancellations.

| # | Type | Code |
|---|------|------|
| 1 | SET | `svc_cd = (String) eKK0081A010Hash.get(EKK0081A010CBSMsg1List.SVC_CD)` |
| 2 | IF | `svc_cd.equals(SVC_CD_NET) && seiop_svc_kei_no_list.size() > 0` |
| 3 | CALL | `statusCode = callSEIKYUSC(param, handle, requestParam, resultHash, TEMPLATE_ID_EKK0081B526)` — invoice service list query |
| 4 | IF | `if (statusCode != 0)` → `return statusCode` |
| 5 | SET | `eKK0081B526HashList = (ArrayList<HashMap<String, Object>>) resultHash.get(TEMPLATE_ID_EKK0081B526)` |
| 6 | SET | `bSeikyuOpDslFlg = true` — flag for "invoice option cancellation possible" |

**Block 12.1** — [FOR] `(Check status of each eKK0081B526Hash entry)` (L1319)

Validates that all invoice option service contracts have status "cancelled" (910) or "cancel completed" (930). If any have a different status, the flag is set to false.

| # | Type | Code |
|---|------|------|
| 1 | SET | `eKK0081B526Hash = eKK0081B526HashList.get(i)` |
| 2 | SET | `svc_kei_stat = (String) eKK0081B526Hash.get(EKK0081B526CBSMsg1List.SVC_KEI_STAT)` |
| 3 | IF | `!svc_kei_stat.equals(SVC_KEI_STAT_DSL) && !svc_kei_stat.equals(SVC_KEI_STAT_CNCL)` |
| 4 | SET | `bSeikyuOpDslFlg = false; break` |
| 5 | IF | `if (bSeikyuOpDslFlg)` — all stats valid |

**Block 12.2** — [FOR] `(Loop over seiop_svc_kei_no_list)` (L1329)

For each collected invoice option service contract number, sets it in requestParam and executes the invoice option forced cancellation.

| # | Type | Code |
|---|------|------|
| 1 | SET | `requestParam.put(SEIOP_SVC_KEI_NO, seiop_svc_kei_no_list.get(i))` |
| 2 | CALL | `statusCode = seiOpSvcKei_KyoseiDsl(handle, param, requestParam, resultHash)` |
| 3 | IF | `if (statusCode != 0)` → `return statusCode` |

**Constant Resolution:**
- `SVC_CD_NET = "01"` — Service code for Internet service
- `SVC_KEI_STAT_DSL = "910"` — Service contract status: DSL cancelled (解約済)
- `SVC_KEI_STAT_CNCL = "930"` — Service contract status: Cancel completed (キャンセル済)
- `SEIOP_SVC_KEI_NO = "seiop_svc_kei_no"` — Key name for invoice option service contract number in maps
- `TEMPLATE_ID_EKK0081A010 = "EKK0081A010"` — Template identifier for service agreement consultation result
- `TEMPLATE_ID_EKK0321B002 = "EKK0321B002"` — Template identifier for charge-prefix list result
- `TEMPLATE_ID_EKK0321A010 = "EKK0321A010"` — Template identifier for charge-prefix agreement result
- `TEMPLATE_ID_EKK0081B526 = "EKK0081B526"` — Template identifier for invoice service list result

**Block 13** — [CALL] `(AxM linkage data — category 07: Delete)` (L1345)

Sets AxM (AxM連携情報) linkage data category 07 for delete processing. Category 07 stores "various service contract information linked to the line contract" (回線契約に紐づく各種サービス契約の情報). Uses TRN_KBN_DEL ("03") to indicate deletion.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `JKKBpCommon.putAxMRenkeiDataKbn07(param, JKKDslRunConstCC.SJISHO_MAP, JKKAddSjishoConst.TRN_KBN_DEL, new String[]{svc_kei_no}, "料金グループ番号?")` |

**Constant Resolution:**
- `TRN_KBN_DEL = "03"` — Transaction type: Delete
- `SJISHO_MAP = "KKSV019502CC"` — Instruction map identifier

**Block 14** — [CALL] `(AxM linkage data — category 02: Update)` (L1356)

Sets AxM linkage data category 02 for update processing. Category 02 stores "linkage information between service contract numbers and SYSID related to the line contract" (回線契約にかかるサービス契約番号とSYSIDとの紐付け情報). Uses TRN_KBN_UPD ("02") to indicate update (needed because service contract state changes).

| # | Type | Code |
|---|------|------|
| 1 | CALL | `JKKBpCommon.putAxMRenkeiDataKbn(param, JKKDslRunConstCC.SJISHO_MAP, JKKAddSjishoConst.RENKEI_DATA_KBN_SYSID, JKKAddSjishoConst.TRN_KBN_UPD, new String[]{svc_kei_no}, "")` |

**Constant Resolution:**
- `TRN_KBN_UPD = "02"` — Transaction type: Update
- `RENKEI_DATA_KBN_SYSID = "02"` — Linkage data category: SYSID linkage

**Block 15** — [CALL] `(callCusTaikaiCmnKino: Customer exit common info)` (L1370)

Invokes customer exit common information processing for post-customer-exit procedures. Handles cases where the master customer has not become an open customer after forced cancellation of a migrated member.

| # | Type | Code |
|---|------|------|
| 1 | SET | `sysid = (String) eKK0081A010Hash.get(EKK0081A010CBSMsg1List.SYSID)` |
| 2 | CALL | `callCusTaikaiCmnKino(handle, param, sysid, prm_svc_kei_no)` |

**Block 16** — [CALL + IF] `(svcCtlKyoKaiReq: Service control forced cancellation request)` (L1381)

Executes the service control management system forced cancellation request. This is the request sent to the service control system to notify it of the forced cancellation.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `statusCode = svcCtlKyoKaiReq(handle, param, requestParam, resultHash, fixedText)` |
| 2 | IF | `if (statusCode != 0)` → `return statusCode` |

**Block 17** — [CALL] `(JKKAddSjishoCC.addSjisho: Register instructions)` (L1392)

Registers the instruction data (指示書) by calling the `addSjisho` method of `JKKAddSjishoCC`. Creates instruction/notice records for downstream processing.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `(new JKKAddSjishoCC()).addSjisho(handle, param, JKKDslRunConstCC.SJISHO_MAP)` |

**Block 18** — [IF] `(prc_grp_cd is 02 or 03 or 04 — net service billing groups)` (L1400)

For internet service contracts where the billing group code is "02", "03", or "04" (corresponding to JKKStrConst.CD00133_02, CD00133_03, CD00133_04), adds the service contract number to the `netKaiTaiLst` for downstream network equipment cancellation processing. This replaced the original `SVC_CD_NET.equals(svc_cd)` check in an OM-2016-0001720 fix to properly determine by billing group instead of service code.

| # | Type | Code |
|---|------|------|
| 1 | IF | `JKKStrConst.CD00133_02.equals(prc_grp_cd) || JKKStrConst.CD00133_03.equals(prc_grp_cd) || JKKStrConst.CD00133_04.equals(prc_grp_cd)` |
| 2 | SET | `svcKeiNoMap = new HashMap<String, String>()` |
| 3 | EXEC | `svcKeiNoMap.put(EKK0081A010CBSMsg1List.SVC_KEI_NO, svc_kei_no)` |
| 4 | EXEC | `netKaiTaiLst.add(svcKeiNoMap)` |

**Constant Resolution:**
- `JKKStrConst.CD00133_02 = "02"` — Billing group code 02
- `JKKStrConst.CD00133_03 = "03"` — Billing group code 03
- `JKKStrConst.CD00133_04 = "04"` — Billing group code 04

**Block 19** — [RETURN] `(normal completion)` (L1410)

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return 0` — normal completion |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `executeKyoseiDslProc` | Method | Forced DSL cancellation main process — core business method for terminating service contracts |
| `kyosei` (強制) | Japanese | Forced — as in "kyousei kaiyaku" (強制解約) meaning forced cancellation/termination |
| `kaiyaku` (解約) | Japanese | Cancellation — termination of a service contract |
| `dsl` | Acronym | Digital Subscriber Line — the broadband service type being cancelled |
| `svc_kei_no` | Field | Service contract number — unique identifier for a service agreement |
| `prm_svc_kei_no` | Field | Parameter service contract number — the service contract number extracted from the request |
| `prc_grp_cd` | Field | Billing group code (料金グループコード) — classifies the billing arrangement type (mansion parent, MINEO, electric power, etc.) |
| `svc_cd` | Field | Service code (サービスコード) — identifies the type of service (e.g., "01" for Internet) |
| `svc_kei_stat` | Field | Service contract status (サービス契約ステータス) — current state of the service contract |
| `SVC_KEI_STAT_DSL` | Constant | Service contract status "910" — DSL cancelled (解約済) |
| `SVC_KEI_STAT_CNCL` | Constant | Service contract status "930" — Cancel completed (キャンセル済) |
| `PRC_GRP_CD_MANSION_OYA` | Constant | Billing group code "99" — Mansion parent (collective) contract |
| `PRC_GRP_CD_MINEO` | Constant | Billing group code "51" — au/minne (MINEO) MVNO billing group |
| `PRC_GRP_CD_EODENKI` | Constant | Billing group code "17" — Electric power service |
| `SVC_CD_NET` | Constant | Service code "01" — Internet service (IP network) |
| `kktk_svc_kei_no` | Field | Equipment-provided service contract number (機器提供サービス契約番号) — contract for equipment like routers/set-top boxes provided by K-Opticom |
| `op_svc_kei_no` | Field | Option service contract number (オプションサービス契約番号) — contract for optional services added to the main service |
| `sbop_svc_kei_no` | Field | Sub-option service contract number (サブオプションサービス契約番号) — secondary optional service contract |
| `seiop_svc_kei_no` | Field | Invoice option service contract number (請求オプションサービス契約番号) — option services that appear on the invoice separately |
| `kaki` (課金先) | Japanese | Charge prefix — a billing address/prefix under which multiple service contracts are grouped |
| `mansion` (マンション) | Japanese | Apartment building — refers to multi-unit dwelling service contracts |
| `jdgHiChrgMapSvcKei` | Field | Overcharge decision map for service (非課金判定マップサービス) — result from the overcharge decision utility |
| `DSL_SBT_FLG_SVC_KEI_DSL` | Constant | DSL sub-type flag "1" — indicates DSL service contract processing type |
| `dslTrgtByKaisuckw` | Method | DSL target by line — processes ONU equipment cancellation or cancel on the network side |
| `ONU` | Acronym | Optical Network Unit — fiber-optic termination equipment at the customer premise |
| `callCusTaikaiCmnKino` | Method | Customer exit common information — processes common data for customer departure/exit |
| `svcCtlKyoKaiReq` | Method | Service control management forced cancellation request — sends cancellation notification to the service control system |
| `SJISHO_MAP` | Constant | Instruction map identifier "KKSV019502CC" — map identifier for instruction/notice data |
| `TRN_KBN_DEL` | Constant | Transaction type "03" — Delete |
| `TRN_KBN_UPD` | Constant | Transaction type "02" — Update |
| `RENKEI_DATA_KBN_SYSID` | Constant | Linkage data category "02" — SYSID linkage category for AxM |
| `AxM` | Acronym | External linkage system — K-Opticom's downstream system for instruction/notice processing |
| `addSjisho` | Method | Register instruction — creates instruction/notice records (指示書登録) |
| `wk_Fuka_flg` | Field | Processing result flag (処理結果フラグ) — set true when a contract is ineligible for forced cancellation |
| `fukaKaiTaiLst` | Field | Forced cancellation exclusion list — contracts that cannot be forcibly terminated |
| `netKaiTaiLst` | Field | Network cancellation list — list of internet service contract numbers for network-side processing |
| `fixedText` | Field | User-defined arbitrary string — custom text passed through cancellation processing for traceability |
| `MINEO` | Business term | au/minne — NTT Docomo's MVNO (Mobile Virtual Network Operator) brand; in this context refers to the au/minne billing arrangement |
| `EODENKI` | Business term | Electric power (電気) — new electric power service business line |
| `TEMPLATE_ID_EKK0081A010` | Constant | Template identifier for service agreement consultation result |
| `TEMPLATE_ID_EKK0321B002` | Constant | Template identifier for charge-prefix list result |
| `TEMPLATE_ID_EKK0321A010` | Constant | Template identifier for charge-prefix agreement result |
| `TEMPLATE_ID_EKK0081B526` | Constant | Template identifier for invoice service list result |
