# Business Logic — JBSbatKKSmtvlRnkiInfCst.initial() [20 LOC]

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

## 1. Role

### JBSbatKKSmtvlRnkiInfCst.initial()

This method serves as the **initialization entry point** for the "Smart Balance Linkage Information Extraction" batch component (スマートバリュールー連携情報抽出部品). It is part of the K-Opticom customer base system's batch processing infrastructure, specifically responsible for preparing DB access objects before any actual data extraction or business logic is executed.

The method delegates common batch parameter setup to its parent class `JBSbatBusinessService.setCommonInfo()`, which configures the standard shared batch context (connection info, thread settings, message resources, etc.) into the provided `commonItem` parameter.

Following parameter setup, the method instantiates five `JBSbatSQLAccess` objects — one for each database table that this batch component needs to interact with during its lifecycle. These include tables for service contract line details (`KK_T_SVKEI_KAISEN_UW`), address change details (`KK_T_ADCHG_DTL`), work completion work tables (`KK_T_KJ_FIN_WK`), service contract/project cases (`KU_T_SVKEI_KOJIAK`), and service contracts (`KK_T_SVC_KEI`).

This component is consumed exclusively by the **Address Change Registration Data Extraction (画面起動)** batch process (`JBSbatKKAdChgCstScreenKidou`), where it is instantiated as `execObjSmtvl` and its `initial()` method is called as part of a chain of component initializations. The overall address change batch handles address modifications for K-Opticom customers, including Smart Balance linkage updates and place number changes.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["initial(commonItem)"])

    STEP1["setCommonInfo
(super.setCommonInfo)"]
    STEP2["db_KK_T_SVKEI_KAISEN_UW =
new JBSbatSQLAccess
(KK_T_SVKEI_KAISEN_UW)"]
    STEP3["db_KK_T_ADCHG_DTL =
new JBSbatSQLAccess
(KK_T_ADCHG_DTL)"]
    STEP4["db_KK_T_KJ_FIN_WK =
new JBSbatSQLAccess
(KK_T_KJ_FIN_WK)"]
    STEP5["db_KU_T_SVKEI_KOJIAK =
new JBSbatSQLAccess
(KU_T_SVKEI_KOJIAK)"]
    STEP6["db_KK_T_SVC_KEI =
new JBSbatSQLAccess
(KK_T_SVC_KEI)"]
    END_NODE(["Return / Next"])

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

**Processing Summary:**

This method follows a linear, sequential initialization pattern with no conditional branches. It performs two types of operations:

1. **Parent initialization**: Calls `super.setCommonInfo(commonItem)` to configure shared batch infrastructure parameters.
2. **SQL Access instantiation**: Creates five `JBSbatSQLAccess` objects, each bound to a specific database table. These access objects serve as the data access layer handles used by other methods within `JBSbatKKSmtvlRnkiInfCst` for querying and updating the respective tables.

The method always executes all six steps in order — there are no early returns, conditional skips, or error-handling branches within this method itself. Any exceptions from SQL access creation or parent initialization propagate up to the caller.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `commonItem` | `JBSbatCommonItem` | Batch common parameter message — the shared batch context carrying connection information, thread settings, message resources, and other infrastructure-level configuration required by all batch components in the K-Opticom customer base system. |

**Instance Fields Read:** None. This method does not read any instance fields; it only writes to them (the `db_*` fields).

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| U | `JBSbatBusinessService.setCommonInfo` | - | - | Sets common batch configuration parameters via the parent class (Update to batch context) |

### Direct DB Access Object Creations (used by subsequent methods):

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `new JBSbatSQLAccess(...)` | - | `KK_T_SVKEI_KAISEN_UW` | Creates SQL access handle for Service Contract Line Details table (used by other methods in this component) |
| - | `new JBSbatSQLAccess(...)` | - | `KK_T_ADCHG_DTL` | Creates SQL access handle for Address Change Details table (used by other methods in this component) |
| - | `new JBSbatSQLAccess(...)` | - | `KK_T_KJ_FIN_WK` | Creates SQL access handle for Work Completion Work table (used by other methods in this component) |
| - | `new JBSbatSQLAccess(...)` | - | `KU_T_SVKEI_KOJIAK` | Creates SQL access handle for Service Contract / Project Case table (used by other methods in this component) |
| - | `new JBSbatSQLAccess(...)` | - | `KK_T_SVC_KEI` | Creates SQL access handle for Service Contract table (used by other methods in this component) |

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Batch: `JBSbatKKAdChgCstScreenKidou` | `JBSbatKKAdChgCstScreenKidou.initial()` → `this.execObjSmtvl.initial(commonItem)` where `execObjSmtvl` is `JBSbatKKSmtvlRnkiInfCst` | `setCommonInfo [U] batchContext`; SQLAccess → `KK_T_SVKEI_KAISEN_UW`, `KK_T_ADCHG_DTL`, `KK_T_KJ_FIN_WK`, `KU_T_SVKEI_KOJIAK`, `KK_T_SVC_KEI` |

**Caller Context:** `JBSbatKKAdChgCstScreenKidou` is the "Address Change Registration Data Extraction (Screen Startup)" batch component. It orchestrates multiple sub-components for handling address change operations, including Smart Balance linkage information extraction (`JBSbatKKSmtvlRnkiInfCst`), address change data extraction (`JBSbatKKAdChgAddDataCst`), SOD update information extraction (`JBSbatKKSodUpdInfCst`), and place number change linkage (`JBSbatKKPlaceNoChgRnkiInfCst`). This component is one of several parallel initialization targets within the address change batch's `initial()` method.

## 6. Per-Branch Detail Blocks

**Block 1** — [CALL] `(parent initialization)` (L142)

> Calls the parent class method to configure shared batch parameters. This sets up the common infrastructure context (connection info, thread settings, message resources) required by all batch components.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `super.setCommonInfo(commonItem)` // Set common batch parameters — configures shared batch context via parent class |

**Block 2** — [CALL x5] `(SQL Access instantiation)` (L145–L154)

> Instantiates five `JBSbatSQLAccess` objects, one per database table this component needs. Each access object encapsulates the connection and SQL definition key for its respective table.

| # | Type | Code |
|---|------|------|
| 1 | SET | `db_KK_T_SVKEI_KAISEN_UW = new JBSbatSQLAccess(commonItem, D_TBL_NAME_KK_T_SVKEI_KAISEN_UW)` // Create SQL access for Service Contract Line Details table |
| 2 | SET | `db_KK_T_ADCHG_DTL = new JBSbatSQLAccess(commonItem, D_TBL_NAME_KK_T_ADCHG_DTL)` // Create SQL access for Address Change Details table [→ KK_T_ADCHG_DTL = "KK_T_ADCHG_DTL"] (ST2-2013-0001008对应 20130301 OKITA ADD) |
| 3 | SET | `db_KK_T_KJ_FIN_WK = new JBSbatSQLAccess(commonItem, D_TBL_NAME_KK_T_KJ_FIN_WK)` // Create SQL access for Work Completion Work table |
| 4 | SET | `db_KU_T_SVKEI_KOJIAK = new JBSbatSQLAccess(commonItem, D_TBL_NAME_KU_T_SVKEI_KOJIAK)` // Create SQL access for Service Contract / Project Case table |
| 5 | SET | `db_KK_T_SVC_KEI = new JBSbatSQLAccess(commonItem, D_TBL_NAME_KK_T_SVC_KEI)` // Create SQL access for Service Contract table [ANK-1429-00-00 2013.03.21 T.TORIKAI ADD] |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `commonItem` | Field | Batch common parameter message — shared batch context carrying connection info, thread settings, message resources, and infrastructure configuration for all batch components |
| `JBSbatCommonItem` | Class | Batch common item — framework class carrying shared batch execution parameters across all batch components |
| `JBSbatSQLAccess` | Class | SQL access object — framework class that provides database connectivity and SQL execution for a specific table |
| `KK_T_SVKEI_KAISEN_UW` | Table | Service Contract Line Details — internal detail records for service contract line items, used for tracking service breakdown within a contract |
| `KK_T_ADCHG_DTL` | Table | Address Change Details — detailed records of address change operations performed on customer accounts |
| `KK_T_KJ_FIN_WK` | Table | Work Completion Work — work table tracking the completion status of installation/maintenance work orders |
| `KU_T_SVKEI_KOJIAK` | Table | Service Contract / Project Case — links between service contracts and project cases for cross-referencing |
| `KK_T_SVC_KEI` | Table | Service Contract — master table for customer service contracts |
| `Smart Balance` | Business term | スマートバリュー — a bundled telecom service offering by K-Opticom combining internet, phone, and other services |
| `連携情報` (Renkei Johou) | Field | Linkage information — data shared or synchronized between related systems/services |
| `抽出` (Chushutsu) | Field | Extraction — the batch process of retrieving and exporting data from the database |
| `住所変更` (Juusho Henkou) | Field | Address Change — the business process of modifying a customer's registered address |
| `登録` (Touroku) | Field | Registration — the process of recording data into the system |
| `画面起動` (Gamen Kidou) | Field | Screen Startup — a batch process variant triggered from a user interface screen rather than scheduled |
| `初期処理` (Shoki Shori) | Field | Initial Processing — setup/initialization phase of a component's lifecycle |
| `JBSbatBusinessService` | Class | Base batch service class — parent class providing shared batch service functionality including `setCommonInfo()` |
| `setCommonInfo` | Method | Set common info — configures shared batch parameters in the common item |
| `SC Code` | Pattern | Service Component code — typically follows pattern `[A-Z]{3}\d{4}[A-Z]\d{3}(SC|CBS)` in method/class names |
