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

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.business.service.JBSbatKKPlaceNoChgRnkiInfCst` |
| Layer | Service Component (CC/Common Component) |
| Module | `service` (Package: `eo.business.service`) |

## 1. Role

### JBSbatKKPlaceNoChgRnkiInfCst.initial()

This method performs the **initialization of the "No Change Place" (住所変更不変更) service notification batch component**. In the K-Opticom customer core system, when a customer changes their registered address, the system must notify all affected service contracts. However, some service contracts do not need to be modified solely because of the address change (e.g., services where the physical location is irrelevant). This method is the entry point that prepares the `JBSbatKKPlaceNoChgRnkiInfCst` component for such a batch processing scenario — it registers the instance within the batch processing pipeline so that downstream processing can determine whether a particular service line item requires no modification and skip further address-change processing accordingly.

The method acts as an **initialization step** in a broader batch workflow orchestrated by `JBSbatKKAdChgCstScreenKidou` (住所変更顧客画面移動 — Address Change Customer Screen Move). This orchestrator initializes multiple service components (SOD update, SMTEL update, place-no-change notification, etc.) sequentially and then dispatches them for actual execution. `initial()` specifically configures the database access handles needed by this component to read and write to the service detail tables during the address-change batch run.

As a **delegated batch component**, `initial()` follows a consistent pattern across the codebase: set common batch parameters via the parent class and instantiate `JBSbatSQLAccess` handlers for every table that the component's downstream `execute()` method will need to query or update.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["initial(JBSbatCommonItem commonItem)"])
    START --> SET_INFO["setCommonInfo(commonItem)"]
    SET_INFO --> SQL1["new JBSbatSQLAccess for KK_T_SVKEI_KAISEN_UW"]
    SQL1 --> SQL2["new JBSbatSQLAccess for KK_T_ADCHG_DTL"]
    SQL2 --> SQL3["new JBSbatSQLAccess for KK_T_KJ_FIN_WK"]
    SQL3 --> SQL4["new JBSbatSQLAccess for KU_T_SVKEI_KOJIAK"]
    SQL4 --> SQL5["new JBSbatSQLAccess for KK_T_KKTK_SVC_KEI"]
    SQL5 --> SQL6["new JBSbatSQLAccess for KK_T_SVC_KEI"]
    SQL6 --> END_NODE(["Return void / Next Step"])
```

**Step-by-step description:**

1. **Call `super.setCommonInfo(commonItem)`** — Passes the batch common parameters to the parent class `JBSbatBusinessService`, which registers shared context (job ID, logging, transaction handle, etc.) needed by all batch components.

2. **Create `JBSbatSQLAccess` for `KK_T_SVKEI_KAISEN_UW`** — Initializes a database access handler for the service detail output table (service detail work table). This table stores the output/results of service detail processing.

3. **Create `JBSbatSQLAccess` for `KK_T_ADCHG_DTL`** — Initializes a database access handler for the address change detail table. This table contains line-level details of address change records (including the "switch date" confirmation field used to skip already-processed records).

4. **Create `JBSbatSQLAccess` for `KK_T_KJ_FIN_WK`** — Initializes a database access handler for the accounting finish work table. This is a work table used during accounting/financial processing steps of the batch.

5. **Create `JBSbatSQLAccess` for `KU_T_SVKEI_KOJIAK`** — Initializes a database access handler for the service detail individual table. This table holds individual service contract details (service number, execution date, etc.).

6. **Create `JBSbatSQLAccess` for `KK_T_KKTK_SVC_KEI`** — Initializes a database access handler for the KK/TK service detail table. KK/TK likely refers to "K-Opticom/TK" (Tokyo Cable) service contract lines — a consolidated service detail table for inter-operator service records.

7. **Create `JBSbatSQLAccess` for `KK_T_SVC_KEI`** — Initializes a database access handler for the service detail table. This is the primary service contract line item table.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `commonItem` | `JBSbatCommonItem` | Batch common parameter message — carries shared batch execution context including job ID, batch run timestamp, transaction handle, logging configuration, and database connection pool references. This is passed to the parent class and to every `JBSbatSQLAccess` constructor to ensure all database handlers share the same transaction and job context. |

**Instance fields initialized by this method:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `db_KK_T_SVKEI_KAISEN_UW` | `JBSbatSQLAccess` | Database access handler for `KK_T_SVKEI_KAISEN_UW` (Service Detail Output Work Table) |
| `db_KK_T_ADCHG_DTL` | `JBSbatSQLAccess` | Database access handler for `KK_T_ADCHG_DTL` (Address Change Detail Table) |
| `db_KK_T_KJ_FIN_WK` | `JBSbatSQLAccess` | Database access handler for `KK_T_KJ_FIN_WK` (Accounting Finish Work Table) |
| `db_KU_T_SVKEI_KOJIAK` | `JBSbatSQLAccess` | Database access handler for `KU_T_SVKEI_KOJIAK` (Service Detail Individual Table) |
| `db_KK_T_KKTK_SVC_KEI` | `JBSbatSQLAccess` | Database access handler for `KK_T_KKTK_SVC_KEI` (KK/TK Service Detail Table) |
| `db_KK_T_SVC_KEI` | `JBSbatSQLAccess` | Database access handler for `KK_T_SVC_KEI` (Service Detail Table) |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `JBSbatBusinessService.setCommonInfo` | - | - | Calls `setCommonInfo` in the parent class to register batch common context (job ID, transaction, logging) |
| - | `JBSbatSQLAccess` constructor | - | `KK_T_SVKEI_KAISEN_UW` | Creates a database access handler for the service detail output work table |
| - | `JBSbatSQLAccess` constructor | - | `KK_T_ADCHG_DTL` | Creates a database access handler for the address change detail table |
| - | `JBSbatSQLAccess` constructor | - | `KK_T_KJ_FIN_WK` | Creates a database access handler for the accounting finish work table |
| - | `JBSbatSQLAccess` constructor | - | `KU_T_SVKEI_KOJIAK` | Creates a database access handler for the service detail individual table |
| - | `JBSbatSQLAccess` constructor | - | `KK_T_KKTK_SVC_KEI` | Creates a database access handler for the KK/TK service detail table |
| - | `JBSbatSQLAccess` constructor | - | `KK_T_SVC_KEI` | Creates a database access handler for the service detail table |

**Notes:** This method performs **zero actual CRUD operations** on the database. It only initializes `JBSbatSQLAccess` objects — these are factory patterns that prepare the SQL access layer for use by downstream `execute()` methods. The actual insert/select/update/delete operations happen later when the `execute()` method is invoked on the same component instance, using these pre-initialized database handlers.

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Batch: `JBSbatKKAdChgCstScreenKidou` | `JBSbatKKAdChgCstScreenKidou.initial()` → `this.execObjPlaceNoChg.initial(commonItem)` | N/A (pure initialization, no terminal CRUD in this method) |

**Call chain details for `JBSbatKKAdChgCstScreenKidou`:**
This batch class orchestrates the full address-change registration flow. In its `initial()` method, it instantiates `JBSbatKKPlaceNoChgRnkiInfCst` as `execObjPlaceNoChg` and calls `initial()` to prepare it. Later, in the `execute()` method, the orchestrator calls `execObjPlaceNoChg.execute()` to run the actual address-change-no-change processing logic.

The downstream processing from this method's initialized handlers reads from and writes to:
- `KK_T_ADCHG_DTL` — Address Change Detail (Read during execute to confirm switch date registration)
- `KK_T_SVKEI_KAISEN_UW` — Service Detail Output Work (Write results)
- `KU_T_SVKEI_KOJIAK` — Service Detail Individual (Read for service number info)
- `KK_T_KKTK_SVC_KEI` — KK/TK Service Detail (Read for KK/TK service lines)
- `KK_T_SVC_KEI` — Service Detail (Read for service contract lines)

## 6. Per-Branch Detail Blocks

This method contains **no conditional branches** (no if/else, no loops, no switch/case). It executes a fixed, linear sequence of setup operations. All operations are side-effect-free initialization.

**Block 1** — [SEQUENTIAL EXECUTION] (L161)

> The entire method body is a linear initialization sequence. There are no conditional branches, loops, or exception handlers. Each statement is an independent setup step that prepares the component for downstream batch processing.

| # | Type | Code | Comment |
|---|------|------|---------|
| 1 | CALL | `super.setCommonInfo(commonItem)` | 共通パラメータを設定します (Set common parameters) — Registers batch context in parent class [-> L168] |
| 2 | SET | `db_KK_T_SVKEI_KAISEN_UW = new JBSbatSQLAccess(commonItem, D_TBL_NAME_KK_T_SVKEI_KAISEN_UW)` | DBアクセスクラスを生成します (Generate DB access class) [-> D_TBL_NAME_KK_T_SVKEI_KAISEN_UW="KK_T_SVKEI_KAISEN_UW"] [-> L169] |
| 3 | SET | `db_KK_T_ADCHG_DTL = new JBSbatSQLAccess(commonItem, D_TBL_NAME_KK_T_ADCHG_DTL)` | 共通パラメータを設定します (Set common parameters) [ST2-2013-0001008対応 20130301 OKITA ADD] [-> D_TBL_NAME_KK_T_ADCHG_DTL="KK_T_ADCHG_DTL"] [-> L171] |
| 4 | SET | `db_KK_T_KJ_FIN_WK = new JBSbatSQLAccess(commonItem, D_TBL_NAME_KK_T_KJ_FIN_WK)` | DBアクセスクラスを生成します (Generate DB access class) [-> D_TBL_NAME_KK_T_KJ_FIN_WK="KK_T_KJ_FIN_WK"] [-> L173] |
| 5 | SET | `db_KU_T_SVKEI_KOJIAK = new JBSbatSQLAccess(commonItem, D_TBL_NAME_KU_T_SVKEI_KOJIAK)` | DBアクセスクラスを生成します (Generate DB access class) [-> D_TBL_NAME_KU_T_SVKEI_KOJIAK="KU_T_SVKEI_KOJIAK"] [-> L174] |
| 6 | SET | `db_KK_T_KKTK_SVC_KEI = new JBSbatSQLAccess(commonItem, D_TBL_NAME_KK_T_KKTK_SVC_KEI)` | DBアクセスクラスを生成します (Generate DB access class) [-> D_TBL_NAME_KK_T_KKTK_SVC_KEI="KK_T_KKTK_SVC_KEI"] [-> L175] |
| 7 | SET | `db_KK_T_SVC_KEI = new JBSbatSQLAccess(commonItem, D_TBL_NAME_KK_T_SVC_KEI)` | DBアクセスクラスを生成します (Generate DB access class) [OM-2013-0000735 2013.09.08 T.TORIKAI ADD] [-> D_TBL_NAME_KK_T_SVC_KEI="KK_T_SVC_KEI"] [-> L177] |

**Block 1.1** — [CONSTANT RESOLUTION] (L46–L64)

> Table name constants resolved from class-level static final fields:

| # | Constant | Resolved Value | Description |
|---|----------|----------------|-------------|
| 1 | `D_TBL_NAME_KK_T_SVKEI_KAISEN_UW` | `"KK_T_SVKEI_KAISEN_UW"` | Service detail output work table |
| 2 | `D_TBL_NAME_KK_T_ADCHG_DTL` | `"KK_T_ADCHG_DTL"` | Address change detail table |
| 3 | `D_TBL_NAME_KK_T_KJ_FIN_WK` | `"KK_T_KJ_FIN_WK"` | Accounting finish work table |
| 4 | `D_TBL_NAME_KU_T_SVKEI_KOJIAK` | `"KU_T_SVKEI_KOJIAK"` | Service detail individual table |
| 5 | `D_TBL_NAME_KK_T_KKTK_SVC_KEI` | `"KK_T_KKTK_SVC_KEI"` | KK/TK (K-Opticom/Tokyo Cable) service detail table |
| 6 | `D_TBL_NAME_KK_T_SVC_KEI` | `"KK_T_SVC_KEI"` | Service detail table |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `initial` | Method | Initialization method — sets up the component's state (common parameters, DB handlers) before the main `execute()` method runs |
| `commonItem` | Parameter | Batch common parameter message (バッチ共通パラメータ電文) — shared context for batch execution including job ID, transaction handle, logging |
| `JBSbatSQLAccess` | Class | Database access handler class — a wrapper that manages SQL operations for a specific table within the batch processing framework |
| `JBSbatBusinessService` | Class | Parent service component class — provides common batch infrastructure including `setCommonInfo()`, logging, transaction management |
| `KK_T_SVKEI_KAISEN_UW` | Table | Service detail output work table — stores results of service detail processing work |
| `KK_T_ADCHG_DTL` | Table | Address change detail table — stores line-level details of address change records (adchg_no, mskm_no, switch date confirmation) |
| `KK_T_KJ_FIN_WK` | Table | Accounting finish work table — work table for accounting/financial processing steps |
| `KU_T_SVKEI_KOJIAK` | Table | Service detail individual table — holds individual service contract details (service number, execution date) |
| `KK_T_KKTK_SVC_KEI` | Table | KK/TK service detail table — consolidated service detail for K-Opticom and Tokyo Cable inter-operator service records |
| `KK_T_SVC_KEI` | Table | Service detail table — primary service contract line item table |
| `JBSbatKKAdChgCstScreenKidou` | Class | Address change customer screen move batch — the orchestrating batch that coordinates multiple service notification components (SOD update, SMTEL update, place-no-change, etc.) |
| `ADCHG` | Acronym | Address Change (住所変更) — the business process of updating a customer's registered address and notifying affected service contracts |
| `SVKEI` | Acronym | Service Detail (サービス詳細) — refers to service contract line items |
| `UW` | Acronym | Work/Work Table (作業) — suffix indicating a work/staging table |
| `KJ` | Acronym | Accounting (会計) — refers to financial/accounting processing |
| `KOJIAK` | Acronym | Individual Execution (個別実行) — refers to individual/line-level service execution records |
| `KK` | Acronym | K-Opticom — the primary service provider in this system |
| `TK` | Acronym | Tokyo Cable — a sister/acquired cable operator whose services are integrated into the K-Opticom system |
| `MSKM_NO` | Field | Service contract number (サービス契約番号) — unique identifier for a customer's service contract |
| `ADCHG_NO` | Field | Address change number (住所変更番号) — unique identifier for an address change record |
| `SETUP` | Business term | Setup — refers to the initialization phase where database access handlers are created before actual processing begins |
| `place_no_chg` | Domain term | No Change Place (変更不変更) — refers to service lines that do NOT need modification when a customer's address is changed |
