# Business Logic — JKKSecurityPackOperateCC.dslOption() [228 LOC]

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

## 1. Role

### JKKSecurityPackOperateCC.dslOption()

This method performs **option cancellation and contract termination processing** for the Fujitsu Security Pack service ecosystem (Japanese: `オプションキャンセル・解約処理`). It is a central dispatch method invoked by the main option handling routine (`addChgMain`) when the user requests to cancel or terminate a subscribed option service within the K-Opticom customer base system.

The method implements a **routing/dispatch pattern** based on the current service contract status of the option service. It classifies the target option service into one of two primary processing branches: (1) services that are registered or under review (status `010`/`020`) which follow a lighter **cancellation-only path**, and (2) services that are closed, in service, suspended, or stopped (status `030`/`100`/`210`/`220`) which follow a full **cancellation-with-termination path** including charge judgment and contract finalization.

When the "inheritance exists" flag (`hikitugiUm = "1"`) is set, the method preserves the original option service information by fetching it via the appropriate data retrieval CBS (either `callEKK0391A010` for Remote Support Plus or `callEKK0361A010` for other services), setting the operation service code to null on the preserved record, and storing it in the inheritance source list (`hikiSakiOpSvcKeiList`) in the work map.

After cancellation/termination processing, the method registers a progress tracking entry via `addPrg` with status `PRG_STAT_5102` ("Option Setting Complete"), and returns the updated datetime (`updDtm`). The method is called directly by `JKKSecurityPackOperateCC.adChgMain()` and `JKKSecurityPackOperateCC.main()`, making it the primary execution point for option lifecycle termination in the security pack workflow.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["dslOption start"])
    A1["Log: dslOption start"]
    A2["Init: retMsg = null"]
    B1["Get: ekk0081a010 = callEKK0081A010(svcKeiNo)"]
    B2["Get: idoDiv from ccWorkMap[KEY_IDO_DIV]"]
    B3["Get: aplyYmd from ccWorkMap[OPE_DATE]"]
    B4["Get: retMsgList = mapper.callEKK0351B002(FUNC_CD_1, svcKeiNo)"]
    B5["FOR EACH ekk0351b002 IN retMsgList"]
    C1{"opSvcCd == ekk0351b002.OP_SVC_CD?"}
    C1 -->|No| B5
    C1 -->|Yes| D1["Get dslOpSvcKeiNo"]
    D1 --> D2["Get dslOpSvcKeiStat"]
    D2 --> E1{"dslOpSvcKeiStat is 010 or 020?"}

    E1 -->|Yes| F1["IF hikitugiUm == 1"]
    F1 -->|hikitugiUm == 1| G1{"opSvcCd == RMTSPRT_PLUS?"}
    F1 -->|No| G6["editInMsgEKK0351C220"]
    G1 -->|Yes| G2["callEKK0391A010"]
    G1 -->|No| G3["callEKK0361A010"]
    G2 --> G4["Get hikiSakiOpSvcKeiList"]
    G3 --> G4
    G4 --> G5["Setup mapOpSvcCd, add to list"]
    G5 --> G6
    G6 --> G7["Get updDtm, callEKK0321B002, addPrg"]

    E1 -->|No| H1["checkCnsl(handle, param, dslOpSvcKeiNo)"]
    H1 --> H2["callEKK0351A010(dslOpSvcKeiNo)"]
    H2 --> H3["Build jdgHiChrgMapOpSvcKei"]
    H3 --> H4["jdgHiChrgKekka"]
    H4 --> H5{"hikitugiUm == 1?"}
    H5 -->|Yes| I1{"opSvcCd == RMTSPRT_PLUS?"}
    H5 -->|No| I5["editInMsgEKK0351C240"]
    I1 -->|Yes| I2["callEKK0391A010"]
    I1 -->|No| I3["callEKK0361A010"]
    I2 --> I4["Setup mapOpSvcCd, add to list"]
    I3 --> I4
    I4 --> I5
    I5 --> I6["editInMsgEKK0351C250"]
    I6 --> I7["Get updDtm, callEKK0321B002, addPrg"]

    G7 --> B5
    I7 --> B5
    B5 -->|End| J1["Return updDtm"]
    J1 --> END(["dslOption end"])

    START --> A1
    A1 --> A2
    A2 --> B1
    B1 --> B2
    B2 --> B3
    B3 --> B4
    B4 --> B5
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `opSvcCd` | `String` | Option service code — identifies the specific option service being cancelled (e.g., Remote Support Plus vs standard security options). Used to select the correct CBS data retrieval method and matched against the option service list from `callEKK0351B002`. |
| 2 | `svcKeiNo` | `String` | Service contract number — the primary service contract identifier used to look up the original service agreement details (`callEKK0081A010`) and query the option service list (`callEKK0351B002`). |
| 3 | `pcrsCd` | `String` | Pricing code — the pricing plan code for the option service (e.g., `F08` for Smartlink Premium). Passed into this method but not directly used within `dslOption` itself; likely consumed by downstream CBS calls. |
| 4 | `pplanCd` | `String` | Pricing plan code — the specific pricing plan identifier associated with the option service (e.g., `PF0801` for Smartlink Premium plan). Passed to downstream processing for charge calculations. |
| 5 | `updDtmBf` | `String` | Update date-time before processing — the timestamp prior to this cancellation operation. Used as the initial `updDtm` and updated after each CBS call to track the chronological progression of changes. |
| 6 | `hikitugiUm` | `String` | Inheritance existence flag — when `"1"`, indicates that the cancelled option service should be preserved in a "before state" list for inheritance/transfer purposes. Triggers pre-cancellation data retrieval and archival. |
| 7 | `kakinFlg` | `String` | Billing flag — indicates whether the option service is chargeable (`"1"`) or non-chargeable (`"0"`). Used in the charge judgment map (`jdgHiChrgMapOpSvcKei`) during the full termination path to determine if charges should continue or stop. |
| 8 | `handle` | `SessionHandle` | Session handle — carries session context including work map (`ccWorkMap`) with pre-populated data like `KEY_IDO_DIV` (migration difference indicator) and `OPE_DATE` (operation date). Required for the `checkCnsl` method to cancel migration reservations. |
| 9 | `param` | `IRequestParameterReadWrite` | Request parameter interface — used by `checkCnsl` to access request-level data for migration reservation cancellation. Provides read/write access to request-scoped parameters. |

**Instance fields / external state read:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `this.ccWorkMap` | `Map<String, Object>` | CC work map holding contextual data: `KEY_IDO_DIV` (migration difference indicator), `OPE_DATE` (operation date for service end calculations), `hikiSakiOpSvcKeiList` (inheritance source list), `mskm_dtl_no_cancel` (detail number for cancellation). |
| `this.mapper` | `JKKSecurityPackOperateMapperCC` | Mapper object providing access to CBS methods (`callEKK0351B002`, `editInMsgEKK0351C220`, `editInMsgEKK0351C240`, `editInMsgEKK0351C250`, `callEKK0361A010`, `callEKK0391A010`). |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `callEKK0081A010` | `EKK0081A010SC` | `KK_T_OPSVKEI_ISP` (Service Contract Info) | Retrieves the original service contract agreement details (including `SVC_CHRG_STAYMD` — service charge start date) for the given `svcKeiNo` to calculate billing end dates. |
| R | `mapper.callEKK0351B002` | `EKK0351B002SC` | `KK_T_OPSVKEI_ISP` (Option Service Contracts) | Fetches the list of option service contracts associated with the main service, returning the `OP_SVC_CD`, `OP_SVC_KEI_NO`, and `OP_SVC_KEI_STAT` for each option. |
| R | `mapper.callEKK0361A010` | `EKK0361A010SC` | `KK_T_OPSVKEI_OPT` (Option Service Info) | Retrieves detailed option service contract data for the purpose of preserving "before state" when `hikitugiUm = "1"`. Used for standard (non-Remote-Support-Plus) options. |
| R | `mapper.callEKK0391A010` | `EKK0391A010SC` | `KK_T_OPSVKEI_OPT` (Option Service Info) | Same as `callEKK0361A010` but specifically for Remote Support Plus (`RMTSPRT_PLUS`) options. Retrieves the data to preserve for inheritance. |
| U | `mapper.editInMsgEKK0351C220` | `EKK0351C220SC` | `KK_T_OPSVKEI_OPT` (Option Service Contract) | Performs option cancellation processing — sets the option service status to cancellation-pending. Returns updated `updDtm`. Called for both registered/review and closed/service-in-progress statuses. |
| U | `mapper.editInMsgEKK0351C240` | `EKK0351C240SC` | `KK_T_OPSVKEI_OPT` (Option Service Contract) | Performs option cancellation finalization — writes cancellation date, service end date, charge end date, and charge judgment results. Called only for the full termination path. |
| U | `mapper.editInMsgEKK0351C250` | `EKK0351C250SC` | `KK_T_OPSVKEI_OPT` (Option Service Contract) | Performs option contract termination — finalizes the contract status to "terminated" (910). Updates the contract to reflect the completed cancellation. Called only for the full termination path. |
| R | `callEKK0321B002` | `EKK0321B002SC` | `KK_T_SEIKY_KEI_ISP` (Billing Contract) | Resolves the billing contract number (request contract number / service contract number mapping) for progress tracking registration. |
| C | `addPrg` | — | `KK_T_PRG` (Progress Management) | Registers a progress tracking entry with status `PRG_STAT_5102` ("Option Setting Complete") to monitor the asynchronous completion of the option cancellation workflow. |
| - | `checkCnsl` | — | — | Cancels pending migration reservations (`callEKK0321B002` internal) before processing the full termination path. Called only for status `030/100/210/220`. |
| - | `jdgHiChrgKekka` | — | `jdgHiChrgMapOpSvcKei` (in-memory) | Performs charge/non-charge judgment based on service charge start/end dates, billing flag, and usage start dates. Populates the charge judgment result map used by subsequent CBS calls. |

## 5. Dependency Trace

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

No screen/batch entry points found within 8 hops. Direct callers found: 21 methods.

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | `JKKSecurityPackOperateCC.adChgMain` | `adChgMain` → `dslOption` | `callEKK0351B002 [R] KK_T_OPSVKEI_ISP`, `callEKK0351A010 [R] KK_T_OPSVKEI_OPT`, `editInMsgEKK0351C220 [U] KK_T_OPSVKEI_OPT`, `editInMsgEKK0351C240 [U] KK_T_OPSVKEI_OPT`, `editInMsgEKK0351C250 [U] KK_T_OPSVKEI_OPT` |
| 2 | `JKKSecurityPackOperateCC.main` | `main` → `dslOption` | `callEKK0351B002 [R] KK_T_OPSVKEI_ISP`, `callEKK0351A010 [R] KK_T_OPSVKEI_OPT`, `editInMsgEKK0351C220 [U] KK_T_OPSVKEI_OPT`, `editInMsgEKK0351C240 [U] KK_T_OPSVKEI_OPT`, `editInMsgEKK0351C250 [U] KK_T_OPSVKEI_OPT` |
| 3 | `JKKOpSvcHktgiUpdCC` (call at line 1996 area) | `opSvcHktgiUpd` → `dslOption` | `callEKK0361A010 [R] KK_T_OPSVKEI_OPT`, `editInMsgEKK0351C220 [U] KK_T_OPSVKEI_OPT`, `editInMsgEKK0351C250 [U] KK_T_OPSVKEI_OPT` |

**Notes:**
- The direct callers `adChgMain()` and `main()` are internal routing methods within `JKKSecurityPackOperateCC` that dispatch to `dslOption` after determining the cancellation path.
- The method is the terminal CBS dispatch point — all data operations flow through `JKKSecurityPackOperateMapperCC` to external CBS (EKKxxxxx) services.

## 6. Per-Branch Detail Blocks

**Block 1** — INIT `(Initialization)` (L1744)

> Initialize working variables and fetch prerequisite data.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `printlnEjbLog("JKKSecurityPackOperateCC.dslOption start")` // Log method entry |
| 2 | SET | `retMsg = null` // Initialize return message |
| 3 | SET | `retMsgList = null` // Initialize return message list |
| 4 | SET | `hikitugiMotoEKK03X1A010 = null` // Initialize preserved data array |
| 5 | SET | `hikitugiMotoEKK03X1A010msg = null` // Initialize preserved message |
| 6 | SET | `msgsEKK0351A010 = null` // Initialize call return messages |
| 7 | SET | `updDtm = updDtmBf` // Copy update date-time before [Japanese: 更新年月日時秒] |
| 8 | CALL | `ekk0081a010 = callEKK0081A010(svcKeiNo)` // [Japanese: サービス契約照会] Service contract inquiry — retrieves original service agreement details |
| 9 | SET | `idoDiv = (String) this.ccWorkMap.get(JKKSecurityPackOperateCC.KEY_IDO_DIV)` // [Japanese: 引数.異動区分] Argument: migration difference indicator |
| 10 | SET | `aplyYmd = (String) this.ccWorkMap.get(OPE_DATE)` // [Japanese: 運用日] Operation date |
| 11 | CALL | `retMsgList = this.mapper.callEKK0351B002(JPCModelConstant.FUNC_CD_1, svcKeiNo)` // Query option service contracts for the main service |

**Block 2** — FOR EACH `(iterate retMsgList)` (L1754)

> Iterate over each option service contract returned by the CBS query.

| # | Type | Code |
|---|------|------|
| 1 | SET | `ekk0351b002 : CAANMsg` // Loop variable over `retMsgList` |

**Block 2.1** — IF `opSvcCd` match `(find matching option service)` (L1757)

> Check if the current loop item's option service code matches the target `opSvcCd` parameter.

| # | Type | Code |
|---|------|------|
| 1 | IF | `opSvcCd.equals(ekk0351b002.getString(EKK0351B002CBSMsg1List.OP_SVC_CD))` // Match option service code |
| 2 | SET | `dslOpSvcKeiNo = ekk0351b002.getString(EKK0351B002CBSMsg1List.OP_SVC_KEI_NO)` // [Japanese: 解約オプションサービス契約番号取得] Get option service contract number |
| 3 | SET | `dslOpSvcKeiStat = ekk0351b002.getString(EKK0351B002CBSMsg1List.OP_SVC_KEI_STAT)` // [Japanese: 解約オプションサービス契約ステータス取得] Get option service contract status |

**Block 2.1.1** — IF `dslOpSvcKeiStat == "010" or "020"` `(Registered / Review Complete path)` (L1767)

> [Japanese: オプションサービス契約ステータスが「010:受注済」or「020:照済」] The option service contract status is "010: Registered" or "020: Review Complete". This branch handles cancellation of option services that are newly registered or under review but not yet in active service.

| # | Type | Code |
|---|------|------|
| 1 | IF | `SVC_KEI_STAT_010.equals(dslOpSvcKeiStat) || SVC_KEI_STAT_020.equals(dslOpSvcKeiStat)` — [SVC_KEI_STAT_010="010" (JKKSecurityPackOperateCC.java:254) Registered, SVC_KEI_STAT_020="020" (JKKSecurityPackOperateCC.java:257) Review Complete] |

**Block 2.1.1.1** — IF `hikitugiUm == "1"` `(Preserve inheritance data)` (L1777)

> [Japanese: 引継ぎ有無が「有」の場合、解約情報を保持しておく] If inheritance flag is "Yes", preserve the cancellation information.

| # | Type | Code |
|---|------|------|
| 1 | SET | `mapOpSvcCd = new HashMap<String, Object>()` // [ANK-3149-00-01] Create new map for opSvcCd |
| 2 | IF | `hikitugiUm.equals("1")` // Check if inheritance exists |
| 3 | IF | `opSvcCd.equals(JKKStrConst.OP_SVC_CD_RMTSPRT_PLUS)` — [Japanese: オプションコードがリモートサポートの場合] If option code is Remote Support Plus |
| 4 | CALL | `hikitugiMotoEKK03X1A010 = this.mapper.callEKK0391A010(dslOpSvcKeiNo)` // Retrieve Remote Support Plus option data |
| 5 | ELSE | — |
| 6 | CALL | `hikitugiMotoEKK03X1A010 = this.mapper.callEKK0361A010(dslOpSvcKeiNo)` // Retrieve standard option data |
| 7 | SET | `hikiSakiOpSvcKeiList = (ArrayList<CAANMsg>) this.ccWorkMap.get("hikiSakiOpSvcKeiList")` // Get inheritance source list from work map |
| 8 | SET | `hikitugiMotoEKK03X1A010msg = hikitugiMotoEKK03X1A010[0]` // Get first preserved message |
| 9 | EXEC | `hikitugiMotoEKK03X1A010msg.setNull("op_svc_cd")` // Clear the op_svc_cd field on the preserved record |
| 10 | SET | `mapOpSvcCd.put("op_svc_cd", opSvcCd)` // [ANK-3149-00-01 MOD] Set op_svc_cd into mapOpSvcCd |
| 11 | EXEC | `hikitugiMotoEKK03X1A010msg.setMsgDataOfAll(mapOpSvcCd)` // Apply map data to message |
| 12 | EXEC | `hikiSakiOpSvcKeiList.add(hikitugiMotoEKK03X1A010[0])` // [Japanese: 引継ぎ元リストにセット] Set into inheritance source list |

**Block 2.1.1.2** — `editInMsgEKK0351C220` `(Option cancellation — Registered/Review path)` (L1796)

> [Japanese: オプションサービス契約キャンセル] Option service contract cancellation. Processes the cancellation of the option service without full termination.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `retMsg = this.mapper.editInMsgEKK0351C220(dslOpSvcKeiNo, (String)this.ccWorkMap.get("mskm_dtl_no_cancel"), updDtm, idoDiv, hikitugiUm)` // [ANK-3149-00-02 ADD] Cancel option service — includes inheritance flag |
| 2 | SET | `updDtm = retMsg.getString(EKK0351C220CBSMsg.UPD_DTM)` // [Japanese: 更新年月日時秒（更新後）取得] Get updated date-time after processing |
| 3 | CALL | `seikyKeiNo = callEKK0321B002(svcKeiNo)` // [Japanese: 請求一覧照会] Billing contract inquiry — get billing number |
| 4 | SET | `prgStat = PRG_STAT_5102` // [PRG_STAT_5102="5102" (JKKSecurityPackOperateCC.java:265) Option setting complete] |
| 5 | CALL | `addPrg(KEY_CANCEL_INFO_LIST, (String)this.ccWorkMap.get("mskm_dtl_no_cancel"), seikyKeiNo, dslOpSvcKeiNo, svcKeiNo, "", "", opSvcCd, prgStat)` // [Japanese: 進捗登録用のリストを設定] Set progress registration list |

**Block 2.1.2** — IF `dslOpSvcKeiStat == "030"/"100"/"210"/"220"` `(Full termination path)` (L1823)

> [Japanese: オプションサービス契約ステータスが「030:締結済」or「100:サービス提供中」or「210:休止・中断中」or「220:停止中」] The option service contract status is "030: Closed" or "100: Service in Progress" or "210: Suspended/Interrupted" or "220: Stopped". This branch handles full cancellation with contract termination, including migration reservation cancellation and charge judgment.

| # | Type | Code |
|---|------|------|
| 1 | IF | `SVC_KEI_STAT_030.equals(dslOpSvcKeiStat) || SVC_KEI_STAT_100.equals(dslOpSvcKeiStat) || SVC_KEI_STAT_210.equals(dslOpSvcKeiStat) || SVC_KEI_STAT_220.equals(dslOpSvcKeiStat)` — [SVC_KEI_STAT_030="030" (L260) Closed, SVC_KEI_STAT_100="100" (L263) Service in Progress, SVC_KEI_STAT_210="210" (L266) Suspended, SVC_KEI_STAT_220="220" (L269) Stopped] |

**Block 2.1.2.1** — `checkCnsl` `(Cancel migration reservations)` (L1833)

> [Japanese: 異動予約取消を行う] Perform migration reservation cancellation. Removes any pending migration reservations associated with this option service before processing the termination.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `checkCnsl(handle, param, dslOpSvcKeiNo)` // [IT1-2017-0000039 ADD] Cancel pending migration reservations |

**Block 2.1.2.2** — `callEKK0351A010` `(Fetch option service data)` (L1838)

> Retrieve current option service contract data for termination processing.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `msgsEKK0351A010 = this.mapper.callEKK0351A010(dslOpSvcKeiNo)` // Retrieve option service data for termination |

**Block 2.1.2.3** — `Build charge judgment map` `(Construct charge judgment parameters)` (L1844)

> [Japanese: サービス終了年月日, サービス課金終了年月日, 課金非課金判定] Construct service end dates and charge judgment parameters.

| # | Type | Code |
|---|------|------|
| 1 | SET | `svcEndYmd = aplyYmd` // [Japanese: サービス終了年月日] Service end date = operation date |
| 2 | SET | `svcChrgEndYmd = addYYYYMMDD(aplyYmd, -1)` // [Japanese: サービス課金終了年月日（適用日−1日）] Service charge end date = operation date minus 1 day |
| 3 | SET | `jdgHiChrgMapOpSvcKei = new HashMap<String, Object>()` // Create charge judgment map |
| 4 | SET | `jdgHiChrgMapOpSvcKei.put("svcChrgEndYmd", svcChrgEndYmd)` // [Japanese: サービス契約サービス課金終了日] Service contract service charge end date |
| 5 | SET | `jdgHiChrgMapOpSvcKei.put("chrgHichrgCd", kakinFlg)` // [Japanese: 課金フラグ] Billing flag |
| 6 | SET | `jdgHiChrgMapOpSvcKei.put("svcChrgStaYmd", ekk0081a010.getString(EKK0081A010CBSMsg1List.SVC_CHRG_STAYMD))` // [Japanese: サービス契約サービス課金開始日] Service contract charge start date |
| 7 | SET | `jdgHiChrgMapOpSvcKei.put("opSvcUseStaYmd", msgsEKK0351A010[0].getString(EKK0351A010CBSMsg1List.SVC_USE_STA_KIBO_YMD))` // [Japanese: オプションサービスサービス利用開始日] Option service service usage start date (requested) |
| 8 | SET | `jdgHiChrgMapOpSvcKei.put("opSvcChrgStaYmd", msgsEKK0351A010[0].getString(EKK0351A010CBSMsg1List.SVC_CHRG_STAYMD))` // [Japanese: オプションサービス課金開始年月日] Option service charge start date |
| 9 | SET | `jdgHiChrgMapOpSvcKei.put("dslSbtFlg", "2")` // [DSL_SBT_FLG_OP_SVC_KEI_DSL="2" (L283) Option service contract cancellation] Cancellation type flag |
| 10 | SET | `jdgHiChrgMapOpSvcKei.put("svcChrgEndYmd", addYYYYMMDD(aplyYmd, -1))` // [Japanese: 固定] Fixed — overwrite service charge end date |
| 11 | CALL | `jdgHiChrgKekka(jdgHiChrgMapOpSvcKei)` // [Japanese: 課金非課金判定] Charge/non-charge judgment |

**Block 2.1.2.4** — IF `hikitugiUm == "1"` `(Preserve inheritance data — full termination)` (L1873)

> [Japanese: 引継ぎ有無が「有」の場合、解約情報を保持しておく] If inheritance flag is "Yes", preserve the cancellation information (same logic as Block 2.1.1.1).

| # | Type | Code |
|---|------|------|
| 1 | IF | `hikitugiUm.equals("1")` // Inheritance exists |
| 2 | IF | `opSvcCd.equals(JKKStrConst.OP_SVC_CD_RMTSPRT_PLUS)` — [Japanese: オプションコードがリモートサポートの場合] If option code is Remote Support Plus |
| 3 | CALL | `hikitugiMotoEKK03X1A010 = this.mapper.callEKK0391A010(dslOpSvcKeiNo)` // Retrieve Remote Support Plus data |
| 4 | ELSE | — |
| 5 | CALL | `hikitugiMotoEKK03X1A010 = this.mapper.callEKK0361A010(dslOpSvcKeiNo)` // Retrieve standard option data |
| 6 | SET | `mapOpSvcCd = new HashMap<String, Object>()` // [ANK-3149-00-01 MOD] Re-create map |
| 7 | SET | `hikiSakiOpSvcKeiList = (ArrayList<CAANMsg>) this.ccWorkMap.get("hikiSakiOpSvcKeiList")` // Get inheritance list |
| 8 | SET | `hikitugiMotoEKK03X1A010msg = hikitugiMotoEKK03X1A010[0]` // Get preserved message |
| 9 | EXEC | `hikitugiMotoEKK03X1A010msg.setNull("op_svc_cd")` // Clear op_svc_cd |
| 10 | SET | `mapOpSvcCd.put("op_svc_cd", opSvcCd)` // [ANK-3149-00-01 MOD] Set into map |
| 11 | EXEC | `hikitugiMotoEKK03X1A010msg.setMsgDataOfAll(mapOpSvcCd)` // Apply map to message |
| 12 | EXEC | `hikiSakiOpSvcKeiList.add(hikitugiMotoEKK03X1A010[0])` // [Japanese: 引継ぎ元リストにセット] Add to inheritance list |

**Block 2.1.2.5** — `editInMsgEKK0351C240` `(Option cancellation — full termination)` (L1897)

> [Japanese: オプションサービス契約解約] Option service contract cancellation/finalization. Writes the cancellation details including service end dates and charge judgment results.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `retMsg = this.mapper.editInMsgEKK0351C240(dslOpSvcKeiNo, msgsEKK0351A010[0], (String)this.ccWorkMap.get("mskm_dtl_no_cancel"), aplyYmd, svcEndYmd, svcChrgEndYmd, updDtm, idoDiv, jdgHiChrgMapOpSvcKei)` // Full cancellation with all termination parameters |
| 2 | SET | `updDtm = retMsg.getString(EKK0351C240CBSMsg.UPD_DTM)` // [Japanese: 更新年月日時秒（更新後）取得] Get updated date-time |

**Block 2.1.2.6** — `editInMsgEKK0351C250` `(Contract termination finalization)` (L1909)

> [Japanese: オプションサービス契約解約確定] Option service contract termination finalization. Makes the cancellation permanent and sets the contract to final terminated status.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `retMsg = this.mapper.editInMsgEKK0351C250(dslOpSvcKeiNo, msgsEKK0351A010[0], svcEndYmd, svcChrgEndYmd, updDtm, idoDiv, jdgHiChrgMapOpSvcKei, hikitugiUm)` // [ANK-3149-00-02 ADD] Contract termination — includes inheritance flag |
| 2 | SET | `updDtm = retMsg.getString(EKK0351C250CBSMsg.UPD_DTM)` // [Japanese: 更新年月日時秒（更新後）取得] Get updated date-time |

**Block 2.1.2.7** — `Progress registration` `(Register completion progress)` (L1919)

> Register the cancellation result in the progress tracking table.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `seikyKeiNo = callEKK0321B002(svcKeiNo)` // [Japanese: 請求一覧照会] Billing contract inquiry |
| 2 | SET | `prgStat = PRG_STAT_5102` // [PRG_STAT_5102="5102" (L265) Option setting complete] |
| 3 | CALL | `addPrg(KEY_CANCEL_INFO_LIST, (String)this.ccWorkMap.get("mskm_dtl_no_cancel"), seikyKeiNo, dslOpSvcKeiNo, svcKeiNo, "", "", opSvcCd, prgStat)` // [Japanese: 進捗登録用のリストを設定] Set progress list |

**Block 3** — RETURN `(Method completion)` (L1956)

> Log exit and return the final updated date-time.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `printlnEjbLog("JKKSecurityPackOperateCC.dslOption end")` // Log method exit |
| 2 | RETURN | `return updDtm` // Return the last updated date-time value |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `dslOption` | Method | Option cancellation and contract termination — the primary method for ending an option service subscription |
| `opSvcCd` | Field | Option service code — identifier for the specific option service (e.g., Remote Support Plus, Security Pack) |
| `svcKeiNo` | Field | Service contract number — the main service contract identifier under which option services are subscribed |
| `pcrsCd` | Field | Pricing code — the pricing plan code associated with the option service (e.g., `F08` = Smartlink Premium) |
| `pplanCd` | Field | Pricing plan code — the specific plan identifier within a pricing code (e.g., `PF0801` = Smartlink Premium plan) |
| `updDtmBf` | Field | Update date-time before — timestamp prior to the cancellation operation |
| `hikitugiUm` | Field | Inheritance existence flag — `"1"` means the cancelled option service data should be preserved for inheritance/transfer to another service |
| `kakinFlg` | Field | Billing flag — `"1"` = chargeable, `"0"` = non-chargeable. Determines whether service charges continue until the cancellation effective date |
| `idoDiv` | Field | Migration difference indicator — tracks migration-related differences; stored in the CC work map |
| `aplyYmd` | Field | Application date (operation date) — the effective date used for service end and charge end date calculations; stored in the CC work map as `OPE_DATE` |
| `dslOpSvcKeiNo` | Field | Option service contract number — the specific contract number for the option service being cancelled, retrieved from `callEKK0351B002` |
| `dslOpSvcKeiStat` | Field | Option service contract status — the current status of the option service contract |
| `seikyKeiNo` | Field | Billing contract number / request contract number — the billing-side contract number for the service, used for progress tracking |
| `prgStat` | Field | Progress status — tracks the workflow stage (e.g., `5102` = Option setting complete) |
| `SVC_KEI_STAT_010` | Constant | Service contract status "010" — Registered (`登録済`). The service order has been registered but not yet under review. |
| `SVC_KEI_STAT_020` | Constant | Service contract status "020" — Review Complete (`照済`). The service order has been reviewed and confirmed. |
| `SVC_KEI_STAT_030` | Constant | Service contract status "030" — Closed (`締結済`). The contract has been finalized. |
| `SVC_KEI_STAT_100` | Constant | Service contract status "100" — Service in Progress (`サービス提供中`). The service is actively being provided. |
| `SVC_KEI_STAT_210` | Constant | Service contract status "210" — Suspended/Interrupted (`休止・中断中`). The service is temporarily suspended. |
| `SVC_KEI_STAT_220` | Constant | Service contract status "220" — Stopped (`停止中`). The service has been stopped. |
| `PRG_STAT_5102` | Constant | Progress status "5102" — Option setting complete (`オプション設定完了`). Indicates the option cancellation setup has been completed and is tracked in the progress management table. |
| `EKK0351B002` | SC Code | Option service contract query — retrieves the list of option service contracts for a given service |
| `EKK0351A010` | SC Code | Option service data retrieval — fetches detailed option service data for termination processing |
| `EKK0351C220` | SC Code | Option service cancellation — processes the cancellation of an option service (sets cancellation flag, updates status) |
| `EKK0351C240` | SC Code | Option service cancellation finalization — writes cancellation dates, service end dates, and charge judgment results |
| `EKK0351C250` | SC Code | Option service contract termination finalization — finalizes the contract termination (permanent cancellation) |
| `EKK0321B002` | SC Code | Billing contract inquiry — resolves the billing contract number for a service contract number |
| `EKK0361A010` | SC Code | Option service data retrieval (standard) — retrieves option service details for non-Remote-Support-Plus services |
| `EKK0391A010` | SC Code | Option service data retrieval (Remote Support Plus) — retrieves option service details specifically for Remote Support Plus |
| `EKK0081A010` | SC Code | Service contract inquiry — retrieves the original service contract agreement details including charge start dates |
| `RMTSPRT_PLUS` | Business term | Remote Support Plus — a specific option service code for Fujitsu's remote support service |
| `jdgHiChrgMapOpSvcKei` | Field | Charge judgment map for option service — in-memory map containing charge/non-charge determination parameters (service charge end date, billing flag, charge start/end dates) |
| `hikiSakiOpSvcKeiList` | Field | Inheritance source option service list — a list in the work map that stores preserved "before state" option service data when `hikitugiUm = "1"` |
| `ccWorkMap` | Field | CC (Common Component) work map — shared in-memory data store between CBS calls within a single business operation session |
| `checkCnsl` | Method | Migration reservation cancellation — cancels any pending migration reservations for the option service before full termination |
| `jdgHiChrgKekka` | Method | Charge/non-charge judgment result — performs billing determination based on service dates and flags |
| `addPrg` | Method | Progress registration — registers an entry in the progress management table for asynchronous tracking |
| `mskm_dtl_no_cancel` | Field | Detail number for cancellation — the detail contract number used to identify the specific contract line item being cancelled |
| DSL_SBT_FLG_OP_SVC_KEI_DSL | Constant | Service type flag for option service contract cancellation — value `"2"` indicating this is an option service (not a main service) cancellation |
| FUNC_CD_1 | Constant | Function code "1" — used to identify the type of CBS call |
| `addYYYYMMDD` | Method | Date arithmetic utility — adds (or subtracts, if negative) a specified number of days to a YYYYMMDD date string |
| Security Pack | Business term | Fujitsu's bundled security software service offered as an option to K-Opticom broadband customers |
| Smartlink Premium | Business term | A premium pricing plan (`F08` / `PF0801`) within the security pack option ecosystem |
