# Business Logic — JBSbatKKDelRun.delSodHakko() [84 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.business.service.JBSbatKKDelRun` |
| Layer | Batch / Service |
| Module | `service` (Package: `eo.business.service`) |

## 1. Role

### JBSbatKKDelRun.delSodHakko()

This method is the central dispatch entry point for the "Delete Service Order Data (SOD) Issuance" batch processing. In Japanese telecommunications customer systems, when a customer cancels or modifies a service (such as changing an ISP authentication ID, removing a mail alias, or deleting a PPP credential), a corresponding SOD (Service Order Data) record must be issued to notify downstream fulfillment systems of the cancellation. The `delSodHakko` method orchestrates this SOD issuance by routing the deletion request to one of eight specialized sub-methods, each responsible for generating the SOD for a specific deletion target type. It implements a routing/dispatch pattern: it extracts the deletion target type code (`DEL_TRGT_SBT`) from the input map, populates a shared temporary parameter map with common service contract fields (service contract number and its registration timestamp), then dispatches to the appropriate handler based on the target type. The method handles ISP authentication IDs (both current and legacy), ADSL authentication IDs, mail access, URL-based deletions, mailing list name deletions, and PPP authentication IDs. If the target type is unrecognized, it logs a business error and sets the error flag on the common item context.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["delSodHakko(inMap)"])
    
    DELTRGT["delTrgtSbt = inMap.getString(DEL_TRGT_SBT)"]
    TEMP["tempHakkoParam = new HashMap<Integer, String>()"]
    SET_COMMON["Set common params: SVKEI_NO, SVKEI_GADTM"]
    
    COND_DEL["delTrgtSbt"]
    
    BRANCH1["delSodHakkoIspNinsyoId(inMap, tempHakkoParam)"]
    BRANCH2["delSodHakkoIspNinsyoIdOld(inMap, tempHakkoParam)"]
    BRANCH3["delSodHakkoMlad(inMap, tempHakkoParam)"]
    BRANCH4["delSodHakkoUrl(inMap, tempHakkoParam)"]
    BRANCH5["delSodHakkoMllistNm(inMap, tempHakkoParam)"]
    BRANCH6["delSodHakkoPppNinsyoId(inMap, tempHakkoParam)"]
    BRANCH7["delSodHakkoIspNinsyoId(inMap, tempHakkoParam)"]
    BRANCH8["delSodHakkoStaticMltise(inMap, tempHakkoParam)"]
    BRANCH_ERR["printBusinessErrorLog(ErrFlg=true)"]
    
    END_NODE(["Return"])
    
    START --> DELTRGT --> TEMP --> SET_COMMON --> COND_DEL
    
    COND_DEL -->|"01"| BRANCH1
    COND_DEL -->|"02"| BRANCH2
    COND_DEL -->|"03"| BRANCH3
    COND_DEL -->|"07"| BRANCH4
    COND_DEL -->|"05"| BRANCH5
    COND_DEL -->|"06"| BRANCH6
    COND_DEL -->|"16"| BRANCH7
    COND_DEL -->|"18"| BRANCH8
    COND_DEL -->|else| BRANCH_ERR
    
    BRANCH1 --> END_NODE
    BRANCH2 --> END_NODE
    BRANCH3 --> END_NODE
    BRANCH4 --> END_NODE
    BRANCH5 --> END_NODE
    BRANCH6 --> END_NODE
    BRANCH7 --> END_NODE
    BRANCH8 --> END_NODE
    BRANCH_ERR --> END_NODE
```

**Constant Resolution:**

| Branch Key | Constant | Value | Business Meaning |
|------------|----------|-------|------------------|
| `"01"` | `DEL_TRGT_SBT_ISP_NINSYO_ID` | `"01"` | Delete ISP Authentication ID |
| `"02"` | `DEL_TRGT_SBT_ISP_NINSYO_ID_OLD` | `"02"` | Delete (Legacy) ISP Authentication ID |
| `"03"` | `DEL_TRGT_SBT_MLAD` | `"03"` | Delete Mail Access (Mail Address) |
| `"07"` | `DEL_TRGT_SBT_URL` | `"07"` | Delete URL |
| `"05"` | `DEL_TRGT_SBT_MLLIST_NM` | `"05"` | Delete Mailing List Name |
| `"06"` | `DEL_TRGT_SBT_PPP_NINSHO_ID` | `"06"` | Delete PPP Authentication ID |
| `"16"` | `DEL_TRGT_SBT_ADSL_NINSHO_ID` | `"16"` | Delete ADSL Authentication ID |
| `"18"` | `DEL_TRGT_SBT_MLTISE_NINSHO_ID` | `"18"` | Delete Multisection Authentication ID |

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `inMap` | `JBSbatServiceInterfaceMap` | The input message map carrying the batch deletion request. It contains the deletion target type code (`DEL_TRGT_SBT`), service contract number (`SVKEI_NO`), service contract registration timestamp (`SVKEI_GADTM`), and type-specific fields (e.g., service contract detail number, mail access, URL). The map acts as the wire-format payload between the batch framework and the service method. |

**Instance fields / external state read:**

| Source | Access | Business Description |
|--------|--------|---------------------|
| `super.commonItem` (inherited from `JBSbatBusinessService`) | `setErrFlg(true)` | Sets the error flag on the shared common item context used for error signaling in the batch processing pipeline. |

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `JKKBatOneTimeLogWriter.printBusinessErrorLog` | - | - | Logs a business error message (message key EKKB0130CE) when an unrecognized deletion target type is encountered. |
| - | `JKKHttpCommunicator.printBusinessErrorLog` | - | - | Logs a business error message at the HTTP communication layer for error notification. |
| R | `JBSbatFUCaseFileRnkData.getString` | - | - | Retrieves a string value from the FU (Fallback/Utility) case file ranking data object. |
| R | `JBSbatFUMoveNaviData.getString` | - | - | Retrieves a string value from the FU move navigation data object. |
| - | `JBSbatKKDelRun.delSodHakkoIspNinsyoId` | - | - | Dispatches to the sub-method that generates SOD for ISP authentication ID deletion. |
| - | `JBSbatKKDelRun.delSodHakkoIspNinsyoIdOld` | - | - | Dispatches to the sub-method that generates SOD for legacy ISP authentication ID deletion. |
| - | `JBSbatKKDelRun.delSodHakkoMlad` | - | - | Dispatches to the sub-method that generates SOD for mail access deletion. |
| - | `JBSbatKKDelRun.delSodHakkoMllistNm` | - | - | Dispatches to the sub-method that generates SOD for mailing list name deletion. |
| - | `JBSbatKKDelRun.delSodHakkoPppNinsyoId` | - | - | Dispatches to the sub-method that generates SOD for PPP authentication ID deletion. |
| - | `JBSbatKKDelRun.delSodHakkoStaticMltise` | - | - | Dispatches to the sub-method that generates SOD for multisection authentication ID deletion. |
| - | `JBSbatKKDelRun.delSodHakkoUrl` | - | - | Dispatches to the sub-method that generates SOD for URL deletion. |
| - | `JBSbatKKEMoneyTktnIraiRnk.printBusinessErrorLog` | - | - | Logs a business error via the money ticket payment ranking component. |
| - | `JBSbatKKEMoneyTktnTkyoTchMailSksi.printBusinessErrorLog` | - | - | Logs a business error via the money ticket Tokyo touch mail sending component. |
| R | `JBSbatZMAdDataSet.getString` | - | - | Retrieves a string value from the ZM (customer master) AD set data object. |
| R | `JESC0101B010TPMA.getString` | - | - | Retrieves a string value from the ESC (external service communication) TPMA object. |
| R | `JESC0101B020TPMA.getString` | - | - | Retrieves a string value from the ESC TPMA object (variant 2). |
| - | `JKKejbAdChecker.setErrFlg` | - | - | Sets the error flag on the AD (Account Data) checker EJBC component. |
| - | `JKKejbIdoRestrictBase.setErrFlg` | - | - | Sets the error flag on the Ido (usage) restriction base EJBC component. |

**Analysis Notes:**
- The method itself is a **routing/dispatch** method — it does not directly perform CRUD on database tables. Instead, it delegates to specialized sub-methods (e.g., `delSodHakkoIspNinsyoId`) that handle the actual SOD issuance logic, which includes INSERT operations into SOD order tables and subsequent communication with external systems.
- The `getString` calls on `JBSbatFUCaseFileRnkData`, `JBSbatFUMoveNaviData`, `JBSbatZMAdDataSet`, and `JESC*TPMA` objects are **Read** operations that extract data from pre-populated data carrier objects passed within the batch pipeline.
- The `setErrFlg` calls on `JKKejbAdChecker` and `JKKejbIdoRestrictBase` are side-effect writes (flag setting, not database operations).
- The error logging calls (`printBusinessErrorLog`) are **Write** operations to error log tables/queues.

## 5. Dependency Trace

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

No screen/batch entry points found within 8 hops. Direct callers found: 1 methods.
Terminal operations from this method: `setErrFlg` [-], `setErrFlg` [-], `printBusinessErrorLog` [-], `printBusinessErrorLog` [-], `printBusinessErrorLog` [-], `printBusinessErrorLog` [-], `delSodHakkoStaticMltise` [-], `delSodHakkoIspNinsyoId` [-], `delSodHakkoPppNinsyoId` [-], `delSodHakkoMllistNm` [-], `delSodHakkoUrl` [-], `delSodHakkoMlad` [-], `delSodHakkoIspNinsyoIdOld` [-], `delSodHakkoIspNinsyoId` [-], `getString` [R], `getString` [R], `getString` [R], `getString` [R], `getString` [R], `getString` [R]

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Batch: `JBSbatKKDelRun.execute()` | `JBSbatKKDelRun.execute()` -> `delSodHakko(inMap)` | `delSodHakkoIspNinsyoId [SOD_ISSUE]`, `delSodHakkoIspNinsyoIdOld [SOD_ISSUE]`, `delSodHakkoMlad [SOD_ISSUE]`, `delSodHakkoUrl [SOD_ISSUE]`, `delSodHakkoMllistNm [SOD_ISSUE]`, `delSodHakkoPppNinsyoId [SOD_ISSUE]`, `delSodHakkoStaticMltise [SOD_ISSUE]`, `printBusinessErrorLog [WRITE] ErrorLog`, `setErrFlg [FLAG_SET] CommonItem` |

## 6. Per-Branch Detail Blocks

**Block 1** — SET (extract deletion target type) (L482)

> Extract the deletion target type code from the input map. This code determines which specialized sub-method will handle the SOD issuance.

| # | Type | Code |
|---|------|------|
| 1 | SET | `delTrgtSbt = inMap.getString(JBSbatKKIFM161.DEL_TRGT_SBT)` // Delete target type extracted — determines dispatch branch |

**Block 2** — SET (create temporary parameter map) (L485)

> Create the temporary parameter map that will be shared across all dispatch branches. This map carries common SOD issuance parameters.

| # | Type | Code |
|---|------|------|
| 1 | SET | `tempHakkoParam = new HashMap<Integer, String>()` // Temporary SOD issuance parameter map |

**Block 3** — SET (set common parameters: service contract number and timestamp) (L488-L489)

> Populate the temporary parameter map with fields that are common to ALL deletion target types: the service contract number and its registration timestamp.

| # | Type | Code |
|---|------|------|
| 1 | SET | `tempHakkoParam.put(HAKKO_PARAM_IDX_SVKEI_NO, inMap.getString(JBSbatKKIFM161.SVKEI_NO))` // Service contract number [-> HAKKO_PARAM_IDX_SVKEI_NO=0] |
| 2 | SET | `tempHakkoParam.put(HAKKO_PARAM_IDX_SVKEI_GADTM, inMap.getString(JBSbatKKIFM161.SVKEI_GADTM))` // Service contract registration timestamp [-> HAKKO_PARAM_IDX_SVKEI_GADTM=1] |

**Block 4** — IF/ELSE-IF chain (deletion target type dispatch) (L493)

> The main dispatch logic. Each branch delegates to a specialized sub-method for SOD issuance. All branches share the same `tempHakkoParam` (which each sub-method populates with type-specific fields).

**Block 4.1** — IF `[DEL_TRGT_SBT_ISP_NINSYO_ID = "01"]` (L493-L498)

> Dispatch to ISP authentication ID SOD issuance. The sub-method will add service contract detail number, detail registration timestamp, empty optional service contract fields, and the order type code "1" (Net).

| # | Type | Code |
|---|------|------|
| 1 | CALL | `delSodHakkoIspNinsyoId(inMap, tempHakkoParam)` // Delete: ISP Authentication ID |

**Block 4.2** — ELSE-IF `[DEL_TRGT_SBT_ISP_NINSYO_ID_OLD = "02"]` (L499-L504)

> Dispatch to (Legacy) ISP authentication ID SOD issuance. Handles the old-format ISP authentication ID records.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `delSodHakkoIspNinsyoIdOld(inMap, tempHakkoParam)` // Delete: (Legacy) ISP Authentication ID |

**Block 4.3** — ELSE-IF `[DEL_TRGT_SBT_MLAD = "03"]` (L505-L510)

> Dispatch to mail access (email address) SOD issuance.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `delSodHakkoMlad(inMap, tempHakkoParam)` // Delete: Mail Access |

**Block 4.4** — ELSE-IF `[DEL_TRGT_SBT_URL = "07"]` (L511-L516)

> Dispatch to URL SOD issuance.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `delSodHakkoUrl(inMap, tempHakkoParam)` // Delete: URL |

**Block 4.5** — ELSE-IF `[DEL_TRGT_SBT_MLLIST_NM = "05"]` (L517-L522)

> Dispatch to mailing list name SOD issuance.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `delSodHakkoMllistNm(inMap, tempHakkoParam)` // Delete: Mailing List Name |

**Block 4.6** — ELSE-IF `[DEL_TRGT_SBT_PPP_NINSHO_ID = "06"]` (L523-L528)

> Dispatch to PPP authentication ID SOD issuance.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `delSodHakkoPppNinsyoId(inMap, tempHakkoParam)` // Delete: PPP Authentication ID |

**Block 4.7** — ELSE-IF `[DEL_TRGT_SBT_ADSL_NINSHO_ID = "16"]` (L535-L540)

> Dispatch to ADSL authentication ID SOD issuance. ADSL authentication IDs reuse the same handler as ISP authentication IDs (`delSodHakkoIspNinsyoId`). This branch was added in IT1-2013-0000285.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `delSodHakkoIspNinsyoId(inMap, tempHakkoParam)` // Delete: ADSL Authentication ID (reuses ISP handler) |

**Block 4.8** — ELSE-IF `[DEL_TRGT_SBT_MLTISE_NINSHO_ID = "18"]` (L546-L551)

> Dispatch to multisection authentication ID SOD issuance. This branch was added on 2013-04-16 (IT1-2013-0000927) for multisection service authentication IDs.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `delSodHakkoStaticMltise(inMap, tempHakkoParam)` // Delete: Multisection Authentication ID |

**Block 4.9** — ELSE (unrecognized deletion target type) (L554-L558)

> Error handling: when the deletion target type code does not match any known value, log a business error and set the error flag. This prevents silent failures on invalid target types.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `commonItem.getLogPrint().printBusinessErrorLog(JPCBatchMessageConstant.EKKB0130CE, new String[]{"Delete target type"})` // Log business error with key EKKB0130CE |
| 2 | EXEC | `super.commonItem.setErrFlg(true)` // Set error flag to true on shared common item |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| SOD | Acronym | Service Order Data — a telecommunications order fulfillment entity representing a service change request sent to downstream systems (e.g., billing, provisioning). |
| SOD Issuance (SOD発行) | Business term | The process of creating and sending a Service Order Data record to notify external systems of a service change (cancellation, modification, etc.). |
| delSodHakko | Japanese field/method | "Delete SOD Issuance" — the batch operation that generates SOD records for service deletions/cancellations. |
| DEL_TRGT_SBT | Field | Deletion target type code — a string code that identifies the type of service element being deleted (e.g., ISP ID, mail access, URL). |
| `DEL_TRGT_SBT_ISP_NINSYO_ID` | Constant | Deletion target type "01" — ISP Authentication ID. The web-based credential used by customers to access ISP services. |
| `DEL_TRGT_SBT_ISP_NINSYO_ID_OLD` | Constant | Deletion target type "02" — Legacy ISP Authentication ID. The older-format ISP credential record. |
| `DEL_TRGT_SBT_MLAD` | Constant | Deletion target type "03" — Mail Access. Email address associated with the customer account. |
| `DEL_TRGT_SBT_MLLIST_NM` | Constant | Deletion target type "05" — Mailing List Name. A mailing list identifier associated with the customer account. |
| `DEL_TRGT_SBT_PPP_NINSHO_ID` | Constant | Deletion target type "06" — PPP Authentication ID. The Point-to-Point Protocol credential for dial-up or PPPoE connectivity. |
| `DEL_TRGT_SBT_URL` | Constant | Deletion target type "07" — URL. A web URL associated with the customer account (e.g., homepage URL, portal URL). |
| `DEL_TRGT_SBT_ADSL_NINSHO_ID` | Constant | Deletion target type "16" — ADSL Authentication ID. The credential for ADSL broadband service authentication. |
| `DEL_TRGT_SBT_MLTISE_NINSHO_ID` | Constant | Deletion target type "18" — Multisection Authentication ID. The credential for multisection (multi-line) service authentication. |
| `tempHakkoParam` | Field | Temporary SOD issuance parameter map — a `HashMap<Integer, String>` shared across dispatch branches, populated with SOD order parameters. |
| `HAKKO_PARAM_IDX_SVKEI_NO` | Constant | Index 0 in tempHakkoParam — Service contract number (サービス契約番号). The unique identifier for a customer's service contract. |
| `HAKKO_PARAM_IDX_SVKEI_GADTM` | Constant | Index 1 in tempHakkoParam — Service contract registration timestamp (サービス契約世代登録年月日時分秒). The date/time when the service contract version was registered. |
| `HAKKO_PARAM_IDX_SVKEIUW_NO` | Constant | Index 2 in tempHakkoParam — Service contract detail number (サービス契約内容番号). The unique identifier for a specific line/item within a service contract. |
| `HAKKO_PARAM_IDX_SVKEIUW_GADTM` | Constant | Index 3 in tempHakkoParam — Service contract detail registration timestamp (サービス契約内容世代登録年月日時分秒). The date/time when the service contract detail was registered. |
| `HAKKO_PARAM_IDX_OPSVKEI_NO` | Constant | Index 4 in tempHakkoParam — Optional service contract number (オプションサービス契約番号). The service contract number for optional/add-on services (set to empty string for basic deletion). |
| `HAKKO_PARAM_IDX_OPSVKEI_GADTM` | Constant | Index 5 in tempHakkoParam — Optional service contract registration timestamp (オプションサービス契約世代登録年月日時分秒). The registration timestamp for optional services. |
| `HAKKO_PARAM_IDX_ORDER_SBT_CD` | Constant | Index 6 in tempHakkoParam — Order type code (訂單種別コード). Classifies the type of order being placed. |
| `JBSbatKKConst.ORDER_SBT_CD_NET` | Constant | Order type code "1" — Net. Indicates a net-based service order (as opposed to mobile or other service types). |
| `EKKB0130CE` | Constant | Error message key in `JPCBatchMessageConstant`. Used to log a business error when an invalid deletion target type is encountered. |
| JBSbatServiceInterfaceMap | Type | The batch framework's input/output message container — a map-based interface for passing parameters between batch components. |
| JBSbatCommonItem | Type | The shared context item for batch processing — holds error flags, logging interfaces, and other cross-cutting state. |
| ISP | Business term | Internet Service Provider — the internet connectivity service for which authentication IDs are managed. |
| PPP | Business term | Point-to-Point Protocol — a network layer protocol used for direct connections (dial-up/PPPoE). |
| ADSL | Business term | Asymmetric Digital Subscriber Line — broadband internet service over telephone lines. |
| Multisection | Business term | A service configuration supporting multiple parallel lines/sections under a single account. |
