# Business Logic — JFUAddSvcKeiNetCC.editInEKK0341D010() [112 LOC]

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

## 1. Role

### JFUAddSvcKeiNetCC.editInEKK0341D010()

This method performs the **upper-mapping (上りマッピング) for equipment-provided service contract registration** of eo Hikari Net options — specifically, it populates and enriches the network-option list map with fallback values from broader context work areas. It is a pure data-enrichment routine: given a list of network-option items already built by lower-level mapping (from the `fixedText` data map), it ensures that every item carries the four core contractual identifiers — `svc_kei_no` (service detail number), `sysid` (system ID), `mskm_dtl_no` (application detail number), and `seiky_kei_no` (billing contract number) — by falling back to parent context work maps when these values are missing or empty on a per-item basis.

The method implements a **delegation-and-fallback pattern**: each field is first read from the individual list item; if the item lacks the field or the value is blank, the method falls back to a global work map that was previously populated by dedicated work-area CC components (customer information, submission, billing). This design supports both single-item and multi-item registration flows, such as when a user adds multiple net-option services in a single screen submission.

As a shared CC (Common Component) utility, this method is called from the screen-side registration flow (specifically `addNetTrk()`) and serves as the **data consolidation step** before the enriched list is passed downstream to CBS (Business Support Component) services that ultimately persist the service contracts to the database.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["editInEKK0341D010(params, fixedText)"])
    WORK["Get workMap from param.getMappingWorkArea()"]
    CHECK_NULL{"workMap == null?"}
    INIT_MAP["workMap = new HashMap()"]
    SET_WORK["param.setMappingWorkArea(workMap)"]
    GET_KEISHA["Get addKeishaServiceCCWorkMap from workMap[CC_WORK_AREA_NAME_KEISHA]"]
    GET_SKK["Get addSkkSCWorkMap from workMap[CC_WORK_AREA_NAME_SKK]"]
    GET_MSKM["Get addMskmSCWorkMap from workMap[CC_WORK_AREA_NAME_MSKM]"]
    GET_SVCNET["Get addSvcKeiNetCCWorkMap from workMap[CC_WORK_AREA_NAME]"]
    GET_NETOP["netOpMap = (HashMap) param.getData(fixedText)"]
    GET_LIST["netOpMapList = netOpMap.get(EKK0341D010List)"]
    INIT_NETOP_MAP["netOpMapListMap = new HashMap()"]
    INIT_VARS["Initialize sysId, mskmDtlNo, svcKeiNo, seikyKeiNo, kiki_shs_ad_man_input_flg as empty strings"]
    CHECK_LIST{"netOpMapList.size > 0?"}
    FOR_LOOP["For each item i in netOpMapList"]
    ASSIGN_ITEM["netOpMapListMap = (HashMap) netOpMapList.get(i)"]
    CHECK_SVC{"containsKey svc_kei_no?"}
    GET_SVC["svcKeiNo = netOpMapListMap.get(svc_kei_no)"]
    SVC_EMPTY{"svcKeiNo is empty?"}
    FALLBACK_SVC["put svc_kei_no from addSvcKeiNetCCWorkMap"]
    CHECK_SYSID{"containsKey sysid?"}
    GET_SYSID["sysId = netOpMapListMap.get(sysid)"]
    SYSID_EMPTY{"sysId is empty?"}
    FALLBACK_SYSID["put sysid from addKeishaServiceCCWorkMap"]
    CHECK_MSKM{"containsKey mskm_dtl_no?"}
    GET_MSKM_VAL["mskmDtlNo = netOpMapListMap.get(mskm_dtl_no)"]
    MSKM_EMPTY{"mskmDtlNo is empty?"}
    FALLBACK_MSKM["put mskm_dtl_no from addMskmSCWorkMap"]
    CHECK_SKK{"containsKey seiky_kei_no?"}
    GET_SKK_VAL["seikyKeiNo = netOpMapListMap.get(seiky_kei_no)"]
    SKK_EMPTY{"seikyKeiNo is empty?"}
    FALLBACK_SKK["put seiky_kei_no from addSkkSCWorkMap"]
    CHECK_FLAG{"containsKey kiki_shs_ad_man_input_flg?"}
    GET_FLAG["kiki_shs_ad_man_input_flg = netOpMapListMap.get(kiki_shs_ad_man_input_flg)"]
    NEXT_ITER["Next iteration (i++)"]
    END_LOOP(["End loop"])
    RETURN(["Return / Next"])

    START --> WORK --> CHECK_NULL
    CHECK_NULL -->|true| INIT_MAP --> SET_WORK --> GET_KEISHA
    CHECK_NULL -->|false| GET_KEISHA
    GET_KEISHA --> GET_SKK --> GET_MSKM --> GET_SVCNET --> GET_NETOP
    GET_NETOP --> GET_LIST --> INIT_NETOP_MAP --> INIT_VARS --> CHECK_LIST
    CHECK_LIST -->|false| RETURN
    CHECK_LIST -->|true| FOR_LOOP --> ASSIGN_ITEM
    ASSIGN_ITEM --> CHECK_SVC
    CHECK_SVC -->|true| GET_SVC
    CHECK_SVC -->|false| SVC_EMPTY
    GET_SVC --> SVC_EMPTY
    SVC_EMPTY -->|true| FALLBACK_SVC
    SVC_EMPTY -->|false| CHECK_SYSID
    FALLBACK_SVC --> CHECK_SYSID
    CHECK_SYSID -->|true| GET_SYSID
    CHECK_SYSID -->|false| SYSID_EMPTY
    GET_SYSID --> SYSID_EMPTY
    SYSID_EMPTY -->|true| FALLBACK_SYSID
    SYSID_EMPTY -->|false| CHECK_MSKM
    FALLBACK_SYSID --> CHECK_MSKM
    CHECK_MSKM -->|true| GET_MSKM_VAL
    CHECK_MSKM -->|false| MSKM_EMPTY
    GET_MSKM_VAL --> MSKM_EMPTY
    MSKM_EMPTY -->|true| FALLBACK_MSKM
    MSKM_EMPTY -->|false| CHECK_SKK
    FALLBACK_MSKM --> CHECK_SKK
    CHECK_SKK -->|true| GET_SKK_VAL
    CHECK_SKK -->|false| SKK_EMPTY
    GET_SKK_VAL --> SKK_EMPTY
    SKK_EMPTY -->|true| FALLBACK_SKK
    SKK_EMPTY -->|false| CHECK_FLAG
    FALLBACK_SKK --> CHECK_FLAG
    CHECK_FLAG -->|true| GET_FLAG
    CHECK_FLAG -->|false| NEXT_ITER
    GET_FLAG --> NEXT_ITER
    NEXT_ITER --> END_LOOP
```

**Block Descriptions:**

1. **Work area initialization** — Retrieves or creates the mapping work area (`workMap`) from the request parameter. This area is a shared HashMap that stores context for multiple CC components.

2. **Work area extraction** — Extracts four specialized work maps from the shared work area: customer information (`CC_WORK_AREA_NAME_KEISHA = "JFUAddKeishaServiceCCWork"`), billing (`CC_WORK_AREA_NAME_SKK = "JFUAddSkkSCWork"`), application/submission (`CC_WORK_AREA_NAME_MSKM = "JFUAddMskmSCWork"`), and the net service contract itself (`CC_WORK_AREA_NAME = "JFUAddSvcKeiNetCCWork"`).

3. **Net option map retrieval** — Fetches the network-option data map from `param.getData(fixedText)` and extracts the `EKK0341D010List` ArrayList containing individual service line items.

4. **Iterative field enrichment** — For each list item, reads the four core fields (`svc_kei_no`, `sysid`, `mskm_dtl_no`, `seiky_kei_no`) from the item itself; if missing or blank, falls back to the corresponding parent work map. Also reads the `kiki_shs_ad_man_input_flg` (equipment-delivery-address-manual-input-flag) from the item for potential downstream use.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `param` | `IRequestParameterReadWrite` | The request parameter container holding the full request context. It contains the `mappingWorkArea` — a shared HashMap that stores pre-populated work maps from prior mapping stages (customer info, billing, submission, etc.), and the `data` map keyed by `fixedText` that holds the raw network-option list (`EKK0341D010List`) to be enriched. |
| 2 | `fixedText` | `String` | The service message key / template identifier used to retrieve the network-option data map from `param.getData(fixedText)`. It acts as the key to locate the pre-built list of network-option items (typically "EKK0341D010" or similar) within the parameter's data map. |

**Instance fields read by this method (local constants, not instance fields):**

| Field | Type | Business Description |
|-------|------|---------------------|
| `CC_WORK_AREA_NAME_KEISHA` | String | Work area key for customer information: `"JFUAddKeishaServiceCCWork"` — provides fallback `sysid` |
| `CC_WORK_AREA_NAME_SKK` | String | Work area key for billing contract: `"JFUAddSkkSCWork"` — provides fallback `seiky_kei_no` |
| `CC_WORK_AREA_NAME_MSKM` | String | Work area key for application/submission: `"JFUAddMskmSCWork"` — provides fallback `mskm_dtl_no` |
| `CC_WORK_AREA_NAME` | String | Work area key for net service contract: `"JFUAddSvcKeiNetCCWork"` — provides fallback `svc_kei_no` |

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `JFUAddSvcKeiNetCC.editInEKK0341D010` | - | - | Method itself — performs read-only data enrichment; no direct DB/SC calls within this method. Reads data from `param` work area maps and data map, then writes enriched values back into the list item maps. |
| R | `IRequestParameterReadWrite.getMappingWorkArea` | - | - | Retrieves the shared work area HashMap from the request parameter |
| R | `IRequestParameterReadWrite.getData(String)` | - | - | Retrieves the network-option data map keyed by `fixedText` |
| SET | `param.setMappingWorkArea` | - | - | Initializes the work area if it was null (creates an empty HashMap) |

This method contains **no direct SC/CBS calls**. All data it reads originates from in-memory work maps pre-populated by earlier mapping stages in the call chain (e.g., `addNetTrk()`). The actual DB reads/writes happen at the CBS layer in the caller's downstream flow.

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | CC: `JFUAddSvcKeiNetCC.addNetTrk()` | `addNetTrk()` -> `editInEKK0341D010(handle, param, fixedText)` | `getData [R] work area map (no direct DB)` |

The method is called exclusively from the same class's `addNetTrk()` method. No screen (KKSV*) or batch (KKBV*) entry points were found within 8 hops — this CC method sits below the CBS layer in the call hierarchy and operates purely on in-memory data structures.

## 6. Per-Branch Detail Blocks

**Block 1** — [SET/GET] `(workMap initialization)` (L1249)

> Retrieves the mapping work area from the request parameter. This is a shared HashMap that stores work maps for multiple CC components, enabling cross-component data sharing within a single request.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | GET | `workMap = param.getMappingWorkArea()` | Retrieve the work area map from the request parameter |
| 2 | IF | `workMap == null` | Check if work area was not yet initialized |

**Block 1.1** — [NESTED IF] `(workMap == null)` (L1251)

> If no work area exists, create a new empty HashMap and register it back to the parameter. This ensures the work area is always available for subsequent work map retrievals.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | SET | `workMap = new HashMap()` | Create a new empty HashMap |
| 2 | EXEC | `param.setMappingWorkArea(workMap)` | Register the newly created work area into the request parameter |

**Block 2** — [GET] `(extract specialized work maps)` (L1257-L1267)

> Extracts four specialized work maps from the shared work area. Each work map was previously populated by a dedicated CC component in an earlier mapping stage.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | GET | `addKeishaServiceCCWorkMap = (HashMap)workMap.get(CC_WORK_AREA_NAME_KEISHA)` | Get customer information work map — `[-> CC_WORK_AREA_NAME_KEISHA="JFUAddKeishaServiceCCWork"]` |
| 2 | GET | `addSkkSCWorkMap = (HashMap)workMap.get(CC_WORK_AREA_NAME_SKK)` | Get billing contract work map — `[-> CC_WORK_AREA_NAME_SKK="JFUAddSkkSCWork"]` |
| 3 | GET | `addMskmSCWorkMap = (HashMap)workMap.get(CC_WORK_AREA_NAME_MSKM)` | Get application/submission work map — `[-> CC_WORK_AREA_NAME_MSKM="JFUAddMskmSCWork"]` |
| 4 | GET | `addSvcKeiNetCCWorkMap = (HashMap)workMap.get(CC_WORK_AREA_NAME)` | Get net service contract work map — `[-> CC_WORK_AREA_NAME="JFUAddSvcKeiNetCCWork"]` |

**Block 3** — [GET] `(retrieving network option data map)` (L1273-L1275)

> Retrieves the network-option data map using `fixedText` as the key, then extracts the `EKK0341D010List` ArrayList containing individual service line items to be processed.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | EXEC | `netOpMap = (HashMap)param.getData(fixedText)` | Retrieve the network-option map from the data map |
| 2 | GET | `netOpMapList = (ArrayList)netOpMap.get("EKK0341D010List")` | Extract the list of net-option items from the data map |

**Block 4** — [SET] `(local variable initialization)` (L1278-L1285)

> Initializes local string variables used during iteration. These serve as accumulators for the current iteration's field values and as holders for the previous item's values (since the fallback check reads from the accumulated variable).

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | SET | `netOpMapListMap = new HashMap()` | Create the per-item grouping map |
| 2 | SET | `sysId = ""` | Initialize system ID accumulator |
| 3 | SET | `mskmDtlNo = ""` | Initialize application detail number accumulator |
| 4 | SET | `svcKeiNo = ""` | Initialize service detail number accumulator |
| 5 | SET | `seikyKeiNo = ""` | Initialize billing contract number accumulator |
| 6 | SET | `kiki_shs_ad_man_input_flg = ""` | Initialize equipment-delivery-address manual input flag accumulator |

**Block 5** — [FOR] `(iterate over netOpMapList)` (L1287)

> Iterates over each network-option item in the list. For each item, reads and enriches the four core contractual fields with fallback values from the parent work maps.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | FOR | `for (int i = 0; i < netOpMapList.size(); i++)` | Iterate over all network-option items |

**Block 5.1** — [SET] `(assign current item)` (L1291-L1293)

> Resets the per-item grouping map and assigns the current list item to it.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | SET | `netOpMapListMap = new HashMap()` | Reset the per-item map |
| 2 | SET | `netOpMapListMap = (HashMap)netOpMapList.get(i)` | Assign the current item to the per-item map |

**Block 5.2** — [IF/IF] `(svc_kei_no enrichment)` (L1296-L1304)

> Ensures the service detail number (`svc_kei_no`) is populated. First tries to read it from the current item; if the item lacks it or the value is empty, falls back to the service contract work map.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | IF | `netOpMapListMap.containsKey("svc_kei_no")` | Check if current item has svc_kei_no |
| 2 | SET | `svcKeiNo = (String)netOpMapListMap.get("svc_kei_no")` | Read svc_kei_no from current item |
| 3 | IF | `"".equals(svcKeiNo)` — `[svc_kei_no is empty]` | Check if svc_kei_no is empty or missing |
| 4 | SET | `netOpMapListMap.put("svc_kei_no", (String)addSvcKeiNetCCWorkMap.get("svc_kei_no"))` | Fallback: set svc_kei_no from service contract work map |

**Block 5.3** — [IF/IF] `(sysid enrichment)` (L1307-L1315)

> Ensures the system ID (`sysid`) is populated. Reads from the current item first; if empty or missing, falls back to the customer information work map.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | IF | `netOpMapListMap.containsKey("sysid")` | Check if current item has sysid |
| 2 | SET | `sysId = (String)netOpMapListMap.get("sysid")` | Read sysid from current item |
| 3 | IF | `"".equals(sysId)` — `[sysid is empty]` | Check if sysid is empty or missing |
| 4 | SET | `netOpMapListMap.put("sysid", (String)addKeishaServiceCCWorkMap.get("sysid"))` | Fallback: set sysid from customer information work map |

**Block 5.4** — [IF/IF] `(mskm_dtl_no enrichment)` (L1318-L1326)

> Ensures the application detail number (`mskm_dtl_no`) is populated. Reads from the current item first; if empty or missing, falls back to the submission work map, using the key `ekk0091_mskm_dtl_no`.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | IF | `netOpMapListMap.containsKey("mskm_dtl_no")` | Check if current item has mskm_dtl_no |
| 2 | SET | `mskmDtlNo = (String)netOpMapListMap.get("mskm_dtl_no")` | Read mskm_dtl_no from current item |
| 3 | IF | `"".equals(mskmDtlNo)` — `[mskm_dtl_no is empty]` | Check if mskm_dtl_no is empty or missing |
| 4 | SET | `netOpMapListMap.put("mskm_dtl_no", (String)addMskmSCWorkMap.get("ekk0091_mskm_dtl_no"))` | Fallback: set mskm_dtl_no from submission work map using key `ekk0091_mskm_dtl_no` |

**Block 5.5** — [IF/IF] `(seiky_kei_no enrichment)` (L1329-L1337)

> Ensures the billing contract number (`seiky_kei_no`) is populated. Reads from the current item first; if empty or missing, falls back to the billing work map.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | IF | `netOpMapListMap.containsKey("seiky_kei_no")` | Check if current item has seiky_kei_no |
| 2 | SET | `seikyKeiNo = (String)netOpMapListMap.get("seiky_kei_no")` | Read seiky_kei_no from current item |
| 3 | IF | `"".equals(seikyKeiNo)` — `[seiky_kei_no is empty]` | Check if seiky_kei_no is empty or missing |
| 4 | SET | `netOpMapListMap.put("seiky_kei_no", (String)addSkkSCWorkMap.get("seiky_kei_no"))` | Fallback: set seiky_kei_no from billing work map |

**Block 5.6** — [IF] `(kiki_shs_ad_man_input_flg read)` (L1350-L1354)

> Reads the equipment-delivery-address manual input flag from the current item if present. The fallback logic (which would set from billing work map) is commented out in the source code.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | IF | `netOpMapListMap.containsKey("kiki_shs_ad_man_input_flg")` | Check if current item has manual input flag |
| 2 | SET | `kiki_shs_ad_man_input_flg = (String)netOpMapListMap.get("kiki_shs_ad_man_input_flg")` | Read the manual input flag from the current item |

**Block 5.7** — [COMMENTED OUT] `(kiki_shs_ad_man_input_flg fallback)` (L1355-L1358)

> The fallback logic to set `kiki_shs_ad_man_input_flg` from the billing work map is commented out in the source code and is not executed.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | COMMENT | `// netOpMapListMap.put("kiki_shs_ad_man_input_flg", ...)` | Fallback logic is disabled (commented out) |

**Block 6** — [RETURN] `(method exit)` (L1358)

> The method returns `void` and simply exits after completing all iterations. The enriched `netOpMapListMap` entries are modified in-place within the `netOpMapList` ArrayList, so the caller receives the enriched data.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | RETURN | (return void) | Exit the method — work is complete |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `svc_kei_no` | Field | Service detail number — internal identifier for a service contract line item |
| `sysid` | Field | System ID — unique identifier for the system instance handling the request |
| `mskm_dtl_no` | Field | Application detail number — identifier for the application/submission record (`ekk0091_mskm_dtl_no` is the specific key used in the submission work map) |
| `seiky_kei_no` | Field | Billing contract number — identifier for the billing contract line |
| `kiki_shs_ad_man_input_flg` | Field | Equipment-delivery-address manual input flag — indicates whether the delivery address for equipment was manually entered rather than auto-populated |
| `workMap` | Field | Work area map — a shared HashMap that stores work maps for multiple CC components, enabling cross-component data sharing |
| `CC_WORK_AREA_NAME_KEISHA` | Constant | Customer information work area key — `"JFUAddKeishaServiceCCWork"` |
| `CC_WORK_AREA_NAME_SKK` | Constant | Billing contract work area key — `"JFUAddSkkSCWork"` |
| `CC_WORK_AREA_NAME_MSKM` | Constant | Application/submission work area key — `"JFUAddMskmSCWork"` |
| `CC_WORK_AREA_NAME` | Constant | Net service contract work area key — `"JFUAddSvcKeiNetCCWork"` |
| `fixedText` | Parameter | Service message key — used as the key to retrieve the network-option data map from the request parameter |
| `EKK0341D010List` | Field | The list key within the data map containing the ArrayList of network-option items to be enriched |
| eo光ネット | Business term | eo Hikari Net — NTT's fiber-optic internet service brand (eo = NTT East) |
| 機器提供サービス | Business term | Equipment-provided service — a service type where the ISP provides the customer's networking equipment (ONU/modem) |
| 上りマッピング | Business term | Upper-mapping — the process of enriching lower-level mapped data with additional context from higher-level work areas |
| CC | Technical term | Common Component — a shared service component layer in the eo customer backbone system architecture |
| CBS | Technical term | Business Support Component — the CBS layer that performs actual database operations |
| SC | Technical term | Service Component — a service component that encapsulates business logic and data access |
| HashMap | Technical term | Java HashMap — used as the primary data structure for work areas and data maps throughout the system |
| IRequestParameterReadWrite | Technical term | Interface for reading and writing request parameters — the standard request context interface in the X21 BPM framework |
