# Business Logic — JKKMalwareBlockingNonFlgChengeOverCC.editInMsg() [56 LOC]

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

## 1. Role

### JKKMalwareBlockingNonFlgChengeOverCC.editInMsg()

This method is a **shared message builder utility** used across multiple business processes in the Fujitsu Order Data (FOD) system. Its purpose is to construct a standardized inbound message (`HashMap<String, Object>`) that wraps request metadata and service message templates for CBS (Call-Based Service) invocation. 

The method operates as a **composite builder pattern**: it extracts system-level telemetry data (transaction ID, use case ID, operation ID, call type) from the request parameter object, collects operational context (client hostname, client IP, screen ID, operator ID) from a control map, extracts the service interface name to locate the corresponding Japanese message bundle (`eo.ejb.cbs.cbsmsg.{svcIf}CBSMsg`), and then iterates over `mappingData` to populate template message fields — setting null values for empty entries or copying values for populated ones. 

Its **role in the larger system** is as a message normalization layer: it transforms raw request parameters and mapping configuration into a structured inbound message that CBS components can consume directly. This allows disparate screen flows and batch processes to share a consistent message construction contract without duplicating message-handling logic.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["editInMsg(param, mappingData)"])
    STEP1["Create paramMap HashMap"]
    STEP2["Get Telegram ID - paramMap.put(TRANZACTION_ID_KEY, param.getTelegramID())"]
    STEP3["Get Usecase ID - paramMap.put(USECASE_ID_KEY, param.getUsecaseID())"]
    STEP4["Get Operation ID - paramMap.put(OPERATION_ID_KEY, param.getOperationID())"]
    STEP5["Get Call Type - paramMap.put(CALL_TYPE_KEY, param.getCallType())"]
    STEP6["Get Client Hostname - paramMap.put(CLIENT_HOST_NAME_KEY, param.getControlMapData(REQ_HOSTNAME))"]
    STEP7["Get Client IP - paramMap.put(CLIENT_IP_ADDRESS_KEY, param.getControlMapData(REQ_HOSTIP))"]
    STEP8["Get Screen ID - paramMap.put(INVOKE_GAMEN_ID_KEY, param.getControlMapData(REQ_VIEWID))"]
    STEP9["Get Operator ID - paramMap.put(OPERATOR_ID_KEY, param.getControlMapData(OPERATOR_ID))"]
    STEP10["Extract svcIf from mappingData[0][1]"]
    STEP11["Create CAANMsg template with bundle eo.ejb.cbs.cbsmsg.%sCBSMsg"]
    STEP12["Set Operator ID on template"]
    STEP13["Set Operate Date on template"]
    STEP14["Set Operate Datetime on template"]
    STEP15["Loop: for each mappingData row"]
    COND{"Is mappingData[i][1] empty?"}
    STEPNSET["template.setNull(mappingData[i][0])"]
    STEPSET["template.set(mappingData[i][0], mappingData[i][1])"]
    STEP16["Wrap template in CAANMsg[] array"]
    STEP17["Put template list into paramMap"]
    STEP18["Return paramMap"]

    START --> STEP1 --> STEP2 --> STEP3 --> STEP4 --> STEP5 --> STEP6 --> STEP7 --> STEP8 --> STEP9 --> STEP10 --> STEP11 --> STEP12 --> STEP13 --> STEP14 --> STEP15 --> COND
    COND -- "Yes" --> STEPNSET --> STEP15
    COND -- "No" --> STEPSET --> STEP15
    STEP15 --> STEP16 --> STEP17 --> STEP18 --> END_NODE(["Return"])
```

**Explanation of processing pattern:**

The method follows a **linear pipeline with one conditional loop**:

1. **Telemetry Extraction Phase** — Extracts 4 system-level fields from `param` (Telegram ID, Usecase ID, Operation ID, Call Type) and stores them in `paramMap`.
2. **Operational Context Phase** — Extracts 4 client-side context fields from `param.getControlMapData()` using `SCControlMapKeys` constants and stores them in `paramMap`.
3. **Template Creation Phase** — Reads the service interface name from `mappingData[0][1]` to build a message bundle path (`eo.ejb.cbs.cbsmsg.{svcIf}CBSMsg`), then creates a `CAANMsg` instance. Sets operator ID, operate date, and operate datetime on the template.
4. **Field Population Phase** — Iterates over all rows in `mappingData`. For each row, if the value (`mappingData[i][1]`) is empty, it calls `template.setNull()` with the field key; otherwise it calls `template.set()` to populate the field.
5. **Assembly Phase** — Wraps the single template in a `CAANMsg[]` array, places it in `paramMap` under the template list key, and returns the result.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `param` | `IRequestParameterReadWrite` | The inbound request context object carrying system-level telemetry data (transaction ID, use case ID, operation ID, call type) and operational context (hostname, IP, screen ID, operator ID, date/time). This object is populated by the screen/batch entry point and flows through the CC layer. |
| 2 | `mappingData` | `Object[][]` | A 2D mapping table where each row represents a message field: `[i][0]` is the field name (String key) and `[i][1]` is the field value (Object). Row 0 is reserved for the service interface name. This data is pre-configured by the business process to declare which message template fields should be set. |

**External State / Instance Fields:**
- None. The method is fully stateless and reads nothing from instance variables.

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `JCMConstants` (constants) | - | - | References constants: `TRANZACTION_ID_KEY`, `USECASE_ID_KEY`, `OPERATION_ID_KEY`, `CALL_TYPE_KEY`, `CLIENT_HOST_NAME_KEY`, `CLIENT_IP_ADDRESS_KEY`, `INVOKE_GAMEN_ID_KEY`, `OPERATOR_ID_KEY`, `OPERATE_DATE_KEY`, `OPERATE_DATETIME_KEY`, `TEMPLATE_LIST_KEY` |
| - | `SCControlMapKeys` (constants) | - | - | References constants: `REQ_HOSTNAME`, `REQ_HOSTIP`, `REQ_VIEWID`, `OPERATOR_ID`, `OPE_DATE`, `OPE_TIME` |
| - | `IRequestParameterReadWrite.getTelegramID()` | - | - | Reads Telegram ID from request parameter |
| - | `IRequestParameterReadWrite.getUsecaseID()` | - | - | Reads Usecase ID from request parameter |
| - | `IRequestParameterReadWrite.getOperationID()` | - | - | Reads Operation ID from request parameter |
| - | `IRequestParameterReadWrite.getCallType()` | - | - | Reads Call Type from request parameter |
| - | `IRequestParameterReadWrite.getControlMapData(key)` | - | - | Reads operational context values from the control map |
| - | `CAANMsg.setNull(key)` | - | - | Sets a message template field to null for empty values |
| - | `CAANMsg.set(key, value)` | - | - | Sets a message template field to the specified value |

**Note:** This method is a pure **message builder** — it does not directly invoke CBS service components, DAO methods, or perform any database CRUD operations. It constructs the inbound message structure that will be passed to CBS components by its caller. All called methods (`setNull`, `set`) operate on the `CAANMsg` template object in memory.

## 5. Dependency Trace

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

No screen/batch entry points found within 8 hops. Direct callers found: 1 method.
Terminal operations from this method: `setNull` [-], `set` [-]

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | CBS: JKKMalwareBlockingNonFlgChengeOverCC.callSC() | `callSC()` -> `editInMsg(param, mappingData)` | `template.setNull(key)`, `template.set(key, value)` |

**Notes:**
- The method is `private` and called only by `callSC()` within the same class.
- `callSC()` is the business process orchestrator that coordinates this malware blocking flag change-over operation.
- The method does not traverse to screens, batches, or external CBS/DAO layers directly.

## 6. Per-Branch Detail Blocks

### Block 1 — [SET] `(paramMap initialization)` (L839)

> Initializes the outbound message map that will carry all message metadata.

| # | Type | Code |
|---|------|------|
| 1 | SET | `paramMap = new HashMap<String, Object>()` |

---

### Block 2 — [EXEC] `[Telegram ID Extraction]` (L842)

> Reads system-level transaction identifier from the request parameter.
> Javadoc comment: `【取得元：電文ヘッダ(ヘッダ)】 電文ID` ("Source: Message Header — Transaction ID")

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `paramMap.put(JCMConstants.TRANZACTION_ID_KEY, param.getTelegramID())` |

---

### Block 3 — [EXEC] `[Usecase ID Extraction]` (L844)

> Reads the use case identifier from the request parameter.
> Javadoc comment: `【取得元：電文ヘッダ(ヘッダ)】 ユーケースID` ("Source: Message Header — Usecase ID")

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `paramMap.put(JCMConstants.USECASE_ID_KEY, param.getUsecaseID())` |

---

### Block 4 — [EXEC] `[Operation ID Extraction]` (L846)

> Reads the operation identifier from the request parameter.
> Javadoc comment: `【取得元：電文ヘッダ(ヘッダ)】 オペレーションID` ("Source: Message Header — Operation ID")

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `paramMap.put(JCMConstants.OPERATION_ID_KEY, param.getOperationID())` |

---

### Block 5 — [EXEC] `[Call Type Extraction]` (L848)

> Reads the call type discriminator from the request parameter.
> Javadoc comment: `【取得元：電文ヘッダ(ヘッダ)】 サービス呼び出し区分` ("Source: Message Header — Service Call Type Classification")

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `paramMap.put(JCMConstants.CALL_TYPE_KEY, param.getCallType())` |

---

### Block 6 — [EXEC] `[Client Hostname Extraction]` (L851)

> Reads the client hostname from the control map.
> Javadoc comment: `【取得元：ユーザエリア(コントローラマップ)】 依頼先ホスト名` ("Source: User Area (Controller Map) — Client Hostname")

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `paramMap.put(JCMConstants.CLIENT_HOST_NAME_KEY, param.getControlMapData(SCControlMapKeys.REQ_HOSTNAME))` |

---

### Block 7 — [EXEC] `[Client IP Address Extraction]` (L853)

> Reads the client IP address from the control map.
> Javadoc comment: `【取得元：ユーザエリア(コントローラマップ)】 依頼元IPアドレス` ("Source: User Area (Controller Map) — Client Source IP Address")

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `paramMap.put(JCMConstants.CLIENT_IP_ADDRESS_KEY, param.getControlMapData(SCControlMapKeys.REQ_HOSTIP))` |

---

### Block 8 — [EXEC] `[Screen ID Extraction]` (L855)

> Reads the originating screen/view identifier from the control map.
> Javadoc comment: `【取得元：ユーザエリア(コントローラマップ)】 依頼元画面ID` ("Source: User Area (Controller Map) — Client Source Screen ID")

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `paramMap.put(JCMConstants.INVOKE_GAMEN_ID_KEY, param.getControlMapData(SCControlMapKeys.REQ_VIEWID))` |

---

### Block 9 — [EXEC] `[Operator ID Extraction]` (L857)

> Reads the operator identifier from the control map.
> Javadoc comment: `【取得元：ユーザエリア(コントローラマップ)】 オペレータID` ("Source: User Area (Controller Map) — Operator ID")

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `paramMap.put(JCMConstants.OPERATOR_ID_KEY, param.getControlMapData(SCControlMapKeys.OPERATOR_ID))` |

---

### Block 10 — [SET] `[Service Interface Extraction]` (L860)

> Reads the service interface name from `mappingData[0][1]`, which serves as the key to look up the Japanese message bundle.
> Javadoc comment: `サービスインターフェースID` ("Service Interface ID")

| # | Type | Code |
|---|------|------|
| 1 | SET | `svcIf = (String)mappingData[0][1]` |

---

### Block 11 — [SET] `[Message Template Creation]` (L861)

> Creates a `CAANMsg` instance using the service interface name to form the message bundle path.
> The bundle path follows the pattern `eo.ejb.cbs.cbsmsg.{svcIf}CBSMsg`, which maps to a resource bundle containing Japanese error/success messages.

| # | Type | Code |
|---|------|------|
| 1 | SET | `template = new CAANMsg(String.format("eo.ejb.cbs.cbsmsg.%sCBSMsg", svcIf))` |

---

### Block 12 — [EXEC] `[Template Operator ID]` (L864)

> Sets the operator ID on the message template.
> Javadoc comment: `オペレータID` ("Operator ID")

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `template.set(JCMConstants.OPERATOR_ID_KEY, param.getControlMapData(SCControlMapKeys.OPERATOR_ID))` |

---

### Block 13 — [EXEC] `[Template Operate Date]` (L866)

> Sets the operate date on the message template.
> Javadoc comment: `運用日付` ("Operate Date")

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `template.set(JCMConstants.OPERATE_DATE_KEY, param.getControlMapData(SCControlMapKeys.OPE_DATE))` |

---

### Block 14 — [EXEC] `[Template Operate Datetime]` (L868)

> Sets the operate datetime on the message template.
> Javadoc comment: `運用日時` ("Operate Datetime")

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `template.set(JCMConstants.OPERATE_DATETIME_KEY, param.getControlMapData(SCControlMapKeys.OPE_TIME))` |

---

### Block 15 — [FOR LOOP] `[mappingData Field Population]` (L871)

> Iterates over all rows in `mappingData` to populate message template fields. Each row contains a field key (`[i][0]`) and a field value (`[i][1]`). Row 0 was already consumed for the service interface name; subsequent rows populate template message fields.

#### Block 15.1 — [IF-ELSE] `[Empty Value Check: mappingData[i][1] equals ""]` (L873)

> Determines whether the field value should be set as null or populated.

| # | Type | Code |
|---|------|------|
| 1 | COND | `"".equals(mappingData[i][1])` |

**Block 15.1.1** — [ELSE-IF] `[Yes: empty value]` (L875)

> Calls `setNull` on the template to clear the field.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `template.setNull((String)mappingData[i][0])` |

**Block 15.1.2** — [ELSE] `[No: non-empty value]` (L878)

> Calls `set` on the template to populate the field with the value from `mappingData`.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `template.set((String)mappingData[i][0], mappingData[i][1])` |

---

### Block 16 — [SET] `[Template Array Assembly]` (L883)

> Wraps the single `CAANMsg` template in a one-element array. This is consistent with a design pattern where the template list key expects a `CAANMsg[]` array.

| # | Type | Code |
|---|------|------|
| 1 | SET | `templates = new CAANMsg[1]` |
| 2 | SET | `templates[0] = template` |

---

### Block 17 — [EXEC] `[Template List Assignment]` (L886)

> Places the template array into the parameter map under the template list key.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `paramMap.put(JCMConstants.TEMPLATE_LIST_KEY, templates)` |

---

### Block 18 — [RETURN] (L887)

> Returns the fully assembled inbound message map.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return paramMap` |

---

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `TRANZACTION_ID_KEY` | Constant | Transaction ID key — unique identifier for a message transaction in the system |
| `USECASE_ID_KEY` | Constant | Usecase ID key — identifies the business use case being executed |
| `OPERATION_ID_KEY` | Constant | Operation ID key — identifies the specific operation within a use case |
| `CALL_TYPE_KEY` | Constant | Call Type key — discriminator for the service call type |
| `CLIENT_HOST_NAME_KEY` | Constant | Client Hostname key — the hostname of the client system making the request |
| `CLIENT_IP_ADDRESS_KEY` | Constant | Client IP Address key — the IP address of the originating client |
| `INVOKE_GAMEN_ID_KEY` | Constant | Invoke Gamen ID key — the screen/view ID of the requesting UI ("gamemen" = screen in Japanese) |
| `OPERATOR_ID_KEY` | Constant | Operator ID key — the ID of the operator performing the action |
| `OPERATE_DATE_KEY` | Constant | Operate Date key — the date of the operation |
| `OPERATE_DATETIME_KEY` | Constant | Operate Datetime key — the timestamp of the operation |
| `TEMPLATE_LIST_KEY` | Constant | Template List key — key used to store the array of CAANMsg templates in the parameter map |
| `REQ_HOSTNAME` | Constant | Request Hostname — control map key for the client hostname |
| `REQ_HOSTIP` | Constant | Request Host IP — control map key for the client IP address |
| `REQ_VIEWID` | Constant | Request View ID — control map key for the originating screen/view ID |
| `OPE_DATE` | Constant | Operation Date — control map key for the operate date |
| `OPE_TIME` | Constant | Operation Time — control map key for the operate time |
| `svcIf` | Field | Service Interface — the service interface name extracted from `mappingData[0][1]`, used to locate the message bundle |
| CAANMsg | Class | Fujitsu internal message class — a message template object that holds key-value pairs of translatable message content (typically Japanese error/success messages) |
| IRequestParameterReadWrite | Interface | Request parameter interface — the contract for reading/writing request parameters passed between screens, CC components, and CBS services |
| JCMConstants | Class | Japanese Communication Message Constants — contains constant keys for standard message fields (transaction ID, use case ID, etc.) |
| SCControlMapKeys | Class | Service Component Control Map Keys — contains constant keys for control map data (hostname, IP, screen ID, operator ID, date/time) |
|.mappingData | Field | Mapping Data — a 2D array where `[i][0]` is a field key and `[i][1]` is a field value; used to declare which message template fields to populate |
| FOD | Acronym | Fujitsu Order Data — the telecom order fulfillment platform this system operates within |
| CBS | Acronym | Call-Based Service — the service component architecture for executing business operations |
| CC | Acronym | Common Component — shared service component layer (Controller/Component layer) that provides reusable business logic across multiple screens and processes |
| 電文ヘッダ | Japanese | Message Header — system-level metadata at the top of a message (transaction ID, use case ID, operation ID, call type) |
| ユーザエリア | Japanese | User Area — the contextual section of the request containing operational data (hostname, IP, screen ID, operator ID, date/time) |
| 運用日付 | Japanese | Operate Date — the date the business operation is performed |
| 運用日時 | Japanese | Operate Datetime — the full timestamp of the business operation |
| サービス呼び出し区分 | Japanese | Service Call Type Classification — distinguishes between different types of service invocations |
| 依頼先ホスト名 | Japanese | Client Hostname — the hostname of the destination/requested host |
| 依頼元IPアドレス | Japanese | Client Source IP Address — the IP address of the request originator |
| 依頼元画面ID | Japanese | Client Source Screen ID — the ID of the originating screen/view |
| オペレータID | Japanese | Operator ID — the ID of the human operator performing the operation |
| サービスインターフェースID | Japanese | Service Interface ID — the identifier for the service interface, used to locate the message bundle |
| JKKMalwareBlockingNonFlgChengeOverCC | Class | Malware Blocking Non-Flag Change-Over CC — a common component handling the business operation of changing over the malware blocking flag (a state management toggle for malware blocking in telecom service records) |
| KKSV* | Pattern | Screen class naming convention — screen classes in this system follow the pattern `KKSV` followed by a 4-digit number (e.g., `KKSV0004`) |
