# Business Logic — JKKMalwareBlockingNonFlgChengeOverCC.editHakkoSODMap() [50 LOC]

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

## 1. Role

### JKKMalwareBlockingNonFlgChengeOverCC.editHakkoSODMap()

This method is a **Service Order Data (SOD) issuance CC component handover data map edit** routine — a shared common component that prepares and populates the data structure required by the `JKKHakkoSODCC.hakkoSOD()` method to issue a Service Order Data payload. It is invoked from the `main()` method of the same class, which orchestrates the malware-blocking data migration feature (compliance work introduced in v49.00.00 — ANK-3834-00-00). Specifically, after the service contract status has been verified (ensuring the contract is not in a cancelled, unconfirmed, or inspection-pending state), this method constructs a target data map containing the SOD basic information and service contract information, then delegates to the SOD issuance component. It serves as a **data transformer and builder**: converting flat work map entries from the calling screen (e.g., KKSV0200OPOperation) into a structured multi-level HashMap hierarchy that the SOD issuance component consumes. The method uses a **delegation pattern** — it delegates the core target-data list building to its private `getSODmap()` helper method, and it uses a **builder pattern** — it progressively assembles `sod_kihon_info`, `svc_kei_info`, and their parent containers (`sod_map`, `trgt_data_list`, `targetMap`) before returning them on the parameter object.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["editHakkoSODMap param workMap"])
    START --> GET_DATA["getData hakko_sod_cc_trgt_data from param"]
    GET_DATA --> CREATE_LIST["Create new ArrayList trgt_data_list"]
    CREATE_LIST --> CREATE_SOD_KIHON["Create new HashMap sod_kihon_info"]
    CREATE_SOD_KIHON --> SET_FUNC_CODE["Set targetMap FUNC_CODE_KEY to FUNC_CD_1"]
    SET_FUNC_CODE --> SET_SYSID["Set sod_kihon_info INFO_SYSID from workMap SYSID"]
    SET_SYSID --> SET_IDO_DIV["Set sod_kihon_info INFO_IDO_DIV to blank string"]
    SET_IDO_DIV --> SET_MALWARE["Set sod_kihon_info INFO_MALWARE_BLOCKING_DIV to 1"]
    SET_MALWARE --> CREATE_SVC_KEI["Create new HashMap svc_kei_info"]
    CREATE_SVC_KEI --> SET_SVC_NO["Set svc_kei_info INFO_SVC_KEI_NO from workMap SVC_KEI_NO"]
    SET_SVC_NO --> SET_SAKI_SVC_NO["Set svc_kei_info INFO_SAKI_SVC_KEI_NO from workMap SVC_KEI_NO"]
    SET_SAKI_SVC_NO --> CHECK_LIST_SIZE{List empty or size below 1}
    CHECK_LIST_SIZE -- Yes --> CALL_GET_SODMAP["Call getSODmap trgt_data_list 0"]
    CHECK_LIST_SIZE -- No --> START_FOR["for loop x from 0 to list size"]
    CALL_GET_SODMAP --> START_FOR
    START_FOR --> GET_MAP["Get sod_map from trgt_data_list x"]
    GET_MAP --> SET_SOD_KIHON["Set sod_map SOD_KIHON_INFO to sod_kihon_info"]
    SET_SOD_KIHON --> SET_SVC_KEI_INFO["Set sod_map SVC_KEI_INFO to svc_kei_info"]
    SET_SVC_KEI_INFO --> NEXT_FOR["x increment"]
    NEXT_FOR --> CHECK_FOR{Still in loop}
    CHECK_FOR -- Yes --> GET_MAP
    CHECK_FOR -- No --> PUT_LIST["Set targetMap TRGT_DATA_LIST to trgt_data_list"]
    PUT_LIST --> RETURN(["Return param"])
```

**Flow description:**

1. **Extract target map** — Retrieves the `hakko_sod_cc_trgt_data` HashMap from `param.getData()`. This is the shared data container created by the caller (`main()`) just before invoking this method.
2. **Create list and info maps** — Creates a new `ArrayList<HashMap>` (`trgt_data_list`) to hold per-contract SOD map entries, and creates the `sod_kihon_info` HashMap for SOD-level metadata.
3. **Set function code** — Sets `targetMap[FUNC_CODE_KEY]` to `FUNC_CD_1 = "1"`. This is a fixed value (comment says "機能コード（チェックモードでは実行しないため、'1'固定）" — Functional code (fixed to '1' because it does not execute in check mode)).
4. **Populate SOD basic info** — Populates three fields on `sod_kihon_info`:
   - `INFO_SYSID`: Retrieved from `workMap[SYSID]` — the system ID of the service contract.
   - `INFO_IDO_DIV`: Set to blank string `""` — relocation division (unused here).
   - `INFO_MALWARE_BLOCKING_DIV`: Set to `"1"` — malware blocking division, fixed to `"1"` meaning "value outside of blacklist" (ブラインド値 / blind value, indicating standard processing path).
5. **Populate service contract info** — Creates `svc_kei_info` HashMap and populates `INFO_SVC_KEI_NO` and `INFO_SAKI_SVC_KEI_NO` (previous service contract number) both from `workMap[SVC_KEI_NO]`.
6. **Ensure target data list has entry** — If `trgt_data_list` is empty (size below 1), calls `getSODmap(trgt_data_list, 0)` to create and add a default SOD map entry at position 0.
7. **Iterate and attach info maps** — For each entry in `trgt_data_list`, attaches `sod_kihon_info` and `svc_kei_info` to the SOD map.
8. **Store and return** — Stores `trgt_data_list` back into `targetMap` under `TRGT_DATA_LIST` and returns `param` (modified in place).

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `param` | `IRequestParameterReadWrite` | The request parameter object carrying inter-component data. It contains the pre-populated target data map at key `"hakko_sod_cc_trgt_data"`, which serves as the shared container for SOD issuance data. After this method executes, `param` holds the complete SOD data structure under the same key. |
| 2 | `workMap` | `HashMap<String, Object>` | The work map passed through the BPM flow, originating from the screen operation (e.g., KKSV0200OPOperation). It carries business data extracted from prior CBS calls — specifically `SYSID` (system ID of the service contract) and `SVC_KEI_NO` (service contract number). These values are used to populate SOD basic info and service contract info. |

**Instance/external fields read:** None directly — all data is sourced from the `param` and `workMap` parameters and resolved via constant-key HashMap lookups.

## 4. CRUD Operations / Called Services

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

The method calls only one external service method (`getSODmap`), which is a **private helper** within the same class. There are no database or CBS (service component) calls. The pre-computed evidence table reflects downstream callers' dependency analysis. Below is the accurate CRUD analysis for this specific method:

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `getSODmap` | (private helper) | — | Reads `trgt_data_list` and creates a new SOD map entry if the list is empty (size < position). No DB access — purely in-memory ArrayList manipulation. |

**Analysis notes:**
- The `getSODmap(trgt_data_list, 0)` call at line 225 is a private method that creates a default HashMap entry in the list when needed. It does not access any database tables or external services.
- The pre-computed evidence table listed in the instructions (calling `JBSbatDKNyukaFinAdd.getData`, `JFUeoTelOpTransferCC.getData`, etc.) refers to **different methods** in this class — specifically the `main()` method, not `editHakkoSODMap()`.
- `editHakkoSODMap()` itself performs **only in-memory data transformation**: creating HashMaps, populating fields, and structuring the target data hierarchy. No actual C/R/U/D operations on persistence storage.

## 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: `getSODmap` [R]

**Detailed call chain analysis from the broader codebase:**

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Screen:KKSV0200 | `KKSV0200OPOperation` -> `KKSV020032CC` -> `main()` -> `editHakkoSODMap` | `getSODmap [R]` (in-memory) |
| 2 | Screen:KKSV0197 | `KKSV0197OPOperation` -> `editHakkoSODMap` (wrapper) -> `JKKMalwareBlockingNonFlgChengeOverCC.editHakkoSODMap` | `getSODmap [R]` (in-memory) |
| 3 | Screen:KKSV0198 | `KKSV0198OPOperation` -> `editHakkoSODMap` (wrapper) -> `JKKMalwareBlockingNonFlgChengeOverCC.editHakkoSODMap` | `getSODmap [R]` (in-memory) |
| 4 | Screen:KKSV0101 | `KKSV0101OPOperation` -> `editHakkoSODMap` (wrapper) -> `JKKMalwareBlockingNonFlgChengeOverCC.editHakkoSODMap` | `getSODmap [R]` (in-memory) |
| 5 | Screen:KKSV0118 | `KKSV0118OPOperation` -> `editHakkoSODMap` (wrapper) -> `JKKMalwareBlockingNonFlgChengeOverCC.editHakkoSODMap` | `getSODmap [R]` (in-memory) |

**Note:** Screens KKSV0197, KKSV0198, KKSV0101, and KKSV0118 each define their own private `editHakkoSODMap()` wrapper methods that internally delegate to this common component method. KKSV0200 is the primary caller (though the direct call at line 348 is commented out in the code snapshot — the active path uses `editHakkoSODMap2` at line 947).

## 6. Per-Branch Detail Blocks

### Block 1 — EXEC (Data Extraction) (L196)

> Retrieves the shared target data map from the parameter object. This map was populated by the caller (`main()`) just before invoking this method.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `HashMap<String, Object> targetMap = (HashMap<String, Object>)param.getData("hakko_sod_cc_trgt_data")` |

### Block 2 — EXEC (List Initialization) (L199)

> Creates the target data list — an ArrayList that will hold SOD map entries, one per service contract.

| # | Type | Code |
|---|------|------|
| 1 | SET | `ArrayList<HashMap<String, Object>> trgt_data_list = new ArrayList<HashMap<String, Object>>()` // 対象データリスト (target data list) |

### Block 3 — EXEC (SOD Basic Info Map Creation) (L201)

> Creates the SOD basic information HashMap. This container holds metadata about the SOD issuance operation.

| # | Type | Code |
|---|------|------|
| 1 | SET | `HashMap<String, Object> sod_kihon_info = new HashMap<String, Object>()` // SOD基本情報 (SOD basic info) |

### Block 4 — EXEC (Function Code Assignment) (L204)

> Sets the function code key on the target map. The comment states: "機能コード（チェックモードでは実行しないため、'1'固定）" — Functional code (fixed to '1' since it does not execute in check mode). `FUNC_CD_1 = "1"` from `JPCModelConstant`.

| # | Type | Code |
|---|------|------|
| 1 | SET | `targetMap.put(JCMConstants.FUNC_CODE_KEY, JPCModelConstant.FUNC_CD_1)` // [-> FUNC_CD_1="1"] 機能コード固定 |

### Block 5 — EXEC (SOD System ID Population) (L207)

> Retrieves the system ID from the work map and populates the SOD basic info. The constant `INFO_SYSID = "sysid"` and the work map key `SYSID = "sysid"` from `KKSV0200_KKSV0200OP_WORK`.

| # | Type | Code |
|---|------|------|
| 1 | SET | `sod_kihon_info.put(JKKHakkoSODConstCC.INFO_SYSID, workMap.get(KKSV0200_KKSV0200OP_WORK.SYSID))` // [-> INFO_SYSID="sysid"] SOD基本情報 SYSID |

### Block 6 — EXEC (SOD Relocation Division) (L210)

> Sets the relocation division field to blank. Comment: "異動区分" (relocation/movement division). This is intentionally left blank in this context.

| # | Type | Code |
|---|------|------|
| 1 | SET | `sod_kihon_info.put(JKKHakkoSODConstCC.INFO_IDO_DIV, "")` // [-> INFO_IDO_DIV="ido_div"] 異動区分（空白） |

### Block 7 — EXEC (Malware Blocking Division) (L213)

> Sets the malware blocking division to "1". Comment: "マルウェアブロッキング区分 ブラインド値" — Malware blocking division, blind value. This indicates the standard processing path (not blacklisted).

| # | Type | Code |
|---|------|------|
| 1 | SET | `sod_kihon_info.put(JKKHakkoSODConstCC.INFO_MALWARE_BLOCKING_DIV, "1")` // [-> INFO_MALWARE_BLOCKING_DIV="malware_blocking_div"] マルウェアブロッキング区分=1（ブラインド値） |

### Block 8 — EXEC (Service Contract Info Map Creation) (L216)

> Creates a new HashMap for service contract information.

| # | Type | Code |
|---|------|------|
| 1 | SET | `HashMap<String, Object> svc_kei_info = new HashMap<String, Object>()` // サービス契約情報 (service contract info) |

### Block 9 — EXEC (Service Contract Number Population) (L218)

> Sets the service contract number from the work map. Comment: "サービス契約番号" (service contract number). `INFO_SVC_KEI_NO = "svc_kei_no"` and work map key `SVC_KEI_NO = "svc_kei_no"`.

| # | Type | Code |
|---|------|------|
| 1 | SET | `svc_kei_info.put(JKKHakkoSODConstCC.INFO_SVC_KEI_NO, workMap.get(KKSV0200_KKSV0200OP_WORK.SVC_KEI_NO))` // [-> INFO_SVC_KEI_NO="svc_kei_no"] サービス契約番号 |

### Block 10 — EXEC (Previous Service Contract Number Population) (L220)

> Sets the previous service contract number (先サービス契約番号). For most operations this is the same as the current contract number. `INFO_SAKI_SVC_KEI_NO = "saki_svc_kei_no"`.

| # | Type | Code |
|---|------|------|
| 1 | SET | `svc_kei_info.put(JKKHakkoSODConstCC.INFO_SAKI_SVC_KEI_NO, workMap.get(KKSV0200_KKSV0200OP_WORK.SVC_KEI_NO))` // [-> INFO_SAKI_SVC_KEI_NO="saki_svc_kei_no"] 先サービス契約番号 |

### Block 11 — IF (Target Data List Size Check) (L223)

> Checks if the target data list is empty (size below 1). Comment: "サービス契約内容がないため入力データリストが出ていない場合、1件だけ作成" — If no service contract content exists and the input data list is not generated, create one entry only. This ensures at least one SOD map entry exists.

| # | Type | Code |
|---|------|------|
| 1 | IF | `if (1 > trgt_data_list.size())` // [-> 1] サービス契約内容がない場合のフォールバック |
| 1.1 | CALL | `getSODmap(trgt_data_list, 0)` // private helper — creates a new HashMap entry at position 0 if the list is empty |

### Block 12 — FOR (SOD Map Entry Iteration) (L228)

> Iterates over each SOD map entry in the target data list. For every entry, attaches the SOD basic info and service contract info maps. This creates the nested structure expected by `JKKHakkoSODCC.hakkoSOD()`.

| # | Type | Code |
|---|------|------|
| 1 | FOR | `for (int x = 0; x < trgt_data_list.size(); x++)` // 各SODマップエントリーを走査 |
| 1.1 | SET | `HashMap<String, Object> sod_map = trgt_data_list.get(x)` // SODマップ (SOD map) |
| 1.2 | SET | `sod_map.put(JKKHakkoSODConstCC.SOD_KIHON_INFO, sod_kihon_info)` // [-> SOD_KIHON_INFO="sod_kihon_info"] SOD基本情報をセット |
| 1.3 | SET | `sod_map.put(JKKHakkoSODConstCC.SVC_KEI_INFO, svc_kei_info)` // [-> SVC_KEI_INFO="svc_kei_info"] サービス契約情報をセット |

### Block 13 — EXEC (Store Result and Return) (L234, L236)

> Stores the populated target data list back into the target map under the `TRGT_DATA_LIST` key (`"trgt_data_list"`), then returns the modified `param` object to the caller.

| # | Type | Code |
|---|------|------|
| 1 | SET | `targetMap.put(JKKHakkoSODConstCC.TRGT_DATA_LIST, trgt_data_list)` // [-> TRGT_DATA_LIST="trgt_data_list"] 対象データリストを保存 |
| 2 | RETURN | `return param` // 編集されたパラメータを返す |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `svc_kei_no` | Field | Service contract number — the unique identifier for a telecom service contract (e.g., FTTH line, phone service) |
| `saki_svc_kei_no` | Field | Previous service contract number — the prior contract number used in upgrade/transfer scenarios (e.g., number portability) |
| `sysid` | Field | System ID — the internal system identifier associated with a service contract |
| `ido_div` | Field | Relocation division — a flag indicating whether a service is being relocated; blank here because this operation does not involve relocation |
| `malware_blocking_div` | Field | Malware blocking division — classifies the malware blocking status; "1" indicates the standard (non-blacklisted) processing path |
| `sod_kihon_info` | Field | SOD basic information — the container key for SOD-level metadata (system ID, relocation division, malware blocking status) |
| `svc_kei_info` | Field | Service contract information — the container key for service contract details (contract number, previous contract number) |
| `trgt_data_list` | Field | Target data list — the ArrayList that holds per-contract SOD map entries for the SOD issuance component |
| `hakko_sod_cc_trgt_data` | Field | The parameter key under which the target data map is stored on `IRequestParameterReadWrite` — the shared container between `main()` and `editHakkoSODMap()` |
| `FUNC_CODE_KEY` | Constant | Function code key — the parameter map key used to store the processing mode indicator; value "1" = normal execution (not check mode) |
| `FUNC_CD_1` | Constant | Function code value "1" — indicates normal processing mode (as opposed to check/test mode) |
| SOD | Acronym | Service Order Data — the telecom service order entity that captures contract details for order fulfillment and provisioning workflows |
| CC | Acronym | Common Component — a shared utility class in the K-Opticom framework that provides reusable business logic across screens and BPM flows |
| CBS | Acronym | Component-Based System — the service component architecture used for database-level operations |
| BPM | Acronym | Business Process Management — the workflow engine (via `BPMOperator`) that orchestrates screen operations through step targets |
| KKSV0200 | Screen | Service Contract Update / Service Information Order — the primary screen that manages service contract lifecycle operations, including SOD issuance |
| MALWARE_BLOCKING | Feature | Malware blocking data migration feature (v49.00.00, ANK-3834-00-00) — introduced malware blocking classification fields into SOD data for security compliance |
| FTTH | Business term | Fiber To The Home — fiber-optic broadband internet service; the primary service type in the K-Opticom system |
| ENUM | Business term | Electronic Number Mapping — a telephone numbering service that maps phone numbers to IP-based endpoints (VoIP routing) |
