# Business Logic - JBSbatKKDelKhChk.execute() [319 LOC]

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

## 1. Role

### JBSbatKKDelKhChk.execute()

This method serves as the **deletion eligibility checker** for the K-Opticom customer base system batch processing pipeline. It determines whether a given subscriber's deletion target (such as an authentication ID, phone number, or address) can be safely removed from the system without violating business rules or data integrity constraints.

The method handles **17 distinct service types**: ISP Authentication ID (including legacy), PPP Authentication ID, ADSL Authentication ID, SIP User ID, Mail Address, Mail Alias, Mailing List Name, URL, Fixed IP Address, OABJ Phone Number, 050 Phone Number, eoID, Nickname, WebID, POPID, and Multi-session static Authentication ID. For each service type, it applies the appropriate deletion validation logic specific to that data category.

The method implements a **routing/dispatch pattern** — it inspects the `DEL_TRGT_SBT` (deletion target type) field in the input, dispatches to a type-specific `canDel` (can-delete) check method, and then configures aging-related parameters for downstream processing. When deletion is permitted, it either routes the request to the aging registration subsystem (`ZM_T_AGING`) for deferred deletion tracking, or rewrites the transaction type to trigger immediate deletion or deletion-with-SOD-cancellation.

Its role in the larger system is that of a **gatekeeper service**: it is the single shared entry point used by batch operations to determine whether a deletion can proceed, what aging parameters to apply, and what downstream transaction flags to set. It does not perform the deletion itself — it decides eligibility and prepares the output for the next stage in the deletion pipeline.

Conditional branches cover: (1) input validation failure — returns null immediately; (2) per-service-type eligibility checks with aging param setup — 17 distinct paths; (3) unknown service type — logs error and returns null; (4) deletion not permitted — silently returns empty output; (5) deletion permitted with aging update — queries aging table for an aging number and returns it in output; (6) deletion permitted with non-aging processing — rewrites the transaction type and passes data through.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["execute inMap"])

    START --> INIT["Initialize local variables"]

    INIT --> SETMKF["Set mkFlg to Valid flag"]

    SETMKF --> SINGLE["Check input validation"]

    SINGLE -->|false| ERR_FLG_1["Set errFlg true"]
    ERR_FLG_1 --> RET_NULL_1["Return null"]

    SINGLE -->|true| GET_DEL_TRGT["Get delTrgtSbt from input"]

    GET_DEL_TRGT --> C_DEL["Check delTrgtSbt value"]

    C_DEL -->|"01 or 02"| B_ISP["ISP Auth ID processing"]

    C_DEL -->|"03"| B_MLAD["Mail Address processing"]

    C_DEL -->|"04"| B_MLA["Mail Alias processing"]

    C_DEL -->|"05"| B_MLL["Mailing List processing"]

    C_DEL -->|"06"| B_PPP["PPP Auth ID processing"]

    C_DEL -->|"07"| B_URL["URL processing"]

    C_DEL -->|"08"| B_FI["Fixed IP processing"]

    C_DEL -->|"09"| B_OABJ["OABJ Phone processing"]

    C_DEL -->|"10"| B_050["050 Phone processing"]

    C_DEL -->|"11"| B_EO["eoID processing"]

    C_DEL -->|"12"| B_NK["Nickname processing"]

    C_DEL -->|"14"| B_WI["WebID processing"]

    C_DEL -->|"15"| B_PO["POPID processing"]

    C_DEL -->|"16"| B_AD["ADSL Auth ID processing"]

    C_DEL -->|"17"| B_SI["SIP User ID processing"]

    C_DEL -->|"18"| B_ML["Multi-session Auth processing"]

    C_DEL -->|"other"| ERR_UNK["Log unknown service error
Return null"]

    B_ISP --> B_ISP_A["Set aging parameters
CALL canDelIspNinsyoId"]
    B_MLAD --> B_MLAD_A["Set aging parameters
CALL canDelMlad"]
    B_MLA --> B_MLA_A["Set aging parameters
CALL canDelMailalias"]
    B_MLL --> B_MLL_A["Set aging parameters
CALL canDelMllist"]
    B_PPP --> B_PPP_A["Set aging parameters
CALL canDelPppNinshoId"]
    B_URL --> B_URL_A["Set aging parameters
CALL canDelUrl"]
    B_FI --> B_FI_A["Set aging parameters
CALL canDelFixipad"]
    B_OABJ --> B_OABJ_A["Set aging parameters
CALL canDelOabjTelNo"]
    B_050 --> B_050_A["Set aging parameters
CALL canDel050Telno"]
    B_EO --> B_EO_A["Set aging parameters
CALL canDelEoid"]
    B_NK --> B_NK_A["Set aging parameters
CALL canDelNkname"]
    B_WI --> B_WI_A["Set aging parameters
CALL canDelWebId"]
    B_PO --> B_PO_A["Set aging parameters
CALL canDelPopId"]
    B_AD --> B_AD_A["Set aging parameters
CALL canDelAdslNinshoId"]
    B_SI --> B_SI_A["Set aging parameters
CALL canDelSipUserId"]
    B_ML --> B_ML_A["CALL canDelMltiseNinsyoId"]

    B_MLA_A --> C_MLA{"agingTrgtValue is null"}

    C_MLA -->|true| ERR_MLA["Set errFlg true
Return null"]
    C_MLA -->|false| B_MLA_A2["Set aging values"]

    B_ISP_A --> CAN_CHK
    B_MLAD_A --> CAN_CHK
    B_MLA_A2 --> CAN_CHK
    B_MLL_A --> CAN_CHK
    B_PPP_A --> CAN_CHK
    B_URL_A --> CAN_CHK
    B_FI_A --> CAN_CHK
    B_OABJ_A --> CAN_CHK
    B_050_A --> CAN_CHK
    B_EO_A --> CAN_CHK
    B_NK_A --> CAN_CHK
    B_WI_A --> CAN_CHK
    B_PO_A --> CAN_CHK
    B_AD_A --> CAN_CHK
    B_SI_A --> CAN_CHK
    B_ML_A --> CAN_CHK

    ERR_UNK --> END_N["Return outputBean"]
    ERR_MLA --> END_N

    CAN_CHK{"canDel is true"}

    CAN_CHK -->|false| END_N

    CAN_CHK -->|true| S_MAP["Set outmap from inMap"]

    S_MAP --> G_DT["Get delTranSbt from input"]

    G_DT --> C_DT{"delTranSbt equals 2 or 3"}

    C_DT -->|no| SET_OF["Set outFlg true
Add outmap to output"]

    C_DT -->|yes| G_AG["CALL agingTrgtGai"]

    G_AG --> C_AG{"agingTrgtGaiFlg is false"}

    C_AG -->|yes| E_AGING["CALL executeZM_T_AGING_KK_SELECT_002
CALL selectNext"]

    E_AGING --> C_NR{"nextRec not null"}

    C_NR -->|yes| S_AN["Set agingNo
Set AGING_NO in outmap"]
    S_AN --> SET_OF

    C_NR -->|no| E_AG["Log aging error
Set errFlg true
Return empty outputBean"]

    C_AG -->|no| C_DT2{"delTranSbt equals 2"}

    C_DT2 -->|yes| S_DO["Set DEL_TRAN_SBT to Delete only"]
    C_DT2 -->|no| S_DS["Set DEL_TRAN_SBT to Delete SOD issue"]

    S_DO --> SET_OF
    S_DS --> SET_OF
    SET_OF --> END_N
```

**CRITICAL -- Constant Resolution:**

The `delTrgtSbt` (deletion target type) constant values come from `JKKBatDelRunConst`:

| Constant | Value | Business Meaning |
|----------|-------|-----------------|
| `DEL_TRGT_SBT_ISP_NINSYO_ID` | `"01"` | ISP Authentication ID |
| `DEL_TRGT_SBT_ISP_NINSYO_ID_OLD` | `"02"` | Legacy ISP Authentication ID |
| `DEL_TRGT_SBT_MLAD` | `"03"` | Mail Address |
| `DEL_TRGT_SBT_MAILALIAS` | `"04"` | Mail Alias |
| `DEL_TRGT_SBT_MLLIST_NM` | `"05"` | Mailing List Name |
| `DEL_TRGT_SBT_PPP_NINSHO_ID` | `"06"` | PPP Authentication ID |
| `DEL_TRGT_SBT_URL` | `"07"` | URL |
| `DEL_TRGT_SBT_FIXIPAD` | `"08"` | Fixed IP Address |
| `DEL_TRGT_SBT_OABJ_TELNO` | `"09"` | OABJ Phone Number |
| `DEL_TRGT_SBT_050_TELNO` | `"10"` | 050 Phone Number |
| `DEL_TRGT_SBT_EOID` | `"11"` | eoID |
| `DEL_TRGT_SBT_NKNAME` | `"12"` | Nickname |
| `DEL_TRGT_SBT_WEB_ID` | `"14"` | WebID |
| `DEL_TRGT_SBT_POP_ID` | `"15"` | POPID |
| `DEL_TRGT_SBT_ADSL_NINSHO_ID` | `"16"` | ADSL Authentication ID |
| `DEL_TRGT_SBT_SIP_USER_ID` | `"17"` | SIP User ID |
| `DEL_TRGT_SBT_MLTISE_NINSHO_ID` | `"18"` | Multi-session (Static) Authentication ID |

The `delTranSbt` (deletion transaction type) constant values come from `JKKBatDelRunConst`:

| Constant | Value | Business Meaning |
|----------|-------|-----------------|
| `DEL_TRAN_SBT_DEL_ONLY` | `"0"` | Delete only (no SOD cancellation) |
| `DEL_TRAN_SBT_DEL_SOD_HAKKO` | `"1"` | Delete with SOD (Service Order Data) issue |
| `DEL_TRAN_SBT_AGING_UPD` | `"2"` | Aging update |
| `DEL_TRAN_SBT_DEL_SOD_AGING_UPD` | `"3"` | Delete SOD issue + Aging update |

Aging-related constant values from `JBSbatKKConst`:

| Constant | Value | Business Meaning |
|----------|-------|-----------------|
| `AGING_SBT_CD_ISP_NINSHO_ID` | `"013"` | Aging type: ISP Auth ID (Account) |
| `AGING_SBT_CD_MLAD` | `"009"` | Aging type: Mail Address |
| `AGING_SBT_CD_MAILALIAS` | `"008"` | Aging type: Mail Alias |
| `AGING_SBT_CD_MLLIST` | `"010"` | Aging type: Mailing List |
| `AGING_SBT_CD_PPP_NINSHO_ID` | `"012"` | Aging type: PPP Auth ID (Account) |
| `AGING_SBT_CD_URL` | `"005"` | Aging type: URL |
| `AGING_SBT_CD_FIXIPAD` | `"002"` | Aging type: Fixed IP Address |
| `AGING_SBT_CD_TELNO` | `"001"` | Aging type: Phone Number (OABJ/050) |
| `AGING_SBT_CD_EOID` | `"004"` | Aging type: eoID |
| `AGING_SBT_CD_NKNAME` | `"003"` | Aging type: Nickname |
| `AGING_SBT_CD_WEB_ID` | `"006"` | Aging type: WebID |
| `AGING_SBT_CD_POP_ID` | `"007"` | Aging type: POPID |
| `AGING_SBT_CD_ADSL_NINSHO_ID` | `"015"` | Aging type: ADSL Auth ID (Account) |
| `AGING_SBT_CD_SIP_USER_ID` | `"014"` | Aging type: SIP User ID |
| `AGING_STAT_KAIHK_PSB` | `"200"` | Aging status: Recovery possible |
| `MK_FLG_YK` | `"0"` | Invalid flag: Valid (not invalid) |

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `inMap` | `JBSbatServiceInterfaceMap` | Input message carrying deletion request parameters. Contains the deletion target type (`DEL_TRGT_SBT`), deletion transaction type (`DEL_TRAN_SBT`), and the actual value of the data to be deleted (e.g., ISP Auth ID, mail address, phone number). The specific field depends on the deletion target type. |

**Instance fields / external state read by the method:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `super.commonItem` | `JBSbatCommonItem` | Batch-common parameter item carrying error flags, log print, and shared batch context. Read for error flag setting and log output. |
| `db_ZM_T_AGING` | `JBSbatSQLAccess` | DB access handle for the `ZM_T_AGING` table. Used to query the next available aging number when aging update is required. |

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `JBSbatKKDelKhChk.isSingleCheckKKIFM160_INF1` | - | - | Validates input fields against a rule map to ensure required data is present and correctly formatted |
| R | `JBSbatKKDelKhChk.getItemvalueMap` | - | - | Returns a HashMap of valid input field names for single-item validation |
| R | `JBSbatKKDelKhChk.canDelIspNinsyoId` | - | `KK_T_SVC_KEI`, `KK_T_SVC_KEI_UCWK`, `KK_T_OP_SVC_KEI`, `CK_T_CUST` | Checks ISP Auth ID deletion eligibility by verifying service contract status, under-work status, and operation service contract constraints |
| R | `JBSbatKKDelKhChk.canDelMlad` | - | `KK_T_SVC_KEI`, `KK_T_SVC_KEI_UCWK`, `KK_T_OP_SVC_KEI`, `CK_T_CUST` | Checks Mail Address deletion eligibility across service contracts and customer records |
| R | `JBSbatKKDelKhChk.canDelMailalias` | - | `KK_T_SVC_KEI`, `KK_T_SVC_KEI_UCWK`, `KK_T_OP_SVC_KEI`, `CK_T_CUST` | Checks Mail Alias deletion eligibility; also calls `getMailAliasAgingTgValue` to construct the aging target value from multiple possible fields |
| R | `JBSbatKKDelKhChk.canDelMllist` | - | `KK_T_SVC_KEI`, `KK_T_SVC_KEI_UCWK`, `KK_T_OP_SVC_KEI`, `CK_T_CUST` | Checks Mailing List Name deletion eligibility |
| R | `JBSbatKKDelKhChk.canDelPppNinshoId` | - | `KK_T_SVC_KEI`, `KK_T_SVC_KEI_UCWK`, `KK_T_OP_SVC_KEI`, `CK_T_CUST` | Checks PPP Auth ID deletion eligibility |
| R | `JBSbatKKDelKhChk.canDelUrl` | - | `KK_T_SVC_KEI`, `KK_T_SVC_KEI_UCWK`, `KK_T_OP_SVC_KEI`, `CK_T_CUST` | Checks URL deletion eligibility |
| R | `JBSbatKKDelKhChk.canDelFixipad` | - | `KK_T_SVC_KEI`, `KK_T_SVC_KEI_UCWK`, `KK_T_OP_SVC_KEI`, `CK_T_CUST` | Checks Fixed IP Address deletion eligibility |
| R | `JBSbatKKDelKhChk.canDelOabjTelNo` | - | `KK_T_SVC_KEI`, `KK_T_SVC_KEI_UCWK`, `KK_T_OP_SVC_KEI`, `CK_T_CUST` | Checks OABJ Phone Number deletion eligibility |
| R | `JBSbatKKDelKhChk.canDel050Telno` | - | `KK_T_SVC_KEI`, `KK_T_SVC_KEI_UCWK`, `KK_T_OP_SVC_KEI`, `CK_T_CUST` | Checks 050 Phone Number deletion eligibility |
| R | `JBSbatKKDelKhChk.canDelEoid` | - | `KK_T_SVC_KEI`, `KK_T_SVC_KEI_UCWK`, `KK_T_OP_SVC_KEI`, `CK_T_CUST` | Checks eoID deletion eligibility |
| R | `JBSbatKKDelKhChk.canDelNkname` | - | `KK_T_SVC_KEI`, `KK_T_SVC_KEI_UCWK`, `KK_T_OP_SVC_KEI`, `CK_T_CUST` | Checks Nickname deletion eligibility |
| R | `JBSbatKKDelKhChk.canDelWebId` | - | `KK_T_SVC_KEI`, `KK_T_SVC_KEI_UCWK`, `KK_T_OP_SVC_KEI`, `CK_T_CUST` | Checks WebID deletion eligibility |
| R | `JBSbatKKDelKhChk.canDelPopId` | - | `KK_T_SVC_KEI`, `KK_T_SVC_KEI_UCWK`, `KK_T_OP_SVC_KEI`, `CK_T_CUST` | Checks POPID deletion eligibility |
| R | `JBSbatKKDelKhChk.canDelAdslNinshoId` | - | `KK_T_SVC_KEI`, `KK_T_SVC_KEI_UCWK`, `KK_T_OP_SVC_KEI`, `CK_T_CUST` | Checks ADSL Auth ID deletion eligibility |
| R | `JBSbatKKDelKhChk.canDelSipUserId` | - | `KK_T_SVC_KEI`, `KK_T_SVC_KEI_UCWK`, `KK_T_OP_SVC_KEI`, `CK_T_CUST` | Checks SIP User ID deletion eligibility |
| R | `JBSbatKKDelKhChk.canDelMltiseNinsyoId` | - | `KK_T_SVC_KEI`, `KK_T_SVC_KEI_UCWK`, `KK_T_OP_SVC_KEI`, `KK_T_OPSVKEI_ISP`, `CK_T_CUST` | Checks Multi-session (static) Authentication ID deletion eligibility (added 2013-04-16) |
| R | `JBSbatKKDelKhChk.getAccount` | - | `CK_T_CUST` | Extracts account name from customer table for aging target value (used for Auth ID types) |
| R | `JBSbatKKDelKhChk.getMailAliasAgingTgValue` | - | - | Constructs the aging target value for mail alias from multiple possible source fields in the input map |
| R | `JBSbatKKDelKhChk.agingTrgtGai` | - | `KK_T_ODR_SET` | Checks if deletion target is an exception for aging processing; queries order setup table for special handling rules |
| R | `JBSbatKKDelKhChk.getAgingParam` | - | - | Builds aging parameter map with `agingSbtCd`, `agingTrgtValue`, `agingStat`, and `mkFlg` |
| R | `executeZM_T_AGING_KK_SELECT_002` | - | `ZM_T_AGING` | Queries the aging table to retrieve the next available aging number for deferred deletion processing |
| R | `db_ZM_T_AGING.selectNext` | - | `ZM_T_AGING` | DB query: selects the next aging record from the aging table |
| - | `JKKBatOneTimeLogWriter.printBusinessErrorLog` | - | - | Logs business error for unknown operation service code (EKKB0130CE) |
| - | `JKKBatOneTimeLogWriter.printBusinessErrorLog` | - | - | Logs business error for aging table query failure (EKKB0720KW with "ZM0111 Aging") |
| - | `JBSbatServiceInterfaceMap.setOutFlg` | - | - | Sets the output flag on the output map to indicate deletion is permitted |
| - | `JBSbatOutputItem.addOutMapList` | - | - | Appends the prepared output map to the output bean's result list |

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Batch: `JBSbatKKDelInfCht` | `JBSbatKKDelInfCht` -> `JBSbatKKDelKhChk.execute` | `canDelIspNinsyoId [R] KK_T_SVC_KEI` |
| - | - | - | `canDelMlad [R] KK_T_SVC_KEI_UCWK` |
| - | - | - | `canDelUrl [R] KK_T_OP_SVC_KEI` |
| - | - | - | `canDelOabjTelNo [R] CK_T_CUST` |
| - | - | - | `agingTrgtGai [R] KK_T_ODR_SET` |
| - | - | - | `executeZM_T_AGING_KK_SELECT_002 [R] ZM_T_AGING` |

**Note:** No direct callers were found in the codebase outside of the class itself. This method is designed to be invoked by batch wrapper classes (e.g., `JBSbatKKDelInfCht`) that handle batch scheduling and parameter routing. The `static import` of `JKKBatDelRunConst` indicates this is part of a coordinated deletion batch system.

## 6. Per-Branch Detail Blocks

**Block 1** — VARIABLE DECLARATIONS (L239)

Initialization of local variables and output structures.

| # | Type | Code |
|---|------|------|
| 1 | SET | `outmap = new JBSbatServiceInterfaceMap()` // Output record |
| 2 | SET | `outputBean = new JBSbatOutputItem()` // Output info |
| 3 | SET | `nextRec = null` // Next record |
| 4 | SET | `delTranSbt = null` // Deletion transaction type |
| 5 | SET | `delTrgtSbt = null` // Deletion target type |
| 6 | SET | `agingNo = null` // Aging number |
| 7 | SET | `agingSbtCd = null` // Aging type code |
| 8 | SET | `agingTrgtValue = null` // Aging target value |
| 9 | SET | `agingStat = AGING_STAT_KAIHK_PSB` // Aging status: `"200"` (Recovery possible) |
| 10 | SET | `canDel = false` // Deletion eligibility flag |
| 11 | SET | `mkFlg = MK_FLG_YK` // Invalid flag: `"0"` (Valid) [-> `JBSbatKKConst.MK_FLG_YK="0"`] |

**Block 2** — IF (input validation) (L257)

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `!isSingleCheckKKIFM160_INF1(inMap.getMap(), getItemvalueMap())` // Single item validation |
| 2 | SET | `super.commonItem.setErrFlg(true)` // Set error flag [-> Japanese: エラーフラグ設定] |
| 3 | RETURN | `return null` // Return null on validation failure [-> Japanese: エラー返却] |

**Block 3** — GET DEL_TRGT_SBT (L264)

| # | Type | Code |
|---|------|------|
| 1 | SET | `delTrgtSbt = inMap.getString(JBSbatKKIFM160.DEL_TRGT_SBT)` // Get deletion target type from input [-> Japanese: 削除対象種類] |

**Block 4** — IF/ELSE-IF CHAIN (delTrgtSbt dispatch) (L269)

The core routing logic. Each branch validates deletion eligibility and configures aging parameters.

**Block 4.1** — IF `delTrgtSbt.equals("01")` or `("02")` — ISP Auth ID (L270)

[DEL_TRGT_SBT_ISP_NINSYO_ID="01"] or [DEL_TRGT_SBT_ISP_NINSYO_ID_OLD="02"]

| # | Type | Code |
|---|------|------|
| 1 | CALL | `canDel = canDelIspNinsyoId(inMap)` // Check ISP Auth ID deletion eligibility |
| 2 | SET | `agingSbtCd = AGING_SBT_CD_ISP_NINSHO_ID` // Aging type: `"013"` (ISP Auth ID Account) [-> JBSbatKKConst.AGING_SBT_CD_ISP_NINSHO_ID="013"] |
| 3 | SET | `agingTrgtValue = getAccount(inMap.getString(JBSbatKKIFM160.ISP_NINSHO_ID))` // Aging target = account name from customer table [-> Japanese: エイジング対象値] |

**Block 4.2** — ELSE-IF `delTrgtSbt.equals("03")` — Mail Address (L282)

[DEL_TRGT_SBT_MLAD="03"]

| # | Type | Code |
|---|------|------|
| 1 | CALL | `canDel = canDelMlad(inMap)` // Check Mail Address deletion eligibility |
| 2 | SET | `agingSbtCd = AGING_SBT_CD_MLAD` // Aging type: `"009"` (Mail Address) [-> JBSbatKKConst.AGING_SBT_CD_MLAD="009"] |
| 3 | SET | `agingTrgtValue = inMap.getString(JBSbatKKIFM160.MLAD)` // Aging target = mail address [-> Japanese: エイジング対象値] |

**Block 4.3** — ELSE-IF `delTrgtSbt.equals("04")` — Mail Alias (L292)

[DEL_TRGT_SBT_MAILALIAS="04"]

| # | Type | Code |
|---|------|------|
| 1 | CALL | `canDel = canDelMailalias(inMap)` // Check Mail Alias deletion eligibility |
| 2 | SET | `agingSbtCd = AGING_SBT_CD_MAILALIAS` // Aging type: `"008"` (Mail Alias) [-> JBSbatKKConst.AGING_SBT_CD_MAILALIAS="008"] |
| 3 | SET | `agingTrgtValue = getMailAliasAgingTgValue(inMap)` // Aging target = constructed from multiple fields [-> Japanese: エイジング対象値] |

**Block 4.3.1** — IF `agingTrgtValue == null` (L301)

Nested within Block 4.3: if the mail alias aging target value could not be constructed.

| # | Type | Code |
|---|------|------|
| 1 | SET | `super.commonItem.setErrFlg(true)` // Set error flag [-> Japanese: エラーフラグ設定] |
| 2 | RETURN | `return null` // Return null on missing aging target [-> Japanese: 出力情報を返却] |

**Block 4.4** — ELSE-IF `delTrgtSbt.equals("05")` — Mailing List Name (L308)

[DEL_TRGT_SBT_MLLIST_NM="05"]

| # | Type | Code |
|---|------|------|
| 1 | CALL | `canDel = canDelMllist(inMap)` // Check Mailing List Name deletion eligibility |
| 2 | SET | `agingSbtCd = AGING_SBT_CD_MLLIST` // Aging type: `"010"` (Mailing List) [-> JBSbatKKConst.AGING_SBT_CD_MLLIST="010"] |
| 3 | SET | `agingTrgtValue = inMap.getString(JBSbatKKIFM160.MLLIST_NM)` // Aging target = mailing list name [-> Japanese: エイジング対象値] |

**Block 4.5** — ELSE-IF `delTrgtSbt.equals("06")` — PPP Auth ID (L318)

[DEL_TRGT_SBT_PPP_NINSHO_ID="06"]

| # | Type | Code |
|---|------|------|
| 1 | CALL | `canDel = canDelPppNinshoId(inMap)` // Check PPP Auth ID deletion eligibility |
| 2 | SET | `agingSbtCd = AGING_SBT_CD_PPP_NINSHO_ID` // Aging type: `"012"` (PPP Auth ID Account) [-> JBSbatKKConst.AGING_SBT_CD_PPP_NINSHO_ID="012"] |
| 3 | SET | `agingTrgtValue = getAccount(inMap.getString(JBSbatKKIFM160.PPP_NINSHO_ID))` // Aging target = account name [-> Japanese: エイジング対象値] |

**Block 4.6** — ELSE-IF `delTrgtSbt.equals("07")` — URL (L328)

[DEL_TRGT_SBT_URL="07"]

| # | Type | Code |
|---|------|------|
| 1 | CALL | `canDel = canDelUrl(inMap)` // Check URL deletion eligibility |
| 2 | SET | `agingSbtCd = AGING_SBT_CD_URL` // Aging type: `"005"` (URL) [-> JBSbatKKConst.AGING_SBT_CD_URL="005"] |
| 3 | SET | `agingTrgtValue = inMap.getString(JBSbatKKIFM160.URL)` // Aging target = URL [-> Japanese: エイジング対象値] |

**Block 4.7** — ELSE-IF `delTrgtSbt.equals("08")` — Fixed IP Address (L338)

[DEL_TRGT_SBT_FIXIPAD="08"]

| # | Type | Code |
|---|------|------|
| 1 | CALL | `canDel = canDelFixipad(inMap)` // Check Fixed IP Address deletion eligibility |
| 2 | SET | `agingSbtCd = AGING_SBT_CD_FIXIPAD` // Aging type: `"002"` (Fixed IP Address) [-> JBSbatKKConst.AGING_SBT_CD_FIXIPAD="002"] |
| 3 | SET | `agingTrgtValue = inMap.getString(JBSbatKKIFM160.FIXIPAD)` // Aging target = fixed IP address [-> Japanese: エイジング対象値] |

**Block 4.8** — ELSE-IF `delTrgtSbt.equals("09")` — OABJ Phone Number (L348)

[DEL_TRGT_SBT_OABJ_TELNO="09"]

| # | Type | Code |
|---|------|------|
| 1 | CALL | `canDel = canDelOabjTelNo(inMap)` // Check OABJ Phone Number deletion eligibility |
| 2 | SET | `agingSbtCd = AGING_SBT_CD_TELNO` // Aging type: `"001"` (Phone Number) [-> JBSbatKKConst.AGING_SBT_CD_TELNO="001"] |
| 3 | SET | `agingTrgtValue = inMap.getString(JBSbatKKIFM160.OABJ_TELNO)` // Aging target = OABJ phone number [-> Japanese: エイジング対象値] |

**Block 4.9** — ELSE-IF `delTrgtSbt.equals("10")` — 050 Phone Number (L358)

[DEL_TRGT_SBT_050_TELNO="10"]

| # | Type | Code |
|---|------|------|
| 1 | CALL | `canDel = canDel050Telno(inMap)` // Check 050 Phone Number deletion eligibility |
| 2 | SET | `agingSbtCd = AGING_SBT_CD_TELNO` // Aging type: `"001"` (Phone Number) [-> JBSbatKKConst.AGING_SBT_CD_TELNO="001"] |
| 3 | SET | `agingTrgtValue = inMap.getString(JBSbatKKIFM160.TELNO_050)` // Aging target = 050 phone number [-> Japanese: エイジング対象値] |

**Block 4.10** — ELSE-IF `delTrgtSbt.equals("11")` — eoID (L368)

[DEL_TRGT_SBT_EOID="11"]

| # | Type | Code |
|---|------|------|
| 1 | CALL | `canDel = canDelEoid(inMap)` // Check eoID deletion eligibility |
| 2 | SET | `agingSbtCd = AGING_SBT_CD_EOID` // Aging type: `"004"` (eoID) [-> JBSbatKKConst.AGING_SBT_CD_EOID="004"] |
| 3 | SET | `agingTrgtValue = inMap.getString(JBSbatKKIFM160.EOID)` // Aging target = eoID [-> Japanese: エイジング対象値] |

**Block 4.11** — ELSE-IF `delTrgtSbt.equals("12")` — Nickname (L378)

[DEL_TRGT_SBT_NKNAME="12"]

| # | Type | Code |
|---|------|------|
| 1 | CALL | `canDel = canDelNkname(inMap)` // Check Nickname deletion eligibility |
| 2 | SET | `agingSbtCd = AGING_SBT_CD_NKNAME` // Aging type: `"003"` (Nickname) [-> JBSbatKKConst.AGING_SBT_CD_NKNAME="003"] |
| 3 | SET | `agingTrgtValue = inMap.getString(JBSbatKKIFM160.NKNAME)` // Aging target = nickname [-> Japanese: エイジング対象値] |

**Block 4.12** — ELSE-IF `delTrgtSbt.equals("14")` — WebID (L399)

[DEL_TRGT_SBT_WEB_ID="14"]

| # | Type | Code |
|---|------|------|
| 1 | CALL | `canDel = canDelWebId(inMap)` // Check WebID deletion eligibility |
| 2 | SET | `agingSbtCd = AGING_SBT_CD_WEB_ID` // Aging type: `"006"` (WebID) [-> JBSbatKKConst.AGING_SBT_CD_WEB_ID="006"] |
| 3 | SET | `agingTrgtValue = inMap.getString(JBSbatKKIFM160.WEB_ID)` // Aging target = WebID [-> Japanese: エイジング対象値] |

**Block 4.13** — ELSE-IF `delTrgtSbt.equals("15")` — POPID (L411)

[DEL_TRGT_SBT_POP_ID="15"]

| # | Type | Code |
|---|------|------|
| 1 | CALL | `canDel = canDelPopId(inMap)` // Check POPID deletion eligibility |
| 2 | SET | `agingSbtCd = AGING_SBT_CD_POP_ID` // Aging type: `"007"` (POPID) [-> JBSbatKKConst.AGING_SBT_CD_POP_ID="007"] |
| 3 | SET | `agingTrgtValue = inMap.getString(JBSbatKKIFM160.POP_ID)` // Aging target = POPID [-> Japanese: エイジング対象値] |

**Block 4.14** — ELSE-IF `delTrgtSbt.equals("16")` — ADSL Auth ID (L423)

[DEL_TRGT_SBT_ADSL_NINSHO_ID="16"]

| # | Type | Code |
|---|------|------|
| 1 | CALL | `canDel = canDelAdslNinshoId(inMap)` // Check ADSL Auth ID deletion eligibility |
| 2 | SET | `agingSbtCd = AGING_SBT_CD_ADSL_NINSHO_ID` // Aging type: `"015"` (ADSL Auth ID Account) [-> JBSbatKKConst.AGING_SBT_CD_ADSL_NINSHO_ID="015"] |
| 3 | SET | `agingTrgtValue = getAccount(inMap.getString(JBSbatKKIFM160.ADSL_NINSHO_ID))` // Aging target = account name [-> Japanese: エイジング対象値] |

**Block 4.15** — ELSE-IF `delTrgtSbt.equals("17")` — SIP User ID (L435)

[DEL_TRGT_SBT_SIP_USER_ID="17"]

| # | Type | Code |
|---|------|------|
| 1 | CALL | `canDel = canDelSipUserId(inMap)` // Check SIP User ID deletion eligibility |
| 2 | SET | `agingSbtCd = AGING_SBT_CD_SIP_USER_ID` // Aging type: `"014"` (SIP User ID) [-> JBSbatKKConst.AGING_SBT_CD_SIP_USER_ID="014"] |
| 3 | SET | `agingTrgtValue = inMap.getString(JBSbatKKIFM160.SIP_USER_ID)` // Aging target = SIP user ID [-> Japanese: エイジング対象値] |

**Block 4.16** — ELSE-IF `delTrgtSbt.equals("18")` — Multi-session Auth ID (L446)

[DEL_TRGT_SBT_MLTISE_NINSHO_ID="18"] — Added IT1-2013-0000927, 2013-04-16

| # | Type | Code |
|---|------|------|
| 1 | CALL | `canDel = canDelMltiseNinsyoId(inMap)` // Check Multi-session (static) Auth ID deletion eligibility |
| 2 | NOTE | No aging parameters set for this type — only the canDel flag is returned [-> Japanese: エイジング番号取得用のSQLパラメータ設定なし] |

**Block 5** — ELSE (unknown service type) (L450)

| # | Type | Code |
|---|------|------|
| 1 | CALL | `super.commonItem.getLogPrint().printBusinessErrorLog(JPCBatchMessageConstant.EKKB0130CE, new String[]{"Operation Service Code"})` // Log error for unknown service type [-> Japanese: エラーログ出力] |
| 2 | SET | `super.commonItem.setErrFlg(true)` // Set error flag [-> Japanese: エラーフラグ設定] |
| 3 | RETURN | `return null` // Return null [-> Japanese: 出力情報を返却] |

**Block 6** — IF `canDel` (deletion permitted) (L466)

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `outmap.setMap(inMap.getMap())` // Copy input data to output record [-> Japanese: 入力情報を出力情報に設定する] |
| 2 | SET | `delTranSbt = inMap.getString(JBSbatKKIFM160.DEL_TRAN_SBT)` // Get deletion transaction type [-> Japanese: エイジング番号取得処理] |

**Block 6.1** — IF `delTranSbt.equals("2")` or `("3")` (aging update) (L470)

[DEL_TRAN_SBT_AGING_UPD="2"] or [DEL_TRAN_SBT_DEL_SOD_AGING_UPD="3"] — Deletion transaction type is Aging Update or Delete SOD Issue + Aging Update

| # | Type | Code |
|---|------|------|
| 1 | CALL | `agingTrgtGaiFlg = agingTrgtGai(inMap)` // Check if deletion target is aging exception [-> Japanese: エイジング対象外のパラメータの場合を考慮] |

**Block 6.1.1** — IF `!agingTrgtGaiFlg` (not an aging exception) (L476)

| # | Type | Code |
|---|------|------|
| 1 | CALL | `executeZM_T_AGING_KK_SELECT_002(getAgingParam(agingSbtCd, agingTrgtValue, "200", "0"))` // Query aging table for next aging number [-> Japanese: エイジング対象外の場合] |
| 2 | SET | `nextRec = db_ZM_T_AGING.selectNext()` // Get next aging record [-> Japanese: エイジング番号取得処理] |

**Block 6.1.1.1** — IF `nextRec != null` (aging number obtained) (L480)

| # | Type | Code |
|---|------|------|
| 1 | SET | `agingNo = nextRec.getString(JBSbatZM_T_AGING.AGING_NO)` // Extract aging number [-> Japanese: エイジング番号] |
| 2 | SET | `outmap.set(JBSbatKKIFM161.AGING_NO, agingNo)` // Set aging number in output [-> Japanese: エイジング番号の設定] |

**Block 6.1.1.2** — ELSE (aging number NOT obtained) (L490)

| # | Type | Code |
|---|------|------|
| 1 | CALL | `super.commonItem.getLogPrint().printBusinessErrorLog(JPCBatchMessageConstant.EKKB0720KW, new String[]{"ZM0111 Aging"})` // Log error: aging query failed [-> Japanese: エラーログ出力, changed from EKKB0150JE warning level per IT1-2013-0000388 on 2013-03-29] |
| 2 | SET | `super.commonItem.setErrFlg(true)` // Set error flag |
| 3 | RETURN | `return new JBSbatOutputItem()` // Return empty output |

**Block 6.1.2** — ELSE (`agingTrgtGaiFlg == true`, aging exception) (L497)

Nested within Block 6.1: deletion target is a special case that bypasses aging registration.

| # | Type | Code |
|---|------|------|
| 1 | IF | `delTranSbt.equals("2")` (aging update) [DEL_TRAN_SBT_AGING_UPD="2"] |
| 2 | SET | `outmap.set(JBSbatKKIFM161.DEL_TRAN_SBT, DEL_TRAN_SBT_DEL_ONLY)` // Rewrite to "0" (Delete only) [-> Japanese: 処理種類: エイジング更新 -> 削除処理のみ] |

**Block 6.1.2.1** — ELSE-IF `delTranSbt.equals("3")` (delete SOD + aging update) (L503)

[DEL_TRAN_SBT_DEL_SOD_AGING_UPD="3"]

| # | Type | Code |
|---|------|------|
| 1 | SET | `outmap.set(JBSbatKKIFM161.DEL_TRAN_SBT, DEL_TRAN_SBT_DEL_SOD_HAKKO)` // Rewrite to "1" (Delete SOD issue) [-> Japanese: 処理種類: 削除SOD発行・エイジング更新 -> 削除SOD発行] |

**Block 7** — Final output preparation (L509)

| # | Type | Code |
|---|------|------|
| 1 | SET | `outmap.setOutFlg(true)` // Set output flag: deletion permitted [-> Japanese: 出力フラグ設定] |
| 2 | EXEC | `outputBean.addOutMapList(outmap)` // Append output map to result list |
| 3 | RETURN | `return outputBean` // Return final output [-> Japanese: 出力情報] |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `delTrgtSbt` | Field | Deletion target type — classifies the kind of subscriber data targeted for deletion (ISP Auth ID, phone number, etc.) |
| `delTranSbt` | Field | Deletion transaction type — determines how the deletion is processed (delete only, with SOD cancellation, or with aging update) |
| `agingNo` | Field | Aging number — a unique identifier from the aging table used to track deferred deletions |
| `agingSbtCd` | Field | Aging type code — classifies what kind of data the aging record is for |
| `agingTrgtValue` | Field | Aging target value — the actual data value being tracked for deferred deletion |
| `agingStat` | Field | Aging status — indicates the current state of the aging record (e.g., recovery possible = "200") |
| `canDel` | Field | Deletion eligibility flag — true if the deletion target passes all validation checks |
| `mkFlg` | Field | Invalid flag — "0" means valid (not invalid), used when querying the aging table |
| `agingTrgtGai` | Field | Aging exception flag — true if the deletion target is a special case that bypasses aging registration |
| `SVC_KEI` | Table | Service contract table (`KK_T_SVC_KEI`) — master table for service subscription records |
| `SVC_KEI_UCWK` | Table | Service contract under-work table (`KK_T_SVC_KEI_UCWK`) — tracks in-progress service contract modifications |
| `OP_SVC_KEI` | Table | Operation service contract table (`KK_T_OP_SVC_KEI`) — tracks optional service subscriptions |
| `CK_T_CUST` | Table | Customer table (`CK_T_CUST`) — master customer record table |
| `ZM_T_AGING` | Table | Aging table (`ZM_T_AGING`) — tracks deferred deletions with aging numbers and statuses |
| `OP_SVKEI_ISP` | Table | Operation service contract ISP table (`KK_T_OPSVKEI_ISP`) — ISP-specific operation service data |
| `ODR_SET` | Table | Order setup table (`KK_T_ODR_SET`) — order configuration for deletion exception rules |
| `ADCHG_DTL` | Table | Address change details table (`KK_T_ADCHG_DTL`) — housing address change data |
| SOD | Acronym | Service Order Data — order fulfillment entity in the telecom order management system |
| ISP | Business term | Internet Service Provider — authentication ID for internet access |
| PPP | Business term | Point-to-Point Protocol — authentication ID for dial-up/network connections |
| ADSL | Business term | Asymmetric Digital Subscriber Line — broadband internet over telephone lines |
| SIP | Business term | Session Initiation Protocol — user identifier for VoIP services |
| OABJ | Business term | Object phone number — telephone number associated with a specific object/endpoint |
| eoID | Business term | eo Identity — customer's unique identifier in the eo network service system |
| WebID | Field | Web ID — authentication identifier for web-based services |
| POPID | Field | POP ID — Point of Presence identifier for network access |
| Mail Alias | Business term | Mail alias — an alternative email address that forwards to a primary mailbox |
| Mailing List | Business term | Mailing list — a group email distribution list name |
| Aging | Business term | Deferred deletion — a two-phase deletion process where the aging number reserves the data before actual deletion, allowing recovery within a grace period |
| AGING_STAT_KAIHK_PSB | Constant | Aging status: Recovery possible ("200") — the data can still be restored from the aging record |
| MK_FLG_YK | Constant | Invalid flag: Valid ("0") — indicates the data is currently valid (not marked as invalid) |
| DEL_TRAN_SBT_DEL_ONLY | Constant | Deletion transaction: Delete only ("0") — performs deletion without SOD cancellation |
| DEL_TRAN_SBT_DEL_SOD_HAKKO | Constant | Deletion transaction: Delete SOD issue ("1") — triggers service order cancellation along with deletion |
| DEL_TRAN_SBT_AGING_UPD | Constant | Deletion transaction: Aging update ("2") — queries aging table and assigns an aging number |
| DEL_TRAN_SBT_DEL_SOD_AGING_UPD | Constant | Deletion transaction: Delete SOD issue + Aging update ("3") — combines SOD cancellation with aging registration |
