# Business Logic — JBSbatKKSodUpdInfCst.initial() [24 LOC]

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

## 1. Role

### JBSbatKKSodUpdInfCst.initial()

This method performs the **initialization phase** of the SOD (Service Order Data) Update Information Extraction batch service, a key component in K-Opticom's telecom customer backbone system. The batch job is responsible for extracting update information from service orders that have changed — enabling downstream processing of address changes, work completion events, and other service modifications.

The `initial()` method is a standard batch service entry point method, following the framework pattern of extending `JBSbatBusinessService`. Its primary responsibilities are twofold: first, it delegates to `super.setCommonInfo(commonItem)` to register common batch parameters (such as batch ID, processing date, and system configuration) with the parent framework; second, it instantiates seven `JBSbatSQLAccess` database access objects, each targeting a specific table required for the subsequent data extraction logic.

This method implements the **delegation pattern** (delegating common setup to the parent class) and the **pre-initialization pattern** (creating all necessary database access handles upfront so that the main `execute()` method can efficiently query multiple tables without recreating them). As part of the `JBSbatKKAdChgCstScreenKidou` batch process — the Address Change Status Movement batch — this service is invoked to extract SOD update records triggered by address changes, work completions, and service contract modifications.

The method has **no conditional branches**; it executes a flat, sequential setup routine. Its role in the larger system is that of a **shared batch initializer** — it prepares the data access layer for the extraction job that follows.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["initial(JBSbatCommonItem)"])
    STEP1(["setCommonInfo
Setup common batch parameters"])
    SQL1["new JBSbatSQLAccess
KK_T_SVKEI_KAISEN_UW
(Service Contract Line Details)"]
    SQL2["new JBSbatSQLAccess
KK_T_ADCHG
(Address Change)"]
    SQL3["new JBSbatSQLAccess
KK_T_ADCHG_DTL
(Address Change Details)"]
    SQL4["new JBSbatSQLAccess
KK_T_KJ_FIN_WK
(Work Completion Work)"]
    SQL5["new JBSbatSQLAccess
KU_T_SVKEI_KOJIAK
(Service Contract-Work Project)"]
    SQL6["new JBSbatSQLAccess
KK_T_TK_HOSHIKI_KEI
(Supply Form Contract)"]
    SQL7["new JBSbatSQLAccess
KK_T_SVC_KEI
(Service Contract)"]
    END_NODE(["Return / Next"])

    START --> STEP1
    STEP1 --> SQL1
    SQL1 --> SQL2
    SQL2 --> SQL3
    SQL3 --> SQL4
    SQL4 --> SQL5
    SQL5 --> SQL6
    SQL6 --> SQL7
    SQL7 --> END_NODE
```

**Processing Summary:** This method executes a deterministic, linear sequence of steps with no conditional logic. It first delegates common parameter setup to the parent framework, then instantiates seven database access objects — one for each table the SOD update extraction process requires during its main `execute()` phase.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `commonItem` | `JBSbatCommonItem` | Batch common parameter message — carries the shared batch execution context including batch ID, processing date/time, system configuration flags, database connection details, and error handling configuration. This object is the backbone of batch framework communication and is passed to every framework method and SQL access object to maintain consistency across the batch run. |

**Instance fields / external state read:**
| Field | Type | Business Description |
|-------|------|---------------------|
| `this` (parent class) | `JBSbatBusinessService` | Parent batch service framework — provides `setCommonInfo()` for registering common batch parameters |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `JBSbatBusinessService.setCommonInfo` | (Framework) | - | Delegates to parent framework to set common batch parameters from the incoming `commonItem` |
| - | `JBSbatSQLAccess.<init>` (x7) | (Framework) | `KK_T_SVKEI_KAISEN_UW` | Creates a SQL access handle for the Service Contract Line Details table |
| - | `JBSbatSQLAccess.<init>` (x7) | (Framework) | `KK_T_ADCHG` | Creates a SQL access handle for the Address Change table |
| - | `JBSbatSQLAccess.<init>` (x7) | (Framework) | `KK_T_ADCHG_DTL` | Creates a SQL access handle for the Address Change Details table |
| - | `JBSbatSQLAccess.<init>` (x7) | (Framework) | `KK_T_KJ_FIN_WK` | Creates a SQL access handle for the Work Completion Work table |
| - | `JBSbatSQLAccess.<init>` (x7) | (Framework) | `KU_T_SVKEI_KOJIAK` | Creates a SQL access handle for the Service Contract-Work Project table |
| - | `JBSbatSQLAccess.<init>` (x7) | (Framework) | `KK_T_TK_HOSHIKI_KEI` | Creates a SQL access handle for the Supply Form Contract table |
| - | `JBSbatSQLAccess.<init>` (x7) | (Framework) | `KK_T_SVC_KEI` | Creates a SQL access handle for the Service Contract table |

**Notes:**
- This method performs **no direct CRUD operations** against the database. It only creates `JBSbatSQLAccess` handles (which are connection/table wrappers) — actual read/write operations occur later in the `execute()` method.
- The `setCommonInfo` call is a framework-level setup operation, not a data access operation.

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Batch: `JBSbatKKAdChgCstScreenKidou` | `execObjSod.initial(commonItem)` (line 194) | `JBSbatSQLAccess [R] KK_T_SVKEI_KAISEN_UW`<br>`JBSbatSQLAccess [R] KK_T_ADCHG`<br>`JBSbatSQLAccess [R] KK_T_ADCHG_DTL`<br>`JBSbatSQLAccess [R] KK_T_KJ_FIN_WK`<br>`JBSbatSQLAccess [R] KU_T_SVKEI_KOJIAK`<br>`JBSbatSQLAccess [R] KK_T_TK_HOSHIKI_KEI`<br>`JBSbatSQLAccess [R] KK_T_SVC_KEI` |

**Notes:**
- The sole identified caller is `JBSbatKKAdChgCstScreenKidou`, the **Address Change Status Movement batch** process. This batch coordinates multiple sub-processing components — including address change completion registration, SOD update extraction, address change SOD update, smart balance integration, and place number change — each managed as a dedicated field object.
- `initial()` is called during batch setup (line 194), before the main `execute()` is called (line 411), following the standard framework lifecycle: `initial()` → `execute()` → `terminal()`.
- The `terminal()` method (line 836) is also called on this object, which typically handles cleanup of database resources.

## 6. Per-Branch Detail Blocks

> This method has no conditional branches (no if/else, switch, or loops). The entire method body is a single linear processing block.

**Block 1** — [EXECUTE] `(super.setCommonInfo)` (L175)

> Set common batch parameters by delegating to the parent framework class.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `super.setCommonInfo(commonItem)` // Set common parameters — delegates to `JBSbatBusinessService` parent [-> Framework common batch setup] |

**Block 2** — [EXECUTE] `(DB SQL Access Class Generation)` (L176)

> Begin generation of database SQL access classes from tool.

**Block 2.1** — [NEW] `(KK_T_SVKEI_KAISEN_UW)` (L177)

> Table: Service Contract Line Details (サービス契約回線内詳)

| # | Type | Code |
|---|------|------|
| 1 | SET | `db_KK_T_SVKEI_KAISEN_UW = new JBSbatSQLAccess(commonItem, D_TBL_NAME_KK_T_SVKEI_KAISEN_UW)` // DB SQL access class generation — [-> CONSTANT "KK_T_SVKEI_KAISEN_UW"] |

**Block 2.2** — [NEW] `(KK_T_ADCHG)` (L179)

> Table: Address Change (住所変更) — ST2-2013-0001434対応

| # | Type | Code |
|---|------|------|
| 1 | SET | `db_KK_T_ADCHG = new JBSbatSQLAccess(commonItem, D_TBL_NAME_KK_T_ADCHG)` // DB SQL access class generation — [-> CONSTANT "KK_T_ADCHG"] |

**Block 2.3** — [NEW] `(KK_T_ADCHG_DTL)` (L182)

> Table: Address Change Details (住所変更詳細) — ST2-2013-0001008対応

| # | Type | Code |
|---|------|------|
| 1 | SET | `db_KK_T_ADCHG_DTL = new JBSbatSQLAccess(commonItem, D_TBL_NAME_KK_T_ADCHG_DTL)` // DB SQL access class generation — [-> CONSTANT "KK_T_ADCHG_DTL"] |

**Block 2.4** — [NEW] `(KK_T_KJ_FIN_WK)` (L184)

> Table: Work Completion Work (工事完了ワーク)

| # | Type | Code |
|---|------|------|
| 1 | SET | `db_KK_T_KJ_FIN_WK = new JBSbatSQLAccess(commonItem, D_TBL_NAME_KK_T_KJ_FIN_WK)` // DB SQL access class generation — [-> CONSTANT "KK_T_KJ_FIN_WK"] |

**Block 2.5** — [NEW] `(KU_T_SVKEI_KOJIAK)` (L185)

> Table: Service Contract-Work Project (サービス契約-工事案件)

| # | Type | Code |
|---|------|------|
| 1 | SET | `db_KU_T_SVKEI_KOJIAK = new JBSbatSQLAccess(commonItem, D_TBL_NAME_KU_T_SVKEI_KOJIAK)` // DB SQL access class generation — [-> CONSTANT "KU_T_SVKEI_KOJIAK"] |

**Block 2.6** — [NEW] `(KK_T_TK_HOSHIKI_KEI)` (L186)

> Table: Supply Form Contract (提供方式契約)

| # | Type | Code |
|---|------|------|
| 1 | SET | `db_KK_T_TK_HOSHIKI_KEI = new JBSbatSQLAccess(commonItem, D_TBL_NAME_KK_T_TK_HOSHIKI_KEI)` // DB SQL access class generation — [-> CONSTANT "KK_T_TK_HOSHIKI_KEI"] |

**Block 2.7** — [NEW] `(KK_T_SVC_KEI)` (L188)

> Table: Service Contract (サービス契約) — ANK-1429-00-00対応, 2013.03.21 T.TORIKAI ADD

| # | Type | Code |
|---|------|------|
| 1 | SET | `db_KK_T_SVC_KEI = new JBSbatSQLAccess(commonItem, D_TBL_NAME_KK_T_SVC_KEI)` // DB SQL access class generation — [-> CONSTANT "KK_T_SVC_KEI"] |

**Block 3** — [END] `(Tool Generation Complete)` (L190)

> End of generated SQL access class initialization block.

**Block 4** — [END] `(Return)` (L192)

> Method completes, returning `void` to the caller.

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `SOD` | Acronym | Service Order Data — telecom order fulfillment data that tracks service orders, changes, and completions for K-Opticom's fiber-optic network |
| `KK_T_SVKEI_KAISEN_UW` | Table | Service Contract Line Details (サービス契約回線内詳) — detailed breakdown of service contracts by line, tracking which specific lines are associated with each contract |
| `KK_T_ADCHG` | Table | Address Change (住所変更) — records of address change requests and their status for customer premises |
| `KK_T_ADCHG_DTL` | Table | Address Change Details (住所変更詳細) — line-level details of address change records, including old/new address fields and change dates |
| `KK_T_KJ_FIN_WK` | Table | Work Completion Work (工事完了ワーク) — work order completion tracking table, records when physical installation/repair work is completed at a customer site |
| `KU_T_SVKEI_KOJIAK` | Table | Service Contract-Work Project (サービス契約-工事案件) — joins service contracts to work project orders, linking billing data to field work |
| `KK_T_TK_HOSHIKI_KEI` | Table | Supply Form Contract (提供方式契約) — records the service supply/form of contract (e.g., fiber type, bandwidth tier, service level agreement) |
| `KK_T_SVC_KEI` | Table | Service Contract (サービス契約) — master service contract table, the root entity for all customer service agreements |
| `JBSbatSQLAccess` | Class | Database SQL Access framework class — provides table-level database operations (select, insert, update, delete) for batch processing |
| `JBSbatCommonItem` | Class | Batch common parameter item — carries shared batch execution context (batch ID, date, connection info) across the batch framework |
| `JBSbatBusinessService` | Class | Parent batch business service framework — provides common batch lifecycle methods (`initial`, `execute`, `terminal`, `setCommonInfo`) |
| `JBSbatKKAdChgCstScreenKidou` | Batch | Address Change Status Movement batch — the coordinating batch process that invokes this SOD update extraction as one of its sub-components |
| `FTTH` | Business term | Fiber To The Home — fiber-optic broadband internet service offered by K-Opticom |
| `setCommonInfo` | Method | Framework method that registers common batch parameters for use throughout the batch processing lifecycle |
| `D_TBL_NAME_KK_T_SVKEI_KAISEN_UW` | Constant | Table name constant — value `"KK_T_SVKEI_KAISEN_UW"` |
| `D_TBL_NAME_KK_T_ADCHG` | Constant | Table name constant — value `"KK_T_ADCHG"` |
| `D_TBL_NAME_KK_T_ADCHG_DTL` | Constant | Table name constant — value `"KK_T_ADCHG_DTL"` |
| `D_TBL_NAME_KK_T_KJ_FIN_WK` | Constant | Table name constant — value `"KK_T_KJ_FIN_WK"` |
| `D_TBL_NAME_KU_T_SVKEI_KOJIAK` | Constant | Table name constant — value `"KU_T_SVKEI_KOJIAK"` |
| `D_TBL_NAME_KK_T_TK_HOSHIKI_KEI` | Constant | Table name constant — value `"KK_T_TK_HOSHIKI_KEI"` |
| `D_TBL_NAME_KK_T_SVC_KEI` | Constant | Table name constant — value `"KK_T_SVC_KEI"` |
| ADCHG_DTL_SBT_CD_SVC_KEI_NO | Constant | Address Change Detail Sub Type Code Service Key — value `"01"` (service key classification for address change details) |
| `KK_SELECT_026` | Constant | SQL definition key — key identifier for a pre-defined SQL query in the framework's SQL management registry |
| `OM-2013-0000735` | Change ID | Change management ticket — related to the `ADCHG_DTL_SBT_CD_SVC_KEI_NO` constant addition (2013.09.08) |
| `ST2-2013-0001434` | Change ID | Change management ticket — related to adding `KK_T_ADCHG` table access (2013.03.16, 星野) |
| `ST2-2013-0001008` | Change ID | Change management ticket — related to adding `KK_T_ADCHG_DTL` table access (2013.03.01, OKITA) |
| `ANK-1429-00-00` | Change ID | Change management ticket — related to adding `KK_T_SVC_KEI` table access (2013.03.21, T.TORIKAI) |
