# Business Logic — JFUDslNetOpSvcKeiCC.setSODMappingOpBf() [93 LOC]

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

## 1. Role

### JFUDslNetOpSvcKeiCC.setSODMappingOpBf()

This method creates a pre-change SOD (Service Order Data) mapping structure for DSL network operations involving **Mail Add/Access options** and **IPv6 changes (before modification)**. It constructs a hierarchical `childMap` containing service contract details, optional service contract details (pre-change), sub-option service contract details (pre-change), and device provisioning service details — all of which are then embedded into a shared `parentMap` keyed by `"JKKHakkoSODCC"`. The `parentMap` is retrieved from the request parameter (`param.getData`), and after the new `childMap` is added to the `trgt_data_list` array, the updated `parentMap` is written back into the request for downstream consumption.

The method follows a **Builder + Registry** pattern: it builds a self-contained `childMap` from the supplied `opInfoMap`, `sbopInfoMap`, and `svcKeiUcwkInfoMap`, then registers that map into a shared list stored within the request. It is a shared utility component called from multiple service operation entry points (`dslOpSvcKeiHp`, `dslOpSvcKeiIPv6`, `dslOpSvcKeiMlad`) — each of which represents a different DSL service operation scenario (normal, IPv6 change, Mobile IPv6/LAD). The `"before-change"` suffix (`OpBf`) in the name indicates this method populates the pre-modification snapshot of option service data for SOD reconciliation.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["setSODMappingOpBf Start"])
    STEP_LOG1["outDebugLog: Start"]
    STEP_GET_PARENT["parentMap = param.getData JKHAKKOSODCC"]
    STEP_PARENT_NULL{"parentMap == null"}
    STEP_NEW_MAP["parentMap = new HashMap"]
    STEP_SET_FUNC["parentMap.put func_code FUNC_CD_1"]
    STEP_CHILD_MAP["childMap = new HashMap"]
    STEP_SOD_INFO["sodKihonInfo = new HashMap"]
    STEP_SYSID["sodKihonInfo.put sysid opInfoMap.get SYSID"]
    STEP_IDO_DIV["sodKihonInfo.put ido_div CD00576_00031"]
    STEP_PUT_SOD["childMap.put sod_kihon_info sodKihonInfo"]
    STEP_SVC_INFO["svcKeiInfo = new HashMap"]
    STEP_SVC_NO["svcKeiInfo.put svc_kei_no opInfoMap.get SVC_KEI_NO"]
    STEP_PUT_SVC["childMap.put svc_kei_info svcKeiInfo"]
    STEP_UCWK_INFO["svcKeiUcwkInfo = new HashMap"]
    STEP_UCWK_NULL{"svcKeiUcwkInfoMap != null"}
    STEP_PUT_UCWK_NO["svcKeiUcwkInfo.put svc_kei_ucwk_no svcKeiUcwkInfoMap.get SVC_KEI_UCWK_NO"]
    STEP_PUT_GENE_DTM["svcKeiUcwkInfo.put chaf_svc_kei_ucwk_gene_add_dtm svcKeiUcwkInfoMap.get GENE_ADD_DTM"]
    STEP_PUT_UCWK["childMap.put svc_kei_ucwk_info svcKeiUcwkInfo"]
    STEP_OPS_INFO["opsvkeiInfo = new HashMap"]
    STEP_PUT_CHBF_OPS_NO["opsvkeiInfo.put chbf_opsvkei_no opInfoMap.get OP_SVC_KEI_NO"]
    STEP_PUT_CHBF_OPS_DTM["opsvkeiInfo.put chbf_opsvkei_gene_add_dtm opInfoMap.get GENE_ADD_DTM"]
    STEP_SBOP_NULL{"sbopInfoMap != null"}
    STEP_PUT_SBOP_NO["opsvkeiInfo.put chbf_sbopsvkei_no sbopInfoMap.get SBOP_SVC_KEI_NO"]
    STEP_PUT_SBOP_DTM["opsvkeiInfo.put chbf_sbopsvkei_gene_add_dtm sbopInfoMap.get GENE_ADD_DTM"]
    STEP_PUT_OPS["childMap.put opsvkei_info opsvkeiInfo"]
    STEP_KKT_INFO["kktsvkeiInfo = new HashMap"]
    STEP_PUT_KKT["childMap.put kktsvkei_info kktsvkeiInfo"]
    STEP_GET_LIST["arrayList = parentMap.get trgt_data_list"]
    STEP_LIST_NULL{"arrayList == null"}
    STEP_NEW_LIST["arrayList = new ArrayList"]
    STEP_ADD_CHILD["arrayList.add childMap"]
    STEP_PUT_LIST["parentMap.put trgt_data_list arrayList"]
    STEP_SET_DATA["param.setData JKHAKKOSODCC parentMap"]
    STEP_LOG_END["outDebugLog: End"]
    END(["setSODMappingOpBf End"])

    START --> STEP_LOG1
    STEP_LOG1 --> STEP_GET_PARENT
    STEP_GET_PARENT --> STEP_PARENT_NULL
    STEP_PARENT_NULL -->|true| STEP_NEW_MAP
    STEP_NEW_MAP --> STEP_SET_FUNC
    STEP_PARENT_NULL -->|false| STEP_SET_FUNC
    STEP_SET_FUNC --> STEP_CHILD_MAP
    STEP_CHILD_MAP --> STEP_SOD_INFO
    STEP_SOD_INFO --> STEP_SYSID
    STEP_SYSID --> STEP_IDO_DIV
    STEP_IDO_DIV --> STEP_PUT_SOD
    STEP_PUT_SOD --> STEP_SVC_INFO
    STEP_SVC_INFO --> STEP_SVC_NO
    STEP_SVC_NO --> STEP_PUT_SVC
    STEP_PUT_SVC --> STEP_UCWK_INFO
    STEP_UCWK_INFO --> STEP_UCWK_NULL
    STEP_UCWK_NULL -->|true| STEP_PUT_UCWK_NO
    STEP_PUT_UCWK_NO --> STEP_PUT_GENE_DTM
    STEP_PUT_GENE_DTM --> STEP_PUT_UCWK
    STEP_UCWK_NULL -->|false| STEP_PUT_UCWK
    STEP_PUT_UCWK --> STEP_OPS_INFO
    STEP_OPS_INFO --> STEP_PUT_CHBF_OPS_NO
    STEP_PUT_CHBF_OPS_NO --> STEP_PUT_CHBF_OPS_DTM
    STEP_PUT_CHBF_OPS_DTM --> STEP_SBOP_NULL
    STEP_SBOP_NULL -->|true| STEP_PUT_SBOP_NO
    STEP_PUT_SBOP_NO --> STEP_PUT_SBOP_DTM
    STEP_PUT_SBOP_DTM --> STEP_PUT_OPS
    STEP_SBOP_NULL -->|false| STEP_PUT_OPS
    STEP_PUT_OPS --> STEP_KKT_INFO
    STEP_KKT_INFO --> STEP_PUT_KKT
    STEP_PUT_KKT --> STEP_GET_LIST
    STEP_GET_LIST --> STEP_LIST_NULL
    STEP_LIST_NULL -->|true| STEP_NEW_LIST
    STEP_NEW_LIST --> STEP_ADD_CHILD
    STEP_LIST_NULL -->|false| STEP_ADD_CHILD
    STEP_ADD_CHILD --> STEP_PUT_LIST
    STEP_PUT_LIST --> STEP_SET_DATA
    STEP_SET_DATA --> STEP_LOG_END
    STEP_LOG_END --> END
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `handle` | `SessionHandle` | The database session handle used for DB access. Passed for potential future DB operations; currently unused within this method. |
| 2 | `param` | `IRequestParameterReadWrite` | The request parameter object that holds and provides the shared `JKKHakkoSODCC` parent map for SOD data. It is both read from (via `getData`) and written to (via `setData`) — the primary I/O channel for the SOD mapping structure. |
| 3 | `fixedText` | `String` | The service message text. Declared as a parameter but **not used** within this method body. Likely present for API consistency with the sibling method `setSODMappingOpAf`. |
| 4 | `opInfoMap` | `HashMap<String, Object>` | The option information map carrying pre-change option service contract data. Contains the system ID (`SYSID`), option service contract number (`OP_SVC_KEI_NO`), and generation registration timestamp (`GENE_ADD_DTM`). Essential source of all pre-change option data. |
| 5 | `sbopInfoMap` | `HashMap<String, Object>` | The sub-option information map carrying pre-change sub-option service contract data. Contains the sub-option service contract number (`SBOP_SVC_KEI_NO`) and generation registration timestamp (`GENE_ADD_DTM`). Null-check branches to optionally include sub-option fields in the SOD map. |
| 6 | `svcKeiUcwkInfoMap` | `HashMap<String, Object>` | The service contract detail information map carrying the service detail work number (`SVC_KEI_UCWK_NO`) and the post-change service contract detail generation registration timestamp (`GENE_ADD_DTM`). Null-check branches to optionally include these fields in the SOD map. |

**External state / instance fields read:**
- None — this method reads no instance fields. All data is passed through parameters.

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `JFUDslNetOpSvcKeiCC.outDebugLog` | N/A | - | Calls `outDebugLog` for start/end logging (debug trace utility, no DB impact) |
| R | `IRequestParameterReadWrite.getData` | N/A | - | Reads the existing `JKKHakkoSODCC` parent map from the request parameter |
| U | `IRequestParameterReadWrite.setData` | N/A | - | Writes the updated `JKKHakkoSODCC` parent map back to the request parameter |

**Additional method calls on HashMap (local data manipulation):**

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| U | `HashMap.put` (multiple) | N/A | - | Populates `sodKihonInfo`, `svcKeiInfo`, `svcKeiUcwkInfo`, `opsvkeiInfo` with key-value pairs extracted from input maps |
| U | `HashMap.put` (parentMap) | N/A | - | Puts `func_code` and `trgt_data_list` into the `parentMap` |
| U | `ArrayList.add` | N/A | - | Appends the constructed `childMap` to the `trgt_data_list` list |

**Analysis:** This method is a pure in-memory data transformer. It performs **zero database reads or writes** directly. All operations are HashMap/ArrayList manipulations that construct and register an SOD mapping structure within the request parameter object. The `outDebugLog` calls are trace-only and do not affect business state.

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | `JFUDslNetOpSvcKeiCC.dslOpSvcKeiHp` | `dslOpSvcKeiHp` -> `setSODMappingOpBf` | `setData`, `setData`, `setData`, `setData`, `setData`, `setData` (HashMap mutations) |
| 2 | `JFUDslNetOpSvcKeiCC.dslOpSvcKeiIPv6` | `dslOpSvcKeiIPv6` -> `setSODMappingOpBf` | `setData`, `setData`, `setData`, `setData`, `setData`, `setData` (HashMap mutations) |
| 3 | `JFUDslNetOpSvcKeiCC.dslOpSvcKeiMlad` | `dslOpSvcKeiMlad` -> `setSODMappingOpBf` | `setData`, `setData`, `setData`, `setData`, `setData`, `setData` (HashMap mutations) |

**Terminal operations from this method:** `outDebugLog` [-], `setData` [-], `setData` [-], `setData` [-], `setData` [-], `setData` [-], `setData` [-] — all are in-memory HashMap/ArrayList operations or debug logging. No DB entities are accessed directly.

## 6. Per-Branch Detail Blocks

**Block 1** — [IF] `parentMap == null` (L2046)

> Retrieves the SOD mapping parent map from the request parameter. If it doesn't exist (first call in the session), creates a new HashMap.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `parentMap = (HashMap)param.getData("JKKHakkoSODCC")` // Retrieves existing SOD parent map from request |
| 2 | SET | `parentMap = new HashMap()` [-> `JKKHakkoSODCC` is the parent map key stored in the request] // Creates new HashMap when absent |

**Block 2** — [EXEC] Function code assignment (L2050)

> Sets the function code on the parent map to identify this as a service order creation operation.

| # | Type | Code |
|---|------|------|
| 1 | SET | `parentMap.put("func_code", FUNC_CD_1 = "1")` [-> `FUNC_CD_1 = "1"` (JPCModelConstant.java:29)] |

**Block 3** — [EXEC] Create SOD basic info sub-map (L2053–L2060)

> Constructs the SOD basic information sub-map (`sodKihonInfo`) with system ID and modification area division code, then attaches it to the child map.

| # | Type | Code |
|---|------|------|
| 1 | SET | `childMap = new HashMap<String, Object>()` |
| 2 | SET | `sodKihonInfo = new HashMap<String, Object>()` |
| 3 | SET | `sodKihonInfo.put("sysid", opInfoMap.get(EKK0351A010CBSMsg1List.SYSID))` [-> `SYSID` from EKK0351A010CBSMsg1List] |
| 4 | SET | `sodKihonInfo.put("ido_div", CD00576_00031 = "00031")` [-> `CD00576_00031 = "00031"` (JFUStrConst.java:3937)] |
| 5 | SET | `childMap.put("sod_kihon_info", sodKihonInfo)` |

**Block 4** — [EXEC] Create service contract info sub-map (L2063–L2067)

> Constructs the service contract info sub-map (`svcKeiInfo`) with the service contract number, then attaches it to the child map.

| # | Type | Code |
|---|------|------|
| 1 | SET | `svcKeiInfo = new HashMap<String, Object>()` |
| 2 | SET | `svcKeiInfo.put("svc_kei_no", opInfoMap.get(EKK0351A010CBSMsg1List.SVC_KEI_NO))` [-> `SVC_KEI_NO` from EKK0351A010CBSMsg1List] |
| 3 | SET | `childMap.put("svc_kei_info", svcKeiInfo)` |

**Block 5** — [IF] `svcKeiUcwkInfoMap != null` (L2073)

> Conditionally includes service contract detail information in the SOD mapping. Only populated when the map is non-null (indicating the service detail work is present for this operation).

| # | Type | Code |
|---|------|------|
| 1 | SET | `svcKeiUcwkInfo = new HashMap<String, Object>()` |
| 2 | SET | `svcKeiUcwkInfo.put("svc_kei_ucwk_no", svcKeiUcwkInfoMap.get(EKK0161B001CBSMsg1List.SVC_KEI_UCWK_NO))` [-> `SVC_KEI_UCWK_NO` from EKK0161B001CBSMsg1List] |
| 3 | SET | `svcKeiUcwkInfo.put("chaf_svc_kei_ucwk_gene_add_dtm", svcKeiUcwkInfoMap.get(EKK0161B001CBSMsg1List.GENE_ADD_DTM))` [-> `GENE_ADD_DTM` from EKK0161B001CBSMsg1List] |
| 4 | SET | `childMap.put("svc_kei_ucwk_info", svcKeiUcwkInfo)` |

**Block 6** — [EXEC] Create pre-change option service contract info sub-map (L2079–L2088)

> Constructs the option service contract info sub-map (`opsvkeiInfo`) with pre-change option service contract number and timestamp. Always populated regardless of null-check.

| # | Type | Code |
|---|------|------|
| 1 | SET | `opsvkeiInfo = new HashMap<String, Object>()` |
| 2 | SET | `opsvkeiInfo.put("chbf_opsvkei_no", opInfoMap.get(EKK0351A010CBSMsg1List.OP_SVC_KEI_NO))` [-> `OP_SVC_KEI_NO` from EKK0351A010CBSMsg1List] |
| 3 | SET | `opsvkeiInfo.put("chbf_opsvkei_gene_add_dtm", opInfoMap.get(EKK0351A010CBSMsg1List.GENE_ADD_DTM))` [-> `GENE_ADD_DTM` from EKK0351A010CBSMsg1List] |

**Block 7** — [IF] `sbopInfoMap != null` (L2085)

> Conditionally includes pre-change sub-option service contract details. Only populated when sub-option data exists (indicating an optional sub-service is attached to this operation).

| # | Type | Code |
|---|------|------|
| 1 | SET | `opsvkeiInfo.put("chbf_sbopsvkei_no", sbopInfoMap.get(EKK0401A010CBSMsg1List.SBOP_SVC_KEI_NO))` [-> `SBOP_SVC_KEI_NO` from EKK0401A010CBSMsg1List] |
| 2 | SET | `opsvkeiInfo.put("chbf_sbopsvkei_gene_add_dtm", sbopInfoMap.get(EKK0401A010CBSMsg1List.GENE_ADD_DTM))` [-> `GENE_ADD_DTM` from EKK0401A010CBSMsg1List] |

**Block 8** — [EXEC] Attach option service contract info and empty device provisioning info to child map (L2091–L2097)

> Finalizes the `opsvkeiInfo` sub-map into the child map, then adds an empty `kktsvkei_info` placeholder for device provisioning service details.

| # | Type | Code |
|---|------|------|
| 1 | SET | `childMap.put("opsvkei_info", opsvkeiInfo)` |
| 2 | SET | `kktsvkeiInfo = new HashMap<String, Object>()` |
| 3 | SET | `childMap.put("kktsvkei_info", kktsvkeiInfo)` |

**Block 9** — [IF] `arrayList == null` (L2102)

> Retrieves the target data list from the parent map. If this is the first child map being registered (no existing list), creates a new ArrayList. Then adds the child map and writes the updated list back.

| # | Type | Code |
|---|------|------|
| 1 | SET | `arrayList = (ArrayList<HashMap<String, Object>>)parentMap.get("trgt_data_list")` |
| 2 | SET | `arrayList = new ArrayList<HashMap<String, Object>>()` [-> `trgt_data_list` is the key for the child map collection in the parent map] |
| 3 | EXEC | `arrayList.add(childMap)` |
| 4 | SET | `parentMap.put("trgt_data_list", arrayList)` |
| 5 | EXEC | `param.setData("JKKHakkoSODCC", parentMap)` // Writes back the updated parent map to the request |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `setSODMappingOpBf` | Method | SOD Mapping Before Modification — creates a pre-change snapshot of option service data for DSL network operations |
| `setSODMappingOpAf` | Method | SOD Mapping After Modification — sibling method that updates post-change values (after IPv6 change / Mail Add) |
| SOD | Acronym | Service Order Data — telecom order fulfillment entity holding service contract and option data for provisioning |
| `JKKHakkoSODCC` | Key | Joken Hakko SOD Common Component — the shared parent map key in the request for SOD data registration |
| `func_code` | Field | Function code — identifies the operation type; `"1"` denotes service order creation |
| `trgt_data_list` | Key | Target data list — the array within the parent map holding all SOD child maps to be processed |
| `sod_kihon_info` | Field | SOD basic information — contains system ID and modification area division code |
| `sysid` | Field | System ID — identifies the telecom system processing this order |
| `ido_div` | Field | Modification area division — classifies the type of change area; `"00031"` is a specific division code for DSL operations |
| `svc_kei_info` | Field | Service contract information — contains the service contract number |
| `svc_kei_no` | Field | Service contract number — unique identifier for a service contract line item |
| `svc_kei_ucwk_info` | Field | Service contract detail work information — contains the service detail work number and generation registration timestamp |
| `svc_kei_ucwk_no` | Field | Service detail work number — internal tracking ID for a service contract line item |
| `chaf_svc_kei_ucwk_gene_add_dtm` | Field | Post-change service contract detail generation registration date/time |
| `opsvkei_info` | Field | Option service contract information — contains pre-change option and sub-option service contract details |
| `chbf_opsvkei_no` | Field | Pre-change option service contract number |
| `chbf_opsvkei_gene_add_dtm` | Field | Pre-change option service contract generation registration date/time |
| `chbf_sbopsvkei_no` | Field | Pre-change sub-option service contract number |
| `chbf_sbopsvkei_gene_add_dtm` | Field | Pre-change sub-option service contract generation registration date/time |
| `sbopsvkei` | Abbreviation | Sub-option service contract — an optional sub-service attached to a primary option service |
| `kktsvkei_info` | Field | Device provisioning service detail information — currently an empty placeholder (for future expansion) |
| `kktsvkei` | Abbreviation | Kiki Teikyu Service Kei (Equipment Provisioning Service Line) |
| `FUNC_CD_1` | Constant | Function code `"1"` — denotes service order creation in the JPC model |
| `CD00576_00031` | Constant | Modification area division code `"00031"` — specific code for DSL service modification |
| `fixedText` | Parameter | Service message text — available for use but currently unused in this method |
| `dslOpSvcKeiHp` | Method | DSL operation service line main processing — normal DSL service operation entry point |
| `dslOpSvcKeiIPv6` | Method | DSL operation service line IPv6 — IPv6 service change operation entry point |
| `dslOpSvcKeiMlad` | Method | DSL operation service line Mobile LAD — Mobile IPv6 / LAD operation entry point |
