# Business Logic - JKKAdchgHakkoSODCC.opSetOdrCtrl() [1924 LOC]

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

## 1. Role

### JKKAdchgHakkoSODCC.opSetOdrCtrl()

This method is the central order-control dispatcher for **option service modifications** within the Fujitsu Futurity telecom order fulfillment platform. Its business purpose is to determine which **Service Order Data (SOD)** records must be issued when a customer's option service (e.g., email, web homepage, fixed IP, dial-up, forwarding call, spam rejection) undergoes a state change -- such as new registration, cancellation, disconnection, resumption, or modification.

The method implements a **route-and-dispatch pattern**: it extracts the option service code (opSvcCd) from the pre-built sodMap, then branches into service-type-specific handlers for each option service type. Within each branch, it applies state-transition logic to decide whether to issue create, update, or delete SOD records.

The method plays a **critical orchestration role** in the larger order issuance flow. It is called by the parent class JKKHakkoSODCC and by the adgf/cancel variants (JKKAdchgHakkoSODCC, JKKAdchgCancelHakkoSODCC). It serves as the shared entry point through which screen/business CBS processes funnel option-service-level SOD determination.

Key design patterns:

- **Routing/Dispatch**: Conditional branches on opSvcCd constants (B001 through B075) direct execution to the appropriate service-specific handler block.
- **State Transition Logic**: For each service type, the method compares "before" and "after" option service statuses to determine the business operation needed.
- **Builder/Delegation**: The method delegates SOD creation to addSOD() and tsuikabunAddSOD(), passing resolved order content codes (ODR_NAIYO_CD_xxx).

Branch summary:
- B001 (Email): Handles email registration/cancellation/modification including alias, antivirus, and mailboxes capacity changes.
- B002 (HP - Home Page): Handles web homepage registration/cancellation, homepage capacity changes, and access analysis registration.
- B003 (Mailing List): Handles mailing list registration/cancellation/resumption.
- B004 (Fixed IP): Handles fixed global IP address registration/cancellation, including FTTH authentication pause/resume logic.
- B015 (Multiselection): Handles multiselection (static/dynamic) registration/cancellation/resumption/selection count changes.
- B020 (Dial-up): Handles dial-up connection registration/cancellation/plan change.
- B075 (Feather Cell): Handles Feather Cell (mobile service) registration/cancellation.
- B070 (IPv6): Handles IPv6 registration/cancellation/resumption with pattern-based SOD decision (jdgIpv6).
- WARKMI (Split Phone): Handles split phone (reserved phone) registration including OLS setup, SIP registration, home device info.
- TENSO (Forwarding Call): Handles call forwarding registration/cancellation/selective forwarding.
- DSP (Caller ID Display): Handles caller ID display registration/cancellation, non-delivery rejection.
- MWKTEL (Annoyance Call Rejection): Handles annoyance call reception rejection registration/cancellation.
- STINO (Number Selective Rejection): Handles number-specific reception rejection registration/cancellation.
- KOKUSAI_STP (International Call Suspension): Handles international call suspension registration/cancellation.
- N050 (Number Porting): Handles number porting registration/cancellation.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["opSetOdrCtrl(params)"])
    
    START --> S1[Extract SOD maps from sodMap]
    S1 --> S2[Clean maps via shkkaMap]
    S2 --> S3[Extract required params]
    S3 --> S4[chaf_opsvkei_no blank?]
    
    S4 -->|Yes| EARLY_RET["Return param early"]
    S4 -->|No| S5[Set ipv6 instance fields]
    S5 --> S6[Before opsvkei_no present?]
    
    S6 -->|No| S39[Get after option info]
    S6 -->|Yes| S7[Build chbfInHash]
    S7 --> S8[callEKK0351A010SC - Before option]
    S8 --> S9[statusCode check]
    S9 -->|!=0| S10[Throw CCException]
    S9 -->|==0| S11[Extract chbfEKK0351A010SCHash]
    S11 --> S12[Judge opSvcKind]
    S12 --> S13[opSvcKind null?]
    
    S13 -->|Yes| EARLY_RET2["Return param"]
    S13 -->|No| S14[opSvcKind[0] = NET?]
    
    S14 -->|Yes| S15[callEKK0361A010SC - Before ISP]
    S14 -->|No| S16[opSvcKind[0] = TEL?]
    S16 -->|Yes| S17[callEKK0371A010SC - Before TEL (commented out)]
    
    S15 --> S18[opSvcKind[1]=1 AND subop present?]
    S17 --> S18
    
    S18 -->|No| S39
    S18 -->|Yes| S19[NET? callEKK0411A010SC subop ISP]
    
    S19 --> S20[callEKK0401A010SC subop common]
    S20 --> S39
    
    S39 --> S21[Build chafInHash]
    S21 --> S22[callEKK0351A010SC - After option]
    S22 --> S23[Extract chafEKK0351A010SCHash]
    S23 --> S24[Judge opSvcKind again]
    S24 --> S25[NET? callEKK0361A010SC - After ISP]
    S25 --> S26[subop? callEKK0411A010SC and EKK0401A010SC]
    S26 --> S27[Compare before/after status]
    
    S27 --> S28[Calculate isNewOpsvkei]
    S28 --> S29[Calculate isDslOpsvkei]
    S29 --> S30[Calculate isKaihkOpsvkei]
    S30 --> S31[Calculate isChgOpsvkei]
    
    S31 --> S32[Branch on opSvcCd]
    
    S32 --> B001[OP_SVC_CD_EMAIL = B001]
    S32 --> B002[OP_SVC_CD_HP = B002]
    S32 --> B003[OP_SVC_CD_MLIST = B003]
    S32 --> B004[OP_SVC_CD_FIXIPAD = B004]
    S32 --> B015[OP_SVC_CD_MLTISE = B015]
    S32 --> B020[OP_SVC_CD_DUP = B020]
    S32 --> B075[OP_SVC_CD_FMTCEL = B075]
    S32 --> BWARKMI[WARKMI Split Phone]
    S32 --> BTENSO[TENSO Forwarding Call]
    S32 --> BDSP[DSP Caller ID Display]
    S32 --> BMWKTEL[Annoyance Call Rejection]
    S32 --> BSTINO[Number Selective Rejection]
    S32 --> BKOKUSAI[International Call Suspension]
    S32 --> BIPV6[OP_SVC_CD_IPV6 = B070]
    S32 --> BN050[OP_SVC_CD_N050 = N050]
    
    B001 --> B001_END[addSOD: ML reg/cancel/modify/antivirus/capacity]
    B002 --> B002_END[addSOD: HP reg/cancel/capacity/access analysis]
    B003 --> B003_END[addSOD: ML reg/cancel/resumption]
    B004 --> B004_END[addSOD: Fixed IP reg/resume/cancel, FTTH auth]
    B015 --> B015_END[addSOD: Multiselection static/dynamic]
    B020 --> B020_END[addSOD: Dial-up reg/cancel/plan change]
    B075 --> B075_END[addSOD: Feather Cell reg/cancel]
    BWARKMI --> BWARKMI_END[addSOD: Split phone OLS/SIP reg]
    BTENSO --> BTENSO_END[addSOD: Call forwarding reg/cancel/selective]
    BDSP --> BDSP_END[addSOD: Caller ID display reg/cancel]
    BMWKTEL --> BMWKTEL_END[addSOD: Annoyance call rejection]
    BSTINO --> BSTINO_END[addSOD: Number selective rejection]
    BKOKUSAI --> BKOKUSAI_END[tsuikabunAddSOD: International call suspension]
    BIPV6 --> BIPV6_END[jdgIpv6 pattern decision]
    BN050 --> BN050_END[addSOD: Number porting reg/cancel]
    
    B001_END --> END_NODE["Return param"]
    B002_END --> END_NODE
    B003_END --> END_NODE
    B004_END --> END_NODE
    B015_END --> END_NODE
    B020_END --> END_NODE
    B075_END --> END_NODE
    BWARKMI_END --> END_NODE
    BTENSO_END --> END_NODE
    BDSP_END --> END_NODE
    BMWKTEL_END --> END_NODE
    BSTINO_END --> END_NODE
    BKOKUSAI_END --> END_NODE
    BIPV6_END --> END_NODE
    BN050_END --> END_NODE
    EARLY_RET --> END_NODE
    EARLY_RET2 --> END_NODE
    S10 --> END_NODE
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `handle` | `SessionHandle` | Session management handle carrying session context (e.g., database connection, transaction context) required for all CBS/SC calls |
| 2 | `param` | `IRequestParameterReadWrite` | Parameter object containing model groups and control maps; modified in-place with SOD records added via addSOD() calls; returned after all processing |
| 3 | `fixedText` | `String` | User-designated arbitrary character string used in same transaction number acquisition (sameTrnJdg) for deduplication checks |
| 4 | `sodMap` | `HashMap<String, Object>` | SOD (Service Order Data) map containing five sub-maps: SOD_KIHON_INFO (base SOD info), SVC_KEI_INFO (service contract info), SVC_KEI_UCWK_INFO (service contract details), OPSVKEI_INFO (option service contract info), KKTSVKEI_INFO (equipment provision service contract info) |

**Instance fields read/written by this method:**
- `op_svc_kei_no_ml` / `op_gadtm_ml` -- Stores option service number and generation registration timestamp for Email (B001)
- `mlad` -- Mail alias address from chafEKK0361A010SCHash
- `op_svc_kei_no_hp` / `op_gadtm_hp` -- Stores option service number and generation registration timestamp for Home Page (B002)
- `op_svc_kei_no_mlist` / `op_gadtm_mlist` -- Stores option service number for Mailing List (B003)
- `op_svc_kei_no_fixipad` / `op_gadtm_fixipad` -- Stores option service number for Fixed IP (B004)
- `op_svc_kei_no_mltise` / `op_gadtm_mltise` -- Stores option service number for Multiselection (B015)
- `op_svc_kei_no_dial` / `op_gadtm_dial` -- Stores option service number for Dial-up (B020)
- `op_svc_kei_no_fmtcel` / `op_gadtm_fmtcel` -- Stores option service number for Feather Cell (B075)
- `op_svc_kei_no_ipv6` / `op_gadtm_ipv6` -- Stores option service number for IPv6 (B070)
- `sod_pattern_ipv6` -- IPv6 SOD decision pattern (1=register, 3=cancel)
- `svc_kei_ucwk_no[]` / `svc_kei_ucwk_gadtm[]` -- Service contract detail number and generation registration timestamp
- `old_vrsb_jdg_svc_dtl_cd` -- Old VR identification judgment service detail code
- `same_trn_no` -- Same transaction number acquired for deduplication
- `taknkiki_model_cd[]` / `kiki_seizo_no[]` -- Home device model code and manufacturing number (WARKMI)
- `kktk_svc_kei_no[]` / `kktk_svc_kei_gadtm[]` -- Equipment provision service contract number and timestamp
- `svc_kei_kaisen_ucwk_no` / `svc_kei_kaisen_ucwk_gadtm` -- Service line detail number and generation timestamp
- `op_svc_kei_no_tikan` / `op_gadtm_tikan` -- Number porting option service number (N050)
- `sbop_svckeino_mlvirus` / `sbop_gadtm_mlvirus` -- Sub-option service number for mail antivirus
- `sbop_svckeino_alias` / `sbop_gadtm_alias` -- Sub-option service number for mail alias
- `number050Exe` -- Boolean flag for N050 number porting execution state
- `mae_recode_chaf_op_svc_kei_no` / `mae_recode_chaf_op_svc_kei_gene_add_dtm` -- Previous record after option service no (cleanup)
- `mae_recode_chbf_op_svc_kei_no` / `mae_recode_chbf_op_svc_kei_gene_add_dtm` -- Previous record before option service no (cleanup)
- `pplan_cd` -- Plan code used in getOldVrsbIdgSvcDtlCd()
- `ipv6_svc_kei_ucwk_no` / `ipv6_svc_kei_ucwk_gadtm` -- IPv6 service detail number (set for OLS order output workflow)

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | JKKAdchgHakkoSODCC.callEKK0351A010SC | EKK0351A010SC | KK_T_OPSVKEI | Reads option service contract agreement (before and after) |
| R | JKKAdchgHakkoSODCC.callEKK0361A010SC | EKK0361A010SC | KK_T_OPSVKEI_ISP | Reads option service contract (ISP) agreement (before and after) |
| R | JKKAdchgHakkoSODCC.callEKK0411A010SC | EKK0411A010SC | KK_T_SBOP_SVCKEI | Reads sub-option service contract (ISP) agreement |
| R | JKKAdchgHakkoSODCC.callEKK0401A010SC | EKK0401A010SC | KK_T_SBOP_SVCKEI | Reads sub-option service contract agreement |
| R | JKKAdchgHakkoSODCC.callEKK0191A010SC | EKK0191A010SC | KK_T_SVC_KEI_UCWK | Reads service contract details (eo light phone) |
| R | JKKAdchgHakkoSODCC.callEKK0161A010SC | EKK0161A010SC | KK_T_SVC_KEI_UCWK | Reads service contract detail list (fixed IP path) |
| R | JKKAdchgHakkoSODCC.callEKK0161B004SC | EKK0161B004SC | KK_T_SVC_KEI_UCWK | Reads service contract detail list (multiselection/dial-up path) |
| R | JKKAdchgHakkoSODCC.callEKK0351B002SC | EKK0351B002SC | KK_T_OPSVKEI | Reads option service contract list (multiselection) |
| R | JKKAdchgHakkoSODCC.callEKK0341A010SC | EKK0341A010SC | KK_T_KKTK_SVCKEI | Reads equipment provision service contract agreement (split phone) |
| R | JKKAdchgHakkoSODCC.getEKK0251B001SC | EKK0251B001SC | KK_T_SVC_KEI_KAISEN | Reads service line detail list (split phone) |
| R | JKKAdchgHakkoSODCC.callEKK1041B001SC | EKK1041B001SC | KK_T_SVC_ORDER | Reads order setting list (forwarding call Z1 check) |
| C | JKKAdchgHakkoSODCC.addSOD | - | - | Creates SOD (Service Order Data) records for various order content codes |
| C | JKKAdchgHakkoSODCC.tsuikabunAddSOD | - | - | Creates additional SOD records (international call suspension) |
| R | JKKAdchgHakkoSODCC.getSame_trn_no | - | - | Acquires same transaction number for deduplication |
| R | JKKAdchgHakkoSODCC.getOldVrsbIdgSvcDtlCd | - | - | Gets old VR identification judgment service detail code |
| JKKAdchgHakkoSODCC.jdgOpSvcKind | Local | - | - | Judges option service type (NET/TEL) |
| JKKAdchgHakkoSODCC.isBlank | Local | - | - | Checks if string is blank/null |
| JKKAdchgHakkoSODCC.chgOpsvKeiJdg | Local | - | - | Judges whether option service has changed |
| JKKAdchgHakkoSODCC.sameTrnJdg | Local | - | - | Judges if same transaction number acquisition is needed |
| JKKAdchgHakkoSODCC.jdgIpv6 | Local | - | - | Judges IPv6 SOD pattern (1=register, 3=cancel) |
| JKKAdchgHakkoSODCC.pauseJdg | Local | - | - | Judges service pause status |
| JKKAdchgHakkoSODCC.shkkaMap | Local | - | - | Cleans null values from HashMap |
| JKKAdchgHakkoSODCC.shkkaChr | Local | - | - | Cleans null characters from String |
| JKKAdchgHakkoSODCC.adchgMultiDslDojiJudge | Local | - | - | Judges multi-selection (static) / cancellation for relocation |
| JCCBPCommon.getOpeDate | JCCBPCommon | - | - | Gets operation date |

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | `JKKHakkoSODCC` (parent class) | `JKKHakkoSODCC` order issuance flow -> `opSetOdrCtrl(handle, param, fixedText, sodMap)` | `addSOD [C]`, `callEKK0351A010SC [R] KK_T_OPSVKEI`, `callEKK0361A010SC [R] KK_T_OPSVKEI_ISP` |
| 2 | `JKKAdgfHakkoSODCC` (adgf variant) | `JKKAdgfHakkoSODCC.opSetOdrCtrl` -> calls `opSetOdrCtrl(handle, param, fixedText, opSodMap)` | `addSOD [C]`, `callEKK0351A010SC [R]` |
| 3 | `JKKAdchgHakkoSODCC` (this class, entry point) | Screen CBS invokes -> this class -> `opSetOdrCtrl(handle, param, fixedText, opSodMap)` | `addSOD [C]`, `callEKK0401A010SC [R]` |
| 4 | `JKKAdchgCancelHakkoSODCC` | Cancel issuance -> `param = opSetOdrCtrl(keepSesHandle.get(), param, fixedText, sodMap)` | `addSOD [C]`, `getSame_trn_no [R]` |
| 5 | `JKKBpCommon` | BpCommon order flow -> calls `opSetOdrCtrl` | `addSOD [C]`, various SC calls |

**Terminal operations from this method:**
- `addSOD` [C] -- Creates SOD for 101 (FTTH Auth Register) through 264, 301-424, etc.
- `tsuikabunAddSOD` [C] -- Creates additional SOD for 253/254 (International Call Suspension)
- `getSame_trn_no` [R] -- Acquires same transaction number
- `getOldVrsbIdgSvcDtlCd` [R] -- Gets old VR identification code
- `callEKK0351A010SC` [R] -- Reads option service contract
- `callEKK0361A010SC` [R] -- Reads option service contract (ISP)
- `callEKK0401A010SC` [R] -- Reads sub-option service contract
- `callEKK0411A010SC` [R] -- Reads sub-option service contract (ISP)
- `callEKK0161A010SC` [R] -- Reads service contract detail list
- `callEKK0161B004SC` [R] -- Reads service contract detail list (multiselection)
- `callEKK0351B002SC` [R] -- Reads option service contract list
- `callEKK0341A010SC` [R] -- Reads equipment provision service contract
- `callEKK0191A010SC` [R] -- Reads service contract details (eo light phone)
- `callEKK1041B001SC` [R] -- Reads order setting list

## 6. Per-Branch Detail Blocks

**Block 1** — [IF] `isBlank(chaf_opsvkei_no)` (L9395)
> Early return if no after option service number is present. Skip processing for address-change SOD where no option cancellation occurs.

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

**Block 2** — [BLOCK] Set IPv6 instance fields (L9399-9401)
> Stores svc_kei_ucwk_no and chaf_svc_kei_ucwk_gene_add_dtm for IPv6 OLS order output workflow (ANK-0046-00-01, 2012-02-29)

| # | Type | Code |
|---|------|------|
| 1 | SET | `this.ipv6_svc_kei_ucwk_no = shkkaChr(svc_kei_ucwk_no)` |
| 2 | SET | `this.ipv6_svc_kei_ucwk_gadtm = shkkaChr(chaf_svc_kei_ucwk_gene_add_dtm)` |

**Block 3** — [IF] Before option service information retrieval (L9403) `!isBlank(chbf_opsvkei_no) && !isBlank(chbf_opsvkei_gene_add_dtm)`

> Retrieves **before-state** option service agreement data by calling EKK0351A010SC, then conditionally calls EKK0361A010SC (ISP) or EKK0371A010SC (TEL), and sub-option calls (EKK0411A010SC, EKK0401A010SC).

| # | Type | Code |
|---|------|------|
| 1 | SET | `chbfInMap.put(OP_SVC_KEI_NO, chbf_opsvkei_no)` |
| 2 | SET | `chbfInMap.put(GENE_ADD_DTM, chbf_opsvkei_gene_add_dtm)` |
| 3 | CALL | `callEKK0351A010SC(param, handle, chbfInMap, chbfResultMap, FUNC_CODE_1)` |
| 4 | IF | `0 != statusCode` -> throw CCException + SCCallException |
| 5 | SET | `chbfEKK0351A010SCHash = (HashMap) chbfResultMap.get(TEMPLATE_ID_EKK0351A010)` |
| 6 | SET | `opSvcCd = (String) chbfEKK0351A010SCHash.get(OP_SVC_CD)` |
| 7 | CALL | `opSvcKind[] = jdgOpSvcKind(opSvcCd)` -- Judge option service type |
| 8 | IF | `opSvcKind == null` -> return param (no SOD target) |
| 9 | IF | `SVC_KIND_NET.equals(opSvcKind[0])` -> callEKK0361A010SC |
| 10 | IF | `SVC_KIND_TEL.equals(opSvcKind[0])` -> callEKK0371A010SC (commented out) |
| 11 | IF | `opSvcKind[1] = "1" && !isBlank(chbf_sbopsvkei_no)` -> sub-option retrieval |
| 12 | IF | NET case -> callEKK0411A010SC (sub-option ISP) |
| 13 | CALL | callEKK0401A010SC (sub-option common, for NET/TEL) |

**Block 4** — [BLOCK] After option service information retrieval (L9523)
> Retrieves **after-state** option service agreement data using the same pattern as Block 3.

| # | Type | Code |
|---|------|------|
| 1 | SET | `chafInMap.put(OP_SVC_KEI_NO, chaf_opsvkei_no)` |
| 2 | SET | `chafInMap.put(GENE_ADD_DTM, chaf_opsvkei_gene_add_dtm)` |
| 3 | CALL | `callEKK0351A010SC(param, handle, chafInMap, chafResultMap, FUNC_CODE_1)` |
| 4 | SET | `chafEKK0351A010SCHash = chafResultMap.get(TEMPLATE_ID_EKK0351A010)` |
| 5 | CALL | `opSvcKind[] = jdgOpSvcKind(opSvcCd)` |
| 6 | IF | NET -> callEKK0361A010SC, TEL -> callEKK0371A010SC (commented) |
| 7 | IF | opSvcKind[1]="1" && subop -> callEKK0411A010SC + callEKK0401A010SC |

**Block 5** — [BLOCK] Before/after content comparison (L9595-9637)
> Compares before/after option service status to determine state transitions.

| # | Type | Code |
|---|------|------|
| 1 | SET | `opsvkeiStatBefore = chbfEKK0351A010SCHash.get(OP_SVC_KEI_STAT)` |
| 2 | SET | `opsvkeiStatAfter = chafEKK0351A010SCHash.get(OP_SVC_KEI_STAT)` |
| 3 | SET | `isNewOpsvkei = isBlank(chbf_opsvkei_no) && !isBlank(chaf_opsvkei_no)` |
| 4 | SET | `isDslOpsvkei = SVC_KEI_STAT_910.equals(after) || SVC_KEI_STAT_920.equals(after)` |
| 5 | SET | `isKaihkOpsvkei = (910->before, 100/030->after) || (920->before, 020/030->after)` |
| 6 | SET | `isChgOpsvkei = (100->100) || (020->020) || (030->030)` |

**Block 6** — [IF] `opSvcCd = B001` (Email) (L9642)
> Handles email option service changes. Retrieves MLAD (mail alias address) from chafEKK0361A010SCHash.

| # | Type | Code |
|---|------|------|
| 1 | SET | `this.op_svc_kei_no_ml = chaf_opsvkei_no` |
| 2 | SET | `this.op_gadtm_ml = chaf_opsvkei_gene_add_dtm` |
| 3 | SET | `this.mlad = chafEKK0361A010SCHash.get(MLAD)` |
| 4 | IF | `isNewOpsvkei` (new registration) |
| 5 | IF | `chgOpsvKeiJdg() && sameTrnJdg() > 0` -> getSame_trn_no |
| 6 | IF | `chgOpsvKeiJdg()` -> addSOD(ODR_NAIYO_CD_108) -- Mail Register |
| 7 | ELSE IF | `isDslOpsvkei` (cancellation) -> addSOD(ODR_NAIYO_CD_116) -- Mail Cancel |
| 8 | ELSE IF | `isKaihkOpsvkei` (resumption) -> addSOD(ODR_NAIYO_CD_120) -- Mail Resume |
| 9 | ELSE IF | `isChgOpsvkei` (modification) |
| 10 | IF | MLAD changed -> addSOD(117) Mail Cancel(Schedule) + addSOD(119) Mail Delete(Schedule) + addSOD(108) Mail Register |
| 11 | IF | Sub-option checks |
| 12 | IF | `isNewSbopkei && SBOP_SVC_CD_VIRUS` -> addSOD(114) Mail/Antivirus Register |
| 13 | IF | `SBOP_SVC_CD_VIRUS && isDslSbopkei` -> addSOD(115) Mail/Antivirus Cancel |
| 14 | IF | `SBOP_SVC_CD_MLCAPA && (isNewSbopkei || isDslSbopkei)` -> addSOD(113) Mail/Mailboxes Capacity Change |
| 15 | IF | `isSbopkeiStatNotChg && SBOP_SVC_CD_MLCAPA` -> compare CAPA -> addSOD(113) if changed |
| 16 | IF | `isNewSbopkei && SBOP_SVC_CD_ALIAS` -> addSOD(110) Mail/Alias Register |
| 17 | IF | `isDslSbopkei && SBOP_SVC_CD_ALIAS` -> addSOD(112) Mail/Alias Cancel |
| 18 | IF | `isSbopkeiStatNotChg && SBOP_SVC_CD_ALIAS` -> compare ALIAS -> addSOD(111) if changed |

**Block 7** — [IF] `opSvcCd = B002` (HP - Home Page) (L9863)
> Handles web homepage changes. Retrieves URL_DOMAIN and URL_ACCOUNT from chafEKK0361A010SCHash.

| # | Type | Code |
|---|------|------|
| 1 | SET | `this.op_svc_kei_no_hp = chaf_opsvkei_no` |
| 2 | SET | `this.op_gadtm_hp = chaf_opsvkei_gene_add_dtm` |
| 3 | IF | `isNewOpsvkei` |
| 4 | SET | `chafUrlDomain = chafEKK0361A010SCHash.get(URL_DOMAIN)` |
| 5 | SET | `chafUrlAccount = chafEKK0361A010SCHash.get(URL_ACCOUNT)` |
| 6 | IF | `!isBlank(urlDomain) && !isBlank(urlAccount)` -> register |
| 7 | IF | `chgOpsvKeiJdg() && sameTrnJdg() > 0` -> getSame_trn_no |
| 8 | IF | `chgOpsvKeiJdg()` -> addSOD(121) Web Register |
| 9 | Sub-option: `isNewSbopkei && SBOP_SVC_CD_HPACCESS` -> addSOD(124) Web/Access Analysis Register |
| 10 | Sub-option: `SBOP_SVC_CD_HPCAPA` -> addSOD(123) Web/Home Page Capacity Change |
| 11 | ELSE IF | `isDslOpsvkei` -> addSOD(126) Web Cancel |
| 12 | ELSE IF | `isKaihkOpsvkei` -> addSOD(128) Web Resume |
| 13 | ELSE IF | `isChgOpsvkei` -> compare URL_ACCOUNT -> addSOD(126) Web Cancel + addSOD(127) Web Delete + addSOD(121) Web Register |

**Block 8** — [IF] `opSvcCd = B003` (Mailing List) (L10030)
> Handles mailing list registration/cancellation/resumption.

| # | Type | Code |
|---|------|------|
| 1 | SET | `this.op_svc_kei_no_mlist = chaf_opsvkei_no` |
| 2 | SET | `this.op_gadtm_mlist = chaf_opsvkei_gene_add_dtm` |
| 3 | IF | `isNewOpsvkei` -> same_trn_no = "" -> addSOD(129) ML Register |
| 4 | ELSE IF | `isDslOpsvkei` -> addSOD(131) ML Cancel |
| 5 | ELSE IF | `isKaihkOpsvkei` -> addSOD(133) ML Resume |

**Block 9** — [IF] `opSvcCd = B004` (Fixed IP) (L10075)
> Handles fixed global IP address registration. Calls EKK0161A010SC to read service contract details. Checks FTTH authentication pause status.

| # | Type | Code |
|---|------|------|
| 1 | SET | `inHashUcwk.put(SVC_KEI_UCWK_NO, chafEKK0351A010SCHash.get("svc_kei_ucwk_no"))` |
| 2 | SET | `inHashUcwk.put(OPE_DATE, JCCBPCommon.getOpeDate(null))` |
| 3 | CALL | `callEKK0161A010SC(param, handle, inHashUcwk, resultHashUcwk, FUNC_CODE_2)` |
| 4 | SET | `this.svc_kei_ucwk_no[0] = retHash.get(EKK0161A010CBSMsg1List.SVC_KEI_UCWK_NO)` |
| 5 | SET | `this.old_vrsb_jdg_svc_dtl_cd = getOldVrsbIdgSvcDtlCd(handle, param, svc_kei_no, ...)` |
| 6 | IF | `isBlank(chbf_opsvkei_no)` -> addSOD(152) Fixed IP Register |
| 7 | ELSE IF | `SVC_KEI_STAT_910/920` (after cancel) |
| 8 | IF | `SVC_KEI_STAT_910/920` (svc detail cancel) -> no SOD issued |
| 9 | ELSE | `adchgMultiDslDojiJudge()` -> addSOD(145) Multiselection(Static)/Cancel |
| 10 | CALL | `pauseJdg(param, handle, null, svc_kei_no, pause_jdg_cd)` |
| 11 | CALL | `getSame_trn_no(param, handle, null, sameTrnNo)` |
| 12 | IF | `PAUSE_JDG_CD_1` (paused) -> addSOD(107) FTTH Auth Pause Cancel + addSOD(154) Fixed IP Cancel + addSOD(104) FTTH Auth Delete + addSOD(101) FTTH Register + addSOD(106) FTTH Auth Temporary Suspend |
| 13 | IF | `PAUSE_JDG_CD_0` (not paused) -> addSOD(154) + addSOD(104) + addSOD(101) |
| 14 | ELSE IF | `910->before, 100->after` -> addSOD(153) Fixed IP Resume |

**Block 10** — [IF] `opSvcCd = B015` (Multiselection) (L10274)
> Handles multiselection (static/dynamic) fixed IP option. Calls EKK0351B002SC to list option service contracts.

| # | Type | Code |
|---|------|------|
| 1 | SET | `this.op_svc_kei_no_mltise = chaf_opsvkei_no` |
| 2 | SET | `inHashMltise.put(OP_SVC_CD, OP_SVC_CD_FIXIPAD)` |
| 3 | CALL | `callEKK0351B002SC(param, handle, inHashMltise, resultHashMltise, FUNC_CODE_1)` |
| 4 | LOOP | For msgList -> op_svc_kei_stat = retHash.get(OP_SVC_KEI_STAT) |
| 5 | IF | `SVC_KEI_STAT_100.equals(op_svc_kei_stat)` (service in progress) |
| 6 | IF | `isNewOpsvkei` -> addSOD(144) Multiselection(Static)/Register |
| 7 | IF | `isDslOpsvkei` -> pauseJdg -> PAUSE_JDG_CD_1: addSOD(107)+addSOD(145)+addSOD(106) / PAUSE_JDG_CD_0: addSOD(145) |
| 8 | IF | `isKaihkOpsvkei` -> addSOD(161) Multiselection(Static)/Resume |
| 9 | IF | `isChgOpsvkei` -> addSOD(162) Multiselection(Static)/Selection Count Change |
| 10 | ELSE (not 100) -> callEKK0161B004SC, then isNewOpsvkei: addSOD(142) Dynamic / isDslOpsvkei: addSOD(143) / isChgOpsvkei: addSOD(143)+addSOD(142) |

**Block 11** — [IF] `opSvcCd = B020` (Dial-up) (L10457)
> Handles dial-up connection registration/cancellation.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `callEKK0161B004SC(param, handle, inHashUcwk, resultHashUcwk, FUNC_CODE_1)` |
| 2 | IF | `isNewOpsvkei` -> addSOD(134) Dial-up Register |
| 3 | ELSE IF | `isDslOpsvkei` -> getSame_trn_no -> addSOD(137) Dial-up Cancel + addSOD(138) Dial-up Delete |
| 4 | ELSE IF | `isKaihkOpsvkei` -> addSOD(134) Dial-up Register (Resume) |
| 5 | ELSE IF | `isChgOpsvkei` -> addSOD(136) Dial-up Plan Change |

**Block 12** — [IF] `opSvcCd = B075` (Feather Cell) (L10493)
> Handles Feather Cell (mobile service) registration/cancellation.

| # | Type | Code |
|---|------|------|
| 1 | SET | `this.op_svc_kei_no_fmtcel = chaf_opsvkei_no` |
| 2 | IF | `isBlank(chbf_opsvkei_no)` -> addSOD(164) Feather Cell Register |
| 3 | ELSE IF | `910/920` (after cancel) -> addSOD(166) Feather Cell Cancel + addSOD(167) Feather Cell Delete |
| 4 | ELSE IF | `910->before, 100->after` -> addSOD(164) Feather Cell Register (Resume) |

**Block 13** — [IF] `opSvcCd = WARKMI` (Split Phone) (L10527)
> Handles split phone (reserved phone) registration including OLS setup, SIP registration, home device information.

| # | Type | Code |
|---|------|------|
| 1 | IF | `isBlank(chbf_opsvkei_no) || (910->100)` -> new or resume |
| 2 | SET | `inHashKktk.put(KKTK_SVC_KEI_NO, chaf_kktk_svc_kei_no)` |
| 3 | CALL | `callEKK0341A010SC(param, handle, inHashKktk, resultHashKktk, FUNC_CODE_1)` |
| 4 | SET | `this.taknkiki_model_cd[0] = chafEKK0341A010SCHash.get(TAKNKIKI_MODEL_CD)` |
| 5 | SET | `this.kiki_seizo_no[0] = chafEKK0341A010SCHash.get(KIKI_SEIZO_NO)` |
| 6 | CALL | `getSame_trn_no(param, handle, null, sameTrnNo)` |
| 7 | CALL | `getEKK0251B001SC(param, handle, svc_kei_no, FUNC_CODE_1)` |
| 8 | SET | `this.svc_kei_kaisen_ucwk_no = eKK0251B001Hash.get(SVC_KEI_KAISEN_UCWK_NO)` |
| 9 | CALL | addSOD(214) OLS Setup/Split Phone Register |
| 10 | CALL | addSOD(234) SIP/Split Phone Register |
| 11 | ELSE IF | `910/920` -> addSOD(235) SIP/Split Phone Cancel |

**Block 14** — [IF] `opSvcCd = TENSO` (Forwarding Call) (L10581)
> Handles call forwarding registration/cancellation and selective forwarding.

| # | Type | Code |
|---|------|------|
| 1 | IF | `chbfOpSvcKeiStat != chafOpSvcKeiStat` (status changed) |
| 2 | CALL | `callEKK0191A010SC` -- Service contract details (eo light phone) |
| 3 | SET | `isBmpNon = !BMP_UM_ARI.equals(eKK0191A010Hash.get(BMP_UM))` |
| 4 | CALL | `callEKK1041B001SC(param, handle, ORDER_SBT_CD_TEL, ..., svc_kei_no)` |
| 5 | LOOP | Check Z1 orders: svc_order_cd matches `2[0134]` and rcnt_yokyu_sbt_cd >= "02" |
| 6 | CALL | `getSame_trn_no(param, handle, null, sameTrnNo)` |
| 7 | IF | Not canceled -> `isBmpNon && isOrderedZ1 < 4` -> addSOD(218) SIP Register + addSOD(236) SIP/Forwarding Register |
| 8 | IF | `isOrderedZ1 >= 4` -> addSOD(236) SIP/Forwarding Register |
| 9 | ELSE (canceled) -> addSOD(237) SIP/Forwarding Cancel |
| 10 | Sub-option: `SBOP_SVC_CD_TENSOSEL` -> addSOD(238) SIP/Forwarding Selective Register / addSOD(239) Cancel |

**Block 15** — [IF] `opSvcCd = DSP` (Caller ID Display) (L10719)
> Handles caller ID display registration/cancellation and non-delivery rejection.

| # | Type | Code |
|---|------|------|
| 1 | IF | Status changed |
| 2 | CALL | `getSame_trn_no(param, handle, null, sameTrnNo)` |
| 3 | IF | Not canceled -> addSOD(240) SIP/Caller ID Display Register |
| 4 | ELSE -> addSOD(241) SIP/Caller ID Display Cancel |
| 5 | Sub-option: `SBOP_SVC_CD_NOTELNO` -> addSOD(242) SIP/Non-Delivery Rejection Register / addSOD(243) Cancel |
| 6 | IF | Status unchanged, sub-option changed -> same logic |

**Block 16** — [IF] `opSvcCd = MWKTEL` (Annoyance Call Rejection) (L10799)
> Handles annoyance call reception rejection registration/cancellation.

| # | Type | Code |
|---|------|------|
| 1 | IF | Status changed |
| 2 | CALL | `getSame_trn_no(param, handle, null, sameTrnNo)` |
| 3 | IF | Not canceled -> addSOD(244) SIP/Annoyance Call Rejection Register |
| 4 | ELSE -> addSOD(245) SIP/Annoyance Call Rejection Cancel |

**Block 17** — [IF] `opSvcCd = STINO` (Number Selective Rejection) (L10841)
> Handles number-specific reception rejection registration/cancellation.

| # | Type | Code |
|---|------|------|
| 1 | IF | Status changed |
| 2 | CALL | `getSame_trn_no(param, handle, null, sameTrnNo)` |
| 3 | IF | Not canceled -> addSOD(246) SIP/Number Selective Rejection Register |
| 4 | ELSE -> addSOD(247) SIP/Number Selective Rejection Cancel |

**Block 18** — [IF] `opSvcCd = KOKUSAI_STP` (International Call Suspension) (L10883)
> Handles international call suspension registration/cancellation. Uses tsuikabunAddSOD instead of addSOD.

| # | Type | Code |
|---|------|------|
| 1 | IF | Status changed |
| 2 | CALL | `getSame_trn_no(param, handle, null, sameTrnNo)` |
| 3 | IF | Not canceled -> tsuikabunAddSOD(253) SIP/International Call Suspension Register |
| 4 | ELSE -> tsuikabunAddSOD(254) SIP/International Call Suspension Cancel |

**Block 19** — [IF] `opSvcCd = B070` (IPv6) (L10926)
> Handles IPv6 registration/cancellation/resumption. Sets sod_pattern_ipv6 (1=register, 3=cancel) and calls jdgIpv6 for detailed decision.

| # | Type | Code |
|---|------|------|
| 1 | SET | `this.op_svc_kei_no_ipv6 = chaf_opsvkei_no` |
| 2 | SET | `this.op_gadtm_ipv6 = chaf_opsvkei_gene_add_dtm` |
| 3 | CALL | `getSame_trn_no(param, handle, null, sameTrnNo)` |
| 4 | IF | `isBlank(chbf_opsvkei_no)` -> sod_pattern_ipv6 = 1 -> jdgIpv6(handle, param, "", chaf_opsvkei_no, ...)` |
| 5 | ELSE IF | `910/920` (after cancel) -> sod_pattern_ipv6 = 3 -> jdgIpv6(handle, param, "", chbf_opsvkei_no, ...)` |
| 6 | ELSE IF | `910->before, 100->after` -> sod_pattern_ipv6 = 1 -> jdgIpv6(handle, param, "", chaf_opsvkei_no, ...)` |

**Block 20** — [IF] `opSvcCd = N050` (Number Porting) (L10973)
> Handles number porting registration/cancellation.

| # | Type | Code |
|---|------|------|
| 1 | SET | `this.op_svc_kei_no_tikan = chaf_opsvkei_no` |
| 2 | SET | `this.op_gadtm_tikan = chaf_opsvkei_gene_add_dtm` |
| 3 | IF | `isBlank(chbf_opsvkei_no) || (910->100)` -> addSOD(248) Number Porting Register |
| 4 | ELSE IF | `910/920 || number050Exe` -> addSOD(249) Number Porting Delete + `number050Exe = false` |

**Block 21** — [BLOCK] Cleanup (L11044-11048)
> Stores previous record state for audit trail.

| # | Type | Code |
|---|------|------|
| 1 | SET | `this.mae_recode_chaf_op_svc_kei_no = new String(chaf_opsvkei_no)` |
| 2 | SET | `this.mae_recode_chaf_op_svc_kei_gene_add_dtm = new String(chaf_opsvkei_gene_add_dtm)` |
| 3 | SET | `this.mae_recode_chbf_op_svc_kei_no = new String(chbf_opsvkei_no)` |
| 4 | SET | `this.mae_recode_chbf_op_svc_kei_gene_add_dtm = new String(chbf_opsvkei_gene_add_dtm)` |

**Block 22** — [RETURN] (L11051)

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

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| SOD | Acronym | Service Order Data -- telecom order fulfillment entity that triggers downstream service provisioning workflows |
| opSvcCd | Field | Option service code -- classifies the type of option service (B001=Email, B002=Home Page, B003=Mailing List, B004=Fixed IP, B015=Multiselection, B020=Dial-up, B070=IPv6, B075=Feather Cell, etc.) |
| SVC_KEI_NO | Field | Service contract number -- unique identifier for a customer's main service contract line |
| SVC_KEI_UCWK_NO | Field | Service contract detail number -- unique identifier for a service contract detail/line item |
| OPSVKEI_NO | Field | Option service contract number -- unique identifier for an option service contract line |
| KKTSVKEI_NO | Field | Equipment provision service contract number -- identifier for equipment provision (router, set-top box) |
| OP_SVC_KEI_STAT | Field | Option service contract status -- status code indicating the state of the option service (100=Service in Progress, 020=Suspended, 030=Reserved, 910=Cancelled, 920=Withdrawn) |
| SBOP_SVC_CD | Field | Sub-option service code -- code for sub-option services (D01=Mail Alias, D02=Mailboxes Capacity, D03=Antivirus, D04=Home Page Capacity, D05=Access Analysis, D06=Forwarding Call, D07=Non-Delivery Rejection, D08=Annoyance Rejection, D09=Number Selective Rejection) |
| GENE_ADD_DTM | Field | Generation registration datetime -- timestamp when a contract version was generated/created (used for optimistic concurrency control) |
| chbf / chaf | Abbreviation | Before change / After change -- prefixes used for variable naming to distinguish before-state from after-state data |
| ido_div | Field | Displacement division -- indicates the type of change operation (Cancel, Withdraw, Forced Cancel, etc.) |
| same_trn_no | Field | Same transaction number -- shared transaction number for deduplication across related operations |
| op_svc_kei_no_ml | Field | Option service contract number for Mail (Email) |
| op_svc_kei_no_hp | Field | Option service contract number for Home Page (Web) |
| op_svc_kei_no_mlist | Field | Option service contract number for Mailing List |
| op_svc_kei_no_fixipad | Field | Option service contract number for Fixed IP Address |
| op_svc_kei_no_mltise | Field | Option service contract number for Multiselection |
| op_svc_kei_no_dial | Field | Option service contract number for Dial-up |
| op_svc_kei_no_fmtcel | Field | Option service contract number for Feather Cell (mobile service) |
| op_svc_kei_no_ipv6 | Field | Option service contract number for IPv6 |
| op_svc_kei_no_tikan | Field | Option service contract number for Number Porting |
| MLAD | Field | Mail alias address -- the email alias configured for the user |
| AD_CAPA | Field | Added capacity -- mailboxes capacity or home page capacity value |
| ALIAS | Field | Mail alias address (sub-option) |
| URL_DOMAIN | Field | URL domain -- domain part of the web homepage URL |
| URL_ACCOUNT | Field | URL account -- account/path part of the web homepage URL |
| PAUSE_JDG_CD | Field | Pause judgment code -- 1=paused, 0=not paused (for FTTH authentication pause handling) |
| SOD_PATTERN_IPV6 | Field | IPv6 SOD decision pattern -- 1=register, 3=cancel (driven by jdgIpv6 decision logic) |
| old_vrsb_jdg_svc_dtl_cd | Field | Old VR identification judgment service detail code -- used for legacy VR (version recognition) |
| taknkiki_model_cd | Field | Home device model code -- model code for in-home equipment (split phone) |
| kiki_seizo_no | Field | Equipment manufacturing number -- serial number of the equipment |
| SVC_KEI_KAISEN_UCWK_NO | Field | Service line detail number -- line-specific detail for the service |
| ADD_CAPA | Field | Added capacity -- the capacity value for sub-option (mailboxes or homepage) |
| BMP_UM | Field | BMP (number position) presence/absence -- whether the customer has a number position (ARI=present, UM=absent) |
| RCNT_YOKYU_SBT_CD | Field | Emergency notification service code code -- code for emergency notification service type |
| SVC_ORDER_CD | Field | Service order code -- code identifying the type of service order |
