# Business Logic — JFUDslOpSvcKeiCC.getIdoDiv() [17 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `com.fujitsu.futurity.bp.custom.common.JFUDslOpSvcKeiCC` |
| Layer | CC/Common Component |
| Module | `common` (Package: `com.fujitsu.futurity.bp.custom.common`) |

## 1. Role

### JFUDslOpSvcKeiCC.getIdoDiv()

This method performs **transfer classification processing** (異動区分取得処理) — it determines the appropriate "transfer division" (idoDiv) code based on the service contract status of an operational service detail record. It is a shared utility component invoked by a wide range of screen logic classes (KKSV0080, KKSV0081, KKSV0082, KKSV0182, KKSV0568) and data-utilization classes (JKKKktkSvcKeiDataUtil) to populate the transfer division field in service contract data maps before CRUD operations. The method implements a simple **routing/dispatch pattern**: it reads the service contract status from the input map and dispatches to one of two possible transfer division codes. When the status is `"030"` (Completed/Settled — 締結済), it classifies the transfer as an "Option Reservation Cancellation" (00055); for any other status, it defaults to "Option Setup" (00031). This classification is critical because downstream processing (additions, deletions, and updates of service contract details) branches on the transfer division value to determine how to handle the data. The method is called by over 40 methods across the application, making it a foundational shared utility in the service detail DSL processing layer.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["getIdoDiv(opSvcKeiDslMap)"])
    STEP1["Retrieve opSvcKeiDslMap.get(cc_op_svc_kei_stat)"]
    COND{Status equals 030}
    BRANCH1["idoDiv = 00055
Option Reservation Cancellation"]
    BRANCH2["idoDiv = 00031
Option Setup"]
    RETURN["Return idoDiv"]

    START --> STEP1
    STEP1 --> COND
    COND -->|Yes| BRANCH1
    COND -->|No| BRANCH2
    BRANCH1 --> RETURN
    BRANCH2 --> RETURN
```

**Branch Details:**

| Branch | Condition | Constant Resolved | Business Meaning | Result |
|--------|-----------|-------------------|------------------|--------|
| IF | `opSvcKeiDslMap.get("cc_op_svc_kei_stat")` equals `"030"` | `CD00037_030 = "030"` (Completed/Settled — 締結済) | Service contract is in completed/settled state | `idoDiv = "00055"` (Option Reservation Cancellation — オプション予約取消) |
| ELSE | Status is not `"030"` | N/A | Service contract is in any other state (e.g., in-progress, stopped, suspended) | `idoDiv = "00031"` (Option Setup — オプション設定) |

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `opSvcKeiDslMap` | `HashMap` | Operational service contract DSL map — carries the service contract status (`cc_op_svc_kei_stat`) and other DSL-related fields for a service detail line item. The `cc_op_svc_kei_stat` key holds a status code (e.g., `"030"` for Completed/Settled) that determines which transfer division code is assigned. |
| 2 | (instance field read) `CC_OP_SVC_KEI_STAT` | `String` (private static final) | The map key constant `"cc_op_svc_kei_stat"` used to look up the service contract status value within `opSvcKeiDslMap`. |

## 4. CRUD Operations / Called Services

This method performs **no CRUD operations**. It is a pure decision/routing method that reads a single value from the input map, evaluates a conditional, and returns a classification code. No database reads, entity operations, or service component calls are made.

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| — | — | — | — | No database or service component calls. Pure in-memory classification logic. |

## 5. Dependency Trace

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

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

This method is a foundational shared utility called directly by:
- **KKSV0080 / KKSV0081 / KKSV0082 / KKSV0182 / KKSV0568** screen processing classes — called within data preparation methods (e.g., `setHanyoAddInfo`, `setHanyoDelInfo`, `setWribAddInfo`, `setWribDelInfo`, and numbered CC methods like `setKKSV008003CC`) to populate the transfer division field before CRUD operations on service contract detail tables.
- **JKKKktkSvcKeiDataUtil** data utility class — called twice within `getUpdKktkSvcKeiCommnData` for updating common service contract data.
- **KKW00121SFLogic** screen logic class — called within validation/error-checking methods (`checkArea`, `checkKKW00182Error`, `tdisInfoInputKKW00125`, `tdisInfoInputKKW00179`) for T-Dis information input screen validation.

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Screen:KKSV0080 | `setHanyoAddInfo` -> `getIdoDiv` | N/A (no CRUD from this method) |
| 2 | Screen:KKSV0080 | `setHanyoDelInfo` -> `getIdoDiv` | N/A |
| 3 | Screen:KKSV0080 | `setKKSV008003CC` -> `getIdoDiv` | N/A |
| 4 | Screen:KKSV0080 | `setKKSV008005CC` -> `getIdoDiv` | N/A |
| 5 | Screen:KKSV0080 | `setKKSV008006CC` -> `getIdoDiv` | N/A |
| 6 | Screen:KKSV0080 | `setKKSV008008CC` -> `getIdoDiv` | N/A |
| 7 | Screen:KKSV0080 | `setKKSV008009CC` -> `getIdoDiv` | N/A |
| 8 | Screen:KKSV0080 | `setKKSV008011CC` -> `getIdoDiv` | N/A |
| 9 | Screen:KKSV0080 | `setKKSV008015CC` -> `getIdoDiv` | N/A |
| 10 | Screen:KKSV0080 | `setKKSV008017CC` -> `getIdoDiv` | N/A |
| 11 | Screen:KKSV0080 | `setKKSV008018CC` -> `getIdoDiv` | N/A |
| 12 | Screen:KKSV0080 | `setKKSV008022CC` -> `getIdoDiv` | N/A |
| 13 | Screen:KKSV0080 | `setKKSV008036CC` -> `getIdoDiv` | N/A |
| 14 | Screen:KKSV0080 | `setWribAddInfo` -> `getIdoDiv` | N/A |
| 15 | Screen:KKSV0080 | `setWribDelInfo` -> `getIdoDiv` | N/A |

(Note: KKSV0081, KKSV0082, KKSV0182, KKSV0568, JKKKktkSvcKeiDataUtil, and KKW00121SFLogic follow the same pattern — direct callers that use the returned value for downstream processing.)

## 6. Per-Branch Detail Blocks

**Block 1** — [SET] (initialization) (L716)

> Initialize the return variable to null.

| # | Type | Code |
|---|------|------|
| 1 | SET | `idoDiv = null;` // Initialize transfer division variable |

**Block 2** — [IF] `(JFUStrConst.CD00037_030.equals(opSvcKeiDslMap.get(CC_OP_SVC_KEI_STAT)))` [CD00037_030="030"] (Completed/Settled — 締結済) (L719)

> Check if the service contract status is "030" (Completed/Settled). If so, classify as Option Reservation Cancellation.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `opSvcKeiDslMap.get(CC_OP_SVC_KEI_STAT)` // Retrieve status value from map [-> CC_OP_SVC_KEI_STAT="cc_op_svc_kei_stat"] |
| 2 | EXEC | `JFUStrConst.CD00037_030.equals(...)` // Compare with "030" [-> CD00037_030="030"] (Completed/Settled) |

**Block 2.1** — [ELSE-IF / THEN branch — Status is "030"] (Completed/Settled) (L721)

> Service contract is completed/settled. Set transfer division to "00055" (Option Reservation Cancellation).

| # | Type | Code |
|---|------|------|
| 1 | SET | `idoDiv = JFUStrConst.CD00576_00055` // Transfer division = Option Reservation Cancellation [-> CD00576_00055="00055"] |

**Block 3** — [ELSE] (Status is not "030") (L723)

> Service contract is in any other state. Set transfer division to "00031" (Option Setup) as the default.

| # | Type | Code |
|---|------|------|
| 1 | SET | `idoDiv = JFUStrConst.CD00576_00031` // Transfer division = Option Setup [-> CD00576_00031="00031"] |

**Block 4** — [RETURN] (L726)

> Return the classified transfer division code.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return idoDiv;` // Returns "00055" or "00031" |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `idoDiv` | Field | Transfer Division — classification code indicating the type of change being made to a service contract detail (e.g., setup, cancellation, correction) |
| `cc_op_svc_kei_stat` | Field | Operational Service Contract Status — a status code stored in the DSL map that indicates the current state of the service contract (e.g., "030" = Completed/Settled) |
| `opSvcKeiDslMap` | Field | Operational Service Contract DSL Map — a HashMap carrying service contract detail fields used in DSL (Domain Specific Language) processing for service operations |
| `CC_OP_SVC_KEI_STAT` | Constant | Map key constant `"cc_op_svc_kei_stat"` — used to look up the service contract status in the DSL map |
| CD00037_030 | Constant | Status code `"030"` — represents "Completed/Settled" (締結済) service contract status |
| CD00576_00031 | Constant | Transfer division code `"00031"` — represents "Option Setup" (オプション設定) |
| CD00576_00055 | Constant | Transfer division code `"00055"` — represents "Option Reservation Cancellation" (オプション予約取消) |
| 締結済 | Japanese term | Completed/Settled — the state when a service contract has been finalized and settled |
| オプション設定 | Japanese term | Option Setup — the operation of setting up/registering an option for a service contract |
| オプション予約取消 | Japanese term | Option Reservation Cancellation — the operation of canceling a previously reserved option |
| 異動区分 | Japanese term | Transfer Division — the classification of a change operation type on service contract data |
| DSL | Acronym | Domain Specific Language — a specialized data structure/mapping used for service contract operations in this system |
| CC | Acronym | Common Component — a shared utility class type in this codebase (indicated by the `CC` suffix in class names) |
| KKSV\d{4} | Pattern | Screen class naming convention — KKSV followed by 4 digits identifies screen processing classes |
| KKW00121 | Screen code | T-Dis information input screen — a telecom service information input screen in the KKW series |
