# Business Logic — JKKKyoseiDslRunCC.sbOpSvcKei_KyoseiDsl() [194 LOC]

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

## 1. Role

### JKKKyoseiDslRunCC.sbOpSvcKei_KyoseiDsl()

This method implements the **forced cancellation processing for sub-option service contracts** (サブオプションサービス契約 強制解約処理) within the NTT East telecommunications billing system. It is invoked as part of the broader forced DSL contract termination workflow executed during bulk account termination procedures triggered by the KOSHI (resignation/transfer) customer inquiry process. The method operates as a **router/dispatcher** that first negotiates the sub-option service contract status through a chain of agreement confirmations, then branches based on the current contract state to execute one of two mutually exclusive paths: (1) **cancel path** — if the sub-option service has been accepted (UKE = "010") or under review (SHOSA = "020"), it invokes the cancellation handler directly and returns early; or (2) **active cancellation path** — if the contract is actively running or paused (Teiketu = "030", Service Provision = "100", Suspension/Halting = "220", or Cessation = "210"), it first runs the non-taxable judgment utility to determine early termination fee liability flags, then executes a full three-phase cancellation workflow (cancel initiation, cancel execution, and cancel confirmation). A third branch handles a **mail alias special case**: when the sub-option service code is "D01" (Mail alias service), it additionally processes the option service contract for ISP agreement (both parent and sub-level) and, if a valid mail alias is configured and matches the parent contract number, marks the alias as usage-terminated in the aging system. The method delegates to numerous service component (SC) calls for contract agreement queries, cancellations, and data persistence operations.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["sbOpSvcKei_KyoseiDsl"])
    START --> GET_BILL["Get billing advance agreement from resultHash EKK0321A010"]
    GET_BILL --> CALL_OPT["callEKK0351A010SC Option Service Contract Agreement"]
    CALL_OPT --> CHK_OPT{statusCode != 0?}
    CHK_OPT -->|Yes| RET_OPT["Return statusCode"]
    CHK_OPT -->|No| GET_OPT["Get eKK0351A010Hash from resultHash Extract svc_kei_no"]
    GET_OPT --> CHK_SVC{svc_kei_no null or empty?}
    CHK_SVC -->|Yes| CALL_DETAILS["callEKK0161A010SC Service Contract Details Agreement"]
    CHK_SVC -->|No| CHK_PRM_MATCH{prm_svc_kei_no equals svc_kei_no?}
    CALL_DETAILS --> CHK_DET{statusCode != 0?}
    CHK_DET -->|Yes| RET_DET["Return statusCode"]
    CHK_DET -->|No| GET_DET_SVC["Get eKK0161A010Hash from resultHash Extract svc_kei_no from details"]
    GET_DET_SVC --> CHK_PRM_MATCH
    CHK_PRM_MATCH -->|No| RET_NOOP["Return 0 no-op"]
    CHK_PRM_MATCH -->|Yes| CALL_SBOP["callEKK0401A010SC Sub-Option Service Contract Agreement"]
    CALL_SBOP --> CHK_SBOP{statusCode != 0?}
    CHK_SBOP -->|Yes| RET_SBOP["Return statusCode"]
    CHK_SBOP -->|No| GET_SBOP_DATA["Get eKK0401A010Hash Extract sbop_svc_kei_stat"]
    GET_SBOP_DATA --> CHK_STAT{Status 010 or 020? UKE=010 Shosa=020}
    CHK_STAT -->|Yes| CALL_CANCEL["callEKK0401C150SC Sub-Option Contract Cancel Set svcKeiUpdDtm"]
    CALL_CANCEL --> RET_CANCEL["Return 0"]
    CHK_STAT -->|No| CHK_ACTIVE{Status 030 or 100 or 210 or 220? Teik=030 Tkc=100 Kyus=210 Stp=220}
    CHK_ACTIVE -->|Yes| RUN_HICHRG["runHiChrgJdgUtil Non-taxable judgment for sub-option"]
    RUN_HICHRG --> CALL_CANCEL_OP["callEKK0401C170SC Sub-Option Contract Cancellation Set svcKeiUpdDtm"]
    CALL_CANCEL_OP --> CALL_CONFIRM["callEKK0401C180SC Sub-Option Contract Cancellation Confirmation Set svcKeiUpdDtm"]
    CALL_CONFIRM --> GET_SBOP_CD["Extract sbop_svc_cd from eKK0401A010Hash"]
    GET_SBOP_CD --> CHK_ALIAS{sbop_svc_cd equals D01? Alias Mail}
    CHK_ALIAS -->|Yes| CALL_OPT_ISP["callEKK0361A010SC Option Service Contract ISP Agreement"]
    CHK_ALIAS -->|No| RET_FINAL["Return 0"]
    CALL_OPT_ISP --> GET_ISP_RESULT["Get eKK0361A010Hash Extract oyaOpSvcKeiNo and mlad"]
    GET_ISP_RESULT --> CALL_SUBISP["callEKK0411A010SC Sub-Option Service Contract ISP Agreement"]
    CALL_SUBISP --> CHK_MAIL{mailArias not empty AND koOpSvcKei equals oyaOpSvcKeiNo?}
    CHK_MAIL -->|Yes| SET_AGING["Split mlad by @ Reconstruct mailArias Put AGING_SBT_CD and AGING_TG_VALUE into requestParam"]
    SET_AGING --> CALL_AGING["updateAgingUseEnd Mark alias as usage ended"]
    CALL_AGING --> RET_AGING["Return statusCode if error"]
    CHK_MAIL -->|No| RET_FINAL
    CALL_AGING --> RET_FINAL
    RET_OPT --> END_NODE(["End"])
    RET_DET --> END_NODE
    RET_SBOP --> END_NODE
    RET_CANCEL --> END_NODE
    RET_AGING --> END_NODE
    RET_FINAL --> END_NODE
    END_NODE --> DONE(["Done"])
```

**Processing Summary:**

The method follows a linear contract-negotiation-first pattern, then diverges based on service status. Key branching conditions use these resolved constants:

- `SVC_KEI_STAT_UKE = "010"` (Accepted / 受払済)
- `SVC_KEI_STAT_SHOSA = "020"` (Under Review / 照会済)
- `SVC_KEI_STAT_TEIK = "030"` (Agreed / 締結済)
- `SVC_KEI_STAT_TKC = "100"` (Service Provision in Progress / サービス提供中)
- `SVC_KEI_STAT_KYUS = "210"` (Cessation / 休止・中断中)
- `SVC_KEI_STAT_STP = "220"` (Suspension / 停止中)
- `SBOP_SVC_CD_ALIAS = "D01"` (Mail alias service type / メールエイリアス)
- `DSL_SBT_FLG_SBOP_SVC_KEI_DSL = "3"` (Sub-option DSL flag)
- `AGING_SBT_CD_ALIAS = "008"` (Email alias aging type code)

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `handle` | `SessionHandle` | Database session handle carrying the transaction context and connection state for all SC calls and DB operations within this forced cancellation flow. |
| 2 | `param` | `IRequestParameterReadWrite` | Model group and control map containing parameters read from/written during the UI screen flow. Used to pass request parameters into SC methods and to store aging termination data. |
| 3 | `requestParam` | `HashMap<String, Object>` | Raw request parameters submitted from the calling screen/batch. Contains `SVC_KEI_NO` (service contract number) used for cross-validation, and is mutated with `AGING_SBT_CD` and `AGING_TG_VALUE` for the mail alias usage-end operation. |
| 4 | `resultHash` | `HashMap<String, Object>` | Shared result dictionary where SC response maps are stored under template IDs (e.g., `EKK0321A010`, `EKK0351A010`, `EKK0401A010`). Acts as the inter-step data bus through which the method retrieves contract numbers, statuses, and service codes. |
| 5 | `jdgHiChrgMapSvcKei` | `HashMap<String, Object>` | Non-taxable judgment component result for services. Passed to cancellation SC methods (`callEKK0401C170SC`, `callEKK0401C180SC`) to carry early termination fee determination flags (whether the customer owes a cancellation fee). |

**Instance fields read:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `svcKeiUpdDtm` | `String` | Service contract update timestamp. Set to the update datetime returned by each cancellation/confirmation SC method to persist the contract modification time. |

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `JBSbatDKHmpinAdd.split` | JBSbatDKHmpinAdd | - | Calls `split` utility in `JBSbatDKHmpinAdd` |
| R | `JBSbatDKNyukaFinAdd.split` | JBSbatDKNyukaFinAdd | - | Calls `split` utility in `JBSbatDKNyukaFinAdd` |
| R | `JBSbatDKTanaMoveShkaCmpAdd.split` | JBSbatDKTanaMoveShkaCmpAdd | - | Calls `split` utility in `JBSbatDKTanaMoveShkaCmpAdd` |
| R | `JBSbatDKTkkikiGetReqHmpin.split` | JBSbatDKTkkikiGetReqHmpin | - | Calls `split` utility in `JBSbatDKTkkikiGetReqHmpin` |
| R | `JBSbatDKTkkikiGetReqNyuka.split` | JBSbatDKTkkikiGetReqNyuka | - | Calls `split` utility in `JBSbatDKTkkikiGetReqNyuka` |
| R | `JKKKyoseiDslRunCC.callEKK0161A010SC` | JKKKyoseiDslRunCC | - | Calls `callEKK0161A010SC` — Service Contract Details Agreement (retrieves svc_kei_no if not in option contract) |
| R | `JKKKyoseiDslRunCC.callEKK0351A010SC` | JKKKyoseiDslRunCC | - | Calls `callEKK0351A010SC` — Option Service Contract Agreement (retrieves option service contract info) |
| R | `JKKKyoseiDslRunCC.callEKK0361A010SC` | JKKKyoseiDslRunCC | - | Calls `callEKK0361A010SC` — Option Service Contract <ISP> Agreement (for mail alias service) |
| R | `JKKKyoseiDslRunCC.callEKK0401A010SC` | JKKKyoseiDslRunCC | - | Calls `callEKK0401A010SC` — Sub-Option Service Contract Agreement (retrieves sub-option contract data and status) |
| R | `JKKKyoseiDslRunCC.callEKK0401C150SC` | JKKKyoseiDslRunCC | - | Calls `callEKK0401C150SC` — Sub-Option Service Contract Cancel (cancellation initiation for accepted/reviewed status) |
| R | `JKKKyoseiDslRunCC.callEKK0401C170SC` | JKKKyoseiDslRunCC | - | Calls `callEKK0401C170SC` — Sub-Option Service Contract Cancellation (actual cancellation for active/paused contracts) |
| R | `JKKKyoseiDslRunCC.callEKK0401C180SC` | JKKKyoseiDslRunCC | - | Calls `callEKK0401C180SC` — Sub-Option Service Contract Cancellation Confirmation (finalizes cancellation) |
| R | `JKKKyoseiDslRunCC.callEKK0411A010SC` | JKKKyoseiDslRunCC | - | Calls `callEKK0411A010SC` — Sub-Option Service Contract <ISP> Agreement (for mail alias sub-option ISP) |
| - | `JKKKyoseiDslRunCC.runHiChrgJdgUtil` | JKKKyoseiDslRunCC | - | Calls `runHiChrgJdgUtil` — Non-taxable judgment utility (determines early termination fee liability) |
| U | `JKKKyoseiDslRunCC.updateAgingUseEnd` | JKKKyoseiDslRunCC | - | Calls `updateAgingUseEnd` — Marks mail alias as usage-terminated in the aging management system |

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | CBS: `JKKKyoseiDslRunCC.executeKyoseiDslProc` | `executeKyoseiDslProc` (loopters over billing advance list) -> `sbOpSvcKei_KyoseiDsl` | `callEKK0351A010SC [R]`, `callEKK0401A010SC [R]`, `callEKK0401C150SC [U]`, `callEKK0401C170SC [U]`, `callEKK0401C180SC [U]`, `updateAgingUseEnd [U]`, `callEKK0411A010SC [R]`, `callEKK0361A010SC [R]` |

**Notes:**
- The method is called from within the same class, `executeKyoseiDslProc()`, inside a loop that iterates over the billing advance list (from `EKK0321B002`). It is invoked specifically when the sub-option service contract number (`sbop_svc_kei_no`) is present and non-empty.
- No screen/batch entry points directly invoke this method — it is a sub-component of the DSL forced cancellation batch/CBS process.
- Terminal operations from this method include reads from option/service contract agreements, updates via cancellation confirmations, and aging system updates for mail alias deactivation.

## 6. Per-Branch Detail Blocks

**Block 1** — [SET] `(Billing advance agreement result retrieval) (L2466)`

> Retrieves the billing advance agreement result from the shared resultHash, using the template ID constant.

| # | Type | Code |
|---|------|------|
| 1 | SET | `eKK0321A010Hash = null` |
| 2 | SET | `eKK0321A010Hash = (HashMap)resultHash.get(TEMPLATE_ID_EKK0321A010)` [-> `TEMPLATE_ID_EKK0321A010 = "EKK0321A010"`] // Billing advance agreement result

**Block 2** — [EXEC] `(Option Service Contract Agreement) (L2471)`

> Calls the option service contract agreement SC to obtain the option-level contract information.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `callEKK0351A010SC(param, handle, eKK0321A010Hash, resultHash)` |

**Block 3** — [IF] `(statusCode != 0) (L2472)`

> Error handling: if the option service contract agreement fails, return the error code immediately.

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

**Block 4** — [SET] `(Extract option service contract data) (L2476)`

> Retrieves the option service contract agreement result and extracts the service contract number.

| # | Type | Code |
|---|------|------|
| 1 | SET | `eKK0351A010Hash = null` |
| 2 | SET | `eKK0351A010Hash = (HashMap)resultHash.get(TEMPLATE_ID_EKK0351A010)` [-> `"EKK0351A010"`] |
| 3 | SET | `svc_kei_no = (String)eKK0351A010Hash.get(EKK0351A010CBSMsg1List.SVC_KEI_NO)` |

**Block 5** — [IF] `(svc_kei_no == null or empty) [OPTIONAL CONTRACT] (L2480)`

> If the option service contract has no service contract number, retrieve it from the service contract details agreement. This handles cases where the option contract is linked but the detailed service contract number is not populated at the option level.

**Block 5.1** — [EXEC] `(Service Contract Details Agreement) (L2483)`

| # | Type | Code |
|---|------|------|
| 1 | CALL | `callEKK0161A010SC(param, handle, eKK0351A010Hash, resultHash)` |

**Block 5.2** — [IF] `(statusCode != 0) (L2485)`

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

**Block 5.3** — [SET] `(Extract service contract number from details) (L2491)`

| # | Type | Code |
|---|------|------|
| 1 | SET | `eKK0161A010Hash = null` |
| 2 | SET | `eKK0161A010Hash = (HashMap)resultHash.get(TEMPLATE_ID_EKK0161A010)` [-> `"EKK0161A010"`] |
| 3 | SET | `svc_kei_no = (String)eKK0161A010Hash.get(EKK0161A010CBSMsg1List.SVC_KEI_NO)` |

**Block 6** — [IF] `(prm_svc_kei_no does not match svc_kei_no) (L2499)`

> Validates that the request parameter's service contract number matches the resolved svc_kei_no from the agreement results. If they do not match, the method returns 0 (no-op) — this acts as a guard to prevent processing mismatched contract data.

| # | Type | Code |
|---|------|------|
| 1 | SET | `prm_svc_kei_no = (String)requestParam.get(SVC_KEI_NO)` [-> `"svc_kei_no"`] |
| 2 | IF | `!prm_svc_kei_no.equals(svc_kei_no)` |
| 3 | RETURN | `return 0` // No-op: parameter/service contract number mismatch |

**Block 7** — [EXEC] `(Sub-Option Service Contract Agreement) (L2506)`

> Calls the sub-option service contract agreement SC to retrieve the sub-option contract's current status and details.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `callEKK0401A010SC(param, handle, eKK0321A010Hash, resultHash)` |

**Block 8** — [IF] `(statusCode != 0) (L2507)`

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

**Block 9** — [SET] `(Extract sub-option contract status) (L2513)`

> Retrieves the sub-option service contract data and extracts the status code.

| # | Type | Code |
|---|------|------|
| 1 | SET | `eKK0401A010Hash = null` |
| 2 | SET | `eKK0401A010Hash = (HashMap)resultHash.get(TEMPLATE_ID_EKK0401A010)` [-> `"EKK0401A010"`] |
| 3 | SET | `sbop_svc_kei_stat = (String)eKK0401A010Hash.get(EKK0401A010CBSMsg1List.SBOP_SVC_KEI_STAT)` |

**Block 10** — [IF] `(Status = 010 or 020) [UKE or SHOSA - Cancel Path] (L2523)`

> If the sub-option service status is "Accepted" (UKE = "010") or "Under Review" (SHOSA = "020"), the contract is in a pre-active state. The method performs the cancellation via the cancel method (C150) and returns 0 immediately, skipping the active cancellation workflow.

| # | Type | Code |
|---|------|------|
| 1 | IF | `SVC_KEI_STAT_UKE.equals(sbop_svc_kei_stat)` [-> `"010"`] `|| SVC_KEI_STAT_SHOSA.equals(sbop_svc_kei_stat)` [-> `"020"`] |

**Block 10.1** — [EXEC] `(Sub-Option Service Contract Cancel) (L2531)`

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

**Block 10.2** — [IF] `(statusCode != 0) (L2533)`

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

**Block 10.3** — [SET] `(Capture update datetime) (L2536)`

| # | Type | Code |
|---|------|------|
| 1 | SET | `eKK0401C150Hash = (HashMap)resultHash.get(TEMPLATE_ID_EKK0401C150)` [-> `"EKK0401C150"`] |
| 2 | SET | `this.svcKeiUpdDtm = (String)eKK0401C150Hash.get(EKK0401C150CBSMsg.UPD_DTM)` |
| 3 | RETURN | `return 0` |

**Block 11** — [ELSE-IF] `(Status = 030 or 100 or 210 or 220) [ACTIVE/PASED - Full Cancellation Path] (L2544)`

> If the sub-option service is in an active or paused state (Agreed = "030", Service Provision = "100", Cessation = "210", or Suspension = "220"), the full cancellation workflow is executed. This includes non-taxable judgment, contract cancellation, and cancellation confirmation.

**Block 11.1** — [EXEC] `(Non-taxable judgment utility) (L2552)`

> Runs the non-taxable judgment processing to set flags indicating whether early termination fees apply. The judgment result is stored in a separate map for use in subsequent cancellation SCs.

| # | Type | Code |
|---|------|------|
| 1 | SET | `jdgHiChrgMapSbopSvcKei = runHiChrgJdgUtil(handle, param, requestParam, resultHash, resultHash.get(TEMPLATE_ID_EKK0081A010), null, null, resultHash.get(TEMPLATE_ID_EKK0401A010), DSL_SBT_FLG_SBOP_SVC_KEI_DSL)` [-> `"3"`] // Sub-option DSL flag |

**Block 11.2** — [EXEC] `(Sub-Option Service Contract Cancellation) (L2564)`

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

**Block 11.3** — [IF] `(statusCode != 0) (L2565)`

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

**Block 11.4** — [SET] `(Capture update datetime from cancellation) (L2569)`

| # | Type | Code |
|---|------|------|
| 1 | SET | `eKK0401C170Hash = (HashMap)resultHash.get(TEMPLATE_ID_EKK0401C170)` [-> `"EKK0401C170"`] |
| 2 | SET | `this.svcKeiUpdDtm = (String)eKK0401C170Hash.get(EKK0401C170CBSMsg.UPD_DTM)` |

**Block 11.5** — [EXEC] `(Sub-Option Service Contract Cancellation Confirmation) (L2573)`

| # | Type | Code |
|---|------|------|
| 1 | CALL | `callEKK0401C180SC(param, handle, requestParam, resultHash, jdgHiChrgMapSvcKei, jdgHiChrgMapSbopSvcKei)` |

**Block 11.6** — [IF] `(statusCode != 0) (L2574)`

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

**Block 11.7** — [SET] `(Capture update datetime from confirmation) (L2578)`

| # | Type | Code |
|---|------|------|
| 1 | SET | `eKK0401C180Hash = (HashMap)resultHash.get(TEMPLATE_ID_EKK0401C180)` [-> `"EKK0401C180"`] |
| 2 | SET | `this.svcKeiUpdDtm = (String)eKK0401C180Hash.get(EKK0401C180CBSMsg.UPD_DTM)` |

**Block 11.8** — [SET] `(Extract sub-option service code) (L2581)`

| # | Type | Code |
|---|------|------|
| 1 | SET | `sbop_svc_cd = (String)eKK0401A010Hash.get(EKK0401A010CBSMsg1List.SBOP_SVC_CD)` |

**Block 12** — [IF] `(sbop_svc_cd = "D01") [Mail Alias Special Case] (L2587)`

> When the sub-option service code is "D01" (Mail alias service / メールエイリアス), additional processing is required for the ISP-level agreement chain. This handles the special case where the sub-option is a mail alias service that requires separate option and sub-option ISP agreement processing.

**Block 12.1** — [EXEC] `(Option Service Contract <ISP> Agreement) (L2591)`

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

**Block 12.2** — [IF] `(statusCode != 0) (L2592)`

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

**Block 12.3** — [SET] `(Extract ISP agreement results) (L2596)`

| # | Type | Code |
|---|------|------|
| 1 | SET | `eKK0361A010Hash = null` |
| 2 | SET | `eKK0361A010Hash = (HashMap)resultHash.get(TEMPLATE_ID_EKK0361A010)` [-> `"EKK0361A010"`] |
| 3 | SET | `oyaOpSvcKeiNo = (String)eKK0361A010Hash.get(EKK0361A010CBSMsg1List.OP_SVC_KEI_NO)` |
| 4 | SET | `mlad = (String)eKK0361A010Hash.get(EKK0361A010CBSMsg1List.MLAD)` // Mail address |

**Block 12.4** — [EXEC] `(Sub-Option Service Contract <ISP> Agreement) (L2603)`

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

**Block 12.5** — [IF] `(statusCode != 0) (L2604)`

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

**Block 12.6** — [SET] `(Extract sub-option ISP results) (L2608)`

| # | Type | Code |
|---|------|------|
| 1 | SET | `eKK0411A010Hash = null` |
| 2 | SET | `eKK0411A010Hash = (HashMap)resultHash.get(TEMPLATE_ID_EKK0411A010)` [-> `"EKK0411A010"`] |

**Block 12.7** — [IF] `(eKK0411A010Hash != null) (L2610)`

| # | Type | Code |
|---|------|------|
| 1 | SET | `mailArias = (String)eKK0411A010Hash.get(EKK0411A010CBSMsg1List.ALIAS)` |
| 2 | SET | `koOpSvcKei = (String)eKK0411A010Hash.get(EKK0411A010CBSMsg1List.OP_SVC_KEI_NO)` |

**Block 12.8** — [IF] `(mailArias not empty AND parent contract matches) (L2614)`

> If a mail alias value is present and the sub-option's contract number matches the parent contract number, the alias is reconstructed with the domain from the original mail address and marked as usage-terminated.

**Block 12.8.1** — [IF] `(mailArias != null AND !empty) (L2615)`

| # | Type | Code |
|---|------|------|
| 1 | IF | `mailArias != null && !"".equals(mailArias)` |
| 2 | IF | `koOpSvcKei.equals(oyaOpSvcKeiNo)` |

**Block 12.8.2** — [SET] `(Split and reconstruct mail alias, mark as usage ended) (L2619)`

> Splits the original mail address (mlad) by "@" to extract the domain part, appends it to the alias mail, and updates the requestParam with aging type code and target value, then calls the aging usage-end update.

| # | Type | Code |
|---|------|------|
| 1 | SET | `mladBunkatsu = mlad.split("@")` |
| 2 | SET | `mailArias = mailArias + "@" + mladBunkatsu[mladBunkatsu.length-1]` // Reconstruct: alias@domain |
| 3 | SET | `requestParam.put(AGING_SBT_CD, AGING_SBT_CD_ARIAS)` [-> `AGING_SBT_CD = "aging_sbt_cd"`, `AGING_SBT_CD_ARIAS = "008"`] // Aging type code: Alias |
| 4 | SET | `requestParam.put(AGING_TG_VALUE, mailArias)` [-> `AGING_TG_VALUE = "aging_tg_value"`] // Aging target value |
| 5 | CALL | `updateAgingUseEnd(param, handle, requestParam, resultHash)` |

**Block 12.8.3** — [IF] `(statusCode != 0) (L2623)`

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

**Block 13** — [RETURN] `(Final return) (L2632)`

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return 0` // Success: all processing completed |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `sbop_svc_kei_stat` | Field | Sub-option service contract status — indicates the current lifecycle state of the sub-option service contract |
| `svc_kei_no` | Field | Service contract number — unique identifier for a service contract line |
| `sbop_svc_kei_no` | Field | Sub-option service contract number — identifier for a sub-option level service contract |
| `op_svc_kei_no` | Field | Option service contract number — identifier for an option-level service contract |
| `oyaOpSvcKeiNo` | Field | Parent option service contract number — the top-level option contract number used for cross-referencing |
| `koOpSvcKei` | Field | Child option service contract number — the sub-option's own contract number |
| `sbop_svc_cd` | Field | Sub-option service code — classifies the type of sub-option service (e.g., "D01" for mail alias) |
| `mlad` | Field | Mail address — the original email address associated with a mail alias service |
| `mailArias` | Field | Mail alias — the alias email address configured for the mail alias service |
| `svcKeiUpdDtm` | Field | Service contract update datetime — timestamp recorded when a service contract is modified or cancelled |
| `jdgHiChrgMapSbopSvcKei` | Field | Judgment non-taxation map sub-option — early termination fee determination result for sub-option contracts |
| `jdgHiChrgMapSvcKei` | Field | Judgment non-taxation map service — early termination fee determination result for main service contracts |
| `SVC_KEI_STAT_UKE = "010"` | Constant | Accepted / 受払済 — contract has been accepted but not yet under review |
| `SVC_KEI_STAT_SHOSA = "020"` | Constant | Under Review / 照会済 — contract is under review/inquiry |
| `SVC_KEI_STAT_TEIK = "030"` | Constant | Agreed / 締結済 — contract has been agreed upon |
| `SVC_KEI_STAT_TKC = "100"` | Constant | Service Provision in Progress / サービス提供中 — service is actively being provided |
| `SVC_KEI_STAT_KYUS = "210"` | Constant | Cessation/Halting / 休止・中断中 — service has been suspended or interrupted |
| `SVC_KEI_STAT_STP = "220"` | Constant | Suspended / 停止中 — service is suspended |
| `SVC_KEI_STAT_DSL = "910"` | Constant | Cancelled / 解約済 — contract has been cancelled |
| `SVC_KEI_STAT_CNCL = "920"` | Constant | Cancellation Completed / キャンセル済 — cancellation processing completed |
| `SBOP_SVC_CD_ALIAS = "D01"` | Constant | Mail alias service code — identifies the sub-option service as a mail alias |
| `DSL_SBT_FLG_SBOP_SVC_KEI_DSL = "3"` | Constant | Sub-option DSL flag — indicates this is a sub-option DSL contract for judgment routing |
| `AGING_SBT_CD_ALIAS = "008"` | Constant | Aging type code for alias — identifies the aging management entry type as a mail alias |
| `AGING_SBT_CD` | Field | Aging type code key — map key for specifying the aging management entry type |
| `AGING_TG_VALUE` | Field | Aging target value key — map key for the actual aging target (e.g., email address) |
| EKK0321A010 | SC Code | Billing advance agreement SC — retrieves billing advance agreement data |
| EKK0351A010 | SC Code | Option service contract agreement SC — retrieves option service contract data |
| EKK0161A010 | SC Code | Service contract details agreement SC — retrieves detailed service contract information |
| EKK0401A010 | SC Code | Sub-option service contract agreement SC — retrieves sub-option service contract data |
| EKK0401C150 | SC Code | Sub-option service contract cancel SC — initiates cancellation for accepted/reviewed contracts |
| EKK0401C170 | SC Code | Sub-option service contract cancellation SC — executes cancellation for active/paused contracts |
| EKK0401C180 | SC Code | Sub-option service contract cancellation confirmation SC — finalizes cancellation processing |
| EKK0361A010 | SC Code | Option service contract <ISP> agreement SC — retrieves ISP-level option service contract data |
| EKK0411A010 | SC Code | Sub-option service contract <ISP> agreement SC — retrieves ISP-level sub-option service contract data |
| EKK0081A010 | SC Code | Service contract agreement SC — base service contract agreement data retrieval |
| DSL | Acronym | Digital Subscriber Line — telecommunications forced cancellation processing context |
| SC | Acronym | Service Component — Fujitsu BPMS service component layer for database/service operations |
| ISP | Acronym | Internet Service Provider — the internet connectivity service layer |
| KYOGAI | Domain term | Forced cancellation — bulk termination of DSL contracts performed during customer resignation/transfer processes |
| HicChrg | Acronym | 非課金 (hi-kin-chi) — non-taxable/fee exemption judgment |
| Aging | Domain term | Aging management — system for managing the usage status of resources (IP addresses, email aliases, phone numbers) |
