# Business Logic — JBSbatKKAdChgAddDataCst.setDslKaisenTgSvkei() [89 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.business.service.JBSbatKKAdChgAddDataCst` |
| Layer | Batch (Service Component within batch processing) |
| Module | `service` (Package: `eo.business.service`) |

## 1. Role

### JBSbatKKAdChgAddDataCst.setDslKaisenTgSvkei()

This method populates an output map (`JBSbatServiceInterfaceMap`) with transfer-source line target service contract data for a service contract address change batch process. The business operation corresponds to the **transfer-source service contract line items** (移転元回線対象サービス契約), which represents service contract records that originate from a port-in/port-out line transfer where this customer is the receiving (transfer-source) party.

The method implements a **service-type routing/dispatch pattern**: it branches on the service code (`svcCd`) to populate service-type-specific fields. It supports three service types — **Net (Internet, code "01")**, **Tel (Telephone, code "02")**, and **TV (Television, code "03")** — each of which receives three fields: the service contract number, the line breakdown usage end date, and the service contract update datetime.

If the service code does not match any of these three types, the method silently ignores the request (no-op). The one field (`ITNM_SVC_KEI_KAISEN_UCWK_NO` — transfer-source service contract line breakdown number) is set regardless of service type, before the branching logic.

All field assignments use a **safe-write pattern**: the method first checks if the target map already contains a non-blank value; if not, it writes the input parameter value (or an empty string if the parameter itself is blank). This ensures downstream processes receive a defined value in every case.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["setDslKaisenTgSvkei params"])

    START --> READ1["Read outMap ITNM_SVC_KEI_KAISEN_UCWK_NO"]
    READ1 --> COND1{isBlank value?}

    COND1 -->|true| SET_BLANK1["outMap ITNM_SVC_KEI_KAISEN_UCWK_NO blank"]
    COND1 -->|false| SET_VAL1["outMap ITNM_SVC_KEI_KAISEN_UCWK_NO from param"]

    SET_BLANK1 --> SVC_CD_CHECK{svcCd equals?}
    SET_VAL1 --> SVC_CD_CHECK

    SVC_CD_CHECK -->|SVC_CD_NET 01 Net| NET_BRANCH["Net Internet branch"]
    SVC_CD_CHECK -->|SVC_CD_TEL 02 Tel| TEL_BRANCH["Tel Telephone branch"]
    SVC_CD_CHECK -->|SVC_CD_TV 03 TV| TV_BRANCH["TV Television branch"]
    SVC_CD_CHECK -->|else| ELSE_IGNORE["Ignore no-op"]

    NET_BRANCH --> NET_S1["Set ITNM_SVC_KEI_NO_NET with blank check"]
    NET_S1 --> NET_S2["Set KAISEN_UCWK_USE_ENDYMD_NET with blank check"]
    NET_S2 --> NET_S3["Set ITNM_KISN_TG_SVKEI_UPD_DTM_NET with blank check"]
    NET_S3 --> END_NODE(["Return / Next"])

    TEL_BRANCH --> TEL_S1["Set ITNM_SVC_KEI_NO_TEL with blank check"]
    TEL_S1 --> TEL_S2["Set KAISEN_UCWK_USE_ENDYMD_TEL with blank check"]
    TEL_S2 --> TEL_S3["Set ITNM_KISN_TG_SVKEI_UPD_DTM_TEL with blank check"]
    TEL_S3 --> END_NODE

    TV_BRANCH --> TV_S1["Set ITNM_SVC_KEI_NO_TV with blank check"]
    TV_S1 --> TV_S2["Set KAISEN_UCWK_USE_ENDYMD_TV with blank check"]
    TV_S2 --> TV_S3["Set ITNM_KISN_TG_SVKEI_UPD_DTM_TV with blank check"]
    TV_S3 --> END_NODE

    ELSE_IGNORE --> END_NODE
```

**Constant Resolution:**

| Constant | Value | Business Meaning |
|----------|-------|------------------|
| `JKKBatConst.SVC_CD_NET` | `"01"` | Internet service code |
| `JKKBatConst.SVC_CD_TEL` | `"02"` | Telephone service code |
| `JKKBatConst.SVC_CD_TV` | `"03"` | Television service code |

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `outMap` | `JBSbatServiceInterfaceMap` | Output data map used to carry service contract field values to downstream batch processing stages. Fields are set via key-value pairs using string constants from `JBSbatKKIFM101`. |
| 2 | `svcCd` | `String` | Service code that identifies the service type. Determines the branching path: `"01"` for Net (Internet), `"02"` for Tel (Telephone), `"03"` for TV (Television). Any other value causes the method to skip type-specific field assignment. |
| 3 | `itnmSvcKeiKaisenUcwkNo` | `String` | Transfer-source service contract line breakdown number (移転元サービス契約回線内訳番号). An internal tracking identifier for the service contract line item originating from a line transfer. Set regardless of service type. |
| 4 | `itnmSvcKeiNo` | `String` | Transfer-source service contract number (移転元サービス契約番号). The contract identifier for the originating service. Set only when `svcCd` matches a supported type (Net, Tel, or TV). |
| 5 | `kaisenUcwkUseEndymd` | `String` | Line breakdown usage end date (回線内訳使用終了年月日). The date (year-month-day format) when the line breakdown usage expires/ends. Set only when `svcCd` matches a supported type. |
| 6 | `itnmKisnTgSvkeiUpdDtm` | `String` | Transfer-source line target service contract update datetime (移転元回線対象サービス契約更新年月日時分秒). The full timestamp of the most recent update to the transfer-source line target service contract record. Set only when `svcCd` matches a supported type. |

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `JBSbatServiceInterfaceMap.getString` | - | - | Reads existing value from the output map at key `ITNM_SVC_KEI_KAISEN_UCWK_NO` to check if it is already populated |
| - | `JBSbatKKAdChgAddDataCst.isBlank` | - | - | Utility method used throughout to check whether a string value is null or blank |
| R | `JBSbatServiceInterfaceMap.getString` | - | - | Reads existing value from the output map for each field before deciding whether to overwrite |
| W | `JBSbatServiceInterfaceMap.setString` | - | - | Writes a value to the output map for `ITNM_SVC_KEI_KAISEN_UCWK_NO` (non-type-specific, set once) |
| W | `JBSbatServiceInterfaceMap.setString` | - | - | Writes the service contract number to type-specific keys (e.g., `ITNM_SVC_KEI_NO_NET`, `ITNM_SVC_KEI_NO_TEL`, `ITNM_SVC_KEI_NO_TV`) |
| W | `JBSbatServiceInterfaceMap.setString` | - | - | Writes the line breakdown usage end date to type-specific keys (e.g., `KAISEN_UCWK_USE_ENDYMD_NET`, `KAISEN_UCWK_USE_ENDYMD_TEL`, `KAISEN_UCWK_USE_ENDYMD_TV`) |
| W | `JBSbatServiceInterfaceMap.setString` | - | - | Writes the transfer-source line target service contract update datetime to type-specific keys (e.g., `ITNM_KISN_TG_SVKEI_UPD_DTM_NET`, `ITNM_KISN_TG_SVKEI_UPD_DTM_TEL`, `ITNM_KISN_TG_SVKEI_UPD_DTM_TV`) |

**Classification rationale:**
- **R (Read):** All `getString()` calls on `outMap` are reads to check whether a target field is already populated (the method only writes if the existing value is blank).
- **W (Write):** All `setString()` calls on `outMap` are writes that populate or preserve the field in the output data map. No database reads, creates, updates, or deletes are performed — this is a pure in-memory data transformer within the batch process.

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Batch: JBSbatKKAdChgAddDataCst | `JBSbatKKAdChgAddDataCst.execute()` -> `setDslKaisenTgSvkei(outMap, svcCd, itnmSvcKeiKaisenUcwkNo, ...)` | `setString [W] JBSbatServiceInterfaceMap`, `getString [R] JBSbatServiceInterfaceMap` |

**Call chain detail for caller #1:**
The method is invoked from the `execute()` method of `JBSbatKKAdChgAddDataCst` itself. The caller passes the `outMap` along with field values read via `getString()` from DSL (Data Service Line) target service contract info objects (e.g., `dslKisnTgSvkeiInfo.getString(JBSbatKK_T_SVC_KEI.SVC_CD)`). The `execute()` method orchestrates the overall address change batch processing, and `setDslKaisenTgSvkei` serves as a focused data-population step for the transfer-source line target service contract section of the output.

**Terminal operations from this method:**
- `setString [-]` — writes 13 field values into `outMap` (1 non-type-specific + 3 per service type × 3 supported types)
- `getString [-]` — reads 2 values from `outMap` (one pre-branch check + one per type-specific if-guard)
- `isBlank [-]` — called 13 times as guard checks before each write decision

## 6. Per-Branch Detail Blocks

### Block 1 — IF (pre-branch universal field set) (L1690)

> Set the transfer-source service contract line breakdown number regardless of service type. Uses a defensive check: only write if the target field in `outMap` is currently blank.

| # | Type | Code |
|---|------|------|
| 1 | READ | `outMap.getString(JBSbatKKIFM101.ITNM_SVC_KEI_KAISEN_UCWK_NO)` | read existing value for key `ITNM_SVC_KEI_KAISEN_UCWK_NO` ("移転元サービス契約回線内訳番号") |
| 2 | CALL | `isBlank(...)` | guard: check if existing value is blank |

**Block 1.1 — IF** `(isBlank(existingValue))` (L1691)

> The target field is blank — proceed to set it from the input parameter.

| # | Type | Code |
|---|------|------|
| 1 | IF | `isBlank(itnmSvcKeiKaisenUcwkNo)` | check if input parameter is blank |

**Block 1.1.1 — IF** `(isBlank(itnmSvcKeiKaisenUcwkNo))` (L1692)

> Input parameter is blank — write empty string to ensure the downstream process sees an explicit blank value.

| # | Type | Code |
|---|------|------|
| 1 | SET | `outMap.setString(JBSbatKKIFM101.ITNM_SVC_KEI_KAISEN_UCWK_NO, "")` | write empty string for key "ITNM_SVC_KEI_KAISEN_UCWK_NO" |

**Block 1.1.2 — ELSE** (L1694)

> Input parameter has a value — propagate it into the output map.

| # | Type | Code |
|---|------|------|
| 1 | SET | `outMap.setString(JBSbatKKIFM101.ITNM_SVC_KEI_KAISEN_UCWK_NO, itnmSvcKeiKaisenUcwkNo)` | write input parameter value to key "ITNM_SVC_KEI_KAISEN_UCWK_NO" |

### Block 2 — IF-ELSEIF-ELSE (service type routing) (L1698)

> Route to service-type-specific field assignments based on `svcCd`. Three supported types: Net ("01"), Tel ("02"), TV ("03"). Any other value is silently ignored.

| # | Type | Code |
|---|------|------|
| 1 | IF | `JKKBatConst.SVC_CD_NET.equals(svcCd)` [SVC_CD_NET="01" Net (Internet)] | branch for Internet service |

**Block 2.1 — IF branch: SVC_CD_NET = "01" (Net/Internet)** (L1702)

> Handle Net (Internet) service type fields. Three type-specific keys are populated, each with a blank-check guard.

**Block 2.1.1 — IF** `(isBlank(itnmSvcKeiNo))` (L1705)

> Set the transfer-source service contract number for Net.

| # | Type | Code |
|---|------|------|
| 1 | IF | `isBlank(itnmSvcKeiNo)` | check input |
| 2 | SET (inner-IF) | `outMap.setString(JBSbatKKIFM101.ITNM_SVC_KEI_NO_NET, "")` | write blank to key "ITNM_SVC_KEI_NO_NET" (移転元サービス契約番号（ネット）) |
| 3 | SET (inner-ELSE) | `outMap.setString(JBSbatKKIFM101.ITNM_SVC_KEI_NO_NET, itnmSvcKeiNo)` | write param to key "ITNM_SVC_KEI_NO_NET" |

**Block 2.1.2 — IF** `(isBlank(kaisenUcwkUseEndymd))` (L1713)

> Set the line breakdown usage end date for Net.

| # | Type | Code |
|---|------|------|
| 1 | IF | `isBlank(kaisenUcwkUseEndymd)` | check input |
| 2 | SET (inner-IF) | `outMap.setString(JBSbatKKIFM101.KAISEN_UCWK_USE_ENDYMD_NET, "")` | write blank to key "KAISEN_UCWK_USE_ENDYMD_NET" (回線内訳使用終了年月日（ネット）) |
| 3 | SET (inner-ELSE) | `outMap.setString(JBSbatKKIFM101.KAISEN_UCWK_USE_ENDYMD_NET, kaisenUcwkUseEndymd)` | write param to key "KAISEN_UCWK_USE_ENDYMD_NET" |

**Block 2.1.3 — IF** `(isBlank(itnmKisnTgSvkeiUpdDtm))` (L1721)

> Set the transfer-source line target service contract update datetime for Net.

| # | Type | Code |
|---|------|------|
| 1 | IF | `isBlank(itnmKisnTgSvkeiUpdDtm)` | check input |
| 2 | SET (inner-IF) | `outMap.setString(JBSbatKKIFM101.ITNM_KISN_TG_SVKEI_UPD_DTM_NET, "")` | write blank to key "ITNM_KISN_TG_SVKEI_UPD_DTM_NET" (移転元回線対象サービス契約更新年月日時分秒（ネット）) |
| 3 | SET (inner-ELSE) | `outMap.setString(JBSbatKKIFM101.ITNM_KISN_TG_SVKEI_UPD_DTM_NET, itnmKisnTgSvkeiUpdDtm)` | write param to key "ITNM_KISN_TG_SVKEI_UPD_DTM_NET" |

**Block 2.2 — ELSE-IF** `(JKKBatConst.SVC_CD_TEL.equals(svcCd))` [SVC_CD_TEL="02" Tel (Telephone)] (L1727)

> Handle Tel (Telephone) service type fields. Three type-specific keys with `_TEL` suffix.

**Block 2.2.1 — IF** `(isBlank(itnmSvcKeiNo))` (L1730)

> Set the transfer-source service contract number for Tel.

| # | Type | Code |
|---|------|------|
| 1 | SET (inner-IF) | `outMap.setString(JBSbatKKIFM101.ITNM_SVC_KEI_NO_TEL, "")` | write blank to key "ITNM_SVC_KEI_NO_TEL" (移転元サービス契約番号（電話）) |
| 2 | SET (inner-ELSE) | `outMap.setString(JBSbatKKIFM101.ITNM_SVC_KEI_NO_TEL, itnmSvcKeiNo)` | write param to key "ITNM_SVC_KEI_NO_TEL" |

**Block 2.2.2 — IF** `(isBlank(kaisenUcwkUseEndymd))` (L1738)

> Set the line breakdown usage end date for Tel.

| # | Type | Code |
|---|------|------|
| 1 | SET (inner-IF) | `outMap.setString(JBSbatKKIFM101.KAISEN_UCWK_USE_ENDYMD_TEL, "")` | write blank to key "KAISEN_UCWK_USE_ENDYMD_TEL" (回線内訳使用終了年月日（電話）) |
| 2 | SET (inner-ELSE) | `outMap.setString(JBSbatKKIFM101.KAISEN_UCWK_USE_ENDYMD_TEL, kaisenUcwkUseEndymd)` | write param to key "KAISEN_UCWK_USE_ENDYMD_TEL" |

**Block 2.2.3 — IF** `(isBlank(itnmKisnTgSvkeiUpdDtm))` (L1746)

> Set the transfer-source line target service contract update datetime for Tel.

| # | Type | Code |
|---|------|------|
| 1 | SET (inner-IF) | `outMap.setString(JBSbatKKIFM101.ITNM_KISN_TG_SVKEI_UPD_DTM_TEL, "")` | write blank to key "ITNM_KISN_TG_SVKEI_UPD_DTM_TEL" (移転元回線対象サービス契約更新年月日時分秒（電話）) |
| 2 | SET (inner-ELSE) | `outMap.setString(JBSbatKKIFM101.ITNM_KISN_TG_SVKEI_UPD_DTM_TEL, itnmKisnTgSvkeiUpdDtm)` | write param to key "ITNM_KISN_TG_SVKEI_UPD_DTM_TEL" |

**Block 2.3 — ELSE-IF** `(JKKBatConst.SVC_CD_TV.equals(svcCd))` [SVC_CD_TV="03" TV (Television)] (L1752)

> Handle TV (Television) service type fields. Three type-specific keys with `_TV` suffix.

**Block 2.3.1 — IF** `(isBlank(itnmSvcKeiNo))` (L1755)

> Set the transfer-source service contract number for TV.

| # | Type | Code |
|---|------|------|
| 1 | SET (inner-IF) | `outMap.setString(JBSbatKKIFM101.ITNM_SVC_KEI_NO_TV, "")` | write blank to key "ITNM_SVC_KEI_NO_TV" (移転元サービス契約番号（TV）) |
| 2 | SET (inner-ELSE) | `outMap.setString(JBSbatKKIFM101.ITNM_SVC_KEI_NO_TV, itnmSvcKeiNo)` | write param to key "ITNM_SVC_KEI_NO_TV" |

**Block 2.3.2 — IF** `(isBlank(kaisenUcwkUseEndymd))` (L1763)

> Set the line breakdown usage end date for TV.

| # | Type | Code |
|---|------|------|
| 1 | SET (inner-IF) | `outMap.setString(JBSbatKKIFM101.KAISEN_UCWK_USE_ENDYMD_TV, "")` | write blank to key "KAISEN_UCWK_USE_ENDYMD_TV" (回線内訳使用終了年月日（TV）) |
| 2 | SET (inner-ELSE) | `outMap.setString(JBSbatKKIFM101.KAISEN_UCWK_USE_ENDYMD_TV, kaisenUcwkUseEndymd)` | write param to key "KAISEN_UCWK_USE_ENDYMD_TV" |

**Block 2.3.3 — IF** `(isBlank(itnmKisnTgSvkeiUpdDtm))` (L1771)

> Set the transfer-source line target service contract update datetime for TV.

| # | Type | Code |
|---|------|------|
| 1 | SET (inner-IF) | `outMap.setString(JBSbatKKIFM101.ITNM_KISN_TG_SVKEI_UPD_DTM_TV, "")` | write blank to key "ITNM_KISN_TG_SVKEI_UPD_DTM_TV" (移転元回線対象サービス契約更新年月日時分秒（TV）) |
| 2 | SET (inner-ELSE) | `outMap.setString(JBSbatKKIFM101.ITNM_KISN_TG_SVKEI_UPD_DTM_TV, itnmKisnTgSvkeiUpdDtm)` | write param to key "ITNM_KISN_TG_SVKEI_UPD_DTM_TV" |

**Block 2.4 — ELSE** (L1775)

> Service code is not Net, Tel, or TV. No type-specific fields are set — this is an intentional no-op (commented as "ignore").

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `// ignore` | no operation — unsupported service code, fields are not set |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `svcCd` | Field | Service Code — a numeric code identifying the service type. `"01"` = Net (Internet), `"02"` = Tel (Telephone), `"03"` = TV (Television) |
| `itnmSvcKeiKaisenUcwkNo` | Field | Transfer-source Service Contract Line Breakdown Number (移転元サービス契約回線内訳番号) — an internal tracking identifier for a line item belonging to a transfer-source service contract |
| `itnmSvcKeiNo` | Field | Transfer-source Service Contract Number (移転元サービス契約番号) — the primary contract identifier for the originating (transfer-source) service contract |
| `kaisenUcwkUseEndymd` | Field | Line Breakdown Usage End Date (回線内訳使用終了年月日) — the date when the line breakdown usage period ends (format: year-month-day) |
| `itnmKisnTgSvkeiUpdDtm` | Field | Transfer-source Line Target Service Contract Update Datetime (移転元回線対象サービス契約更新年月日時分秒) — the full timestamp of the most recent update to the transfer-source line target service contract record |
| `outMap` | Field | Output Map (`JBSbatServiceInterfaceMap`) — the shared data carrier object used to pass field values between batch processing steps |
| `JKKBatConst.SVC_CD_NET` | Constant | Service Code = "01" (Net/Internet service) |
| `JKKBatConst.SVC_CD_TEL` | Constant | Service Code = "02" (Tel/Telephone service) |
| `JKKBatConst.SVC_CD_TV` | Constant | Service Code = "03" (TV/Television service) |
| `JBSbatKKIFM101.ITNM_SVC_KEI_KAISEN_UCWK_NO` | Constant | Map key: "ITNM_SVC_KEI_KAISEN_UCWK_NO" for the transfer-source service contract line breakdown number |
| `JBSbatKKIFM101.ITNM_SVC_KEI_NO_NET` | Constant | Map key: "ITNM_SVC_KEI_NO_NET" for the Net service contract number |
| `JBSbatKKIFM101.ITNM_SVC_KEI_NO_TEL` | Constant | Map key: "ITNM_SVC_KEI_NO_TEL" for the Tel service contract number |
| `JBSbatKKIFM101.ITNM_SVC_KEI_NO_TV` | Constant | Map key: "ITNM_SVC_KEI_NO_TV" for the TV service contract number |
| `JBSbatKKIFM101.KAISEN_UCWK_USE_ENDYMD_NET` | Constant | Map key: "KAISEN_UCWK_USE_ENDYMD_NET" for the Net line breakdown usage end date |
| `JBSbatKKIFM101.KAISEN_UCWK_USE_ENDYMD_TEL` | Constant | Map key: "KAISEN_UCWK_USE_ENDYMD_TEL" for the Tel line breakdown usage end date |
| `JBSbatKKIFM101.KAISEN_UCWK_USE_ENDYMD_TV` | Constant | Map key: "KAISEN_UCWK_USE_ENDYMD_TV" for the TV line breakdown usage end date |
| `JBSbatKKIFM101.ITNM_KISN_TG_SVKEI_UPD_DTM_NET` | Constant | Map key: "ITNM_KISN_TG_SVKEI_UPD_DTM_NET" for the Net transfer-source line target service contract update datetime |
| `JBSbatKKIFM101.ITNM_KISN_TG_SVKEI_UPD_DTM_TEL` | Constant | Map key: "ITNM_KISN_TG_SVKEI_UPD_DTM_TEL" for the Tel transfer-source line target service contract update datetime |
| `JBSbatKKIFM101.ITNM_KISN_TG_SVKEI_UPD_DTM_TV` | Constant | Map key: "ITNM_KISN_TG_SVKEI_UPD_DTM_TV" for the TV transfer-source line target service contract update datetime |
| 移転元 (Itenmoto) | Business term | Transfer-source — the party receiving a line in a port-in/port-out line transfer |
| 回線内訳 (Kaisen Uwaku) | Business term | Line breakdown — a sub-division of a service contract line item (e.g., a specific service feature or extension) |
| 回線内訳番号 (Kaisen Uwaku No.) | Business term | Line breakdown number — the unique identifier for a line breakdown item |
| 回線内訳使用終了 (Kaisen Uwaku Shryo Shuryo) | Business term | Line breakdown usage end — the termination date of a line breakdown item's usage period |
| 回線対象サービス契約 (Kisn Tgosa SVC Keiyaku) | Business term | Line target service contract — the service contract record that is the target of a line-related operation (e.g., transfer, change) |
| 住所変更 (Juusho Henkou) | Business term | Address change — the batch process that handles customer address change operations, under which this method operates |
| 移転 (Iten) | Business term | Transfer — the port-in/port-out line transfer operation where lines move between service providers |
| Net | Business term | Internet service (FTTH/broadband) — the "01" service code path |
| Tel | Business term | Telephone service (POTS/ISDN) — the "02" service code path |
| TV | Business term | Television service (cable/broadcast) — the "03" service code path |
| `isBlank()` | Method | Utility method that returns true if the given string is null or has zero length / contains only whitespace |
| `JBSbatServiceInterfaceMap` | Class | Batch service interface map — a key-value data carrier used throughout the batch processing framework to pass field values between processing steps |
