---

# Business Logic — JBSbatKKDelRun.updateDelTrnJssiDtm() [55 LOC]

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

## 1. Role

### JBSbatKKDelRun.updateDelTrnJssiDtm()

This method serves as the **delete transaction date/time routing dispatcher** within the K-Optimco batch deletion processing pipeline (`JBSbatKKDelRun`). Its business purpose is to **route a deletion request to the appropriate sub-handler based on the delete target type** (`delTrgtSbt`). The method receives a single input map carrying a `DEL_TRGT_SBT` key that identifies which class of entity the batch is attempting to delete. Based on the value of this code, the method dispatches to one of four specialized deletion handlers: customer deletion (`updateDelTrnJssiDtmCust`), service contract deletion (`updateDelTrnJssiDtmSvcKei`), service contract detail deletion (`updateDelTrnJssiDtmSvkeiuw`), or optional service contract deletion (`updateDelTrnJssiDtmOpsvkei`). It implements the **routing/dispatch design pattern**, using a switch-by-value chain to direct work to domain-specific handlers. If the `delTrgtSbt` value does not match any known category, the method logs a business error (`EKKB0130CE`) and raises a `JBSbatBusinessError` exception to abort the batch operation. This method is an internal orchestration step within the batch deletion workflow, called by `JBSbatKKDelRun.execute()`.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["updateDelTrnJssiDtm(inMap)"])
    STEP1["Get delTrgtSbt from inMap.getString DEL_TRGT_SBT"]
    STEP2{"delTrgtSbt == 11 eoID or 12 Nickname"}
    STEP3["updateDelTrnJssiDtmCust inMap"]
    STEP4{"delTrgtSbt == 01 ISP AuthID or 06 PPP AuthID or 16 ADSL AuthID"}
    STEP5["updateDelTrnJssiDtmSvcKei inMap"]
    STEP6{"delTrgtSbt == 17 SIP UserID or 02 Old ISP AuthID or 09 OABJ Phone"}
    STEP7["updateDelTrnJssiDtmSvkeiuw inMap"]
    STEP8{"isDelOpsvkei delTrgtSbt"}
    STEP9["updateDelTrnJssiDtmOpsvkei inMap"]
    STEP10["printBusinessErrorLog EKKB0130CE Delete Target Type"]
    STEP11["setErrFlg true"]
    STEP12["throw JBSbatBusinessError"]
    END_NODE(["Return / Next"])

    START --> STEP1 --> STEP2
    STEP2 -- Yes --> STEP3 --> END_NODE
    STEP2 -- No --> STEP4
    STEP4 -- Yes --> STEP5 --> END_NODE
    STEP4 -- No --> STEP6
    STEP6 -- Yes --> STEP7 --> END_NODE
    STEP6 -- No --> STEP8
    STEP8 -- Yes --> STEP9 --> END_NODE
    STEP8 -- No --> STEP10 --> STEP11 --> STEP12 --> END_NODE
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `inMap` | `JBSbatServiceInterfaceMap` | Input message carrying the batch deletion request. Specifically contains the `DEL_TRGT_SBT` key (a String code) that identifies the type of entity to be deleted — e.g., "11" for eoID, "01" for ISP Authentication ID, "17" for SIP User ID. This single field determines which of the four deletion sub-handlers is invoked. |
| — | `super.commonItem` | `JBSbatCommonItem` (inherited) | Shared batch processing context. The method reads `commonItem.getLogPrint()` for error logging and calls `commonItem.setErrFlg(true)` when setting the error flag on the error path. |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `JBSbatServiceInterfaceMap.getString` | - | - | Reads `DEL_TRGT_SBT` value from the input map `inMap` |
| U | `JBSbatKKDelRun.updateDelTrnJssiDtmCust` | - | - | Routes to customer deletion handler when `delTrgtSbt` is "11" (eoID) or "12" (Nickname) |
| U | `JBSbatKKDelRun.updateDelTrnJssiDtmSvcKei` | - | - | Routes to service contract deletion handler when `delTrgtSbt` is "01" (ISP AuthID), "06" (PPP AuthID), or "16" (ADSL AuthID) |
| U | `JBSbatKKDelRun.updateDelTrnJssiDtmSvkeiuw` | - | - | Routes to service contract detail deletion handler when `delTrgtSbt` is "17" (SIP UserID), "02" (Old ISP AuthID), or "09" (OABJ Phone Number) |
| R | `JBSbatKKDelRun.isDelOpsvkei` | - | - | Checks if `delTrgtSbt` matches any optional service type (MLAD, MailAlias, POP ID, URL, Web ID, Mailing List, Fixed IP, 050 Phone, etc.) |
| U | `JBSbatKKDelRun.updateDelTrnJssiDtmOpsvkei` | - | - | Routes to optional service contract deletion handler when `isDelOpsvkei` returns true |
| - | `JPCBatchMessageConstant.printBusinessErrorLog` | - | - | Logs business error with message key `EKKB0130CE` and parameter "Delete Target Type" on invalid routing |
| - | `JBSbatCommonItem.setErrFlg` | - | - | Sets the batch error flag to `true` on invalid routing |
| - | `JBSbatBusinessError` | - | - | Throws business error exception to abort the batch operation |

## 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` [-], `printBusinessErrorLog` [-], `printBusinessErrorLog` [-], `updateDelTrnJssiDtmOpsvkei` [U], `isDelOpsvkei` [R], `updateDelTrnJssiDtmSvkeiuw` [U], `updateDelTrnJssiDtmSvcKei` [U], `updateDelTrnJssiDtmCust` [U], `getString` [R]

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Batch: `JBSbatKKDelRun.execute()` | `JBSbatKKDelRun.execute()` → `updateDelTrnJssiDtm()` | `updateDelTrnJssiDtmCust [U]`, `updateDelTrnJssiDtmSvcKei [U]`, `updateDelTrnJssiDtmSvkeiuw [U]`, `updateDelTrnJssiDtmOpsvkei [U]`, `printBusinessErrorLog [-]`, `setErrFlg [-]` |

## 6. Per-Branch Detail Blocks

**Block 1** — [IF/ELSE-IF/ELSE CHAIN] `(delTrgtSbt-based routing)` (L861)

> The method begins by extracting the delete target type code from the input map, then branches through a cascading if/else-if chain. Each branch identifies a class of entities that share a common deletion sub-handler.

| # | Type | Code |
|---|------|------|
| 1 | SET | `delTrgtSbt = inMap.getString(JBSbatKKIFM161.DEL_TRGT_SBT)` // Extract delete target type from input map [-> `JBSbatKKIFM161.DEL_TRGT_SBT` = `"DEL_TRGT_SBT"`] |

**Block 1.1** — [IF] `(Customer deletion: eoID or Nickname)` (L869) [DEL_TRGT_SBT_EOID="11", DEL_TRGT_SBT_NKNAME="12"]

> If the delete target is the customer entity itself (identified by eoID code "11" or Nickname code "12"), route to the customer deletion handler.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `delTrgtSbt.equals(DEL_TRGT_SBT_EOID)` // Check for eoID [-> `"11"`] |
| 2 | EXEC | `delTrgtSbt.equals(DEL_TRGT_SBT_NKNAME)` // Check for Nickname [-> `"12"`] |
| 3 | CALL | `updateDelTrnJssiDtmCust(inMap)` // Handle customer deletion |

**Block 1.2** — [ELSE-IF] `(Service contract deletion: ISP/PPP/ADSL AuthID)` (L879) [DEL_TRGT_SBT_ISP_NINSYO_ID="01", DEL_TRGT_SBT_PPP_NINSHO_ID="06", DEL_TRGT_SBT_ADSL_NINSHO_ID="16"]

> If the delete target is a service contract (identified by ISP Authentication ID "01", PPP Authentication ID "06", or ADSL Authentication ID "16"), route to the service contract deletion handler.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `delTrgtSbt.equals(DEL_TRGT_SBT_PPP_NINSHO_ID)` // Check for PPP AuthID [-> `"06"`] |
| 2 | EXEC | `delTrgtSbt.equals(DEL_TRGT_SBT_ISP_NINSYO_ID)` // Check for ISP AuthID [-> `"01"`] |
| 3 | EXEC | `delTrgtSbt.equals(DEL_TRGT_SBT_ADSL_NINSHO_ID)` // Check for ADSL AuthID [-> `"16"`] |
| 4 | CALL | `updateDelTrnJssiDtmSvcKei(inMap)` // Handle service contract deletion |

**Block 1.3** — [ELSE-IF] `(Service contract detail deletion: SIP/Old ISP/OABJ)` (L890) [DEL_TRGT_SBT_SIP_USER_ID="17", DEL_TRGT_SBT_ISP_NINSYO_ID_OLD="02", DEL_TRGT_SBT_OABJ_TELNO="09"]

> If the delete target is a service contract detail item (SIP User ID "17", old-format ISP AuthID "02", or OABJ phone number "09"), route to the service contract detail deletion handler.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `delTrgtSbt.equals(DEL_TRGT_SBT_SIP_USER_ID)` // Check for SIP User ID [-> `"17"`] |
| 2 | EXEC | `delTrgtSbt.equals(DEL_TRGT_SBT_ISP_NINSYO_ID_OLD)` // Check for Old ISP AuthID [-> `"02"`] |
| 3 | EXEC | `delTrgtSbt.equals(DEL_TRGT_SBT_OABJ_TELNO)` // Check for OABJ Phone Number [-> `"09"`] |
| 4 | CALL | `updateDelTrnJssiDtmSvkeiuw(inMap)` // Handle service contract detail deletion |

**Block 1.4** — [ELSE-IF] `(Optional service contract deletion via helper)` (L899) [isDelOpsvkei helper]

> If `isDelOpsvkei(delTrgtSbt)` returns true, the delete target is an optional service contract. The `isDelOpsvkei` method internally checks for these codes: "03" (MLAD), "04" (MailAlias), "15" (POPID), "07" (URL), "14" (Web ID), "05" (Mailing List), "08" (Fixed IP), "10" (050 Phone), "18" (Multi-session AuthID).

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `isDelOpsvkei(delTrgtSbt)` // Check if optional service contract type |
| 2 | CALL | `updateDelTrnJssiDtmOpsvkei(inMap)` // Handle optional service contract deletion |

**Block 1.5** — [ELSE] `(Error: unhandled delete target type)` (L906)

> If none of the known `delTrgtSbt` codes matched, the method logs a business error, sets the error flag, and throws a `JBSbatBusinessError` exception. This is a fail-fast path that aborts the batch operation for unrecognized deletion target types.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `commonItem.getLogPrint().printBusinessErrorLog(JPCBatchMessageConstant.EKKB0130CE, new String[]{"消去対象種類"})` // Log error: unrecognized delete target type (Japanese: "Delete Target Type") |
| 2 | EXEC | `super.commonItem.setErrFlg(true)` // Set error flag in shared batch context |
| 3 | EXEC | `throw new JBSbatBusinessError()` // Abort the batch operation with a business error |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `delTrgtSbt` | Field | Delete Target Sub-type — the domain classification code that determines which entity class is being deleted in this batch run |
| `DEL_TRGT_SBT` | Constant | Key name (`"DEL_TRGT_SBT"`) for the delete target type field in the input/output message maps |
| `DEL_TRGT_SBT_EOID` | Constant | Delete target code `"11"` — Customer deletion by eoID (the primary customer entity identifier) |
| `DEL_TRGT_SBT_NKNAME` | Constant | Delete target code `"12"` — Customer deletion by Nickname (display name for the customer) |
| `DEL_TRGT_SBT_ISP_NINSYO_ID` | Constant | Delete target code `"01"` — Internet Service Provider Authentication ID |
| `DEL_TRGT_SBT_PPP_NINSHO_ID` | Constant | Delete target code `"06"` — PPP (Point-to-Point Protocol) Authentication ID |
| `DEL_TRGT_SBT_ADSL_NINSHO_ID` | Constant | Delete target code `"16"` — ADSL (Asymmetric Digital Subscriber Line) Authentication ID |
| `DEL_TRGT_SBT_SIP_USER_ID` | Constant | Delete target code `"17"` — SIP (Session Initiation Protocol) User ID for VoIP services |
| `DEL_TRGT_SBT_ISP_NINSYO_ID_OLD` | Constant | Delete target code `"02"` — Legacy/old-format ISP Authentication ID (pre-migration identifier) |
| `DEL_TRGT_SBT_OABJ_TELNO` | Constant | Delete target code `"09"` — OABJ phone number (operator-assigned billing junction telephone number) |
| `DEL_TRGT_SBT_MLAD` | Constant | Delete target code `"03"` — Mail Access (メールアクセス, email access service) |
| `DEL_TRGT_SBT_MAILALIAS` | Constant | Delete target code `"04"` — Mail Alias (メールエイリアス, email alias forwarding address) |
| `DEL_TRGT_SBT_POP_ID` | Constant | Delete target code `"15"` — POP ID (Post Office Protocol authentication identifier) |
| `DEL_TRGT_SBT_URL` | Constant | Delete target code `"07"` — URL (URL access service) |
| `DEL_TRGT_SBT_WEB_ID` | Constant | Delete target code `"14"` — Web ID (web authentication identifier) |
| `DEL_TRGT_SBT_MLLIST_NM` | Constant | Delete target code `"05"` — Mailing List Name (メーリングリスト名, distribution list identifier) |
| `DEL_TRGT_SBT_FIXIPAD` | Constant | Delete target code `"08"` — Fixed IP Address (固定IPアドレス, static IP assignment) |
| `DEL_TRGT_SBT_050_TELNO` | Constant | Delete target code `"10"` — 050 Phone Number (VoIP telephone number with 050 prefix) |
| `DEL_TRGT_SBT_MLTISE_NINSHO_ID` | Constant | Delete target code `"18"` — Multi-session Authentication ID for fixed-use authentication (マルチセッション用認証ID) |
| eoID | Field | Enterprise Online ID — the primary unique identifier for a K-Optimco customer account |
| NKNAME | Field | Nickname (ニックネーム) — the display name associated with a customer account |
| ISP | Business term | Internet Service Provider — the entity providing internet connectivity services |
| PPP | Acronym | Point-to-Point Protocol — dial-up authentication method using PAP/CHAP credentials |
| ADSL | Acronym | Asymmetric Digital Subscriber Line — broadband internet over copper telephone lines |
| SIP | Acronym | Session Initiation Protocol — signaling protocol for VoIP and real-time communication |
| OABJ | Business term | Operator-assigned Billing Junction — a telephone number used for billing and routing in Japanese telecom |
| POP | Acronym | Post Office Protocol — email retrieval protocol |
| JBSbatKKDelRun | Class | K-Optimco Batch Delete Runner — the batch service class handling deletion processing for K-Optimco telecom services |
| JBSbatKKIFM161 | Class | K-Optimco Input/Message Format 161 — input message definition class for deletion batch operations |
| JBSbatServiceInterfaceMap | Class | Service Interface Map — a key-value map used for inter-layer communication between batch processing components |
| JBSbatCommonItem | Class | Common Batch Item — shared batch processing context holding log, error flag, and system-wide settings |
| JBSbatBusinessError | Class | Business Error — exception type thrown when a business rule violation occurs during batch processing |
| EKKB0130CE | Constant | Error message key — error message for unrecognized delete target type (消去対象種類) |
| updateDelTrnJssiDtmCust | Method | Customer deletion handler — deletes customer-level data (eoID, Nickname) |
| updateDelTrnJssiDtmSvcKei | Method | Service contract deletion handler — deletes service contract-level data (ISP/PPP/ADSL auth IDs) |
| updateDelTrnJssiDtmSvkeiuw | Method | Service contract detail deletion handler — deletes service contract detail items (SIP UserID, old ISP AuthID, OABJ phone) |
| updateDelTrnJssiDtmOpsvkei | Method | Optional service contract deletion handler — deletes optional add-on service data (Mail Access, Mail Alias, URL, etc.) |
| 消去実施年月日時分秒 | Field | Delete Execution Date and Time (Year/Month/Day/Hour/Minute/Second) — the date/time stamp being updated by this method |
| 消去対象種類 | Field | Delete Target Type (Japanese original) — the domain classification of the entity being deleted |
| お客様消去 | Comment | Customer Deletion — the business process of deleting a customer account and all associated data |
| サービス契約消去 | Comment | Service Contract Deletion — the business process of deleting a service contract line |
| サービス契約内訳消去 | Comment | Service Contract Detail Deletion — the business process of deleting a service contract detail/line item |
| オプションサービス契約消去 | Comment | Optional Service Contract Deletion — the business process of deleting optional add-on service contracts |

---

---
