---
description: "Detailed design for JKKUseStpRlsRunCC.executeUseStpRlsMain"
---

# Business Logic -- JKKUseStpRlsRunCC.executeUseStpRlsMain() [308 LOC]

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

## 1. Role

### JKKUseStpRlsRunCC.executeUseStpRlsMain()

This method is the **main orchestration engine for "Use Suspension Removal" (利停止解除)** -- the business process of lifting a previously applied service suspension on a customer's subscription within the K-Opticom telecom billing and service management system. It performs a multi-step workflow: it first validates whether the removal is permissible, then iterates through all associated billing-level service contracts and individually lifts the suspension on each type (core service contracts, option services, sub-option services, and equipment-provisioned services).

The method handles **five distinct service type categories**: core service contracts (`svc_kei_no`), equipment-provisioned services (`kktk_svc_kei_no`), option services (`op_svc_kei_no`), sub-option services (`sbop_svc_kei_no`), and billing option services (`seiopsvc_kei_no`). Each category is dispatched to a dedicated sub-method that handles the specific business rules for that service type.

The method implements a **routing/dispatch pattern**: it reads the billing agreement details via SC `EKK0321A010`, extracts the relevant service contract numbers, and routes each to its appropriate handler based on whether the field is present and non-empty. It also implements a **gatekeeper pattern** at the top, performing early-exit checks: MiNEo and eo Electric price groups are excluded (no removal processing), non-removable conditions block the operation, and billing-level agreement checks verify the contract state.

In the larger system, this method serves as the **shared common component entry point** called by `JKKUseStpRlsRunCC.runUseStpRls()` -- the batch/scheduled processor that triggers use suspension removal across customer portfolios. It is responsible for updating the actual service state records in the telecom database to transition services from "suspended" back to "in-service."

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["executeUseStpRlsMain"]) --> INIT["Initialize statusCode=0<br/>resultHash, hakkoSODDataList,<br/>seiOpSvcKeiNoList"]
    INIT --> SET_FLG["Set SVC_KEI_USE_STP_RLS_EXEC_FLG = false"]
    SET_FLG --> GET_PRM["Get prm_svc_kei_no from requestParam"]
    GET_PRM --> SC1["getEKK0081A010SC<br/>Service Contract Consent"]

    SC1 --> CHECK1{statusCode != 0?}
    CHECK1 -->|"Yes"| ER1["Return statusCode"]
    CHECK1 -->|"No"| EXTRACT["Extract eKK0081A010Hash<br/>from resultHash"]
    EXTRACT --> GET_PRC["Get prc_grp_cd from hash"]

    GET_PRC --> CHECK_PRM{prc_grp_cd ==<br/>PRC_GRP_CD_MINEO<br/>51?}
    CHECK_PRM -->|"Yes"| RET0A["Return 0<br/>MiNEo - skip"]
    CHECK_PRM -->|"No"| CHECK_EOD{prc_grp_cd ==<br/>PRC_GRP_CD_EODENKI<br/>17?}
    CHECK_EOD -->|"Yes"| RET0B["Return 0<br/>eo Electric - skip"]
    CHECK_EOD -->|"No"| SC_MANAGE["getEKK0861B002SC<br/>Management Info"]

    SC_MANAGE --> CHECK2{statusCode != 0?}
    CHECK2 -->|"Yes"| ER2["Return statusCode"]
    CHECK2 -->|"No"| CHECK_FUKA["isUseStpFukaCheck<br/>Non-removable?"]

    CHECK_FUKA -->|"Yes"| SET_FUKA["Set wk_Fuka_flg = true<br/>Return 0"]
    CHECK_FUKA -->|"No"| SC_BILLING["getEKK0321B002SC<br/>Billing Advance Agreement"]

    SC_BILLING --> CHECK3{statusCode != 0?}
    CHECK3 -->|"Yes"| ER3["Return statusCode"]
    CHECK3 -->|"No"| CHECK_SIZE{eKK0321B002HashList.size == 0?}
    CHECK_SIZE -->|"Yes"| RET0C["Return 0 - no billing items"]
    CHECK_SIZE -->|"No"| GET_PREV["getUseStpBfSvcKeiStat<br/>Previous status"]

    GET_PREV --> LOOP["Loop billing items"]
    LOOP --> EXTRACT_BILL["Extract eKK0321A010Hash from result"]

    EXTRACT_BILL --> CHECK_NULL{eKK0321A010Hash == null?}
    CHECK_NULL -->|"Yes"| CONT["Continue to next"]
    CHECK_NULL -->|"No"| EXTRACT_FLD["Extract 5 service contract numbers"]

    EXTRACT_FLD --> CHECK_SVC{svc_kei_no != null<br/>and not empty?}
    CHECK_SVC -->|"Yes"| CAL_SVC["executeSvcKei_UseStp<br/>Service Contract<br/>Pause Removal"]
    CHECK_SVC -->|"No"| CHECK_OP

    CAL_SVC --> CHK_SVC_RC{statusCode != 0?}
    CHK_SVC_RC -->|"Yes"| ER_SVC["Return statusCode"]
    CHK_SVC_RC -->|"No"| CHECK_OP{op_svc_kei_no != null<br/>and not empty<br/>and sbop empty?}

    CHECK_OP -->|"Yes"| CAL_OP["executeOpSvcKei_UseStp<br/>Option Service<br/>Pause Removal"]
    CHECK_OP -->|"No"| CHECK_SBOP{sbop_svc_kei_no<br/>!= null and<br/>not empty?}

    CAL_OP --> CHK_OP_RC{statusCode != 0?}
    CHK_OP_RC -->|"Yes"| ER_OP["Return statusCode"]
    CHK_OP_RC -->|"No"| CHECK_SBOP

    CHECK_SBOP -->|"Yes"| CAL_SBOP["executeSbOpSvcKei_UseStp<br/>Sub-Option Service<br/>Pause Removal"]
    CHECK_SBOP -->|"No"| COLLECT_SEI{seiopsvc_kei_no<br/>!= null and<br/>not empty?}

    CAL_SBOP --> CHK_SBOP_RC{statusCode != 0?}
    CHK_SBOP_RC -->|"Yes"| ER_SBOP["Return statusCode"]
    CHK_SBOP_RC -->|"No"| COLLECT_SEI

    COLLECT_SEI -->|"Yes"| ADD_SEI["Add seiopsvc_kei_no<br/>to seiOpSvcKeiNoList"]
    COLLECT_SEI -->|"No"| CHECK_KKTK{kktk_svc_kei_no<br/>!= null and<br/>not empty?}

    ADD_SEI --> CHECK_KKTK
    CHECK_KKTK -->|"Yes"| CAL_KKTK["executeKktkSvcKei_UseStp<br/>Equipment Provision<br/>Pause Removal"]
    CHECK_KKTK -->|"No"| NEXT_ITER["Next iteration"]

    CAL_KKTK --> CHK_KKTK_RC{statusCode != 0?}
    CHK_KKTK_RC -->|"Yes"| ER_KKTK["Return statusCode"]
    CHK_KKTK_RC -->|"No"| NEXT_ITER

    NEXT_ITER --> LOOP_END{Loop end?}
    LOOP_END -->|"No"| LOOP
    LOOP_END -->|"Yes"| AFTER_LOOP["After billing loop"]

    AFTER_LOOP --> CHECK_NET{eKK0081A010Hash != null<br/>and SVC_CD_TEL?}
    CHECK_NET -->|"Yes"| CAL_KKTK2["executeKktkSvcKei_UseStp2<br/>ONU VDSL Pause Removal"]
    CAL_KKTK2 --> CHK_KKTK2{statusCode != 0?}
    CHK_KKTK2 -->|"Yes"| ER_KKTK2["Return statusCode"]
    CHK_KKTK2 -->|"No"| AFTER_KKTK2
    CHECK_NET -->|"No"| AFTER_KKTK2

    AFTER_KKTK2 --> GET_SVC_CD["Get svc_cd from hash"]
    GET_SVC_CD --> CHECK_SVC_CD{svc_cd ==<br/>SVC_CD_NET 01?}

    CHECK_SVC_CD -->|"Yes"| CALL_526["callEKK0081B526SC<br/>Associated Services"]
    CHECK_SVC_CD -->|"No"| AFTER_526

    CALL_526 --> EXTRACT_526["Extract eKK0081B526HashList"]
    EXTRACT_526 --> COUNT_INIT["isSeikySvcUseStpRlsCnt = 0"]
    COUNT_INIT --> COUNT_LOOP["Loop associated contracts"]
    COUNT_LOOP --> COUNT_CHECK{svcKeiStat ==<br/>SVC_KEI_STAT_TKC 100<br/>or SVC_KEI_STAT_KYUS 210?}
    COUNT_CHECK -->|"Yes"| COUNT_INC["isSeikySvcUseStpRlsCnt++"]
    COUNT_INC --> COUNT_NEXT["Next"]
    COUNT_CHECK -->|"No"| COUNT_NEXT

    COUNT_NEXT --> COUNT_END{Loop end?}
    COUNT_END -->|"No"| COUNT_LOOP
    COUNT_END -->|"Yes"| CHECK_CNT{isSeikySvcUseStpRlsCnt == 1?}

    CHECK_CNT -->|"Yes"| CALL_SEI_STP["executeSeiOpSvcKei_UseStp<br/>Billing Option<br/>Pause Removal"]
    CHECK_CNT -->|"No"| AFTER_SEI_STP
    CALL_SEI_STP --> CHK_SEI_STP{statusCode != 0?}
    CHK_SEI_STP -->|"Yes"| ER_SEI_STP["Return statusCode"]
    CHK_SEI_STP -->|"No"| AFTER_SEI_STP

    AFTER_SEI_STP --> AFTER_526["After EKK0081B526 processing"]

    AFTER_526 --> GET_ADVANCE["getEKK1091D010SC<br/>Advance Registration"]
    GET_ADVANCE --> CHK_ADV{statusCode != 0?}
    CHK_ADV -->|"Yes"| ER_ADV["Return statusCode"]
    CHK_ADV -->|"No"| CHECK_EXEC{SVC_KEI_USE_STP_RLS_EXEC_FLG == true?}

    CHECK_EXEC -->|"Yes"| CAL_CTL["executeSvcCtlUseStpReq<br/>Service Control<br/>Pause Removal Request"]
    CHECK_EXEC -->|"No"| FINAL_RET
    CAL_CTL --> CHK_CTL{statusCode != 0?}
    CHK_CTL -->|"Yes"| ER_CTL["Return statusCode"]
    CHK_CTL -->|"No"| CAL_CTCKSHIN["executeCtcMikstCdKoshin<br/>Member ISP Status Update"]

    CAL_CTCKSHIN --> FINAL_RET["Return 0 - success"]
    ER1 --> FINAL_RET
    ER2 --> FINAL_RET
    ER3 --> FINAL_RET
    ER_SVC --> FINAL_RET
    ER_OP --> FINAL_RET
    ER_SBOP --> FINAL_RET
    ER_KKTK --> FINAL_RET
    ER_KKTK2 --> FINAL_RET
    ER_SEI_STP --> FINAL_RET
    ER_ADV --> FINAL_RET
    ER_CTL --> FINAL_RET
    CONT --> NEXT_ITER
    RET0A --> FINAL_RET
    RET0B --> FINAL_RET
    RET0C --> FINAL_RET
```

**Processing Summary:**

The method follows a phased pipeline approach:

**Phase 1 -- Pre-flight Validation (lines ~612-673):** Retrieves the service contract consent record via `EKK0081A010` SC, extracts the price group code, and performs early-exit checks: if the price group is MiNEo ("51") or eo Electric ("17"), processing is skipped entirely. Then management info is fetched via `EKK0861B002`, and a "non-removable" check (`isUseStpFukaCheck`) is performed. If non-removable flags are set, the method returns early.

**Phase 2 -- Billing Agreement Verification (lines ~675-690):** Retrieves billing-level advance agreements via `EKK0321B002`. If no billing items exist, the method returns (nothing to process). Then it fetches the previous service contract status for pause-prevention logic.

**Phase 3 -- Contract-Level Suspension Removal Loop (lines ~693-817):** Iterates over each billing-level agreement item, and for each item:
- Retrieves the detailed contract info via `EKK0321A010`
- Extracts 5 service contract numbers
- **Dedicated handler per service type** -- core service, option service, sub-option service, and equipment provision services each get their own `execute*UseStp()` method call
- Billing option service numbers are collected (not processed immediately) for deferred handling

**Phase 4 -- Telecom Service Device Pause Removal (lines ~822-835):** If the main service is a telecom service (`SVC_CD_TEL = "02"`), a secondary equipment removal process (`executeKktkSvcKei_UseStp2`) is triggered to pause ONU/VDSL equipment associated with the fiber network.

**Phase 5 -- Associated Service Contract Processing (lines ~839-892):** If the service code is "net" (`SVC_CD_NET = "01"`), associated services are fetched via `EKK0081B526`. The method counts how many associated contracts are in "in-service/pause" (`100`) or "suspended" (`210`) status. If exactly one such contract exists, all collected billing option services are processed via `executeSeiOpSvcKei_UseStp`.

**Phase 6 -- Post-Processing (lines ~895-907):** Advance registration data is fetched via `EKK1091D010`. If the execution flag (`SVC_KEI_USE_STP_RLS_EXEC_FLG`) was set to true during any sub-processing, the service control pause removal request (`executeSvcCtlUseStpReq`) is executed, followed by the member ISP status code update (`executeCtcMikstCdKoshin`). Finally, `0` (success) is returned.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `handle` | `SessionHandle` | Session management handle carrying database connection context, transaction boundary information, and session-scoped resources needed for all SC calls within this method |
| 2 | `param` | `IRequestParameterReadWrite` | Request parameter object used for SC template exchange -- input/output carrier for Service Component calls; holds mapping keys and results via `resultHash` |
| 3 | `requestParam` | `HashMap<String, Object>` | Request-scoped parameter map carrying the target service contract number (`SVC_KEI_NO`), execution flag (`SVC_KEI_USE_STP_RLS_EXEC_FLG`), and results populated by SC calls throughout processing |
| 4 | `fixedText` | `String` | User-defined arbitrary text string passed through the processing pipeline, used for audit logging and traceability; not directly consumed by this method's logic |
| 5 | `fukaUseStpRlsTrgtLst` | `ArrayList<HashMap<String, Object>>` | List of items that are **non-removable** for use suspension removal (利用停止解除不可対象); each entry contains contract numbers, service names, and reasons why removal is blocked; used by `isUseStpFukaCheck` to determine if the operation should be blocked |

**Instance Fields Read by This Method:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `wk_Fuka_flg` | `boolean` | Non-removable flag set to `true` when the non-removable check finds blocking conditions; instance-level state shared across CC methods |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `JKKUseStpRlsRunCC.getEKK0081A010SC` | EKK0081A010SC | KK_T_SVC_KEI (Service Contract) | Retrieves service contract consent record for the target service contract number; obtains prc_grp_cd (price group code) and svc_cd (service code) |
| R | `JKKUseStpRlsRunCC.getEKK0861B002SC` | EKK0861B002SC | KK_T_MANAGE (Management Info) | Fetches management information for the contract, including relationship and status data needed for non-removable checks |
| - | `JKKUseStpRlsRunCC.isUseStpFukaCheck` | - | - | Checks whether the current contract has non-removable conditions (active contract in progress, eo TV KCN, etc.) |
| R | `JKKUseStpRlsRunCC.getEKK0321B002SC` | EKK0321B002SC | KK_T_SEIKYU_KEI (Billing Contract) | Retrieves billing-level advance agreements associated with the target contract; produces the list that drives the main loop |
| - | `JKKUseStpRlsRunCC.getUseStpBfSvcKeiStat` | - | - | Fetches previous service contract status before removal to prevent pause on contracts that cannot be paused (suspended/interrupted state) |
| R | `JKKUseStpRlsRunCC.getEKK0321A010SC` | EKK0321A010SC | KK_T_KKTK_SVC_KEI (Equipment Provision Service Contract) | Retrieves detailed billing-level agreement information including all 5 service contract numbers (svc_kei_no, kktk_svc_kei_no, op_svc_kei_no, seiopsvc_kei_no, sbop_svc_kei_no) |
| - | `JKKUseStpRlsRunCC.executeSvcKei_UseStp` | - | KK_T_SVC_KEI (Service Contract) | Lifts suspension on the core service contract; sets SVC_KEI_USE_STP_RLS_EXEC_FLG to true |
| - | `JKKUseStpRlsRunCC.executeOpSvcKei_UseStp` | - | KK_T_OP_SVC_KEI (Option Service Contract) | Lifts suspension on the option service contract (only when sub-option service is absent or empty) |
| - | `JKKUseStpRlsRunCC.executeSbOpSvcKei_UseStp` | - | KK_T_SBOP_SVC_KEI (Sub-Option Service Contract) | Lifts suspension on the sub-option service contract (only when present and non-empty) |
| - | `JKKUseStpRlsRunCC.executeKktkSvcKei_UseStp` | - | KK_T_KKTK_SVC_KEI (Equipment Provision Service) | Lifts suspension on equipment-provisioned services (e.g., STB, splitter, ONU, router) |
| - | `JKKUseStpRlsRunCC.executeKktkSvcKei_UseStp2` | - | KK_T_KKTK_SVC_KEI (Equipment Provision Service) | Secondary removal process for telecom services -- pauses ONU devices or VDSL models connected to eo fiber network side |
| R | `JKKUseStpRlsRunCC.callEKK0081B526SC` | EKK0081B526SC | KK_T_SEIKYU_SVC_KEI (Billing Service Contract) | Retrieves all associated service contracts within the billing contract; used to count contracts in active/pause status |
| - | `JKKUseStpRlsRunCC.executeSeiOpSvcKei_UseStp` | - | KK_T_SEIOP_SVC_KEI (Billing Option Service) | Lifts suspension on billing option services; only triggered when exactly one associated contract is in in-service/pause state |
| R | `JKKUseStpRlsRunCC.getEKK1091D010SC` | EKK1091D010SC | KK_T_SHINR (Advance Registration) | Registers advance progress information (shinr) for the suspended service removal; required for whole-house pause scenarios |
| - | `JKKUseStpRlsRunCC.executeSvcCtlUseStpReq` | - | KK_T_SVC_CTL (Service Control) | Executes the service control pause removal request, updating the service control management table S |
| - | `JKKUseStpRlsRunCC.executeCtcMikstCdKoshin` | - | KK_T_CTC_MIKST (CTC Agreement) | Updates the member ISP determination status code; called after service control pause removal for member ISP resolution |

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | JKKUseStpRlsRunCC.runUseStpRls() | `runUseStpRls()` -> `executeUseStpRlsMain()` | `executeCtcMikstCdKoshin [-]`, `executeSvcCtlUseStpReq [-]`, `getEKK1091D010SC [R]`, `executeSeiOpSvcKei_UseStp [-]`, `callEKK0081B526SC [R]`, `executeKktkSvcKei_UseStp2 [-]`, `executeKktkSvcKei_UseStp [-]`, `executeSbOpSvcKei_UseStp [-]`, `executeOpSvcKei_UseStp [-]`, `executeSvcKei_UseStp [-]`, `getEKK0321A010SC [R]`, `getUseStpBfSvcKeiStat [-]`, `getEKK0321B002SC [R]`, `isUseStpFukaCheck [-]`, `getEKK0861B002SC [R]`, `getEKK0081A010SC [R]` |

**Trace Explanation:** This method is called directly by `JKKUseStpRlsRunCC.runUseStpRls()`, which is the top-level batch orchestrator for use suspension removal operations. The method itself does not appear to be called from any screen entry point (KKSV*) or batch entry point (KKBT*) within 8 hops. All terminal operations from this method resolve to its own internal SC calls and sub-methods.

## 6. Per-Branch Detail Blocks

### Block 1 -- Variable Initialization (L614-631)

> Initializes all local variables and the execution flag before any business logic begins.

| # | Type | Code |
|---|------|------|
| 1 | SET | `statusCode = 0` // Status code initialized to success |
| 2 | SET | `resultHash = new HashMap<String, Object>()` // S-IF result container |
| 3 | SET | `requestParam.put(SVC_KEI_USE_STP_RLS_EXEC_FLG, false)` // Execution flag set to false (utilized by sub-methods) |
| 4 | SET | `hakkoSODDataList = new ArrayList<HashMap<String, Object>>()` // SNT issuance container |
| 5 | SET | `seiOpSvcKeiNoList = new ArrayList<String>()` // Billing option service contract number list for deferred processing |
| 6 | SET | `prm_svc_kei_no = (String)requestParam.get(SVC_KEI_NO)` // Target service contract number from request |

### Block 2 -- Service Contract Consent Retrieval (L633-639)

> Fetches the service contract consent record to determine the price group code and service code. This is the gateway query -- if it fails, all processing stops.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `statusCode = getEKK0081A010SC(param, handle, requestParam, resultHash, prm_svc_kei_no)` |
| 2 | IF | `statusCode != 0` (error check) (L637) |
| 3 | RETURN | `return statusCode` (early exit on failure) |

### Block 3 -- Price Group Check: MiNEo (L644-651)

> Resolved from constant `PRC_GRP_CD_MINEO = "51"`. MiNEo (softbank's MVNO brand) price group is excluded from suspension removal processing.

| # | Type | Code |
|---|------|------|
| 1 | SET | `eKK0081A010Hash = (HashMap<String, Object>)resultHash.get(TEMPLATE_ID_EKK0081A010)` // Extract result from S-IF |
| 2 | SET | `prc_grp_cd = (String)eKK0081A010Hash.get(EKK0081A010CBSMsg1List.PRC_GRP_CD)` // Price group code |
| 3 | IF | `PRC_GRP_CD_MINEO.equals(prc_grp_cd)` `["51" = MiNEo]` (L649) // Price group check |
| 4 | RETURN | `return 0` (MiNEo: no processing) |

### Block 4 -- Price Group Check: eo Electric (L653-660)

> Resolved from constant `PRC_GRP_CD_EODENKI = "17"`. Added for ANK-2480-00-00 (New electric power service response). eo Electric price group is excluded.

| # | Type | Code |
|---|------|------|
| 1 | IF | `PRC_GRP_CD_EODENKI.equals(prc_grp_cd)` `["17" = eo Electric]` (L656) |
| 2 | RETURN | `return 0` (eo Electric: no processing) |

### Block 5 -- Management Info Retrieval (L664-670)

> Fetches management information required for subsequent non-removable checks.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `statusCode = getEKK0861B002SC(param, handle, requestParam, resultHash)` |
| 2 | IF | `statusCode != 0` (error check) (L668) |
| 3 | RETURN | `return statusCode` (early exit on failure) |

### Block 6 -- Non-Removable Check (L673-679)

> The gatekeeper check: if the contract has conditions that make suspension removal impossible, processing stops. Sets `wk_Fuka_flg = true` to signal the non-removable state to callers.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `isUseStpFukaCheck(fukaUseStpRlsTrgtLst, requestParam, resultHash)` // Checks non-removable conditions |
| 2 | IF | condition is true (L675) // Non-removable detected |
| 3 | SET | `wk_Fuka_flg = true` // Instance-level flag |
| 4 | RETURN | `return 0` (non-removable: terminate) |

### Block 7 -- Billing Advance Agreement Retrieval (L682-692)

> Retrieves billing-level advance agreements. The result drives the main processing loop.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `statusCode = getEKK0321B002SC(param, handle, requestParam, resultHash)` |
| 2 | IF | `statusCode != 0` (L688) |
| 3 | RETURN | `return statusCode` |
| 4 | SET | `eKK0321B002HashList = (ArrayList<HashMap<String, Object>>)resultHash.get(TEMPLATE_ID_EKK0321B002)` |
| 5 | IF | `eKK0321B002HashList.size() == 0` (L693) // No billing items |
| 6 | RETURN | `return 0` (nothing to process) |

### Block 8 -- Previous Status Fetch (L696-697)

> Fetches the service contract status BEFORE removal. Used by sub-methods to prevent pause on contracts in suspended/interrupted state (KT1-2013-0000766).

| # | Type | Code |
|---|------|------|
| 1 | SET | `resultHash.put(MAP_KEY_GET_SVKEI_STAT, getUseStpBfSvcKeiStat(handle, param, prm_svc_kei_no, null))` |

### Block 9 -- Main Loop: Iterate Over Billing Agreement Items (L699-817)

> Iterates through each billing-level agreement item and processes each service contract type independently.

**Block 9 -- Loop Setup (L700)**

| # | Type | Code |
|---|------|------|
| 1 | SET | `i = 0` (loop counter initialization) |
| 2 | IF | `i < eKK0321B002HashList.size()` (L700) |

**Block 9.1 -- Per-Item Processing: Detailed Contract Fetch (L702-712)**

| # | Type | Code |
|---|------|------|
| 1 | SET | `eKK0321B002Hash = eKK0321B002HashList.get(i)` |
| 2 | CALL | `statusCode = getEKK0321A010SC(param, handle, eKK0321B002Hash, resultHash)` // Billing agreement detail |
| 3 | IF | `statusCode != 0` (L706) |
| 4 | RETURN | `return statusCode` |
| 5 | SET | `eKK0321A010Hash = (HashMap<String, Object>)resultHash.get(TEMPLATE_ID_EKK0321A010)` |
| 6 | IF | `eKK0321A010Hash == null` (L712) // No detail data |
| 7 | EXEC | `continue` (skip to next iteration) |

**Block 9.2 -- Field Extraction (L715-726)**

| # | Type | Code |
|---|------|------|
| 1 | SET | `svc_kei_no = (String)eKK0321A010Hash.get(EKK0321A010CBSMsg1List.SVC_KEI_NO)` |
| 2 | SET | `kktk_svc_kei_no = (String)eKK0321A010Hash.get(EKK0321A010CBSMsg1List.KKTK_SVC_KEI_NO)` // Equipment provision |
| 3 | SET | `op_svc_kei_no = (String)eKK0321A010Hash.get(EKK0321A010CBSMsg1List.OP_SVC_KEI_NO)` // Option service |
| 4 | SET | `seiopsvc_kei_no = (String)eKK0321A010Hash.get(EKK0321A010CBSMsg1List.SEIOPSVC_KEI_NO)` // Billing option |
| 5 | SET | `sbop_svc_kei_no = (String)eKK0321A010Hash.get(EKK0321A010CBSMsg1List.SBOP_SVC_KEI_NO)` // Sub-option |

**Block 9.3 -- Core Service Contract Pause Removal (L731-745)**

| # | Type | Code |
|---|------|------|
| 1 | IF | `svc_kei_no != null && !"".equals(svc_kei_no)` (L731) |
| 2 | CALL | `statusCode = executeSvcKei_UseStp(handle, param, requestParam, resultHash, hakkoSODDataList, prm_svc_kei_no)` |
| 3 | IF | `statusCode != 0` (L741) |
| 4 | RETURN | `return statusCode` |

**Block 9.4 -- Option Service Pause Removal (L751-770)**

> Only processed when option service is present AND sub-option service is absent or empty (mutual exclusion).

| # | Type | Code |
|---|------|------|
| 1 | IF | `op_svc_kei_no != null && !"".equals(op_svc_kei_no) && (sbop_svc_kei_no == null || "".equals(sbop_svc_kei_no))` (L751-L756) |
| 2 | CALL | `statusCode = executeOpSvcKei_UseStp(handle, param, requestParam, resultHash, prm_svc_kei_no)` |
| 3 | IF | `statusCode != 0` (L763) |
| 4 | RETURN | `return statusCode` |

**Block 9.5 -- Sub-Option Service Pause Removal (L775-789)**

| # | Type | Code |
|---|------|------|
| 1 | IF | `sbop_svc_kei_no != null && !"".equals(sbop_svc_kei_no)` (L775) |
| 2 | CALL | `statusCode = executeSbOpSvcKei_UseStp(handle, param, requestParam, resultHash, prm_svc_kei_no)` |
| 3 | IF | `statusCode != 0` (L783) |
| 4 | RETURN | `return statusCode` |

**Block 9.6 -- Billing Option Number Collection (L795-800)**

> Billing option services are NOT processed here. They are collected into `seiOpSvcKeiNoList` for deferred processing after associated service contract counting.

| # | Type | Code |
|---|------|------|
| 1 | IF | `seiopsvc_kei_no != null && !"".equals(seiopsvc_kei_no)` (L795) |
| 2 | SET | `seiOpSvcKeiNoList.add(seiopsvc_kei_no)` // Deferred collection |

**Block 9.7 -- Equipment Provision Service Pause Removal (L806-817)**

| # | Type | Code |
|---|------|------|
| 1 | IF | `kktk_svc_kei_no != null && !"".equals(kktk_svc_kei_no)` (L806) |
| 2 | CALL | `statusCode = executeKktkSvcKei_UseStp(handle, param, requestParam, resultHash, prm_svc_kei_no, true)` |
| 3 | IF | `statusCode != 0` (L811) |
| 4 | RETURN | `return statusCode` |

**Block 9.8 -- Loop Counter Increment (L817)**

| # | Type | Code |
|---|------|------|
| 1 | SET | `i++` |
| 2 | GOTO | Back to `i < eKK0321B002HashList.size()` check |

### Block 10 -- Telecom Service ONU/VDSL Equipment Pause Removal (L822-835)

> After the billing loop, if the main service is a telecom service (`SVC_CD_TEL = "02"`), a secondary process removes pause on ONU devices or VDSL models connected to the eo fiber network side.

| # | Type | Code |
|---|------|------|
| 1 | IF | `eKK0081A010Hash != null && SVC_CD_TEL.equals(eKK0081A010Hash.get(EKK0081A010CBSMsg1List.SVC_CD))` `["02" = Tel]` (L822) |
| 2 | CALL | `statusCode = executeKktkSvcKei_UseStp2(handle, param, requestParam, resultHash, eKK0081A010Hash, prm_svc_kei_no)` |
| 3 | IF | `statusCode != 0` (L829) |
| 4 | RETURN | `return statusCode` |

### Block 11 -- Associated Service Contract Processing (L837-892)

> If the main service code is "net" (`SVC_CD_NET = "01"`), retrieves and processes associated service contracts.

**Block 11.1 -- Service Code Check (L839)**

| # | Type | Code |
|---|------|------|
| 1 | SET | `svc_cd = (String)eKK0081A010Hash.get(EKK0081A010CBSMsg1List.SVC_CD)` |
| 2 | IF | `SVC_CD_NET.equals(svc_cd)` `["01" = Net]` (L842) |

**Block 11.2 -- Associated Services Fetch (L843)**

| # | Type | Code |
|---|------|------|
| 1 | CALL | `callEKK0081B526SC(handle, param, requestParam, resultHash)` // Associated service contracts |
| 2 | SET | `eKK0081B526HashList = (ArrayList<HashMap<String, Object>>)resultHash.get(TEMPLATE_ID_EKK0081B526)` |

**Block 11.3 -- Associated Contracts Status Counting Loop (L848-869)**

> Counts how many associated service contracts are in in-service/pause status (`SVC_KEI_STAT_TKC = "100"`) or suspended status (`SVC_KEI_STAT_KYUS = "210"`). Updated in KT1-2013-0000766 to also include suspended state.

| # | Type | Code |
|---|------|------|
| 1 | SET | `isSeikySvcUseStpRlsCnt = 0` |
| 2 | FOR | `i = 0; i < eKK0081B526HashList.size()` |
| 3 | SET | `eKK0081B526Hash = eKK0081B526HashList.get(i)` |
| 4 | SET | `svcKeiStat = (String)eKK0081B526Hash.get(EKK0081B526CBSMsg1List.SVC_KEI_STAT)` |
| 5 | IF | `SVC_KEI_STAT_TKC.equals(svcKeiStat) \|\| SVC_KEI_STAT_KYUS.equals(svcKeiStat)` `["100" = in-service/pause, "210" = suspended]` (L857) |
| 6 | SET | `isSeikySvcUseStpRlsCnt++` |
| 7 | SET | `i++` |

**Block 11.4 -- Billing Option Service Processing (L872-887)**

> Only triggers when exactly one associated contract is in an active/pause state. Processes all collected billing option services.

| # | Type | Code |
|---|------|------|
| 1 | IF | `isSeikySvcUseStpRlsCnt == 1` (L872) // Exactly one active contract |
| 2 | FOR | `i = 0; i < seiOpSvcKeiNoList.size()` |
| 3 | CALL | `statusCode = executeSeiOpSvcKei_UseStp(handle, param, requestParam, resultHash, seiOpSvcKeiNoList.get(i))` |
| 4 | IF | `statusCode != 0` (L880) |
| 5 | RETURN | `return statusCode` |
| 6 | SET | `i++` |

### Block 12 -- Advance Registration Registration (L895-903)

> OM-2014-0002973 addition. Registers advance progress information required for whole-house pause scenarios.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `statusCode = getEKK1091D010SC(param, handle, requestParam, resultHash)` |
| 2 | IF | `statusCode != 0` (L899) |
| 3 | RETURN | `return statusCode` |

### Block 13 -- Post-Processing: Service Control & ISP Status Update (L905-922)

> Final phase: if the execution flag was set by any sub-processing method, execute the service control pause removal request and update the member ISP status code.

| # | Type | Code |
|---|------|------|
| 1 | IF | `(Boolean)requestParam.get(SVC_KEI_USE_STP_RLS_EXEC_FLG) == true` (L907) |
| 2 | CALL | `statusCode = executeSvcCtlUseStpReq(handle, param, requestParam, resultHash, hakkoSODDataList)` |
| 3 | IF | `statusCode != 0` (L911) |
| 4 | RETURN | `return statusCode` |
| 5 | CALL | `executeCtcMikstCdKoshin(param, handle, requestParam)` // Member ISP status code update |
| 6 | RETURN | `return 0` (success) |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `SVC_KEI_NO` | Field | Service Contract Number -- the primary service contract identifier for a customer's telecom service |
| `kktk_svc_kei_no` | Field | Equipment Provision Service Contract Number -- contract number for physical equipment (STB, router, splitter, ONU) provided with the service |
| `op_svc_kei_no` | Field | Option Service Contract Number -- contract number for optional add-on services (e.g., security, antivirus) |
| `sbop_svc_kei_no` | Field | Sub-Option Service Contract Number -- sub-level optional service contract, typically bundled with an option service |
| `seiopsvc_kei_no` | Field | Billing Option Service Contract Number -- option services billed at the invoice level (not directly tied to a service contract) |
| `prc_grp_cd` | Field | Price Group Code -- classifies the pricing tier/brand of the service (e.g., MiNEo, eo Electric, standard) |
| `svc_cd` | Field | Service Code -- classifies the service type (e.g., "01" = Net, "02" = Tel) |
| `SVC_KEI_STAT_TKC` | Constant | Service Contract Status: In-Service/Pause = "100" -- the service is active and under pause management |
| `SVC_KEI_STAT_KYUS` | Constant | Service Contract Status: Suspended/Interrupted = "210" -- the service is in a suspended state |
| `PRC_GRP_CD_MINEO` | Constant | Price Group Code for MiNEo = "51" -- softbank's MVNO brand; excluded from suspension removal |
| `PRC_GRP_CD_EODENKI` | Constant | Price Group Code for eo Electric = "17" -- eo's electric power service; excluded from suspension removal |
| `SVC_CD_NET` | Constant | Service Code for Net = "01" -- fiber optic internet service |
| `SVC_CD_TEL` | Constant | Service Code for Tel = "02" -- telephone service |
| `SVC_KEI_USE_STP_RLS_EXEC_FLG` | Field | Service Contract Use Pause Removal Execution Flag -- set to true by sub-methods when removal processing is actually performed; gates the service control update |
| `SVC_STP_RSN_CD_USESTPRLS` | Constant | Service Pause Reason Code for Use Suspension Removal = "01" |
| `wk_Fuka_flg` | Field | Non-removable flag (instance-level) -- set to true when a non-removable condition is detected |
| `hakkoSODDataList` | Field | SNT (Service Notification Ticket?) issuance data list -- collected SOD data for issuance during removal processing |
| `seiOpSvcKeiNoList` | Field | Billing option service contract number list -- deferred collection of billing option services for post-processing |
| `ido_div_usestprls` | Constant | Discrepancy Classification Code for Use Suspension Removal = "00063" |
| `ido_rsn_cd_kanusestp_rls` | Constant | Discrepancy Reason Code for Related Pause/Removal = "81" |
| `prg_stat_usestp_fin` | Constant | Program Status for Use Pause Completion = "2202" |
| `syori_result_ok` | Constant | Processing Result: OK = "0" |
| `syori_result_fuka` | Constant | Processing Result: Non-removable services present = "1" |
| FUKA_RESON_RTN_IRAI_TORI | Constant | Non-removable reason: Request cancellation = "01" |
| FUKA_RESON_RTN_KEITK_CHU | Constant | Non-removable reason: Contract processing in progress = "02" |
| FUKA_RESON_RTN_TV_KCN | Constant | Non-removable reason: eo TV (KCN) = "03" |
| EKK0081A010SC | SC | Service Contract Consent -- retrieves the service contract master record including price group code and service code |
| EKK0861B002SC | SC | Management Info -- retrieves management/relationship data for non-removable checks |
| EKK0321B002SC | SC | Billing Advance Agreement -- retrieves billing-level contract agreements |
| EKK0321A010SC | SC | Billing Agreement Detail -- retrieves detailed billing agreement with all 5 service contract numbers |
| EKK0081B526SC | SC | Associated Service Contracts -- retrieves all service contracts within a billing contract for counting |
| EKK1091D010SC | SC | Advance Registration -- registers advance progress information for pause scenarios |
| executeSvcKei_UseStp | Method | Core service contract use suspension removal -- lifts pause on the primary service |
| executeOpSvcKei_UseStp | Method | Option service use suspension removal -- lifts pause on option services (when sub-option is absent) |
| executeSbOpSvcKei_UseStp | Method | Sub-option service use suspension removal -- lifts pause on sub-option services |
| executeKktkSvcKei_UseStp | Method | Equipment-provisioned service use suspension removal -- lifts pause on physical equipment contracts (STB, ONU, router, splitter, etc.) |
| executeKktkSvcKei_UseStp2 | Method | Secondary equipment pause removal -- specifically pauses ONU/VDSL devices on the eo fiber network side for telecom services |
| executeSeiOpSvcKei_UseStp | Method | Billing option service use suspension removal -- lifts pause on billing-level option services |
| executeSvcCtlUseStpReq | Method | Service control pause removal request -- updates the service control management table |
| executeCtcMikstCdKoshin | Method | Member ISP determination status code update -- updates CTC agreement status after removal |
| isUseStpFukaCheck | Method | Non-removable condition check -- determines if suspension removal is blocked for this contract |
| getUseStpBfSvcKeiStat | Method | Previous service contract status fetch -- retrieves status before removal for pause-prevention logic |
| MiNEo | Business term | softbank's MVNO (Mobile Virtual Network Operator) brand; price group "51" |
| eo Electric | Business term | eo's electric power service offering; price group "17" |
| ONU | Business term | Optical Network Unit -- fiber optic terminal equipment connected to the eo fiber network |
| VDSL | Business term | Very-high-bit-rate Digital Subscriber Line -- copper-based broadband technology |
| STB | Business term | Set-Top Box -- equipment for receiving TV/digital broadcast services |
| SOD | Acronym | Service Order Data -- order fulfillment data entity |
| SC | Acronym | Service Component -- the service layer class for database/business operations |
| CC | Acronym | Common Component -- shared business logic component (this method's class type) |
| Use Suspension Removal (利停止解除) | Business term | The business operation of lifting a previously applied service suspension/pause, returning a service to active status |
| KK_T_SVC_KEI | Entity | Service Contract table -- master record for service contracts |
| KK_T_SEIKYU_KEI | Entity | Billing Contract table -- top-level billing contract records |
| KK_T_KKTK_SVC_KEI | Entity | Equipment Provision Service Contract table -- physical equipment contracts |
| KK_T_OP_SVC_KEI | Entity | Option Service Contract table |
| KK_T_SBOP_SVC_KEI | Entity | Sub-Option Service Contract table |
| KK_T_SEIKYU_SVC_KEI | Entity | Billing Service Contract table |
| KK_T_SVC_CTL | Entity | Service Control management table |
| KK_T_CTC_MIKST | Entity | CTC Agreement table |
| KK_T_SHINR | Entity | Advance Registration table |
