# Business Logic — JFUDslOpSvcKeiCC.setInMapOpSvcKeiDslFix() [24 LOC]

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

## 1. Role

### JFUDslOpSvcKeiCC.setInMapOpSvcKeiDslFix()

This method performs the **outbound data mapping** for the Option Service Contract Cancellation Confirmation screen (FUSV0050). It takes option service contract cancellation data from the DSL (Data Service Layer) map and populates a structured HashMap (`inMap`) that will be passed downstream to the CBS (Central Billing System) callback `EKK0351C250CBS` for processing the actual cancellation confirmation.

The method follows a **builder/delegation pattern**: it gathers all required cancellation fields by delegating to helper methods (`getEndDate`, `getIdoDiv`) and extracting values from the input maps (`param`, `opSvcKeiDslMap`), then assembles them into the output map using the CBS message key constants from `EKK0351C250CBSMsg`. Notably, the service cancellation reason code (`SVC_DLRE_CD`) is hardcoded to `"01"` (via `JFUStrConst.CD00879_01`), representing a standard/defined cancellation reason for DSL (disaggregation) cancellations.

It serves as a **data transformation step** within the service contract cancellation DSL flow — bridging the generic request parameter layer with the CBS-specific data format. This method is called by `JFUDslOpSvcKeiCC.dslOpSvcKei()` as one of the mapping steps in the broader cancellation workflow.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["setInMapOpSvcKeiDslFix"])

    STEP1["Get inMap from param.getData"]
    STEP2["Get svcEndDate via getEndDate"]
    STEP3["Get idoDiv via getIdoDiv"]
    STEP4["Put OP_SVC_KEI_NO into inMap"]
    STEP5["Put SVC_ENDYMD into inMap"]
    STEP6["Put SVC_DLRE_CD = 01 into inMap"]
    STEP7["Put IDO_DIV into inMap"]
    STEP8["Put UPD_DTM_BF into inMap"]
    STEP9["Put SVC_CHRG_ENDYMD into inMap"]
    END(["Return / Next"])

    START --> STEP1 --> STEP2 --> STEP3 --> STEP4 --> STEP5 --> STEP6 --> STEP7 --> STEP8 --> STEP9 --> END
```

The method executes a linear, sequential data assembly process with no conditional branches:

1. **Retrieve input map** — Extracts a HashMap from the request parameter using `fixedText` as the key. This is the working data structure to be populated.
2. **Obtain service end date** — Delegates to `getEndDate(opSvcKeiDslMap)` to compute the service termination date.
3. **Obtain migration/division classification** — Delegates to `getIdoDiv(opSvcKeiDslMap)` to determine the migration division.
4. **Populate inMap** with six fields:
   - **Option Service Contract Number** — Extracted from the DSL map.
   - **Service End Date** — The computed end date.
   - **Service Cancellation Reason Code** — Hardcoded to `CD00879_01 = "01"` (Standard cancellation reason).
   - **Migration Division** — The computed migration/division value.
   - **Update Date/Time Before** — Taken from the existing `kk0351_upd_dtm` value in the input map (preserving the pre-update timestamp).
   - **Service Charging End Date** — Delegates to `JFUBPCommon.getSvcChrgEndYmdOpTv(null)` to determine when service charging ends.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `param` | `IRequestParameterReadWrite` | Request parameter object that carries the screen's input data. Used to retrieve the working map (`inMap`) via `getData(fixedText)`. Acts as the bridge between the web request and the CBS callback data structure. |
| 2 | `fixedText` | `String` | Service message identifier / data key. Used as the lookup key in `param.getData(fixedText)` to retrieve the specific HashMap containing the current processing context data for the option service contract cancellation flow. |
| 3 | `opSvcKeiDslMap` | `HashMap` | Option service contract cancellation information map. Contains the DSL (disaggregation) specific data for the option service contract line item, including the contract number (`cc_op_svc_kei_no`) and other DSL-specific fields needed for cancellation processing. |

**Instance/External State Read:**
| Source | Description |
|--------|-------------|
| `EKK0351C250CBSMsg` constants | CBS message key constants for output field names (e.g., `OP_SVC_KEI_NO`, `SVC_ENDYMD`, `SVC_DLRE_CD`, `IDO_DIV`, `UPD_DTM_BF`, `SVC_CHRG_ENDYMD`) |
| `JFUStrConst.CD00879_01` | Constant resolving to `"01"` — the standard service cancellation reason code for DSL cancellation. |
| `KK0351_UPD_DTM` | Private constant in this class: `"kk0351_upd_dtm"` — key used to retrieve the pre-update timestamp from the input map. |

## 4. CRUD Operations / Called Services

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

This method performs **no direct CRUD operations** on entities or databases. It is a pure data transformation/mapping method that reads from in-memory data structures and writes to a HashMap. All called methods are **Read (R)** operations that extract or compute values.

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `JFUDslOpSvcKeiCC.getEndDate` | - | - | Calls `getEndDate(opSvcKeiDslMap)` to compute the service end date from the DSL map. |
| R | `JFUDslOpSvcKeiCC.getIdoDiv` | - | - | Calls `getIdoDiv(opSvcKeiDslMap)` to determine the migration/division classification. |
| R | `JFUBPCommon.getSvcChrgEndYmdOpTv` | - | - | Calls `getSvcChrgEndYmdOpTv(null)` to compute the service charging end date. The null argument indicates default behavior for option service validation. |

### Pre-computed evidence (additional downstream calls):

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `JFUBaseUtil.getSvcChrgEndYmdOpTv` | - | - | Called internally by `JFUBPCommon.getSvcChrgEndYmdOpTv` |
| R | `KKKBaseUtil.getSvcChrgEndYmdOpTv` | - | - | Called internally by `JFUBPCommon.getSvcChrgEndYmdOpTv` |
| R | `KKKBPActCommon.getSvcChrgEndYmdOpTv` | - | - | Called internally by `JFUBPCommon.getSvcChrgEndYmdOpTv` |

## 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: `getSvcChrgEndYmdOpTv` [R], `getSvcChrgEndYmdOpTv` [R], `getEndDate` [R], `getIdoDiv` [R], `getData` [R].

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | CBS: `EKK0351C250CBS` | `JFUDslOpSvcKeiCC.dslOpSvcKei` -> `setInMapOpSvcKeiDslFix` | `getSvcChrgEndYmdOpTv [R]`, `getEndDate [R]`, `getIdoDiv [R]`, `param.getData [R]` |

**Call chain notes:**
- `dslOpSvcKei()` in `JFUDslOpSvcKeiCC` is the direct caller. This method is part of the Option Service Contract DSL processing flow, invoked when the CBS `EKK0351C250CBS` (Option Service Contract Cancellation Confirmation) processes cancellation data.
- The terminal operations all resolve to read-only data retrieval — this method does not write to any database or create/update/delete any entity records.

## 6. Per-Branch Detail Blocks

This method has **no conditional branches** — it executes a linear sequence of assignments. Each operation is documented below as a sequential block.

### Block 1 — [EXTRACT] (L498)

> Retrieve the working HashMap from the request parameter. The Japanese comment reads: ユーザーデータ取得 (Get user data).

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `inMap = (HashMap)param.getData(fixedText)` // Comment: ユーザーデータ取得 (Get user data) |

### Block 2 — [CALL] (L501)

> Obtain the service end date by delegating to the helper method. The Japanese comment reads: サービス終了年月日を取得 (Get service end date).

| # | Type | Code |
|---|------|------|
| 1 | CALL | `svcEndDate = getEndDate(opSvcKeiDslMap)` // Comment: サービス終了年月日を取得 (Get service end date) |

### Block 3 — [CALL] (L504)

> Determine the migration/division classification. The Japanese comment reads: 異動区分を取得 (Get migration division).

| # | Type | Code |
|---|------|------|
| 1 | CALL | `idoDiv = getIdoDiv(opSvcKeiDslMap)` // Comment: 異動区分を取得 (Get migration division) |

### Block 4 — [SET] (L507)

> Populate the option service contract number. The Japanese comment reads: オプションサービス契約番号 (Option service contract number).

| # | Type | Code |
|---|------|------|
| 1 | SET | `inMap.put(EKK0351C250CBSMsg.OP_SVC_KEI_NO, opSvcKeiDslMap.get(CC_OP_SVC_KEI_NO))` // Comment: オプションサービス契約番号 (Option service contract number) |

- `EKK0351C250CBSMsg.OP_SVC_KEI_NO` = `"op_svc_kei_no"` (CBS message key)
- `CC_OP_SVC_KEI_NO` = `"cc_op_svc_kei_no"` (local constant for DSL map key)

### Block 5 — [SET] (L509)

> Populate the service end date. The Japanese comment reads: サービス終了年月日 (Service end date).

| # | Type | Code |
|---|------|------|
| 1 | SET | `inMap.put(EKK0351C250CBSMsg.SVC_ENDYMD, svcEndDate)` // Comment: サービス終了年月日 (Service end date) |

- `EKK0351C250CBSMsg.SVC_ENDYMD` = `"svc_endYmd"` (CBS message key)

### Block 6 — [SET] (L511)

> Populate the service cancellation reason code with the hardcoded constant value. The Japanese comment reads: サービス解約理由コード (Service cancellation reason code).

| # | Type | Code |
|---|------|------|
| 1 | SET | `inMap.put(EKK0351C250CBSMsg.SVC_DLRE_CD, JFUStrConst.CD00879_01)` // Comment: サービス解約理由コード (Service cancellation reason code) [-> CONSTANT CD00879_01="01"] |

- `JFUStrConst.CD00879_01` = `"01"` (Standard cancellation reason code for DSL cancellation)

### Block 7 — [SET] (L513)

> Populate the migration/division classification. The Japanese comment reads: 異動区分 (Migration division).

| # | Type | Code |
|---|------|------|
| 1 | SET | `inMap.put(EKK0351C250CBSMsg.IDO_DIV, idoDiv)` // Comment: 異動区分 (Migration division) |

- `EKK0351C250CBSMsg.IDO_DIV` = `"ido_div"` (CBS message key)

### Block 8 — [SET] (L515)

> Preserve the pre-update timestamp by copying from the existing map value. The Japanese comment reads: 更新年月日時秒(更新前) (Update datetime seconds — before update).

| # | Type | Code |
|---|------|------|
| 1 | SET | `inMap.put(EKK0351C250CBSMsg.UPD_DTM_BF, inMap.get(KK0351_UPD_DTM))` // Comment: 更新年月日時秒(更新前) (Update datetime seconds — before update) |

- `EKK0351C250CBSMsg.UPD_DTM_BF` = `"upd_dtm_bf"` (CBS message key for pre-update timestamp)
- `KK0351_UPD_DTM` = `"kk0351_upd_dtm"` (local constant for the pre-update timestamp key in the input map)

### Block 9 — [SET] (L517)

> Set the service charging end date. The Japanese comment reads: サービス課金終了年月日 (Service charging end date).

| # | Type | Code |
|---|------|------|
| 1 | SET | `inMap.put(EKK0351C250CBSMsg.SVC_CHRG_ENDYMD, JFUBPCommon.getSvcChrgEndYmdOpTv(null))` // Comment: サービス課金終了年月日 (Service charging end date) |

- `EKK0351C250CBSMsg.SVC_CHRG_ENDYMD` = `"svc_chrg_endYmd"` (CBS message key)
- Delegates to `JFUBPCommon.getSvcChrgEndYmdOpTv(null)` with `null` argument, which applies default option service validation rules to compute the charging end date.

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `op_svc_kei_no` | Field | Option service contract number — unique identifier for an option service contract line item |
| `cc_op_svc_kei_no` | Field | Internal DSL map key for the option service contract number (maps to `op_svc_kei_no` in CBS) |
| `svc_endYmd` | Field | Service end date — the date when the option service contract terminates |
| `svc_chrg_endYmd` | Field | Service charging end date — the date when billing/charging for the service ceases |
| `svc_dlre_cd` | Field | Service cancellation reason code — classifies why the service was cancelled |
| `ido_div` | Field | Migration/division classification — indicates the type of migration or division for the service change |
| `upd_dtm_bf` | Field | Update datetime before — the timestamp before the update, used for optimistic concurrency control |
| `kk0351_upd_dtm` | Field | Internal key for the pre-update timestamp stored in the input map |
| `CD00879_01` | Constant | Value `"01"` — standard service cancellation reason code used for DSL (disaggregation) cancellations |
| `EKK0351C250CBS` | CBS | Option Service Contract Cancellation Confirmation CBS — the central billing system callback that processes the cancellation confirmation |
| FUSV0050 | Screen | Option Service Contract Screen — the web screen for managing option service contracts |
| DSL | Business term | Disaggregation — in this context, relates to disaggregated option service contract management |
| SOD | Acronym | Service Order Data — telecom order fulfillment entity (referenced in related methods) |
| FTTH | Business term | Fiber To The Home — fiber-optic internet service (referenced in cancellation reason codes) |
| CBS | Acronym | Central Billing System — the core billing/ordering system that processes service contract changes |
| SC | Acronym | Service Component — a service layer class that handles business logic for specific operations |
| HashMap | Data structure | Java Map implementation used throughout for flexible key-value data transfer between layers |
| IN_MAP | Internal | The working HashMap built by this method, containing all fields for the CBS cancellation callback |
