# Business Logic — JBSbatKKDelSavePrdKikData.initial() [154 LOC]

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

## 1. Role

### JBSbatKKDelSavePrdKikData.initial()

This method performs **initial processing** for a batch job responsible for the **physical deletion of stored data that has exceeded its retention period** (保存期間経過データ物理削除). The business domain is personal data deletion and service contract lifecycle management within K-Opticom's telecommunications customer backbone system. As a retention-period-based data purge service, it ensures regulatory compliance by permanently removing customer data after its legally-defined storage period has elapsed.

The method acts as a **batch entry point** (shared utility called by the batch execution framework) that prepares the entire processing environment. It uses the **delegation pattern** — initializing `JBSbatSQLAccess` objects for over 40 database tables, each serving as a dedicated data access proxy for subsequent CRUD operations. It also implements **parameter routing** — parsing a comma-delimited `freeItem` string to extract the transaction number, deletion stop flag, file path, and multi-run count.

The method handles four primary conditional branches: (1) parsing the freeItem string to extract processing metadata including the run count for multi-run support (ANK-3141), (2) validating the maximum processing time parameter exists and throwing `EKKB0740CE` if missing, (3) validating the transaction number exists and throwing `EKKB0130CE` if null, and (4) querying the personal deletion work table to determine the maximum multi-processing branch number — critical for handling concurrent batch restarts. The `DELSTOP_CD` flag (`"1"`) allows the deletion process to be suppressed entirely, providing a manual override for safety.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["initial(commonItem)"])
    START --> S1["setCommonInfo"]
    S1 --> INIT["Initialize DB Access Objects<br/>40+ table connections"]

    INIT --> LOG1["Log: Batch operation date"]

    LOG1 --> SPLIT["Split freeItem by SEMI_COLON"]
    SPLIT --> FREQ{"3 less than<br/>freeItems.length?"}
    FREQ -->|Yes| SETRCNT["runCnt = freeItems[3]"]
    FREQ -->|No| SKIPRCNT["Keep default runCnt"]
    SETRCNT --> GETLIMIT["GET: getWorkParamSetteValue<br/>DEL_RUN_UPPL_TIM plus runCnt"]
    SKIPRCNT --> GETLIMIT

    GETLIMIT --> LIMCHECK{"strLimitTime<br/>is null?"}
    LIMCHECK -->|Yes| ERRLIMIT["throw JBSbatBusinessException<br/>EKKB0740CE"]
    LIMCHECK -->|No| SETLIM["strTrnLimit = strLimitTime"]
    SETLIM --> LOGLIM["Log: Max processing time"]

    LOGLIM --> SETTRAN["tran_No = freeItems[0]"]
    SETTRAN --> TRANCHECK{"tran_No<br/>is null?"}
    TRANCHECK -->|Yes| ERRERRNO["throw JBSbatBusinessException<br/>EKKB0130CE"]
    TRANCHECK -->|No| LOGTRAN["Log: Free item parameter"]
    ERRERRNO --> ERR_END(["Error Exit"])

    LOGTRAN --> FILLZERO["tran_No = fillZero(tran_No, 2, false)"]

    FILLZERO --> DBQUERY["CALL: executeKK_T_KJNIFDEL_WK_KK_SELECT_003"]
    DBQUERY --> SELNEXT["GET: db_KK_T_KJNIFDEL_WK.selectNext"]
    SELNEXT --> DATACHECK{"edaNoList<br/>not null?"}
    DATACHECK -->|Yes| GETMAXSEQ["tran_SeqMax = parseInt<br/>TAJU_KIDOU_TRAN_SEQ"]
    DATACHECK -->|No| SETZERO["tran_SeqMax = 0<br/>No concurrent restart number"]
    GETMAXSEQ --> LOGSEQ["Log: max multi-processing branch"]
    SETZERO --> LOGSEQ

    LOGSEQ --> FILEPATH["filePath = freeItems[2]"]
    FILEPATH --> CREATEFILE["CREATE: createBusinessFileUtil"]
    CREATEFILE --> DELCHECK{"freeItems[1]<br/>equals DELSTOP_CD?"}
    DELCHECK -->|Yes equals 1| SETSTOP["delStopFlg = true<br/>Deletion suppressed"]
    DELCHECK -->|No equals other| SETDEL["delStopFlg = false<br/>Deletion allowed"]
    SETSTOP --> END_NODE(["Return / Next"])
    SETDEL --> END_NODE
    ERR_END --> END_NODE
```

### Constant Resolution

| Constant | Actual Value | Business Meaning |
|----------|-------------|------------------|
| `DELSTOP_CD` | `"1"` | Deletion suppression code — when `freeItems[1]` equals `"1"`, physical deletion is suppressed for safety |
| `DEL_RUN_UPPL_TIM` | `"KK_DEL_RUNUPPL_TIME"` | Work parameter key for the maximum processing time (in minutes) allowed for deletion operations |
| `JACStrConst.SEMI_COLON` | `";"` | Delimiter used to split the `freeItem` string into segments |

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `commonItem` | `JBSbatCommonItem` | Batch common parameter message — carries the batch execution context including operation date (`opeDate`), free item string (`freeItem`) containing comma-delimited processing metadata (transaction number, deletion stop flag, file path, run count), and work parameter settings used to retrieve configurable batch behavior (e.g., maximum processing time limit) |

**Instance fields read by this method:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `super.freeItem` | `String` | Free item string from parent class — comma-delimited metadata: [0]=transaction number, [1]=deletion stop code, [2]=output file path, [3]=run count (ANK-3141 multi-run support) |
| `super.opeDate` | `String` | Batch operation date — the date on which this batch job is executing |
| `super.commonItem` | `JBSbatCommonItem` | Reference to the common item passed in, used for work parameter lookups |
| `super.logPrint` | Debug logger | Logging utility for debug and business error log output |

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| U | `JBSbatBusinessService.setCommonInfo` | - | - | Sets common information in parent class from `commonItem` |
| C | `JBSbatSQLAccess` constructor | - | `KK_T_KJNIFDEL_WK` | Initializes SQL access for Personal Data Deletion Work table |
| C | `JBSbatSQLAccess` constructor | - | `KK_M_KJNIFDEL_TGSCM` | Initializes SQL access for Personal Data Deletion Target Schema table |
| C | `JBSbatSQLAccess` constructor | - | `KK_T_SVKEI_EXC_CTRL` | Initializes SQL access for Service Contract Exclusion Control table |
| C | `JBSbatSQLAccess` constructor | - | `KK_T_KOJIN_INFO_DEL` | Initializes SQL access for Personal Data Deletion table |
| C | `JBSbatSQLAccess` constructor | - | `AC_T_HAPIEPOINT_HKAT` | Initializes SQL access for HappyPoint Application table |
| C | `JBSbatSQLAccess` constructor | - | `AC_T_HAPIEPOINT_UCWK` | Initializes SQL access for HappyPoint Internal table |
| C | `JBSbatSQLAccess` constructor | - | `CH_T_SAIKEN` | Initializes SQL access for Lien (guarantee) table |
| C | `JBSbatSQLAccess` constructor | - | `CH_T_JUTO` | Initializes SQL access for Deposit table |
| C | `JBSbatSQLAccess` constructor | - | `CH_T_SEIKY_SKN_KNRN` | Initializes SQL access for Billing Lien Related table |
| C | `JBSbatSQLAccess` constructor | - | `CH_T_TOKUSK_SKN_KNRN` | Initializes SQL access for Incentive Lien Related table |
| C | `JBSbatSQLAccess` constructor | - | `CR_T_TAIO_KIROK` | Initializes SQL access for Response Record table |
| C | `JBSbatSQLAccess` constructor | - | `KK_T_DCHSKMST_TG_KEI` | Initializes SQL access for Data Extraction Item Setting Target Contract table |
| C | `JBSbatSQLAccess` constructor | - | `KK_T_DCHSKMST` | Initializes SQL access for Data Extraction Item Setting table |
| C | `JBSbatSQLAccess` constructor | - | `KK_T_HAPIE_POINT_KEI` | Initializes SQL access for HappyPoint Contract table |
| C | `JBSbatSQLAccess` constructor | - | `KK_T_JUDGE` | Initializes SQL access for Judgment table |
| C | `JBSbatSQLAccess` constructor | - | `KK_T_KAISEN_TG_SVKEI` | Initializes SQL access for Retrievable Target Service Contract table |
| C | `JBSbatSQLAccess` constructor | - | `KK_T_KKTK_SVC_KEI` | Initializes SQL access for Equipment Provision Service Contract table |
| C | `JBSbatSQLAccess` constructor | - | `KK_T_MSKM` | Initializes SQL access for Application table |
| C | `JBSbatSQLAccess` constructor | - | `KK_T_OP_SVC_KEI` | Initializes SQL access for Option Service Contract table |
| C | `JBSbatSQLAccess` constructor | - | `KK_T_SBOP_SVC_KEI` | Initializes SQL access for Sub-Option Service Contract table |
| C | `JBSbatSQLAccess` constructor | - | `KK_T_SEIKY_KEI` | Initializes SQL access for Billing Contract table |
| C | `JBSbatSQLAccess` constructor | - | `KK_T_SEIOPSVC_KEI` | Initializes SQL access for Billing Option Service Contract table |
| C | `JBSbatSQLAccess` constructor | - | `KK_T_SUPPORT` | Initializes SQL access for Support table |
| C | `JBSbatSQLAccess` constructor | - | `KK_T_SVC_KEI` | Initializes SQL access for Service Contract table |
| C | `JBSbatSQLAccess` constructor | - | `KK_T_SVC_KEI_UCWK` | Initializes SQL access for Service Contract Internal table |
| C | `JBSbatSQLAccess` constructor | - | `KK_T_SVKEI_KAISEN_UW` | Initializes SQL access for Service Contract Retrieval Internal table |
| C | `JBSbatSQLAccess` constructor | - | `KK_T_TAJGSWKEI_TGKEI` | Initializes SQL access for Third-Party Discount Contract Target Contract table |
| C | `JBSbatSQLAccess` constructor | - | `KK_T_TAJGS_WRIB_KEI` | Initializes SQL access for Third-Party Discount Contract table |
| C | `JBSbatSQLAccess` constructor | - | `KK_T_TCHI_TG_BPIN` | Initializes SQL access for Notification Target Product table |
| C | `JBSbatSQLAccess` constructor | - | `KK_T_WRISVC_TG_KEI` | Initializes SQL access for Discount Service Target Contract table |
| C | `JBSbatSQLAccess` constructor | - | `KK_T_WRIB_SVC_KEI` | Initializes SQL access for Discount Service Contract table |
| C | `JBSbatSQLAccess` constructor | - | `KK_T_KAP_KEI` | Initializes SQL access for Gift Contract table |
| C | `JBSbatSQLAccess` constructor | - | `DK_T_BTRYHOZN` | Initializes SQL access for Logistics Safety table |
| C | `JBSbatSQLAccess` constructor | - | `DK_T_HAISO_TG_BPIN` | Initializes SQL access for Delivery Target Product table |
| C | `JBSbatSQLAccess` constructor | - | `DK_T_SHKA_KIHON_INFO` | Initializes SQL access for Outbound Drawing (Basic Information) table |
| C | `JBSbatSQLAccess` constructor | - | `DK_T_MKHMPIN` | Initializes SQL access for Mobile HMPIN table |
| C | `JBSbatSQLAccess` constructor | - | `DK_T_SHKA_FIN_DTL` | Initializes SQL access for Outbound Finish Detail table |
| C | `JBSbatSQLAccess` constructor | - | `DK_T_HIS_SJI_REQ_DTL` | Initializes SQL access for History Execution Request Detail table |
| C | `JBSbatSQLAccess` constructor | - | `KU_T_SVKEI_KOJIAK` | Initializes SQL access for Service Contract Personal Inquiry table |
| C | `JBSbatSQLAccess` constructor | - | `KU_T_KOJIAK` | Initializes SQL access for Personal Inquiry table |
| C | `JBSbatSQLAccess` constructor | - | `KK_T_MSKM_DTL` | Initializes SQL access for Application Detail table |
| C | `JBSbatSQLAccess` constructor | - | `TU_T_DNWACHOMSK` | Initializes SQL access for Download Watch Monitoring table |
| C | `JBSbatSQLAccess` constructor | - | `KK_T_MAJOR_KMK_DLJSK` | Initializes SQL access for Major Item Deletion Record Dealer table |
| C | `JBSbatSQLAccess` constructor | - | `KK_T_KKOP_SVC_KEI` | Initializes SQL access for KK Option Service Contract table |
| C | `JBSbatSQLAccess` constructor | - | `DK_T_HAISO_TG_DOHUBT` | Initializes SQL access for Delivery Target D-Hub Table table |
| C | `JBSbatSQLAccess` constructor | - | `KK_T_SVKEI_GRP_SETE` | Initializes SQL access for Service Group Setting table |
| C | `JBSbatSQLAccess` constructor | - | `KK_T_ADCHG` | Initializes SQL access for Address Change table |
| C | `JBSbatSQLAccess` constructor | - | `CK_T_CUST_GRP_SETTE` | Initializes SQL access for Customer Group Setting table |
| C | `JBSbatSQLAccess` constructor | - | `KK_T_OPSVKEI_ISP` | Initializes SQL access for Option Service ISP table |
| C | `JBSbatSQLAccess` constructor | - | `KK_T_SVKEIUW_EOH_NET` | Initializes SQL access for Service Retrieval EOH NET table |
| C | `JBSbatSQLAccess` constructor | - | `KK_T_KAKINS` | Initializes SQL access for Storage table |
| C | `JBSbatSQLAccess` constructor | - | `CK_T_SJISHO` | Initializes SQL access for Branch Office table |
| - | `JACBatCommon.printDebugLog` | JACBatCommon | - | Logs batch operation date |
| - | `JKKBatCommon.getWorkParamSetteValue` | JKKBatCommon | Work Parameter Table | Retrieves maximum processing time from work parameter settings keyed by `KK_DEL_RUNUPPL_TIME` plus run count |
| - | `JCCBatCommon.createBusinessFileUtil` | JCCBatCommon | - | Creates a business file for physical deletion record output CSV |
| C | `executeKK_T_KJNIFDEL_WK_KK_SELECT_003` | - | `KK_T_KJNIFDEL_WK` | Executes SQL SELECT on Personal Data Deletion Work table to populate the deletion target work list |
| R | `db_KK_T_KJNIFDEL_WK.selectNext` | - | `KK_T_KJNIFDEL_WK` | Retrieves next row from deletion target work list to get the maximum multi-processing branch number |
| - | `JBSbatCommonDBInterface.getString` | JBSbatCommonDBInterface | - | Gets value of `TAJU_KIDOU_TRAN_SEQ` field from result |
| - | `JACStrConst.SEMI_COLON` | JACStrConst | - | Used as delimiter to split the `freeItem` string |
| - | `JPCEditString.fillZero` | JPCEditString | - | Pads the transaction number with leading zeros (2 characters) |

## 5. Dependency Trace

This method is called by the batch execution framework through the `JBSbatBusinessService` inheritance hierarchy. As a batch service class that extends `JBSbatBusinessService`, the `initial()` method is invoked by the batch framework's processing pipeline before the main `execute()` method runs. The class follows the standard batch service pattern where `initial(JBSbatCommonItem)` is the template method hook for preparation.

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Batch: JBSbatKKDelSavePrdKikData | `JBSbatBusinessService.initial(commonItem)` -> `JBSbatKKDelSavePrdKikData.initial` | `executeKK_T_KJNIFDEL_WK_KK_SELECT_003 [R] KK_T_KJNIFDEL_WK` |

**Notes:** No other classes directly reference `JBSbatKKDelSavePrdKikData` or call its `initial()` method. This class is the entry point for the retention-period data physical deletion batch, orchestrated by the external batch scheduler/job engine which instantiates the class and calls `initial()` followed by `execute()`.

## 6. Per-Branch Detail Blocks

**Block 1** — CALL `(super.setCommonInfo)` (L912)

> Sets common information in the parent class from the incoming batch common parameters.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `super.setCommonInfo(commonItem)` |

---

**Block 2** — SEQUENCE `DB Access Object Initialization` (L915–L979)

> Initializes SQL access proxy objects for over 40 database tables used throughout the deletion processing lifecycle. Each `JBSbatSQLAccess` wraps a specific table and provides typed query/update/delete capabilities.

| # | Type | Code |
|---|------|------|
| 1 | SET | `db_KK_T_KJNIFDEL_WK = new JBSbatSQLAccess(commonItem, "KK_T_KJNIFDEL_WK")` | Personal Data Deletion Work |
| 2 | SET | `db_KK_M_KJNIFDEL_TGSCM = new JBSbatSQLAccess(commonItem, "KK_M_KJNIFDEL_TGSCM")` | Personal Data Deletion Target Schema |
| 3 | SET | `db_KK_T_SVKEI_EXC_CTRL = new JBSbatSQLAccess(commonItem, "KK_T_SVKEI_EXC_CTRL")` | Service Contract Exclusion Control |
| 4 | SET | `db_KK_T_KOJIN_INFO_DEL = new JBSbatSQLAccess(commonItem, "KK_T_KOJIN_INFO_DEL")` | Personal Data Deletion |
| 5 | SET | `db_AC_T_HAPIEPOINT_HKAT = new JBSbatSQLAccess(commonItem, "AC_T_HAPIEPOINT_HKAT")` | HappyPoint Application |
| 6 | SET | `db_AC_T_HAPIEPOINT_UCWK = new JBSbatSQLAccess(commonItem, "AC_T_HAPIEPOINT_UCWK")` | HappyPoint Internal |
| 7 | SET | `db_CH_T_SAIKEN = new JBSbatSQLAccess(commonItem, "CH_T_SAIKEN")` | Lien (Guarantee) |
| 8 | SET | `db_CH_T_JUTO = new JBSbatSQLAccess(commonItem, "CH_T_JUTO")` | Deposit |
| 9 | SET | `db_CH_T_SEIKY_SKN_KNRN = new JBSbatSQLAccess(commonItem, "CH_T_SEIKY_SKN_KNRN")` | Billing Lien Related |
| 10 | SET | `db_CH_T_TOKUSK_SKN_KNRN = new JBSbatSQLAccess(commonItem, "CH_T_TOKUSK_SKN_KNRN")` | Incentive Lien Related |
| 11 | SET | `db_CR_T_TAIO_KIROK = new JBSbatSQLAccess(commonItem, "CR_T_TAIO_KIROK")` | Response Record |
| 12 | SET | `db_KK_T_DCHSKMST_TG_KEI = new JBSbatSQLAccess(commonItem, "KK_T_DCHSKMST_TG_KEI")` | Data Extraction Item Setting Target Contract |
| 13 | SET | `db_KK_T_DCHSKMST = new JBSbatSQLAccess(commonItem, "KK_T_DCHSKMST")` | Data Extraction Item Setting |
| 14 | SET | `db_KK_T_HAPIE_POINT_KEI = new JBSbatSQLAccess(commonItem, "KK_T_HAPIE_POINT_KEI")` | HappyPoint Contract |
| 15 | SET | `db_KK_T_JUDGE = new JBSbatSQLAccess(commonItem, "KK_T_JUDGE")` | Judgment |
| 16 | SET | `db_KK_T_KAISEN_TG_SVKEI = new JBSbatSQLAccess(commonItem, "KK_T_KAISEN_TG_SVKEI")` | Retrievable Target Service Contract |
| 17 | SET | `db_KK_T_KKTK_SVC_KEI = new JBSbatSQLAccess(commonItem, "KK_T_KKTK_SVC_KEI")` | Equipment Provision Service Contract |
| 18 | SET | `db_KK_T_MSKM = new JBSbatSQLAccess(commonItem, "KK_T_MSKM")` | Application |
| 19 | SET | `db_KK_T_OP_SVC_KEI = new JBSbatSQLAccess(commonItem, "KK_T_OP_SVC_KEI")` | Option Service Contract |
| 20 | SET | `db_KK_T_SBOP_SVC_KEI = new JBSbatSQLAccess(commonItem, "KK_T_SBOP_SVC_KEI")` | Sub-Option Service Contract |
| 21 | SET | `db_KK_T_SEIKY_KEI = new JBSbatSQLAccess(commonItem, "KK_T_SEIKY_KEI")` | Billing Contract |
| 22 | SET | `db_KK_T_SEIOPSVC_KEI = new JBSbatSQLAccess(commonItem, "KK_T_SEIOPSVC_KEI")` | Billing Option Service Contract |
| 23 | SET | `db_KK_T_SUPPORT = new JBSbatSQLAccess(commonItem, "KK_T_SUPPORT")` | Support |
| 24 | SET | `db_KK_T_SVC_KEI = new JBSbatSQLAccess(commonItem, "KK_T_SVC_KEI")` | Service Contract |
| 25 | SET | `db_KK_T_SVC_KEI_UCWK = new JBSbatSQLAccess(commonItem, "KK_T_SVC_KEI_UCWK")` | Service Contract Internal |
| 26 | SET | `db_KK_T_SVKEI_KAISEN_UW = new JBSbatSQLAccess(commonItem, "KK_T_SVKEI_KAISEN_UW")` | Service Contract Retrieval Internal |
| 27 | SET | `db_KK_T_TAJGSWKEI_TGKEI = new JBSbatSQLAccess(commonItem, "KK_T_TAJGSWKEI_TGKEI")` | Third-Party Discount Contract Target Contract |
| 28 | SET | `db_KK_T_TAJGS_WRIB_KEI = new JBSbatSQLAccess(commonItem, "KK_T_TAJGS_WRIB_KEI")` | Third-Party Discount Contract |
| 29 | SET | `db_KK_T_TCHI_TG_BPIN = new JBSbatSQLAccess(commonItem, "KK_T_TCHI_TG_BPIN")` | Notification Target Product |
| 30 | SET | `db_KK_T_WRISVC_TG_KEI = new JBSbatSQLAccess(commonItem, "KK_T_WRISVC_TG_KEI")` | Discount Service Target Contract |
| 31 | SET | `db_KK_T_WRIB_SVC_KEI = new JBSbatSQLAccess(commonItem, "KK_T_WRIB_SVC_KEI")` | Discount Service Contract |
| 32 | SET | `db_KK_T_KAP_KEI = new JBSbatSQLAccess(commonItem, "KK_T_KAP_KEI")` | Gift Contract |
| 33 | SET | `db_DK_T_BTRYHOZN = new JBSbatSQLAccess(commonItem, "DK_T_BTRYHOZN")` | Logistics Safety |
| 34 | SET | `db_DK_T_HAISO_TG_BPIN = new JBSbatSQLAccess(commonItem, "DK_T_HAISO_TG_BPIN")` | Delivery Target Product |
| 35 | SET | `db_DK_T_SHKA_KIHON_INFO = new JBSbatSQLAccess(commonItem, "DK_T_SHKA_KIHON_INFO")` | Outbound Drawing (Basic Information) |
| 36 | SET | `db_DK_T_MKHMPIN = new JBSbatSQLAccess(commonItem, "DK_T_MKHMPIN")` | Mobile HMPIN |
| 37 | SET | `db_DK_T_SHKA_FIN_DTL = new JBSbatSQLAccess(commonItem, "DK_T_SHKA_FIN_DTL")` | Outbound Finish Detail |
| 38 | SET | `db_DK_T_HIS_SJI_REQ_DTL = new JBSbatSQLAccess(commonItem, "DK_T_HIS_SJI_REQ_DTL")` | History Execution Request Detail |
| 39 | SET | `db_KU_T_SVKEI_KOJIAK = new JBSbatSQLAccess(commonItem, "KU_T_SVKEI_KOJIAK")` | Service Contract Personal Inquiry |
| 40 | SET | `db_KU_T_KOJIAK = new JBSbatSQLAccess(commonItem, "KU_T_KOJIAK")` | Personal Inquiry |
| 41 | SET | `db_KK_T_MSKM_DTL = new JBSbatSQLAccess(commonItem, "KK_T_MSKM_DTL")` | Application Detail |
| 42 | SET | `db_TU_T_DNWACHOMSK = new JBSbatSQLAccess(commonItem, "TU_T_DNWACHOMSK")` | Download Watch Monitoring |
| 43 | SET | `db_KK_T_MAJOR_KMK_DLJSK = new JBSbatSQLAccess(commonItem, "KK_T_MAJOR_KMK_DLJSK")` | Major Item Deletion Record Dealer |
| 44 | SET | `db_KK_T_KKOP_SVC_KEI = new JBSbatSQLAccess(commonItem, "KK_T_KKOP_SVC_KEI")` | KK Option Service Contract (ANK-1655) |
| 45 | SET | `db_DK_T_HAISO_TG_DOHUBT = new JBSbatSQLAccess(commonItem, "DK_T_HAISO_TG_DOHUBT")` | Delivery Target D-Hub Table (ST-2014-0000103) |
| 46 | SET | `db_KK_T_SVKEI_GRP_SETE = new JBSbatSQLAccess(commonItem, "KK_T_SVKEI_GRP_SETE")` | Service Group Setting (ANK-2480) |
| 47 | SET | `db_KK_T_ADCHG = new JBSbatSQLAccess(commonItem, "KK_T_ADCHG")` | Address Change (IT1-2015-0000054) |
| 48 | SET | `db_CK_T_CUST_GRP_SETTE = new JBSbatSQLAccess(commonItem, "CK_T_CUST_GRP_SETTE")` | Customer Group Setting (ANK-2711) |
| 49 | SET | `db_KK_T_OPSVKEI_ISP = new JBSbatSQLAccess(commonItem, "KK_T_OPSVKEI_ISP")` | Option Service ISP (ANK-2711) |
| 50 | SET | `db_KK_T_SVKEIUW_EOH_NET = new JBSbatSQLAccess(commonItem, "KK_T_SVKEIUW_EOH_NET")` | Service Retrieval EOH NET (ANK-2711) |
| 51 | SET | `db_KK_T_KAKINS = new JBSbatSQLAccess(commonItem, "KK_T_KAKINS")` | Storage (ANK-2711) |
| 52 | SET | `db_CK_T_SJISHO = new JBSbatSQLAccess(commonItem, "CK_T_SJISHO")` | Branch Office (ANK-2711) |

---

**Block 3** — EXEC `(Log operation date)` (L981–L983)

> Logs the batch operation date to the debug log.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `super.logPrint.printDebugLog("[Processing Start] Batch operation date: " + super.opeDate)` |

---

**Block 4** — IF `(freeItem split for run count)` (L986–L992)

> Parses the `freeItem` string by splitting on semicolon to extract the run count for multi-run support (ANK-3141). If the split produces more than 3 segments, the fourth element `[3]` is stored as `runCnt`.

| # | Type | Code |
|---|------|------|
| 1 | SET | `freeItems = super.freeItem.split(JACStrConst.SEMI_COLON)` [-> `JACStrConst.SEMI_COLON` = `";"`] |
| 2 | SET | `runCnt = freeItems[3]` // Free item 4th index = run count |

**Block 4.1** — ELSE `[implicit: 3 >= freeItems.length]` (L986–L992)

> When freeItem has 3 or fewer elements, `runCnt` retains its default value from the parent class.

| # | Type | Code |
|---|------|------|
| 1 | SET | `runCnt` remains at default value |

---

**Block 5** — SET `(Retrieve maximum processing time)` (L995–L998)

> Retrieves the maximum processing time (deletion processing upper limit time) from the work parameter settings. The key is `KK_DEL_RUNUPPL_TIME` appended with the `runCnt` value to support multiple concurrent batch runs.

| # | Type | Code |
|---|------|------|
| 1 | SET | `strLimitTime = JKKBatCommon.getWorkParamSetteValue(super.commonItem, DEL_RUN_UPPL_TIM + runCnt)` [-> `DEL_RUN_UPPL_TIM` = `"KK_DEL_RUNUPPL_TIME"`] |

---

**Block 6** — IF `(strLimitTime null check)` (L999–L1005)

> If the maximum processing time cannot be retrieved from work parameters, throws a business exception `EKKB0740CE`. This is a hard failure — the batch cannot proceed without a defined time limit.

| # | Type | Code |
|---|------|------|
| 1 | SET | `msgParam = new String[] { "Work parameter", "Deletion processing upper limit time"}` |
| 2 | RETURN | `throw new JBSbatBusinessException("EKKB0740CE", msgParam)` |

---

**Block 7** — SET `(Assign limit time)` (L1008–L1010)

> Assigns the retrieved processing time limit and logs it.

| # | Type | Code |
|---|------|------|
| 1 | SET | `strTrnLimit = strLimitTime` |
| 2 | EXEC | `super.logPrint.printDebugLog("Deletion processing upper limit time: " + strTrnLimit)` |

---

**Block 8** — SET `(Transaction number extraction)` (L1014–L1017)

> Extracts the transaction number from the first element of the split freeItem array.

| # | Type | Code |
|---|------|------|
| 1 | SET | `this.tran_No = freeItems[0]` |

---

**Block 9** — IF `(tran_No null check)` (L1017–L1022)

> If the transaction number is null (could not be extracted), throws business exception `EKKB0130CE` with parameter "Input parameter".

| # | Type | Code |
|---|------|------|
| 1 | SET | `msgParam = new String[] { "Input parameter"}` |
| 2 | RETURN | `throw new JBSbatBusinessException("EKKB0130CE", msgParam)` |

---

**Block 10** — SET `(Log and pad transaction number)` (L1023–L1025)

> Logs the free item parameter and pads the transaction number to 2 characters with leading zeros.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `super.logPrint.printDebugLog("Free item: parameter: " + this.tran_No)` |
| 2 | SET | `this.tran_No = JPCEditString.fillZero(tran_No, 2, false)` |

---

**Block 11** — CALL `(Query deletion target work table)` (L1028–L1031)

> Queries the Personal Data Deletion Work table (`KK_T_KJNIFDEL_WK`) to determine the maximum multi-processing branch number. This is critical for handling concurrent batch restarts — if the same transaction is reprocessed, the branch number identifies which parallel instance it belongs to.

| # | Type | Code |
|---|------|------|
| 1 | SET | `edaNoList = new JBSbatCommonDBInterface()` |
| 2 | SET | `edaNoParam = new String[1]` |
| 3 | SET | `edaNoParam[0] = this.tran_No` |
| 4 | CALL | `executeKK_T_KJNIFDEL_WK_KK_SELECT_003(edaNoParam)` |

---

**Block 12** — IF `(edaNoList null check for max branch number)` (L1034–L1044)

> Retrieves the maximum multi-processing branch sequence number from the deletion target work table. If no records exist (no deletion targets), sets `tran_SeqMax` to 0.

| # | Type | Code |
|---|------|------|
| 1 | SET | `edaNoList = db_KK_T_KJNIFDEL_WK.selectNext()` |
| 2 | SET | `tran_SeqMax = Integer.parseInt(edaNoList.getString(JBSbatKK_T_KJNIFDEL_WK.TAJU_KIDOU_TRAN_SEQ))` |

**Block 12.1** — ELSE `[edaNoList == null]` (L1041–L1044)

> When no deletion target records exist, set the multi-processing restart number to 0.

| # | Type | Code |
|---|------|------|
| 1 | SET | `tran_SeqMax = 0` // No multi-processing restart number |

---

**Block 13** — EXEC `(Log processing info)` (L1045–L1048)

> Logs the transaction number and the maximum branch number (padded to 6 digits) to the debug/error logs.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `super.logPrint.printBusinessErrorLog("EKKB0820AI", new String[] { tran_No })` |
| 2 | EXEC | `super.logPrint.printDebugLog("Multi-processing restart number: " + this.tran_No)` |
| 3 | EXEC | `super.logPrint.printDebugLog("Max multi-processing branch number: " + JPCEditString.fillZero(tran_SeqMax + "", 6, false))` |

---

**Block 14** — SET `(Physical deletion record output file)` (L1050–L1053)

> Extracts the file path from the third freeItem element and creates a business file utility for writing physical deletion record output as CSV. This file records which records were actually deleted, providing an audit trail.

| # | Type | Code |
|---|------|------|
| 1 | SET | `filePath = freeItems[2]` |
| 2 | SET | `delRecordOutFile = JCCBatCommon.createBusinessFileUtil(filePath, "", "", JACStrConst.COMMA)` [-> `JACStrConst.COMMA` = `","`] |

---

**Block 15** — IF `(freeItems[1] equals DELSTOP_CD)` (L1055–L1057)

> Checks if the deletion stop code is set to `"1"`. If true, sets the deletion suppression flag to prevent any actual deletion from occurring. This is a safety mechanism — operators can set this flag to disable the batch without modifying code.

| # | Type | Code |
|---|------|------|
| 1 | SET | `delStopFlg = true` |

**Block 15.1** — ELSE `[freeItems[1] != "1"]`

> If the deletion stop code is not `"1"`, the deletion flag remains at its default `false` value, allowing normal deletion processing.

| # | Type | Code |
|---|------|------|
| 1 | SET | `delStopFlg = false` (default) |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `tran_No` | Field | Transaction number — internal identifier for this batch run, padded to 2 digits |
| `tran_SeqMax` | Field | Maximum multi-processing branch number — used when the same batch is restarted concurrently; identifies which parallel instance is active |
| `strTrnLimit` | Field | Transaction limit time — maximum allowed processing time (in minutes) for deletion operations |
| `strLimitTime` | Field | Limit time string — retrieved from work parameter settings, contains the configured max processing time |
| `runCnt` | Field | Run count — number of times this batch has been executed in a multi-run scenario (freeItem[3]) |
| `delStopFlg` | Field | Deletion stop flag — when `true`, deletion is suppressed; batch prepares but does not execute actual deletes |
| `delRecordOutFile` | Field | Deletion record output file — CSV file writing which records were physically deleted (audit trail) |
| `freeItem` | Field | Free item string — comma-delimited batch metadata string carrying transaction number, stop code, file path, and run count |
| `DAJU_KIDOU_TRAN_SEQ` | Field | Multi-processing branch transaction sequence — the field name in `KK_T_KJNIFDEL_WK` storing the branch number |
| `DELSTOP_CD` | Constant | `"1"` — Deletion suppression code; when freeItem[1] equals this, physical deletion is prevented |
| `DEL_RUN_UPPL_TIM` | Constant | `"KK_DEL_RUNUPPL_TIME"` — Work parameter key for configuring maximum deletion processing time |
| `KK_T_KJNIFDEL_WK` | Table | Personal Data Deletion Work table — temporary work table storing deletion target data and branch numbers |
| `KK_M_KJNIFDEL_TGSCM` | Table | Personal Data Deletion Target Schema table — defines which database schemas/tables are subject to deletion |
| `KK_T_KOJIN_INFO_DEL` | Table | Personal Data Deletion table — main table tracking personal data deletion status |
| `KK_T_SVC_KEI` | Table | Service Contract table — core telecommunications service contract master |
| `KK_T_SVC_KEI_UCWK` | Table | Service Contract Internal table — internal/detail records for service contracts |
| `KK_T_OP_SVC_KEI` | Table | Option Service Contract table — optional service add-on contracts |
| `KK_T_SEIKY_KEI` | Table | Billing Contract table — contract records for billing purposes |
| `KK_T_KKTK_SVC_KEI` | Table | Equipment Provision Service Contract table — contracts for equipment provision services |
| `KK_T_JUDGE` | Table | Judgment table — contains judgment/approval status for service changes |
| `KK_T_MSKM` | Table | Application table — customer application/order records |
| `KK_T_ADCHG` | Table | Address Change table — records of customer address changes |
| `KK_T_MAJOR_KMK_DLJSK` | Table | Major Item Deletion Record Dealer table — audit trail for major item deletions (dealer records) |
| `AC_T_HAPIEPOINT_HKAT` | Table | HappyPoint Application table — loyalty/rewards program application data |
| `AC_T_HAPIEPOINT_UCWK` | Table | HappyPoint Internal table — internal HappyPoint reward program data |
| `DK_T_HAISO_TG_BPIN` | Table | Delivery Target Product table — products scheduled for delivery |
| `DK_T_BTRYHOZN` | Table | Logistics Safety table — logistics and inventory safety data |
| `CR_T_TAIO_KIROK` | Table | Response Record table — customer service response records |
| `CH_T_SAIKEN` | Table | Lien table — guarantee/lien records for financial security |
| `CH_T_JUTO` | Table | Deposit table — customer deposit records |
| `KU_T_KOJIAK` | Table | Personal Inquiry table — customer personal inquiry records |
| `KU_T_SVKEI_KOJIAK` | Table | Service Contract Personal Inquiry table — inquiries linked to specific service contracts |
| `CK_T_CUST_GRP_SETTE` | Table | Customer Group Setting table — customer group configuration |
| `CK_T_SJISHO` | Table | Branch Office table — branch/regional office master data |
| `JBSbatCommonItem` | Class | Batch common parameter item — carries batch execution parameters (date, freeItem, work settings) |
| `JBSbatBusinessService` | Class | Abstract parent class for batch services — provides common initialization and logging infrastructure |
| `JBSbatBusinessException` | Class | Application-level exception — thrown for business rule violations (e.g., missing parameters) |
| `JBSbatSQLAccess` | Class | Database access proxy — wraps JDBC operations for a specific table |
| `JKKBatCommon` | Class | K-Opticom batch common utilities — work parameter retrieval, batch utility methods |
| `JPCEditString` | Class | String editing utility — zero-padding, format conversion |
| `JCCBatCommon` | Class | Common batch utilities — file creation, common batch operations |
| `EKKB0740CE` | Exception | Missing work parameter exception — thrown when maximum processing time is not configured |
| `EKKB0130CE` | Exception | Missing input parameter exception — thrown when required input parameter (transaction number) is absent |
| `EKKB0820AI` | Log | Transaction number log — business error log entry recording the transaction number for traceability |
| FTTH | Business term | Fiber To The Home — fiber optic internet service (domain context) |
| Batch | Technical term | Scheduled automated job — this method is part of a batch processing system |
| Work Parameter | Business term | Configurable system parameters stored in a work parameter table — allows operators to adjust batch behavior without code changes |
| Multi-processing | Technical term | Concurrent batch execution — the same batch can be restarted while already running; branch numbers track parallel instances |
| 保存期間経過データ | Japanese term | Data exceeding storage retention period — data that has passed its legally required retention period and must be deleted |
| 物理削除 | Japanese term | Physical deletion — permanent removal of data from the database (not soft delete) |
| 多重起動 | Japanese term | Multi-processing / concurrent startup — scenario where the batch job starts again before a previous instance completes |
| 免除コード | Japanese term | Exclusion code / stop code — flag that disables specific processing (in this case, deletion) |
