---

# Business Logic — JBSbatKKAdEmgSODSendOutput.initial() [14 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.business.service.JBSbatKKAdEmgSODSendOutput` |
| Layer | Service (Batch Output) — extends `JBSbatBusinessService` |
| Module | `service` (Package: `eo.business.service`) |

## 1. Role

### JBSbatKKAdEmgSODSendOutput.initial()

`JBSbatKKAdEmgSODSendOutput` is the **Emergency Notification SOD Transmission Data Creation Class** (緊急通知SOD送信データ作成クラス) — a batch output service responsible for preparing transmission data for emergency notification Service Order Data (SOD) records. The `initial()` method serves as the **batch initialization entry point**, following the standard `JBSbatBusinessService` lifecycle pattern: it sets up database access layer instances and propagates common batch parameters to the parent service context.

Specifically, this method performs three database access setup steps — instantiating `JBSbatSQLAccess` handles for the tables `KK_T_ODR_HAKKO_JOKEN`, `KK_T_ODR_INF_SKSI_WK`, and `KK_T_CHG_AD_JGRTWK` — which correspond to the order issuance conditions, order information work, and change/addition judgment work tables, respectively. It then delegates to `super.setCommonInfo(commonItem)` to initialize inherited batch context fields (such as batch ID, process date, and operator info).

This method implements the **batch lifecycle hook pattern**: it is not called directly by other Java classes in the codebase. Instead, it is invoked by the batch framework's execution engine when processing a batch job registered with this output class. The method has **no conditional branches** — its processing is purely sequential and deterministic, always executing the same initialization steps regardless of input state.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["initial(commonItem)"])
    STEP1["Generate DB Access: db_KK_T_ODR_HAKKO_JOKEN"]
    STEP2["Generate DB Access: db_KK_T_ODR_INF_SKSI_WK"]
    STEP3["Generate DB Access: db_CHG_AD_JGRTWK"]
    STEP4["Set common info: super.setCommonInfo(commonItem)"]
    END_NODE(["Return / Next"])

    START --> STEP1
    STEP1 --> STEP2
    STEP2 --> STEP3
    STEP3 --> STEP4
    STEP4 --> END_NODE
```

This method has a linear, unconditional control flow with no branching. Each step is a dependency for the next:

1. **DB Access Creation (Line 75):** Initializes `db_KK_T_ODR_HAKKO_JOKEN` — a SQL access handler for the order issuance conditions table.
2. **DB Access Creation (Line 76):** Initializes `db_KK_T_ODR_INF_SKSI_WK` — a SQL access handler for the order information creation work table.
3. **DB Access Creation (Line 77):** Initializes `db_CHG_AD_JGRTWK` — a SQL access handler for the change/addition judgment work table.
4. **Common Info Setup (Line 79):** Calls the parent class method `setCommonInfo()` to populate inherited batch context fields.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `commonItem` | `JBSbatCommonItem` | Batch common parameter message — carries shared batch execution context including batch ID, process date/time, operator ID, and configuration settings. This is the standard parameter envelope passed to all batch service methods in the K-Opticom batch framework. |

**External State (Instance Fields) Read/Written by this Method:**

| Field | Type | Description |
|-------|------|-------------|
| `db_KK_T_ODR_HAKKO_JOKEN` | `JBSbatSQLAccess` | Set to a new DB access handler for the order issuance conditions table (`KK_T_ODR_HAKKO_JOKEN`) |
| `db_KK_T_ODR_INF_SKSI_WK` | `JBSbatSQLAccess` | Set to a new DB access handler for the order information work table (`KK_T_ODR_INF_SKSI_WK`) |
| `db_CHG_AD_JGRTWK` | `JBSbatSQLAccess` | Set to a new DB access handler for the change/addition judgment work table (`KK_T_CHG_AD_JGRTWK`) |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `JBSbatBusinessService.setCommonInfo` | JBSbatBusinessService | (Inherited batch context) | Calls `setCommonInfo` in parent `JBSbatBusinessService` to propagate common batch parameters into the service's inherited fields |

**Method calls within `initial()` and their classification:**

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `JBSbatSQLAccess(<commonItem>, "KK_T_ODR_HAKKO_JOKEN")` | N/A | KK_T_ODR_HAKKO_JOKEN | Creates a new DB access handler for the order issuance conditions table. No SQL execution occurs at this stage — only the connection context is prepared. |
| - | `JBSbatSQLAccess(<commonItem>, "KK_T_ODR_INF_SKSI_WK")` | N/A | KK_T_ODR_INF_SKSI_WK | Creates a new DB access handler for the order information creation work table. Connection context only — no data access yet. |
| - | `JBSbatSQLAccess(<commonItem>, "KK_T_CHG_AD_JGRTWK")` | N/A | KK_T_CHG_AD_JGRTWK | Creates a new DB access handler for the change/addition judgment work table. Connection context only — no data access yet. |
| - | `setCommonInfo(commonItem)` | JBSbatBusinessService | N/A | Parent method that copies common batch parameters (batch ID, process date, operator) into inherited fields. No DB interaction. |

**Notes:**
- This method performs **no direct data operations** (CRUD) on any table. It only prepares the DB access infrastructure.
- The actual data operations (insert, update, query) on these three tables occur in the `execute()` method of this same class, which is called after `initial()`.

## 5. Dependency Trace

This method follows the standard K-Opticom batch framework pattern where `initial()` is invoked by the batch execution engine rather than by explicit Java callers. The class `JBSbatKKAdEmgSODSendOutput` is referenced in batch configuration/job registration, and the framework's batch scheduler triggers the `initial()` → `execute()` lifecycle.

No direct Java-level callers were found that reference `initial(JBSbatCommonItem)` on this class. The method is part of the batch service interface contract implemented by extending `JBSbatBusinessService`.

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Batch: JBSbatKKAdEmgSODSendOutput | `BatchExecutionEngine.initial()` -> `JBSbatKKAdEmgSODSendOutput.initial(commonItem)` | `JBSbatSQLAccess[KK_T_ODR_HAKKO_JOKEN, KK_T_ODR_INF_SKSI_WK, KK_T_CHG_AD_JGRTWK]` |
| 2 | Batch: JBSbatBusinessService (parent) | `BatchExecutionEngine.invokeService()` -> `JBSbatBusinessService.initial()` -> `super.initial()` (delegated to subclass) | N/A |

## 6. Per-Branch Detail Blocks

> **Block 1** — SEQUENTIAL PROCESSING (No conditional branches — all operations execute unconditionally) (L75)

This block encompasses all processing steps executed in sequence during initialization.

| # | Type | Code |
|---|------|------|
| 1 | SET | `db_KK_T_ODR_HAKKO_JOKEN = new JBSbatSQLAccess(commonItem, "KK_T_ODR_HAKKO_JOKEN")` // Initialize DB access handler for order issuance conditions table [-> table: KK_T_ODR_HAKKO_JOKEN] |
| 2 | SET | `db_KK_T_ODR_INF_SKSI_WK = new JBSbatSQLAccess(commonItem, "KK_T_ODR_INF_SKSI_WK")` // Initialize DB access handler for order information creation work table [-> table: KK_T_ODR_INF_SKSI_WK] |
| 3 | SET | `db_CHG_AD_JGRTWK = new JBSbatSQLAccess(commonItem, "KK_T_CHG_AD_JGRTWK")` // Initialize DB access handler for change/addition judgment work table [-> table: KK_T_CHG_AD_JGRTWK] |
| 4 | EXEC | `super.setCommonInfo(commonItem)` // Call parent batch service to set common parameters (batch ID, process date, operator) |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| SOD | Acronym | Service Order Data — the core telecom order fulfillment entity representing a service request in the K-Opticom system |
| 緊急通知 (KinKyuu TsuuChi) | Japanese term | Emergency Notification — a priority message category for urgent service updates or outages |
| KK | Acronym | K-Opticom — the company/brand prefix used throughout the system naming convention |
| AdEmg | Acronym | Advertisement Emergency — denotes the emergency notification subsystem within the batch processing framework |
| SendOutput | Term | Batch output processing — the phase where batch data is prepared and transmitted to external systems |
| KK_T_ODR_HAKKO_JOKEN | Table | Order Issuance Conditions Table — stores the conditions and criteria for generating order issuances |
| KK_T_ODR_INF_SKSI_WK | Table | Order Information Creation Work Table — temporary/work table for assembling order information during batch processing |
| KK_T_CHG_AD_JGRTWK | Table | Change/Addition Judgment Work Table — work table used to evaluate whether service changes or additions are applicable |
| ODR_HAKKO_JOKEN_NO | Field | Order Issuance Condition Number — internal sequence number identifying a specific issuance condition |
| ORDER_HAKKO_JOKEN_ORDER_SBT_CD | Field | Order Subtype Code — classifies the type of order issuance (value "4" = Emergency Notification) |
| ORDER_HAKKO_JOKEN_SVC_ORDER_CD | Field | Service Order Code — identifies the specific service order type (value "24" = Emergency Notification) |
| ORDER_HAKKO_JOKEN_YOKYU_SBT_CD | Field | Request Subtype Code — classifies the request type (value "04" = Modification/Change) |
| ORDER_HAKKO_JOKEN_ODR_HAKKO_JOKEN_CD | Field | Issuance Condition Code — determines the issuance trigger (value "01" = Immediate Issuance) |
| ORDER_INF_WORK_ORDER_NAIYO_CD | Field | Order Content Code — specifies the content type in the order information work table (value "251" = Emergency Notification/Change) |
| SEQ_KETA | Field | Sequence Digit Count — defines the number of digits in sequence number formatting (value: 12) |
| JBSbatCommonItem | Class | Batch Common Item — the standard parameter envelope carrying shared batch execution context |
| JBSbatSQLAccess | Class | Batch SQL Access — the database access wrapper used for table-level operations in batch processing |
| JBSbatBusinessService | Class | Batch Business Service — the parent class providing common batch service lifecycle methods (initial, execute, finalize) |
| 初期処理 (Shori) | Japanese term | Initial Processing — the initialization phase of a batch service |
| バッチ共通パラメータ電文 | Japanese term | Batch Common Parameter Message — the message envelope containing shared batch parameters |

---
