# Business Logic — JKKSecurityPackOperateCC.adChgMain() [146 LOC]

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

## 1. Role

### JKKSecurityPackOperateCC.adChgMain()

`adChgMain` is the primary orchestrator for security pack and add-on service registration and cancellation operations within the K-Opticom customer base system. It performs a coordinated two-phase lifecycle: first processing all cancellation (deregistration) operations for services flagged for removal, then processing all registration (addition) operations for services flagged for activation. The method handles four distinct service categories — Security Pack (including McAfee Multi-Access and Smartlink Premium), Remote Support Plus, Internet Gateway, and Notification Premium — by dispatching to specialized sub-methods (`dslWrib`, `dslOption`, `adchgDslOption`, `addWrib`, `addSupportOption`, `addOption`) based on enable flags stored in the component work map. It implements a routing/dispatch pattern where boolean enable flags determine which service bundles are processed. The method sits at the center of the "address change registration" screen flow (`adChgMain` is invoked from `execute()` when the operation mode is address change addition), ensuring all bundled services are consistently registered or cancelled alongside the main service contract change. After processing, it updates the final update timestamp (`upd_dtm_af`) in both cancel and add information lists.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["adChgMain start"])
    START --> LOG["printlnEjbLog: start marker"]
    LOG --> EXTRACT["Extract fields from ccWorkMap"]
    EXTRACT --> CANCEL_CHECK{"Cancel flags ENABLE?"}
    CANCEL_CHECK -->|Yes| CANCEL_BLOCK["Cancel Processing"]
    CANCEL_CHECK -->|No| INETSGWL_CANCEL{"inetsgwlTgFlgCancel ENABLE?"}
    CANCEL_BLOCK --> SEC_CANCEL{"Security Pack ENABLE?"}
    SEC_CANCEL -->|Yes| SEC_CANCEL_STEP["dslWrib: Security Pack cancel
adchgDslOption: Remote Support cancel
adchgDslOption: McAfee cancel"]
    SEC_CANCEL -->|No| PRM_CANCEL{"Premium Pack ENABLE?"}
    PRM_CANCEL -->|Yes| PRM_CANCEL_STEP["dslWrib: Smartlink Premium cancel
adchgDslOption: Remote Support cancel
adchgDslOption: McAfee cancel"]
    PRM_CANCEL -->|No| INETSGWL_CANCEL
    SEC_CANCEL_STEP --> INETSGWL_CANCEL
    PRM_CANCEL_STEP --> INETSGWL_CANCEL
    INETSGWL_CANCEL -->|Yes| INETSGWL_CANCEL_STEP["adchgDslOption: Internet Gateway cancel"]
    INETSGWL_CANCEL -->|No| NTFMLPRM_CANCEL{"ntfmlprm_tg_flgCancel ENABLE?"}
    INETSGWL_CANCEL_STEP --> NTFMLPRM_CANCEL
    NTFMLPRM_CANCEL -->|Yes| NTFMLPRM_CANCEL_STEP["adchgDslOption: Notification Premium cancel"]
    NTFMLPRM_CANCEL -->|No| SVC_KEY_CHECK{"svcKeiNoCancel equals svcKeiNoAdd?"}
    NTFMLPRM_CANCEL_STEP --> SVC_KEY_CHECK
    SVC_KEY_CHECK -->|Yes| COPY_DTM["updDtmAdd = updDtmCancel"]
    COPY_DTM --> ADD_BLOCK["Register Processing"]
    SVC_KEY_CHECK -->|No| ADD_BLOCK
    ADD_BLOCK --> SEC_ADD{"Security Pack ENABLE?"}
    SEC_ADD -->|Yes| SEC_ADD_STEP["addWrib: Security Pack register
addSupportOption: Remote Support register
addOption: McAfee register"]
    SEC_ADD -->|No| PRM_ADD{"Premium Pack ENABLE?"}
    PRM_ADD -->|Yes| PRM_ADD_STEP["addWrib: Smartlink Premium register
addSupportOption: Remote Support register
addOption: McAfee register"]
    PRM_ADD -->|No| INETSGWL_ADD{"inetsgwlTgFlgAdd ENABLE?"}
    SEC_ADD_STEP --> INETSGWL_ADD
    PRM_ADD_STEP --> INETSGWL_ADD
    INETSGWL_ADD -->|Yes| INETSGWL_ADD_STEP["addOption: Internet Gateway register"]
    INETSGWL_ADD -->|No| NTFMLPRM_ADD{"ntfmlprm_tg_flgAdd ENABLE?"}
    INETSGWL_ADD_STEP --> NTFMLPRM_ADD
    NTFMLPRM_ADD -->|Yes| NTFMLPRM_ADD_STEP["addOption: Notification Premium register"]
    NTFMLPRM_ADD -->|No| SOD_CHECK{"SOD list has data?"}
    NTFMLPRM_ADD_STEP --> SOD_CHECK
    SOD_CHECK -->|Yes| SOD_CALL["invokeHakkoSODCC: Service Order issuance"]
    SOD_CHECK -->|No| UPDATE_INMAP["Update inMap upd_dtm_af"]
    SOD_CALL --> UPDATE_INMAP
    UPDATE_INMAP --> LOG_END["printlnEjbLog: end marker"]
    LOG_END --> END_NODE(["Return / Next"])
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `handle` | `SessionHandle` | Database session handle providing the transactional context for all service component calls. Represents the current user's database connection and transaction boundary. |
| 2 | `param` | `IRequestParameterReadWrite` | Request parameter object carrying the screen input data and work map state. Contains the service operation function code, transfer division code, and all runtime configuration flags extracted from the screen. Used as a carrier for the SOD issuance call (`invokeHakkoSODCC`). |

**Instance fields read by this method:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `ccWorkMap` | `Map<String, Object>` | Component work area map containing all runtime configuration flags and service contract numbers. Read from keys including `svc_kei_no_cancel`, `svc_kei_no_add`, `hikitugi_um`, `security_pack_tg_flg_cancel`, `premium_pack_tg_flg_cancel`, `security_pack_tg_flg_add`, `premium_pack_tg_flg_add`, `inetsgwl_tg_flg_add`, `inetsgwl_tg_flg_cancel`, `ntfmlprm_tg_flg_add`, `ntfmlprm_tg_flg_cancel`, `mcafee_op_svc_kei_no`, `inetsgwl_op_svc_kei_no`, `ntfmlprm_op_svc_kei_no`, `upd_dtm_bf_cancel`, `upd_dtm_bf_add`, `kisan_ymd` |
| `inMap` | `HashMap<String, Object>` | Input data map containing the cancel and add information lists. Updated at the end of the method with the final update timestamps (`upd_dtm_af`). |
| `sodHakkoCCTrgtDataList` | `ArrayList<HashMap<String, Object>>` | Target list for Service Order Data (SOD) issuance. When non-empty, triggers an SOD issuance call. |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `JKKSecurityPackOperateCC.adchgDslOption` | - | - | Calls `adchgDslOption` in `JKKSecurityPackOperateCC` — cancels DSL options (Remote Support, McAfee, Internet Gateway, Notification Premium) |
| C | `JKKSecurityPackOperateCC.addOption` | - | - | Calls `addOption` in `JKKSecurityPackOperateCC` — registers a new option service (McAfee, Internet Gateway, Notification Premium) |
| C | `JKKSecurityPackOperateCC.addSupportOption` | - | - | Calls `addSupportOption` in `JKKSecurityPackOperateCC` — registers a support/remote access option service |
| C | `JKKSecurityPackOperateCC.addWrib` | - | - | Calls `addWrib` in `JKKSecurityPackOperateCC` — registers a wrapped/discount service contract (Security Pack or Smartlink Premium) |
| C | `JKKSecurityPackOperateCC.addWrib` | - | - | Calls `addWrib` in `JKKSecurityPackOperateCC` — registers a wrapped/discount service contract |
| - | `JKKSecurityPackOperateCC.dslOption` | - | - | Calls `dslOption` in `JKKSecurityPackOperateCC` — cancels an option service contract |
| - | `JKKSecurityPackOperateCC.dslWrib` | - | - | Calls `dslWrib` in `JKKSecurityPackOperateCC` — cancels a wrapped/discount service contract |
| - | `JKKSecurityPackOperateCC.invokeHakkoSODCC` | - | - | Calls `invokeHakkoSODCC` in `JKKSecurityPackOperateCC` — issues a Service Order Data request |
| - | `JKKSecurityPackOperateCC.printlnEjbLog` | - | - | Calls `printlnEjbLog` in `JKKSecurityPackOperateCC` — logs EJBM processing messages |

**CRUD breakdown by service category:**

**Cancel Operations (DSL = Deregistration):**

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| U | `JKKSecurityPackOperateCC.dslWrib` | - | WRIB_SVC_CD (wrapped service contract) | Cancels the Security Pack service contract with rate plan MSKM |
| U | `JKKSecurityPackOperateCC.dslOption` | - | OPSVCKEI (option service contract) | Cancels the Remote Support Plus option service contract |
| U | `JKKSecurityPackOperateCC.adchgDslOption` | - | OPSVCKEI (option service contract) | Cancels the McAfee Multi-Access option service contract |
| U | `JKKSecurityPackOperateCC.dslWrib` | - | WRIB_SVC_SMARTLINK_PREMIUM | Cancels the Smartlink Premium (premium pack) service contract |
| U | `JKKSecurityPackOperateCC.adchgDslOption` | - | OPSVCKEI (option service contract) | Cancels the Internet Gateway option service contract |
| U | `JKKSecurityPackOperateCC.adchgDslOption` | - | OPSVCKEI (option service contract) | Cancels the Notification Premium option service contract |

**Register Operations (ADD):**

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| C | `JKKSecurityPackOperateCC.addWrib` | - | WRIB_SVC_CD (wrapped service contract) | Registers the Security Pack service contract with rate plan MSKM |
| C | `JKKSecurityPackOperateCC.addWrib` | - | WRIB_SVC_SMARTLINK_PREMIUM | Registers the Smartlink Premium service contract |
| C | `JKKSecurityPackOperateCC.addSupportOption` | - | OPSVCKEI (option service contract) | Registers the Remote Support Plus option service contract |
| C | `JKKSecurityPackOperateCC.addOption` | - | OPSVCKEI (option service contract) | Registers the McAfee Multi-Access option service contract |
| C | `JKKSecurityPackOperateCC.addOption` | - | OPSVCKEI (option service contract) | Registers the Internet Gateway option service contract |
| C | `JKKSecurityPackOperateCC.addOption` | - | OPSVCKEI (option service contract) | Registers the Notification Premium option service contract |
| C | `JKKSecurityPackOperateCC.invokeHakkoSODCC` | - | SOD (Service Order Data) | Issues Service Order Data for email whitelist auto-registration |

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | `JKKSecurityPackOperateCC.execute` | `execute` -> `adChgMain` (when `idoDiv != CD00576_ADCHG_ADD`) | `dslWrib [U] WRIB_SVC_CD, dslOption [U] OPSVCKEI, adchgDslOption [U] OPSVCKEI, addWrib [C] WRIB_SVC_CD, addOption [C] OPSVCKEI, addSupportOption [C] OPSVCKEI, invokeHakkoSODCC [C] SOD` |

**Caller detail:**

The `adChgMain` method is a `private` method within `JKKSecurityPackOperateCC`, invoked exclusively from the `execute` method (line 344) when the transfer division code (`idoDiv`) equals `CD00576_ADCHG_ADD` (address change registration). The `execute` method serves as the public entry point, called from screen CBS components handling address change/addition operations.

**Terminal operations reached from this method:**

| Terminal | CRUD | Entity / Entity Description |
|----------|------|---------------------------|
| `dslWrib` (Security Pack) | U | WRIB_SVC_CD — Wrapped service contract (Security Pack MSKM) |
| `dslWrib` (Smartlink Premium) | U | WRIB_SVC_SMARTLINK_PREMIUM — Wrapped service contract (Smartlink Premium) |
| `dslOption` (Remote Support) | U | OPSVCKEI — Option service contract (Remote Support Plus) |
| `adchgDslOption` (McAfee, Internet Gateway, Notification Premium) | U | OPSVCKEI — Option service contract |
| `addWrib` (Security Pack) | C | WRIB_SVC_CD — Wrapped service contract (Security Pack MSKM) |
| `addWrib` (Smartlink Premium) | C | WRIB_SVC_SMARTLINK_PREMIUM — Wrapped service contract |
| `addSupportOption` (Remote Support) | C | OPSVCKEI — Option service contract (Remote Support Plus) |
| `addOption` (McAfee, Internet Gateway, Notification Premium) | C | OPSVCKEI — Option service contract |
| `invokeHakkoSODCC` | C | SOD — Service Order Data (email whitelist issuance) |
| `printlnEjbLog` | - | System log |

## 6. Per-Branch Detail Blocks

**Block 1** — [SET] Extract all runtime fields from ccWorkMap (L562-L596)

> Retrieves all configuration flags and service numbers from the component work map that are needed for the cancellation and registration sections.

| # | Type | Code |
|---|------|------|
| 1 | SET | `svcKeiNoCancel = (String)this.ccWorkMap.get("svc_kei_no_cancel")` // Service contract number for cancel list [-> svc_kei_no_cancel] |
| 2 | SET | `svcKeiNoAdd = (String)this.ccWorkMap.get("svc_kei_no_add")` // Service contract number for add list [-> svc_kei_no_add] |
| 3 | SET | `hikitugiUm = (String)this.ccWorkMap.get(JKKSecurityPackOperateCC.KEY_HIKITUGI_UM)` // Inheritance flag [-> KEY_HIKITUGI_UM="hikitugi_um"] |
| 4 | SET | `updDtmCancel = (String)this.ccWorkMap.get("upd_dtm_bf_cancel")` // Update timestamp before cancellation [-> upd_dtm_bf_cancel] |
| 5 | SET | `updDtmAdd = (String)this.ccWorkMap.get("upd_dtm_bf_add")` // Update timestamp before registration [-> upd_dtm_bf_add] |
| 6 | SET | `securityPackTgFlgAdd = (String)this.ccWorkMap.get("security_pack_tg_flg_add")` // Security pack registration target flag [-> security_pack_tg_flg_add] |
| 7 | SET | `securityPackTgFlgCancel = (String)this.ccWorkMap.get("security_pack_tg_flg_cancel")` // Security pack cancellation target flag [-> security_pack_tg_flg_cancel] |
| 8 | SET | `premiumPackTgFlgAdd = (String)this.ccWorkMap.get("premium_pack_tg_flg_add")` // Premium pack registration target flag [-> premium_pack_tg_flg_add] |
| 9 | SET | `premiumPackTgFlgCancel = (String)this.ccWorkMap.get("premium_pack_tg_flg_cancel")` // Premium pack cancellation target flag [-> premium_pack_tg_flg_cancel] |
| 10 | SET | `mcafeeOpSvcKeiNo = (String)this.ccWorkMap.get("mcafee_op_svc_kei_no")` // McAfee multi-access option service contract number for address change [-> mcafee_op_svc_kei_no] |
| 11 | SET | `inetsgwlTgFlgAdd = (String)this.ccWorkMap.get("inetsgwl_tg_flg_add")` // Internet Gateway registration target flag [-> inetsgwl_tg_flg_add] |
| 12 | SET | `inetsgwlTgFlgCancel = (String)this.ccWorkMap.get("inetsgwl_tg_flg_cancel")` // Internet Gateway cancellation target flag [-> inetsgwl_tg_flg_cancel] |
| 13 | SET | `inetsgwlOpSvcKeiNo = (String)this.ccWorkMap.get("inetsgwl_op_svc_kei_no")` // Internet Gateway option service contract number for address change [-> inetsgwl_op_svc_kei_no] |
| 14 | SET | `ntfmlprm_tg_flgAdd = (String)this.ccWorkMap.get("ntfmlprm_tg_flg_add")` // Notification Premium registration target flag [-> ntfmlprm_tg_flg_add] |
| 15 | SET | `ntfmlprm_tg_flgCancel = (String)this.ccWorkMap.get("ntfmlprm_tg_flg_cancel")` // Notification Premium cancellation target flag [-> ntfmlprm_tg_flg_cancel] |
| 16 | SET | `ntfmlprmOpSvcKeiNo = (String)this.ccWorkMap.get("ntfmlprm_op_svc_kei_no")` // Notification Premium option service contract number for address change [-> ntfmlprm_op_svc_kei_no] |

**Block 2** — [IF] Cancel processing section — Security Pack or Premium Pack cancellation flag ENABLE `[ENABLE="1"]` (L599)

> Checks whether any security pack or premium pack cancellation is requested. If so, enters the cancel processing section.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `ENABLE.equals(securityPackTgFlgCancel)` // Check Security Pack cancel flag [-> ENABLE="1"] |
| 1 | EXEC | `ENABLE.equals(premiumPackTgFlgCancel)` // Check Premium Pack cancel flag [-> ENABLE="1"] |
| 2 | EXEC | `dslWrib(JKKStrConst.WRIB_SVC_CD_SECURITY_PACK, ...)` // Security Pack cancellation (Branch: securityPackTgFlgCancel ENABLE) |
| 3 | EXEC | `dslOption(JKKStrConst.OP_SVC_CD_RMTSPRT_PLUS, ...)` // Remote Support Plus cancellation (Branch: securityPackTgFlgCancel ENABLE) |
| 4 | EXEC | `adchgDslOption(JKKStrConst.OP_SVC_CD_MCAFEE_MULTI_ACCSS, ...)` // McAfee Multi-Access cancellation (Branch: securityPackTgFlgCancel ENABLE) |
| 5 | EXEC | `dslWrib(JKKStrConst.WRIB_SVC_SMARTLINK_PREMIUM, ...)` // Smartlink Premium cancellation (Branch: premiumPackTgFlgCancel ENABLE) |
| 6 | EXEC | `dslOption(JKKStrConst.OP_SVC_CD_RMTSPRT_PLUS, ...)` // Remote Support Plus cancellation (Branch: premiumPackTgFlgCancel ENABLE) |
| 7 | EXEC | `adchgDslOption(JKKStrConst.OP_SVC_CD_MCAFEE_MULTI_ACCSS, ...)` // McAfee Multi-Access cancellation (Branch: premiumPackTgFlgCancel ENABLE) |

**Block 2.1** — [IF-ELSE] Security Pack cancellation `[ENABLE="1"]` (L601)

> When the security pack cancellation flag is enabled, cancels the Security Pack service contract (dslWrib), Remote Support Plus option (dslOption), and McAfee Multi-Access option (adchgDslOption) — all three bundled together.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `updDtmCancel = dslWrib(WRIB_SVC_CD_SECURITY_PACK, svc_kei_no_cancel, PCRS_CD_SECURITY_PACK_MSKM, PPLAN_CD_SECURITY_PACK_MSKM, security_pack_chrg_hichrg_cd_cancel, updDtmCancel)` // Cancels the Security Pack wrapped service contract. Returns updated timestamp. |
| 2 | CALL | `updDtmCancel = dslOption(OP_SVC_CD_RMTSPRT_PLUS, svc_kei_no_cancel, OPSVC_PCRS_RMTSPRT_PLUS, OPSVC_PPLAN_RMTSPRT_PLUS, updDtmCancel, hikitugiUm, security_pack_chrg_hichrg_cd_cancel, handle, param)` // Cancels the Remote Support Plus option service. Returns updated timestamp. |
| 3 | CALL | `updDtmCancel = adchgDslOption(OP_SVC_CD_MCAFEE_MULTI_ACCSS, svc_kei_no_cancel, PCRS_CD_MCAFEE_MULTI_ACCSS="BE1", PPLAN_CD_MCAFEE_MULTI_ACCSS="PBE101", updDtmCancel, hikitugiUm, security_pack_chrg_hichrg_cd_cancel, handle, param, mcafeeOpSvcKeiNo)` // Cancels the McAfee Multi-Access option service. Returns updated timestamp. |

**Block 2.2** — [ELSE-IF] Premium Pack cancellation `[ENABLE="1"]` (L607)

> When the premium pack cancellation flag is enabled, cancels the Smartlink Premium service contract (dslWrib), Remote Support Plus option (dslOption), and McAfee Multi-Access option (adchgDslOption) — the premium equivalent of the security pack bundle.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `updDtmCancel = dslWrib(WRIB_SVC_SMARTLINK_PREMIUM, svc_kei_no_cancel, PCRS_CD_SMARTLINK_PREMIUM="F08", PPLAN_CD_SMARTLINK_PREMIUM="PF0801", premium_pack_chrg_hichrg_cd_cancel, updDtmCancel)` // Cancels the Smartlink Premium wrapped service contract. Returns updated timestamp. |
| 2 | CALL | `updDtmCancel = dslOption(OP_SVC_CD_RMTSPRT_PLUS, svc_kei_no_cancel, OPSVC_PCRS_RMTSPRT_PLUS, OPSVC_PPLAN_RMTSPRT_PLUS, updDtmCancel, hikitugiUm, premium_pack_chrg_hichrg_cd_cancel, handle, param)` // Cancels the Remote Support Plus option service. Returns updated timestamp. |
| 3 | CALL | `updDtmCancel = adchgDslOption(OP_SVC_CD_MCAFEE_MULTI_ACCSS, svc_kei_no_cancel, PCRS_CD_MCAFEE_MULTI_ACCSS="BE1", PPLAN_CD_MCAFEE_MULTI_ACCSS="PBE101", updDtmCancel, hikitugiUm, premium_pack_chrg_hichrg_cd_cancel, handle, param, mcafeeOpSvcKeiNo)` // Cancels the McAfee Multi-Access option service. Returns updated timestamp. |

**Block 3** — [IF] Internet Gateway cancellation `[ENABLE="1"]` (L613)

> Cancels the Internet Gateway option service when its cancellation flag is enabled.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `updDtmCancel = adchgDslOption(OP_SVC_CD_INETSGWL, svc_kei_no_cancel, PCRS_CD_INETSGW_FOR_EO, PPLAN_CD_INETSGW_FOR_EO, updDtmCancel, hikitugiUm, inetsgwl_chrg_hichrg_cd_cancel, handle, param, inetsgwlOpSvcKeiNo)` // Cancels the Internet Gateway option service. Returns updated timestamp. |

**Block 4** — [IF] Notification Premium cancellation `[ENABLE="1"]` (L616)

> Cancels the Notification Premium option service when its cancellation flag is enabled.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `updDtmCancel = adchgDslOption(OP_SVC_CD_NTFMLPRM, svc_kei_no_cancel, PCRS_CD_NTFMLPRM_FOR_EO, PPLAN_CD_NTFMLPRM_FOR_EO, updDtmCancel, hikitugiUm, ntfmlprm_chrg_hichrg_cd_cancel, handle, param, ntfmlprmOpSvcKeiNo)` // Cancels the Notification Premium option service. Returns updated timestamp. |

**Block 5** — [IF] SOD issuance check (commented out, IT1-2017-0000094 DEL) (L619-L626)

> Commented out: previously issued Service Order Data when `sodHakkoCCTrgtDataList` was populated. This was replaced by a later version (IT1-2017-0000094 ADD) that moved the SOD check after the registration section.

| # | Type | Code |
|---|------|------|
| 1 | COMMENT | `// ANK-3149-20-00 ADD START` // Disabled — moved below registration section |

**Block 6** — [IF] Same service contract number check (L632)

> If the cancel and add service contract numbers are the same, copies the cancel update timestamp to the add update timestamp to ensure consistency.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `svcKeiNoCancel.equals(svcKeiNoAdd)` // Check if both operations target the same contract |
| 2 | SET | `updDtmAdd = updDtmCancel` // Sync update timestamp when same contract [-> upd_dtm_af] |

**Block 7** — [IF] Registration section — Security Pack or Premium Pack registration flag ENABLE `[ENABLE="1"]` (L635)

> Checks whether any security pack or premium pack registration is requested.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `ENABLE.equals(securityPackTgFlgAdd)` // Check Security Pack add flag [-> ENABLE="1"] |
| 1 | EXEC | `ENABLE.equals(premiumPackTgFlgAdd)` // Check Premium Pack add flag [-> ENABLE="1"] |
| 2 | CALL | `addWrib(WRIB_SVC_CD_SECURITY_PACK, svc_kei_no_add, ...)` // Security Pack registration |
| 3 | CALL | `addWrib(WRIB_SVC_SMARTLINK_PREMIUM, svc_kei_no_add, ...)` // Smartlink Premium registration |
| 4 | CALL | `addSupportOption(OP_SVC_CD_RMTSPRT_PLUS, svc_kei_no_add, ...)` // Remote Support Plus registration |
| 5 | CALL | `addOption(OP_SVC_CD_MCAFEE_MULTI_ACCSS, svc_kei_no_add, ...)` // McAfee Multi-Access registration |

**Block 7.1** — [IF-ELSE] Security Pack registration `[ENABLE="1"]` (L639)

> When the security pack registration flag is enabled, registers the Security Pack wrapped service contract (addWrib). When the premium pack flag is enabled, registers the Smartlink Premium wrapped service contract instead.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `updDtmAdd = addWrib(WRIB_SVC_CD_SECURITY_PACK, svc_kei_no_add, PCRS_CD_SECURITY_PACK_MSKM, PPLAN_CD_SECURITY_PACK_MSKM, updDtmAdd)` // Registers the Security Pack wrapped service contract. Returns updated timestamp. (Branch: securityPackTgFlgAdd ENABLE) |
| 2 | CALL | `updDtmAdd = addWrib(WRIB_SVC_SMARTLINK_PREMIUM, svc_kei_no_add, PCRS_CD_SMARTLINK_PREMIUM="F08", PPLAN_CD_SMARTLINK_PREMIUM="PF0801", updDtmAdd)` // Registers the Smartlink Premium wrapped service contract. Returns updated timestamp. (Branch: premiumPackTgFlgAdd ENABLE) |
| 3 | CALL | `updDtmAdd = addSupportOption(OP_SVC_CD_RMTSPRT_PLUS, svc_kei_no_add, OPSVC_PCRS_RMTSPRT_PLUS, OPSVC_PPLAN_RMTSPRT_PLUS, updDtmAdd, kisan_ymd)` // Registers the Remote Support Plus option service. Returns updated timestamp. |
| 4 | CALL | `updDtmAdd = addOption(OP_SVC_CD_MCAFEE_MULTI_ACCSS, svc_kei_no_add, PCRS_CD_MCAFEE_MULTI_ACCSS="BE1", PPLAN_CD_MCAFEE_MULTI_ACCSS="PBE101", updDtmAdd, kisan_ymd)` // Registers the McAfee Multi-Access option service. Returns updated timestamp. [-> OM-2021-0000510 MOD: uses kisan_ymd instead of empty string] |

**Block 8** — [IF] Internet Gateway registration `[ENABLE="1"]` (L647)

> Registers the Internet Gateway option service when its registration flag is enabled.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `updDtmAdd = addOption(OP_SVC_CD_INETSGWL, svc_kei_no_add, PCRS_CD_INETSGW_FOR_EO, PPLAN_CD_INETSGW_FOR_EO, updDtmAdd, inetsgwl_start_ymd_add)` // Registers the Internet Gateway option service. Returns updated timestamp. |

**Block 9** — [IF] Notification Premium registration `[ENABLE="1"]` (L651)

> Registers the Notification Premium option service when its registration flag is enabled.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `updDtmAdd = addOption(OP_SVC_CD_NTFMLPRM, svc_kei_no_add, PCRS_CD_NTFMLPRM_FOR_EO, PPLAN_CD_NTFMLPRM_FOR_EO, updDtmAdd, ntfmlprm_start_ymd_add)` // Registers the Notification Premium option service. Returns updated timestamp. |

**Block 10** — [IF] SOD issuance after registration (IT1-2017-0000094 ADD) (L657)

> When the SOD target data list is populated, issues a Service Order Data request. This was moved from the cancellation section (IT1-2017-0000094) to the registration section to ensure SOD is issued after all registration operations complete.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `sodHakkoCCTrgtDataList != null && sodHakkoCCTrgtDataList.size() > 0` // Check if SOD target list has data |
| 2 | CALL | `invokeHakkoSODCC(handle, param, FUNC_CD_1="1")` // Issues Service Order Data for email whitelist auto-registration |

**Block 11** — [SET] Initialize info list references (L664-L665)

> Initializes the input info list references for cancel and add data, retrieved from the inMap.

| # | Type | Code |
|---|------|------|
| 1 | SET | `inListCancel = (ArrayList)this.inMap.get(JKKSecurityPackOperateCC.KEY_CANCEL_INFO_LIST="cancel_info_list")` // Retrieves cancel info list for timestamp update [-> KEY_CANCEL_INFO_LIST="cancel_info_list"] |
| 2 | SET | `inListAdd = (ArrayList)this.inMap.get(JKKSecurityPackOperateCC.KEY_ADD_INFO_LIST="add_info_list")` // Retrieves add info list for timestamp update [-> KEY_ADD_INFO_LIST="add_info_list"] |

**Block 12** — [IF] Update cancel info list with final timestamp (L666)

> Updates the first entry of the cancel info list with the final update timestamp after all cancellation operations.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `inListCancel != null` // Check if cancel info list exists |
| 2 | SET | `childMap = (HashMap)inListCancel.get(0)` // Get first entry of cancel list |
| 3 | SET | `childMap.put("upd_dtm_af", updDtmCancel)` // Set the final update timestamp after cancellation [-> upd_dtm_af] |

**Block 13** — [IF] Update add info list with final timestamp (L672)

> Updates the first entry of the add info list with the final update timestamp after all registration operations.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `inListAdd != null` // Check if add info list exists |
| 2 | SET | `childMap = (HashMap)inListAdd.get(0)` // Get first entry of add list |
| 3 | SET | `childMap.put("upd_dtm_af", updDtmAdd)` // Set the final update timestamp after registration [-> upd_dtm_af] |

**Block 14** — [EXEC] End logging (L677)

> Logs the completion marker.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `printlnEjbLog("JKKSecurityPackOperateCC.main end")` // Logs method completion |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `svc_kei_no` | Field | Service contract number — the unique identifier for a service contract line item in the K-Opticom billing system |
| `svc_kei_no_cancel` | Field | Service contract number for cancellation — the target contract to be deregistered |
| `svc_kei_no_add` | Field | Service contract number for registration — the target contract to be newly registered |
| `upd_dtm_bf_cancel` | Field | Update date/time before cancellation — the timestamp prior to cancellation processing |
| `upd_dtm_bf_add` | Field | Update date/time before registration — the timestamp prior to registration processing |
| `upd_dtm_af` | Field | Update date/time after processing — the final computed timestamp stored back into the info list |
| `hikitugi_um` | Field | Inheritance flag (hikitugi = succession/inheritance, um = unit/multi) — indicates whether a contract carries over from a previous contract |
| `security_pack_tg_flg_cancel` | Field | Security Pack target cancellation flag — when set to "1", triggers Security Pack deregistration |
| `security_pack_tg_flg_add` | Field | Security Pack target registration flag — when set to "1", triggers Security Pack registration |
| `premium_pack_tg_flg_cancel` | Field | Premium Pack target cancellation flag — when set to "1", triggers Smartlink Premium deregistration |
| `premium_pack_tg_flg_add` | Field | Premium Pack target registration flag — when set to "1", triggers Smartlink Premium registration |
| `inetsgwl_tg_flg_cancel` | Field | Internet Gateway target cancellation flag — triggers Internet Gateway option deregistration |
| `inetsgwl_tg_flg_add` | Field | Internet Gateway target registration flag — triggers Internet Gateway option registration |
| `ntfmlprm_tg_flg_cancel` | Field | Notification Premium target cancellation flag — triggers Notification Premium option deregistration |
| `ntfmlprm_tg_flg_add` | Field | Notification Premium target registration flag — triggers Notification Premium option registration |
| `mcafee_op_svc_kei_no` | Field | McAfee option service contract number for address change — the McAfee contract number when service changes due to address relocation |
| `inetsgwl_op_svc_kei_no` | Field | Internet Gateway option service contract number for address change — the IG contract number for address relocation scenarios |
| `ntfmlprm_op_svc_kei_no` | Field | Notification Premium option service contract number for address change — the NP contract number for address relocation scenarios |
| `chrg_hichrg_cd` | Field | Charge/discharge code — determines whether a service is chargeable (1 = charge) or non-chargeable (0 = discharge) |
| `kisan_ymd` | Field | Billing start date — the date from which billing for newly registered services begins |
| `ido_div` | Field | Transfer division code — classifies the type of service transfer operation (address change, regular change, etc.) |
| `CD00576_ADCHG_ADD` | Constant | Address change registration code — the division code that routes execution to `adChgMain` |
| SOD | Acronym | Service Order Data — an order issuance mechanism for telecom service provisioning, used here for email whitelist auto-registration |
| Security Pack | Business term | Security suite service offering — includes McAfee Multi-Access antivirus and Remote Support Plus remote assistance |
| Premium Pack | Business term | Smartlink Premium — a premium security/service bundle including McAfee and Remote Support |
| Remote Support Plus | Business term | Remote assistance option service — Fujitsu-provided remote technical support |
| McAfee Multi-Access | Business term | McAfee antivirus option service — provides endpoint security software as an add-on subscription |
| Internet Gateway | Business term | Internet Gateway service — network gateway connectivity option (for EO fiber service) |
| Notification Premium | Business term | Notification Premium service — premium email/notification service add-on |
| dslWrib | Method | Wrapped service contract cancellation — cancels a wrapped/discount service contract entry in the billing system |
| addWrib | Method | Wrapped service contract registration — registers a new wrapped/discount service contract entry |
| dslOption | Method | Option service contract cancellation — cancels an optional add-on service contract |
| addOption | Method | Option service registration — registers a new optional add-on service contract |
| adchgDslOption | Method | Adjusted option service cancellation — cancells an option service contract with address change handling (supports optional service contract number override) |
| addSupportOption | Method | Support option registration — registers a support-type option service (Remote Support Plus) |
| invokeHakkoSODCC | Method | Service Order Data issuance component call — triggers the SOD issuance workflow for email whitelist auto-registration |
| ccWorkMap | Field | Component work map — the shared work area holding all runtime configuration flags, service numbers, and timestamps for the current operation |
| inMap | Field | Input map — the carrier map holding cancel and add information lists that flow between processing stages |
| ENABLE | Constant | Enable flag value — string "1" indicating a flag is active/enabled |
| FUNC_CD_1 | Constant | Function code 1 — used to identify the SOD issuance function type |
| PCRS_CD_SECURITY_PACK_MSKM | Constant | Security Pack contract rate code — the rate plan code for the Security Pack MSKM bundle |
| PPLAN_CD_SECURITY_PACK_MSKM | Constant | Security Pack plan code — the plan code for the Security Pack MSKM bundle |
| PCRS_CD_SMARTLINK_PREMIUM | Constant | Smartlink Premium contract rate code — "F08" |
| PPLAN_CD_SMARTLINK_PREMIUM | Constant | Smartlink Premium plan code — "PF0801" |
| PCRS_CD_MCAFEE_MULTI_ACCSS | Constant | McAfee Multi-Access contract rate code — "BE1" |
| PPLAN_CD_MCAFEE_MULTI_ACCSS | Constant | McAfee Multi-Access plan code — "PBE101" |
| PCRS_CD_INETSGW_FOR_EO | Constant | Internet Gateway for EO contract rate code |
| PPLAN_CD_INETSGW_FOR_EO | Constant | Internet Gateway for EO plan code |
| PCRS_CD_NTFMLPRM_FOR_EO | Constant | Notification Premium for EO contract rate code |
| PPLAN_CD_NTFMLPRM_FOR_EO | Constant | Notification Premium for EO plan code |
| WRIB_SVC_CD_SECURITY_PACK | Constant | Wrapped service code for Security Pack |
| WRIB_SVC_SMARTLINK_PREMIUM | Constant | Wrapped service code for Smartlink Premium |
| OP_SVC_CD_RMTSPRT_PLUS | Constant | Option service code for Remote Support Plus |
| OP_SVC_CD_MCAFEE_MULTI_ACCSS | Constant | Option service code for McAfee Multi-Access |
| OP_SVC_CD_INETSGWL | Constant | Option service code for Internet Gateway |
| OP_SVC_CD_NTFMLPRM | Constant | Option service code for Notification Premium |
| OPSVC_PCRS_RMTSPRT_PLUS | Constant | Option service contract rate code for Remote Support Plus |
| OPSVC_PPLAN_RMTSPRT_PLUS | Constant | Option service plan code for Remote Support Plus |
| K-Opticom | Business term | K-Opticom — the optical fiber internet service provider; the system domain for this codebase |
| EO | Business term | EO (Express Optical / eo Hikari) — K-Opticom's fiber optic internet service brand |
| MSKM | Acronym | Master contract — the primary billing contract (muskou = charge/billing in Japanese) |
| ADCHG | Acronym | Address change (adachange in katakana: アドチェ) — service contract modification due to customer address relocation |
