# Business Logic — JBSbatKKOpsvkeiDelTrgtChsht.setDelTrgtDataMllist() [21 LOC]

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

## 1. Role

### JBSbatKKOpsvkeiDelTrgtChsht.setDelTrgtDataMllist()

This method prepares the deletion target data configuration for a **mailing list** (メーリングリスト) in the context of batch-based service contract cancellation operations. It is part of a family of methods under the `JBSbatKKOpsvkeiDelTrgtChsht` class, which collectively handle deletion target data setup across different service types (mailing list, fixed global IP, etc.). The method follows a **delegation and preparation pattern** — it does not perform actual deletion but constructs an output map carrying the parameters needed by downstream processing to identify which mailing list entry should be deleted. Specifically, it retrieves the mailing list name from the input message, validates that it is present, initializes a new output map, populates it with the deletion processing type (`DEL_TRAN_SBT`), deletion target sub-type (set to constant `"05"` for mailing list name), and the mailing list name itself. If the mailing list name is null or empty, the method performs a no-op, allowing the caller to skip this deletion path entirely. This method serves as a **branching entry point** within the broader deletion workflow, called from `JBSbatKKOpsvkeiDelTrgtChsht.execute()` to conditionally add mailing list deletion data to the output bean.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["setDelTrgtDataMllist(inMap, outputBean)"])
    START --> GET_MLLIST["Get mllist = inMap.getString(MLLIST_NM)"]
    GET_MLLIST --> CHECK_MLLIST{mllist != null<br>AND<br>mllist is not empty}
    CHECK_MLLIST -->|Yes| INIT["outMap = initData(inMap)"]
    CHECK_MLLIST -->|No| END_NODE(["Return / End"])
    INIT --> SET_DEL_TRAN["outMap.setString(DEL_TRAN_SBT, getDelTranSbt(inMap))"]
    SET_DEL_TRAN --> SET_DEL_TRGT["outMap.setString(DEL_TRGT_SBT, DEL_TRGT_SBT_MLLIST_NM)"]
    SET_DEL_TRGT --> SET_MLLIST_NAME["outMap.setString(MLLIST_NM, mllist)"]
    SET_MLLIST_NAME --> SET_OUTFLG["outMap.setOutFlg(true)"]
    SET_OUTFLG --> ADD_OUTMAP["outputBean.addOutMapList(outMap)"]
    ADD_OUTMAP --> END_NODE
```

**Constant Resolution:**
- `DEL_TRGT_SBT_MLLIST_NM = "05"` — Constant defining the deletion target sub-type for mailing list name entries. This value is resolved from `JBSbatKKOpsvkeiDelTrgtChsht` class field (line 60).
- `JBSbatKK_T_OPSVKEI_ISP.MLLIST_NM = "MLLIST_NM"` — Field name constant for the mailing list name column in the ops_kei_isp (ops services ISP) entity/table.

The method implements a single conditional branch: if the mailing list name is both non-null and non-empty, the method proceeds to construct and populate the deletion target output map; otherwise, it returns immediately without any action (a guard clause pattern for optional deletion).

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `inMap` | `JBSbatServiceInterfaceMap` | Input message container carrying the business data for batch processing. It holds the mailing list name (`MLLIST_NM`) and other fields needed to determine the deletion processing subtype via `getDelTranSbt()`. This is the primary source of business input for this method. |
| 2 | `outputBean` | `JBSbatOutputItem` | Output information container that accumulates prepared deletion target data. The method adds the constructed `outMap` to this bean via `addOutMapList()`, making the deletion request available to downstream batch stages. |

**Instance fields / external state:**
| Source | Field / State | Business Description |
|--------|--------------|---------------------|
| `DEL_TRGT_SBT_MLLIST_NM` | Static constant = `"05"` | Hardcoded deletion target subtype identifier for mailing list name entries. |

## 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_ISP.getString` | - | `KK_T_OPSVKEI_ISP` (MLLIST_NM column) | Reads mailing list name from input map using the `MLLIST_NM` column key |
| C | `JBSbatKKOpsvkeiDelTrgtChsht.initData` | - | - | Initializes an empty output map (`JBSbatServiceInterfaceMap`) from the input map, preparing a container for deletion parameters |
| R | `JBSbatKKOpsvkeiDelTrgtChsht.getDelTranSbt` | - | - | Retrieves the deletion processing subtype from the input map, determining what kind of deletion is being performed |
| C | `JBSbatServiceInterfaceMap.setString` | - | - | Sets the deletion processing subtype (`DEL_TRAN_SBT`) in the output map |
| C | `JBSbatServiceInterfaceMap.setString` | - | - | Sets the deletion target subtype to `"05"` (mailing list name) in the output map |
| C | `JBSbatServiceInterfaceMap.setString` | - | - | Sets the mailing list name value in the output map |
| C | `JBSbatServiceInterfaceMap.setOutFlg` | - | - | Marks the output map entry as an active output flag (`true`), signaling this entry should be processed |
| C | `JBSbatOutputItem.addOutMapList` | - | - | Adds the prepared deletion target map to the output bean's accumulated list for downstream batch consumption |

**Classification rationale:**
- **R (Read)**: `getString()` calls on the input map and called methods that only read/derive data (`getDelTranSbt`).
- **C (Create)**: `initData()` creates a new output map; multiple `setString()` calls populate it; `setOutFlg(true)` flags it for output; `addOutMapList()` commits it to the output bean.
- **No U/D operations**: This method does not directly update or delete database records; it prepares the data structures for downstream processing to perform actual deletions.

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Batch: `JBSbatKKOpsvkeiDelTrgtChsht` | `JBSbatKKOpsvkeiDelTrgtChsht.execute()` -> `JBSbatKKOpsvkeiDelTrgtChsht.setDelTrgtDataMllist` | `addOutMapList [C]`, `setOutFlg [-]`, `setString [-]`, `getDelTranSbt [R]`, `initData [-]` |

**Call chain description:**
This method is called directly from `JBSbatKKOpsvkeiDelTrgtChsht.execute()`, which is the main batch execution entry point for the deletion target data setup process. The execute method orchestrates multiple `setDelTrgtData*` methods (for mailing list, fixed IP, etc.) as part of preparing the full set of deletion targets. This method's terminal operations ultimately feed into `addOutMapList`, which commits the deletion target entry to the output bean for downstream batch processing stages.

## 6. Per-Branch Detail Blocks

**Block 1** — IF `(mllist != null AND ! "".equals(mllist))` (L317)

> Guard clause: only proceeds if the mailing list name is present and non-empty. If the mailing list name is absent, this deletion path is silently skipped.

| # | Type | Code |
|---|------|------|
| 1 | SET | `String mllist = inMap.getString(JBSbatKK_T_OPSVKEI_ISP.MLLIST_NM)` // Retrieve mailing list name from input map [-> MLLIST_NM = "MLLIST_NM"] |
| 2 | EXEC | Check: `mllist != null` // Guard: value must not be null |
| 3 | EXEC | Check: `! "".equals(mllist)` // Guard: value must not be empty string |

**Block 1.1** — IF-THEN `(mllist is valid)` (L320)

> Initialization and construction of the deletion target output map.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `initData(inMap)` // Initialize a new output map from input; creates empty `JBSbatServiceInterfaceMap` container |
| 2 | SET | `outMap = initData(inMap)` // Local variable assignment |

**Block 1.1.1** — EXEC `[DEL_TRAN_SBT]` (L322)

> Set the deletion processing subtype by delegating to `getDelTranSbt()`.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `getDelTranSbt(inMap)` // Derive the deletion processing subtype from input |
| 2 | EXEC | `outMap.setString(JBSbatKKIFM160.DEL_TRAN_SBT, getDelTranSbt(inMap))` // Set deletion processing type in output map |

**Block 1.1.2** — EXEC `[DEL_TRGT_SBT]` (L323)

> Set the deletion target subtype to the constant value `"05"`, identifying this as a mailing list name deletion.

| # | Type | Code |
|---|------|------|
| 1 | SET | `DEL_TRGT_SBT_MLLIST_NM = "05"` [-> Constant: deletion target sub-type for mailing list name] |
| 2 | EXEC | `outMap.setString(JBSbatKKIFM160.DEL_TRGT_SBT, DEL_TRGT_SBT_MLLIST_NM)` // Set deletion target subtype = "05" |

**Block 1.1.3** — EXEC `[MLLIST_NM]` (L324)

> Set the actual mailing list name value into the output map.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `outMap.setString(JBSbatKKIFM160.MLLIST_NM, mllist)` // Set the retrieved mailing list name value |

**Block 1.1.4** — EXEC `[setOutFlg]` (L325)

> Flag the entry as active output.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `outMap.setOutFlg(true)` // Mark this deletion entry as active for output |

**Block 1.1.5** — EXEC `[addOutMapList]` (L326)

> Commit the prepared deletion target data to the output bean for downstream consumption.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `outputBean.addOutMapList(outMap)` // Add the completed deletion target map to output bean list |

**Block 2** — ELSE / FALL-THROUGH `(mllist is null or empty)` (L317)

> No action is taken. The method returns void without modifying the output bean. This allows the calling `execute()` method to branch across multiple `setDelTrgtData*` methods — only the ones with valid data contribute output entries.

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `mllist` | Field | Mailing list — a named collection of subscriber records used in batch email distribution operations |
| `MLLIST_NM` | Field | Mailing list name — the unique identifier/name of a mailing list entry in the `KK_T_OPSVKEI_ISP` (ops services ISP) entity/table |
| `DEL_TRAN_SBT` | Field | Deletion processing subtype — indicates the kind of deletion operation (e.g., which processing path within the deletion workflow) |
| `DEL_TRGT_SBT` | Field | Deletion target subtype — classifies what kind of data entity is being targeted for deletion |
| `DEL_TRGT_SBT_MLLIST_NM` | Constant | Deletion target subtype for mailing list name — fixed value `"05"` identifying that the deletion target is a mailing list name entry |
| `inMap` | Field | Input message map — the business data container passed into the method, carrying fields from the input transaction |
| `outputBean` | Field | Output item bean — accumulates all prepared deletion target entries for downstream batch processing |
| `outMap` | Field | Output map — a temporary `JBSbatServiceInterfaceMap` holding the constructed deletion target data before committing to `outputBean` |
| `setOutFlg` | Field | Output flag — a boolean flag (`true`) marking an entry as active/valid for downstream processing |
| `KK_T_OPSVKEI_ISP` | Entity | Ops services ISP table — the database entity/table storing operations service configuration including mailing list names |
| `initData` | Method | Initialize data — creates an empty output map from the input, providing a clean container for building output entries |
| `getDelTranSbt` | Method | Get deletion processing subtype — derives which type of deletion processing should be applied based on input data |
| `setDelTrgtDataMllist` | Method | Set deletion target data (mailing list) — prepares mailing list deletion target configuration for batch processing |
| `JBSbatServiceInterfaceMap` | Class | Service interface map — a generic key-value map used for inter-component data transfer in the batch service layer |
| `JBSbatOutputItem` | Class | Output item — a container that accumulates output maps from multiple batch processing branches for downstream consumption |
| メーリングリスト | Japanese | Mailing list — a named collection of subscriber records |
| 消去対象データ設定処理 | Japanese | Deletion target data setup processing — prepares data structures identifying what should be deleted |
| 入力電文 | Japanese | Input message — the transaction data passed into the service method |
| 出力情報 | Japanese | Output information — the accumulated result data |
| 消去処理種類 | Japanese | Deletion processing type/subtype — the kind of deletion operation |
| 消去対象種類 | Japanese | Deletion target type/subtype — what category of entity is being deleted |
| メールリスト名 | Japanese | Mailing list name — the name/identifier of the mailing list |
