# Business Logic — JBSbatKKOpsvkeiDelTrgtChsht.setDelTrgtData050TelNo() [20 LOC]

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

## 1. Role

### JBSbatKKOpsvkeiDelTrgtChsht.setDelTrgtData050TelNo()

This method configures deletion target data for the "050 Number Plus" (ナンバープラス) telephony service within the K-Opticom customer infrastructure batch deletion pipeline. The 050 number is a virtual telephone number service operated through KDDI/AU, distinct from traditional fixed-line (0abj) numbers. It serves as one of several deletion-target categories in a unified batch deletion framework that handles service contract cancellation workflows across multiple service types (email, My Homepage, mailing list, fixed IP, and 050 telephony).

The method implements a data preparation and dispatch pattern: it reads the 050 telephone number from the input interface map, validates its presence, initializes an output map, and populates it with three key fields — the deletion type (aging update), the deletion target type (050 telephone number), and the actual phone number value — before marking the record as an active deletion target and adding it to the output collection for downstream processing. It acts as a specialized handler invoked by the `execute()` method, which routes incoming service codes to the appropriate deletion configuration sub-method based on the service type.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["setDelTrgtData050TelNo"])
    CHECK_TEL["Extract telNo505 = inMap.getString(n_050_op_telno)"]
    VALIDATE{"telNo505 != null && non-empty?"}
    INIT_DATA["outMap = initData(inMap)"]
    SET_DEL_TYPE["outMap.setString(DEL_TRAN_SBT, DEL_TRAN_SBT_AGING_UPD = 2)<br/>Deletion type = Aging update"]
    SET_DEL_TRGT["outMap.setString(DEL_TRGT_SBT, DEL_TRGT_SBT_050_TELNO = 10)<br/>Deletion target = 050 telephone number"]
    SET_TELNO["outMap.setString(TELNO_050, telNo505)<br/>Set 050 phone number"]
    SET_OUT_FLG["outMap.setOutFlg(true)<br/>Mark as deletion target"]
    ADD_OUTPUT["outputBean.addOutMapList(outMap)<br/>Add to output collection"]
    END_NODE(["Return / Next"])

    START --> CHECK_TEL
    CHECK_TEL --> VALIDATE
    VALIDATE -- true --> INIT_DATA
    VALIDATE -- false --> END_NODE
    INIT_DATA --> SET_DEL_TYPE
    SET_DEL_TYPE --> SET_DEL_TRGT
    SET_DEL_TRGT --> SET_TELNO
    SET_TELNO --> SET_OUT_FLG
    SET_OUT_FLG --> ADD_OUTPUT
    ADD_OUTPUT --> END_NODE
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `inMap` | `JBSbatServiceInterfaceMap` | The input message carrying batch processing context and source data. For this method, it holds the 050 option telephone number field (`n_050_op_telno`) which is the core data needed to configure the deletion target. This map is also passed to `initData()` to produce an output map for downstream processing. |
| 2 | `outputBean` | `JBSbatOutputItem` | The output collection that accumulates deletion target records. The populated `outMap` (containing the 050 phone number deletion configuration) is added here via `addOutMapList()` for subsequent batch deletion operations. |

| # | Field Name | Type | Business Description |
|---|-----------|------|---------------------|
| 1 | `DEL_TRAN_SBT_AGING_UPD` (constant) | `String` | Deletion type code `"2"` — Aging update. Indicates the deletion processing method is an aging (deferred/deleted with aging) update rather than an immediate full deletion. |
| 2 | `DEL_TRGT_SBT_050_TELNO` (constant) | `String` | Deletion target type code `"10"` — 050 telephone number. Classifies this deletion record as targeting a 050 virtual number service. |
| 3 | `JBSbatKK_T_OPSVKEI_TEL.N_050_OP_TELNO` (constant key) | `String` | Map key `"n_050_op_telno"` used to extract the 050 option telephone number from the input map. |
| 4 | `JBSbatKKIFM160.DEL_TRAN_SBT` (constant key) | `String` | Map key for the deletion type field in the output interface map. |
| 5 | `JBSbatKKIFM160.DEL_TRGT_SBT` (constant key) | `String` | Map key for the deletion target type field in the output interface map. |
| 6 | `JBSbatKKIFM160.TELNO_050` (constant key) | `String` | Map key for the 050 telephone number field in the output interface map. |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `JBSbatKK_T_OPSVKEI_TEL.getString` | - | - | Reads the 050 option telephone number (`n_050_op_telno`) from the input interface map |
| C | `JBSbatKKOpsvkeiDelTrgtChsht.initData` | - | - | Initializes and returns a new `JBSbatServiceInterfaceMap` for output data preparation |
| U | `JBSbatServiceInterfaceMap.setString` (DEL_TRAN_SBT) | - | - | Sets the deletion type to `"2"` (aging update) on the output map |
| U | `JBSbatServiceInterfaceMap.setString` (DEL_TRGT_SBT) | - | - | Sets the deletion target type to `"10"` (050 telephone number) on the output map |
| U | `JBSbatServiceInterfaceMap.setString` (TELNO_050) | - | - | Sets the actual 050 telephone number value on the output map |
| U | `JBSbatServiceInterfaceMap.setOutFlg` | - | - | Marks the record as an active deletion target by setting the output flag to `true` |
| C | `JBSbatOutputItem.addOutMapList` | - | - | Adds the fully populated output map to the deletion target output collection for downstream batch processing |

## 5. Dependency Trace

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

No screen/batch entry points found within 8 hops. Direct callers found: 1 methods.
Terminal operations from this method: `addOutMapList` [C], `setOutFlg` [U], `setString` [U], `setString` [U], `setString` [U], `initData` [C], `getString` [R]

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Batch: JBSbatKKOpsvkeiDelTrgtChsht.execute | `execute()` → `setDelTrgtData050TelNo(inMap, outputBean)` | `addOutMapList` [C], `setOutFlg` [U], `setString` [U], `setString` [U], `setString` [U], `initData` [C], `getString` [R] |

The `execute()` method is the main entry point of this batch service class. It dispatches to `setDelTrgtData050TelNo()` when the service code matches `OP_SVC_CD_050_TELNO` (the 050 Number Plus service code). The output map produced by this method flows downstream to the batch deletion pipeline via `addOutMapList()`, where it is consumed by downstream CBS/SC components that perform actual database operations against the 050 telephone number deletion tables.

## 6. Per-Branch Detail Blocks

**Block 1** — [IF] `(telNo505 != null && ! "".equals(telNo505))` (L375)

> Validate that the 050 telephone number is present and non-empty before proceeding with deletion target configuration. If the phone number is null or blank, the method returns immediately without setting any deletion target data.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `telNo505 = inMap.getString(JBSbatKK_T_OPSVKEI_TEL.N_050_OP_TELNO)` // Extract 050 option telephone number from input map [key = "n_050_op_telno"] |
| 2 | IF | `if (telNo505 != null && !"".equals(telNo505))` // Proceed only if phone number is populated [L375] |
| 3 | SET | `outMap = initData(inMap)` // Initialize output map from input [-> initData call] |
| 4 | EXEC | `outMap.setString(JBSbatKKIFM160.DEL_TRAN_SBT, DEL_TRAN_SBT_AGING_UPD)` // Set deletion type = "2" (Aging update) |
| 5 | EXEC | `outMap.setString(JBSbatKKIFM160.DEL_TRGT_SBT, DEL_TRGT_SBT_050_TELNO)` // Set deletion target = "10" (050 telephone number) |
| 6 | EXEC | `outMap.setString(JBSbatKKIFM160.TELNO_050, telNo505)` // Set the actual 050 phone number value |
| 7 | EXEC | `outMap.setOutFlg(true)` // Mark record as deletion target [flag = true] |
| 8 | CALL | `outputBean.addOutMapList(outMap)` // Add output map to output collection |

**Block 2** — [ELSE/IMPLICIT SKIP] (L375)

> If `telNo505` is null or empty, no deletion target data is configured. The method returns `void` with no side effects — the 050 telephone number is simply not added to the deletion target list. This is a valid no-op path for cases where the 050 number was not provisioned for the customer record.

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `n_050_op_telno` | Field | 050 Option Telephone Number — the virtual telephone number assigned under KDDI's 050 service, stored in the input interface map for batch processing |
| 050 Number Plus (ナンバープラス) | Business term | A virtual telephone number service by KDDI/AU that provides a dedicated phone number (starting with 050) independent of any fixed-line connection, enabling business communications over IP |
| `DEL_TRAN_SBT` | Field | Deletion Processing Type — classifies the kind of deletion operation (0=deletion only, 1=delete SOD issuance, 2=aging update, 3=delete SOD issuance + aging update) |
| `DEL_TRGT_SBT` | Field | Deletion Target Type — classifies the category of data being deleted (e.g., 03=mail access, 04=mail alias, 10=050 telephone number, 14=Web ID, 15=POP ID) |
| `DEL_TRAN_SBT_AGING_UPD` | Constant | Deletion type code "2" — Aging update. Indicates a deferred deletion where the record is marked for aging (scheduled for eventual removal) rather than immediate deletion |
| `DEL_TRGT_SBT_050_TELNO` | Constant | Deletion target type code "10" — Identifies this deletion record as targeting a 050 virtual telephone number service |
| `OP_SVC_CD_050_TELNO` | Constant | Service code identifying the 050 Number Plus telephony service, used by `execute()` to route to the correct deletion handler |
| `setOutFlg` | Field/Operation | Output flag — when set to `true`, marks the record as an active deletion target to be processed by downstream batch deletion operations |
| `initData` | Method | Initializes a new `JBSbatServiceInterfaceMap` (output carrier) from the input context, providing a clean map for building deletion target data |
| SOD | Acronym | Service Order Data — telecom order fulfillment entity representing a service order record in K-Opticom's order management system |
| Aging (エージング更新) | Business term | A deferred deletion mechanism where records are flagged for eventual removal rather than being immediately deleted; typically used to maintain audit trails or allow rollback during a grace period |
| `JBSbatServiceInterfaceMap` | Class | Service interface message map — a key-value container used to pass structured data between batch service components |
| `JBSbatOutputItem` | Class | Output item container — accumulates result records (including deletion target configurations) produced by batch processing |
| KK | Acronym | K-Opticom — the telecommunications service provider whose customer infrastructure is managed by this system |