---
# Business Logic — JBSbatKKSvkeiuwDelTgCst.initial() [21 LOC]

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

## 1. Role

### JBSbatKKSvkeiuwDelTgCst.initial()

This method serves as the **initialization entry point** for the `JBSbatKKSvkeiuwDelTgCst` batch service, which is responsible for **extracting (querying out) service contract content records targeted for deletion** within the K-Opticom EO Customer Core System. The batch processes records related to service contract terminations, including deletion of SOD (Service Order Data) issuance, aging updates, and combinations of both. Specifically, it handles deletion target types such as legacy ISP authentication IDs, OABJ (out-of-business) phone numbers, and SIP user IDs. As a batch service component, it implements the **lifecycle pattern** common to the batch framework — `initial()` initializes SQL access objects and common parameters, `execute()` performs the main extraction logic, and `terminal()` handles cleanup. This method plays the role of a **shared batch setup utility**, instantiated by the batch scheduler and called at the beginning of each batch execution cycle. It sets up the operational context and prepares database access handles for all tables required during the subsequent main processing phase.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["initial(commonItem)"])
    START --> SET_COMMON["SET Common Info
super.setCommonInfo(commonItem)"]
    SET_COMMON --> INIT_NET["INIT db_KK_T_SVKEIUW_EOH_NET
new JBSbatSQLAccess
(D_TBL_NAME_KK_T_SVKEIUW_EOH_NET)"]
    INIT_NET --> INIT_TEL["INIT db_KK_T_SVKEIUW_EOH_TEL
new JBSbatSQLAccess
(D_TBL_NAME_KK_T_SVKEIUW_EOH_TEL)"]
    INIT_TEL --> INIT_PRC["INIT db_KK_M_PRC_GRP
new JBSbatSQLAccess
(D_TBL_NAME_KK_M_PRC_GRP)"]
    INIT_PRC --> INIT_WPARAM["INIT db_ZM_M_WORK_PARAM_KNRI
new JBSbatSQLAccess
(D_TBL_NAME_ZM_M_WORK_PARAM_KNRI)"]
    INIT_WPARAM --> INIT_ODRSET["INIT db_KK_T_ODR_SET
new JBSbatSQLAccess
(D_TBL_NAME_KK_T_ODR_SET)"]
    INIT_ODRSET --> INIT_KKTK["INIT db_KK_T_KKTK_SVC_KEI
new JBSbatSQLAccess
(D_TBL_NAME_KK_T_KKTK_SVC_KEI)"]
    INIT_KKTK --> INIT_HMPIN["INIT db_DK_T_HMPIN_KIKI
new JBSbatSQLAccess
(D_TBL_NAME_DK_T_HMPIN_KIKI)"]
    INIT_HMPIN --> END_NODE(["Return / Next"])
```

This method performs **linear sequential initialization** with no conditional branches. It:

1. Delegates to `super.setCommonInfo(commonItem)` to propagate batch common parameters (operation date, batch user ID, system code, job ID, etc.) into the parent service context.
2. Instantiates nine `JBSbatSQLAccess` objects, each bound to a specific database table that will be queried or modified during the batch's main processing phase.
3. The `db_KK_T_ODR_HAKKO_JOKEN` SQL access object (for the Order Release Conditions table) was **removed in version 5.00.01** (fix IT1-2013-0000285) and remains commented out.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `commonItem` | `JBSbatCommonItem` | Batch common parameter message — carries the core operational metadata for the batch run, including operation date (`opeDate`), online operation date (`onlineOpeDate`), batch user ID (`batchUserId`), system code (`systemCode`), log print control object (`logPrint`), job ID (`jobid`), and free item field (`freeItem`). This object is the single source of batch-level context shared across all service components during the batch execution. |
| - | `this.opeDate` | `Date` | Operation date — set by `super.setCommonInfo()` from `commonItem`. Represents the business date for the batch processing run. |
| - | `this.batchUserId` | `String` | Batch update user ID — the operator or system account executing the batch. |
| - | `this.systemCode` | `String` | System code — identifies the K-Opticom EO system. |
| - | `this.jobid` | `String` | Job ID — the scheduler-assigned execution identifier for this batch run. |
| - | `this.commonItem` | `JBSbatCommonItem` | Reference to the common message object, stored in the parent class for downstream access. |
| - | `this.db_KK_T_SVKEIUW_EOH_NET` | `JBSbatSQLAccess` | Initialized in this method — SQL access handle for the Service Contract <EO Light Net> table. |
| - | `this.db_KK_T_SVKEIUW_EOH_TEL` | `JBSbatSQLAccess` | Initialized in this method — SQL access handle for the Service Contract <EO Light Tel> table. |
| - | `this.db_KK_M_PRC_GRP` | `JBSbatSQLAccess` | Initialized in this method — SQL access handle for the Price Group table. |
| - | `this.db_ZM_M_WORK_PARAM_KNRI` | `JBSbatSQLAccess` | Initialized in this method — SQL access handle for the Business Parameter Management table. |
| - | `this.db_KK_T_ODR_SET` | `JBSbatSQLAccess` | Initialized in this method — SQL access handle for the Order Settings table. |
| - | `this.db_KK_T_KKTK_SVC_KEI` | `JBSbatSQLAccess` | Initialized in this method — SQL access handle for the Machine Provisioning Service Contract table. |
| - | `this.db_DK_T_HMPIN_KIKI` | `JBSbatSQLAccess` | Initialized in this method — SQL access handle for the Return Machine table. |

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| U | `JBSbatBusinessService.setCommonInfo` | - | In-memory (batch context) | Updates the parent class fields (operation date, batch user ID, system code, job ID, etc.) with values from `commonItem`. Sets up batch-wide operational context. |
| - | `JBSbatSQLAccess` constructor | - | KK_T_SVKEIUW_EOH_NET | Initializes SQL access handle for the Service Contract <EO Light Net> table. Prepares the data access layer for subsequent queries. |
| - | `JBSbatSQLAccess` constructor | - | KK_T_SVKEIUW_EOH_TEL | Initializes SQL access handle for the Service Contract <EO Light Tel> table. |
| - | `JBSbatSQLAccess` constructor | - | KK_M_PRC_GRP | Initializes SQL access handle for the Price Group table. |
| - | `JBSbatSQLAccess` constructor | - | ZM_M_WORK_PARAM_KNRI | Initializes SQL access handle for the Business Parameter Management table. |
| - | `JBSbatSQLAccess` constructor | - | KK_T_ODR_SET | Initializes SQL access handle for the Order Settings table. |
| - | `JBSbatSQLAccess` constructor | - | KK_T_KKTK_SVC_KEI | Initializes SQL access handle for the Machine Provisioning Service Contract table. |
| - | `JBSbatSQLAccess` constructor | - | DK_T_HMPIN_KIKI | Initializes SQL access handle for the Return Machine table. |

## 5. Dependency Trace

This method follows the standard batch service lifecycle pattern of the K-Opticom batch framework. The `initial()` method is **called by the batch scheduler/runtime** when it instantiates and executes the batch service — the batch framework invokes `initial()`, then `execute()`, then `terminal()` in sequence.

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Batch: JBSbatKKSvkeiuwDelTgCst | `BatchScheduler.run()` -> `JBSbatKKSvkeiuwDelTgCst.initial(commonItem)` | `setCommonInfo [U] batch_context (in-memory)` |

The batch framework (batch scheduler/runtime) discovers and instantiates the batch service class by name, then invokes its lifecycle methods. Since no Java caller directly references this `initial()` method in the codebase, it is called exclusively through the batch runtime reflection/instantiation mechanism.

## 6. Per-Branch Detail Blocks

This method has **no conditional branches** — it follows a single linear execution path.

### Block 1 — [EXEC] `(super.setCommonInfo)` (L170)

> Sets common batch parameters from the input `commonItem` into the parent `JBSbatBusinessService` context. This propagates operational metadata (operation date, batch user ID, system code, job ID, log control, etc.) so that all downstream SQL operations and service components share consistent batch-level context.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `super.setCommonInfo(commonItem)` // Sets batch common parameters into parent service context [-> this.opeDate, this.batchUserId, this.systemCode, this.jobid, this.commonItem] |

### Block 2 — [EXEC] `JBSbatSQLAccess initialization` (L173-L181)

> Initializes `JBSbatSQLAccess` objects for all database tables required during batch processing. Each SQL access object wraps a specific table and is stored as an instance field for use by other methods (e.g., `execute()`, `terminal()`). This establishes the data access layer for the batch's CRUD operations on service contract, price group, parameter management, order settings, machine provisioning, and return machine tables.

| # | Type | Code |
|---|------|------|
| 1 | SET | `db_KK_T_SVKEIUW_EOH_NET = new JBSbatSQLAccess(commonItem, "KK_T_SVKEIUW_EOH_NET")` // SQL access for Service Contract <EO Light Net> table |
| 2 | SET | `db_KK_T_SVKEIUW_EOH_TEL = new JBSbatSQLAccess(commonItem, "KK_T_SVKEIUW_EOH_TEL")` // SQL access for Service Contract <EO Light Tel> table |
| 3 | SET | `db_KK_M_PRC_GRP = new JBSbatSQLAccess(commonItem, "KK_M_PRC_GRP")` // SQL access for Price Group table |
| 4 | SET | `db_ZM_M_WORK_PARAM_KNRI = new JBSbatSQLAccess(commonItem, "ZM_M_WORK_PARAM_KNRI")` // SQL access for Business Parameter Management table |
| 5 | SET | `db_KK_T_ODR_SET = new JBSbatSQLAccess(commonItem, "KK_T_ODR_SET")` // SQL access for Order Settings table |
| 6 | SET | `db_KK_T_KKTK_SVC_KEI = new JBSbatSQLAccess(commonItem, "KK_T_KKTK_SVC_KEI")` // SQL access for Machine Provisioning Service Contract table |
| 7 | SET | `db_DK_T_HMPIN_KIKI = new JBSbatSQLAccess(commonItem, "DK_T_HMPIN_KIKI")` // SQL access for Return Machine table |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `svkeiuw_eoh_net` | Field | Service Contract <EO Light Net> — a database table storing internet (EO Light) service contract content details targeted for deletion |
| `svkeiuw_eoh_tel` | Field | Service Contract <EO Light Tel> — a database table storing telephone (EO Light) service contract content details targeted for deletion |
| `prc_grp` | Field | Price Group — classification group for service pricing tiers |
| `work_param_knri` | Field | Work Parameter Management — configuration parameters that control batch processing behavior |
| `odr_set` | Field | Order Settings — table storing order configuration parameters |
| `kktk_svc_kei` | Field | Machine Provisioning Service Contract — contract records for machine-provisioned services (e.g., leased equipment) |
| `hmpin_kiki` | Field | Return Machine — records of equipment returned by customers as part of service termination |
| `del_tran_sbt` | Field | Deletion Processing Type — classifies the type of deletion operation: "1" = Delete SOD Issuance, "2" = Aging Update, "3" = Delete SOD Issuance / Aging Update (combined) |
| `del_trgt_sbt` | Field | Deletion Target Type — classifies what is being deleted: "02" = Legacy ISP Authentication ID, "09" = OABJ (Out-of-Business) Phone Number, "17" = SIP User ID |
| SOD | Acronym | Service Order Data — the formal order record for telecom service provisioning/cancellation in the K-Opticom system |
| EO Light | Business term | K-Opticom's fiber-optic internet service brand (EO光) — covers both internet-only and bundled telephone plans |
| SIP | Acronym | Session Initiation Protocol — VoIP protocol used for internet telephone service user identification |
| OABJ | Acronym | Out-of-Business — a customer status designation for clients who have ceased operations (used to flag phone numbers needing deletion) |
| JBSbatSQLAccess | Class | SQL Access abstraction — a batch framework class that provides database connectivity and query execution for a specific table, configured with batch common parameters |
| JBSbatCommonItem | Class | Batch Common Parameter Message — the central batch context object carrying operation date, user ID, system code, job ID, and other shared metadata across the batch execution lifecycle |
| JBSbatBusinessService | Class | Parent batch service base class — provides the common batch lifecycle (`initial()`, `execute()`, `terminal()`) and shared fields (operation date, batch user ID, etc.) |
| KK_SELECT_XXX | Constant | SQL Definition Key — identifiers for pre-defined SQL statements stored in the batch SQL configuration, used to execute parameterized queries against the respective tables |
| v5.00.01 | Version | Version 5.00.01 (2013/02/13) — removed the `db_KK_T_ODR_HAKKO_JOKEN` (Order Release Conditions) SQL access object as part of fix IT1-2013-0000285 |
