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

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.business.service.JBSbatKKOpsvkeiDelTrgtChsht` |
| Layer | Service (Batch — `eo.business.service` package, extends `JBSbatBusinessService`) |
| Module | `service` (Package: `eo.business.service`) |

## 1. Role

### JBSbatKKOpsvkeiDelTrgtChsht.getDelTranSbt()

This method determines the **deletion processing type** (消去処理種別) that dictates how a target deletion batch operation should proceed for an opt-in service contract line item. It serves as a shared utility method within the K-Opticom EO Customer Core System, specifically for the **Opt-in Service Contract Cancellation Target Extraction** feature (`JBSbatKKOpsvkeiDelTrgtChsht`). 

The method implements a **conditional routing pattern**: it inspects whether a Service Order Data (SOD) has already been issued for the current customer record. If an SOD has been issued (`ORDER_UM_FLG` is present and non-empty in the input interface map), the method returns deletion type "3", indicating a combined deletion-and-aging-update operation (消去SOD発行・エイジング更新). If no SOD has been issued, it returns deletion type "2", indicating a simple aging update operation (エイジング更新).

This method is **called by three target-data-setting methods** (`setDelTrgtDataEmail`, `setDelTrgtDataMllist`, `setDelTrgtDataMyHp`) during batch processing of deletion targets. It has no CRUD or service component (SC) interactions — it is a pure business decision method. Its return value is set into the output interface map via the `JBSbatKKIFM160.DEL_TRAN_SBT` key and passed downstream to subsequent batch processing stages.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
START(["getDelTranSbt(inMap)"])
GET_FLG["Get ORDER_UM_FLG from inMap"]
CHECK_FLAG{Order flag set and not empty}
BRANCH_REG_SOD["delTranSbt = 3 - Delete SOD issuance and Aging Update"]
BRANCH_NO_REG_SOD["delTranSbt = 2 - Aging Update"]
RETURN_VAL["Return delTranSbt"]
END_NODE(["End"])
START --> GET_FLG --> CHECK_FLAG
CHECK_FLAG -->|True| BRANCH_REG_SOD --> RETURN_VAL --> END_NODE
CHECK_FLAG -->|False| BRANCH_NO_REG_SOD --> RETURN_VAL --> END_NODE
```

The processing logic is straightforward:

1. **Retrieve flag**: The method retrieves the `ORDER_UM_FLG` (order issuance presence/absence flag) from the input `JBSbatServiceInterfaceMap`. If this flag is present and not set, no SOD has been issued and the SOD issuance conditions in the database have no matching records.
2. **Conditional branch**:
   - **If flag is non-null and non-empty** (`orderUmFlg != null && !"".equals(orderUmFlg)`): The SOD has already been issued. The method returns `"3"` (消去SOD発行・エイジング更新 — Delete SOD issuance & Aging Update). This triggers a combined deletion of the SOD record followed by aging update.
   - **Else (flag is null or empty)**: No SOD has been issued. The method returns `"2"` (エイジング更新 — Aging Update). This triggers only an aging update without SOD deletion.
3. **Return**: The determined processing type string is returned to the caller.

**Constant Resolution:**

| Constant Name | Actual Value | Business Meaning |
|---------------|-------------|------------------|
| `DEL_TRAN_SBT_AGING_UPD` | `"2"` | Aging Update — simple aging update without SOD deletion |
| `DEL_TRAN_SBT_DEL_SOD_AGING_UPD` | `"3"` | Delete SOD issuance & Aging Update — combined SOD deletion and aging update |
| `KEY_ORDER_UM_FLG` | `"ORDER_UM_FLG"` | Key in the interface map that holds the order issuance flag |

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `inMap` | `JBSbatServiceInterfaceMap` | The input message (入力電文) carrying batch processing parameters, including the `ORDER_UM_FLG` key that indicates whether an SOD (Service Order Data) has already been issued for the current customer line item. This map serves as both input carrier and context for the batch service pipeline. |

**External State / Instance Fields Read:** None. This method is stateless and relies entirely on its input parameter.

## 4. CRUD Operations / Called Services

This method performs **no CRUD operations** and **calls no external services or SC/CBS components**. It is a pure business-decision utility that only reads from the input map and returns a string constant.

| No | Method Called | Type | SC Code | Entity / DB | Operation Description |
|----|---------------|------|---------|-------------|----------------------|
| 1 | `inMap.get(KEY_ORDER_UM_FLG)` | N/A | N/A | N/A | Reads the order issuance flag from the input interface map. This is an in-memory map access, not a database query. |

**Notes:** This method does not interact with any database tables or service components. It simply evaluates a flag value from the batch input and returns a processing type code that is used by the caller to determine downstream batch processing behavior.

## 5. Dependency Trace

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

No screen/batch entry points found within 8 hops. Direct callers found: 3 methods.

This method is a **leaf-level utility** called exclusively from three internal target-data-setting methods within the same class. These callers are responsible for preparing deletion target records for different channel types (Email, Mail list, My Home Page/URL). No external screens or batch entry points call this method directly.

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Batch: `setDelTrgtDataEmail()` | `JBSbatKKOpsvkeiDelTrgtChsht.setDelTrgtDataEmail()` -> `getDelTranSbt()` | None (utility only) |
| 2 | Batch: `setDelTrgtDataMllist()` | `JBSbatKKOpsvkeiDelTrgtChsht.setDelTrgtDataMllist()` -> `getDelTranSbt()` | None (utility only) |
| 3 | Batch: `setDelTrgtDataMyHp()` | `JBSbatKKOpsvkeiDelTrgtChsht.setDelTrgtDataMyHp()` -> `getDelTranSbt()` | None (utility only) |

**Notes:** All callers are private batch methods within `JBSbatKKOpsvkeiDelTrgtChsht`. They invoke `getDelTranSbt()` to populate the `DEL_TRAN_SBT` field in the output interface map for email address, mail alias, URL, webID, POPID, and mail list name deletion targets. The method has no terminal CRUD endpoints.

## 6. Per-Branch Detail Blocks

### Block 1 — [VARIABLE DECLARATION] (L397)

> Initialize the local return variable.

| # | Type | Code |
|---|------|------|
| 1 | SET | `delTranSbt = null` |

### Block 2 — [SET / EXTRACT] (L400–L401)

> Retrieve the order issuance presence/absence flag (オーダ発行有無フラグ番号取得) from the input map. The comment notes that if this value is NOT "NULL", the number of SOD issuance condition records matching the criteria is set.

| # | Type | Code |
|---|------|------|
| 1 | SET | `orderUmFlg = inMap.get(KEY_ORDER_UM_FLG)` // KEY = "ORDER_UM_FLG" |

### Block 3 — [IF CONDITION] `orderUmFlg != null && !"".equals(orderUmFlg)` (L403)

> Check if the order issuance flag is present and non-empty. This indicates that the registered SOD has already been issued (登録SOD発行済み).

| # | Type | Code |
|---|------|------|
| 1 | SET | `delTranSbt = DEL_TRAN_SBT_DEL_SOD_AGING_UPD` // = "3" — 消去SOD発行・エイジング更新 (Delete SOD issuance & Aging Update) |

**Block 3.1** — [ELSE — nested else block] (L406)

> The SOD has not been issued (登録SOD未発行). Set to simple aging update.

| # | Type | Code |
|---|------|------|
| 1 | SET | `delTranSbt = DEL_TRAN_SBT_AGING_UPD` // = "2" — エイジング更新 (Aging Update) |

### Block 4 — [RETURN] (L409)

> Return the determined deletion processing type.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return delTranSbt` |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `DEL_TRAN_SBT` | Field | Deletion processing type — codes "2" and "3" determine whether an SOD record is deleted during the aging update batch process |
| `DEL_TRAN_SBT_AGING_UPD` | Constant | Deletion processing type code "2" — Aging Update only, no SOD deletion |
| `DEL_TRAN_SBT_DEL_SOD_AGING_UPD` | Constant | Deletion processing type code "3" — Combined SOD deletion and aging update |
| `ORDER_UM_FLG` | Field | Order issuance presence/absence flag — indicates whether a Service Order Data (SOD) has been issued for this customer line item |
| ` Aging Update` (エイジング更新) | Business term | Aged processing update — a batch operation that updates the aging/timing status of service contract records during deletion processing |
| SOD | Acronym | Service Order Data — the order/registration data entity in the K-Opticom customer core system |
| `inMap` | Field | Input message (入力電文) — a `JBSbatServiceInterfaceMap` carrying batch processing parameters between pipeline stages |
| `JBSbatServiceInterfaceMap` | Technical | Framework service interface map — a key-value data carrier used for inter-component communication within the batch service pipeline |
| Opt-in Service Contract | Business term | Service contracts where customers have explicitly opted in (e.g., email delivery, URL access, webID/POPID authentication) |
| `DEL_TRGT_SBT` | Field | Deletion target type — classifies what kind of data is being deleted (email address, mail alias, URL, webID, POPID, etc.) |
| `JBSbatKKIFM160` | Technical | Inter-face message constants class — contains keys for batch input/output data exchange between service components |
| `JBSbatKK_T_OPSVKEI_ISP` | Technical | Utility table constants — field definitions for the ops service ISP table (`KK_T_OPSVKEI_ISP`) |
| Batch processing (バッチ処理) | Business term | Background batch job processing — the `eo` customer core system runs batch processes (indicated by the `JBSbat` prefix) for scheduled data operations like deletion target extraction |
| MLAD | Acronym | Mail address — email address field for opt-in email delivery target |
| MLLIST_NM | Field | Mail list name — the name of a mailing list associated with an opt-in service |
