# Business Logic — JKKStbUcwkEoTvKktkSvcKeiCC.editInMsg() [38 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `com.fujitsu.futurity.bp.custom.common.JKKStbUcwkEoTvKktkSvcKeiCC` |
| Layer | CC (Common Component — shared utility called by CBS and check layers) |
| Module | `common` (Package: `com.fujitsu.futurity.bp.custom.common`) |

## 1. Role

### JKKStbUcwkEoTvKktkSvcKeiCC.editInMsg()

This method is a **request message preparation utility** that constructs the inbound parameter map and message bundle for downstream Service Component (SC) invocations. It plays the role of a **data enrichment and header propagation layer** — extracting operational context (transaction IDs, use-case IDs, operation IDs, call types) from the `IRequestParameterReadWrite` interface and packaging them into a `HashMap<String, Object>` that is passed to subsequent SC calls. It also extracts client-side connection metadata (hostname, IP address, screen ID, operator ID) from the control map, propagates the operator ID and operational timestamps to the `CAANMsg` envelope for audit logging, and prepares a template message array containing the sanitized `msg` object. The method implements the **preparation/delegation pattern** common across the e-Optical TV channel registration subsystem — every screen-level Business Screen Mapper (BS Mapper) in the e-Optical TV domain delegates inbound message preparation to this shared component, ensuring consistent message envelope structure regardless of which specific CBS (EKK, ECR, EZM, ETC) is ultimately invoked. It is a non-branching, linear preparation routine with no conditional logic, making it a stable shared utility.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["editInMsg(param, msg)"])
    STEP1["Create paramMap (HashMap)"]
    STEP2["Extract transaction header - TelegramID, UsecaseID, OperationID, CallType"]
    STEP3["Extract client info - REQ_HOSTNAME, REQ_HOSTIP, REQ_VIEWID, OPERATOR_ID"]
    STEP4["Set operator date/time on msg - OPERATOR_ID, OPE_DATE, OPE_TIME"]
    STEP5["Call setNullToMsg(msg) - null out all schema keys"]
    STEP6["Wrap msg into CAANMsg array template"]
    STEP7["Put templateList into paramMap"]
    END(["Return paramMap"])

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

**Processing summary:** This method performs strictly sequential operations with no conditional branches:

1. Create a new `HashMap<String, Object>` as the parameter map container.
2. Extract four transaction header values from `param`: Telegram ID, use-case ID, operation ID, and call type. These are standard framework keys defined in `JCMConstants`.
3. Extract four client connection metadata values from the control map of `param`: client hostname, client IP address, screen ID, and operator ID. These come from `SCControlMapKeys` constants.
4. Set the operator ID, operation date, and operation datetime into the `CAANMsg` object for audit trail purposes.
5. Call `setNullToMsg(msg)` to null out all schema-defined keys in the message envelope.
6. Wrap the processed `msg` into a single-element `CAANMsg[]` array and store it under the template list key.
7. Put the template array into `paramMap` and return the map to the caller.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `param` | `IRequestParameterReadWrite` | The request parameter interface carrying all inbound context: transaction identifiers (telegram ID, use-case ID, operation ID, call type) and client-side connection metadata (hostname, IP, screen ID, operator ID) obtained from the control map. This object originates from the screen-level Business Screen Mapper and serves as the single source of operational and client context for the SC invocation. |
| 2 | `msg` | `CAANMsg` | The message envelope that will be passed to the downstream Service Component. Before being wrapped into the template list, its operator ID, operation date, and operation datetime fields are populated from the control map, and all schema keys are nulled out via `setNullToMsg()` to ensure a clean message slate. |

**External state read:**

| Field | Source | Business Description |
|-------|--------|---------------------|
| `JCMConstants.TRANZACTION_ID_KEY` | External framework constant | Key string for transaction/telegram ID |
| `JCMConstants.USECASE_ID_KEY` | External framework constant | Key string for use-case ID |
| `JCMConstants.OPERATION_ID_KEY` | External framework constant | Key string for operation ID |
| `JCMConstants.CALL_TYPE_KEY` | External framework constant | Key string for call type classification |
| `JCMConstants.CLIENT_HOST_NAME_KEY` | External framework constant | Key string for client hostname |
| `JCMConstants.CLIENT_IP_ADDRESS_KEY` | External framework constant | Key string for client IP address |
| `JCMConstants.INVOKE_GAMEN_ID_KEY` | External framework constant | Key string for screen ID |
| `JCMConstants.OPERATOR_ID_KEY` | External framework constant | Key string for operator ID |
| `JCMConstants.OPERATE_DATE_KEY` | External framework constant | Key string for operation date |
| `JCMConstants.OPERATE_DATETIME_KEY` | External framework constant | Key string for operation datetime |
| `JCMConstants.TEMPLATE_LIST_KEY` | External framework constant | Key string for the template list array |
| `SCControlMapKeys.REQ_HOSTNAME` | External framework constant | Control map key for request hostname |
| `SCControlMapKeys.REQ_HOSTIP` | External framework constant | Control map key for request IP address |
| `SCControlMapKeys.REQ_VIEWID` | External framework constant | Control map key for screen (game) ID |
| `SCControlMapKeys.OPERATOR_ID` | External framework constant | Control map key for operator ID |
| `SCControlMapKeys.OPE_DATE` | External framework constant | Control map key for operation date |
| `SCControlMapKeys.OPE_TIME` | External framework constant | Control map key for operation time |

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| U | `JKKStbUcwkEoTvKktkSvcKeiCC.setNullToMsg` | JKKStbUcwkEoTvKktkSvcKeiCC | CAANMsg schema keys | Calls `setNullToMsg` to null out all schema-defined message fields, preparing a clean message envelope |

**Analysis notes:**
- This method performs **no actual database CRUD operations** (no C/R/U/D against `KK_T_*` tables).
- It performs **no SC/CBS invocations** (no calls to service components like `EKK0361A010SC`).
- It is a pure **message preparation and enrichment** utility.
- The only mutable external effect is the call to `setNullToMsg(msg)`, which clears all schema keys on the `CAANMsg` object in-place — this is a **modification (U)** of the message envelope's internal state, not a database operation.

## 5. Dependency Trace

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

No screen/batch entry points found within 8 hops. Direct callers found: 1 method (`callSC`).
Terminal operations from this method: `setNullToMsg` [-], `getCallType` [R]

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | CBS:JKKStbUcwkEoTvKktkSvcKeiCC.callSC | `callSC(handle, scCall, param, fixedText, inMsg)` -> `editInMsg(param, msg)` | `setNullToMsg [-]` |

**Context:** The primary caller of `editInMsg` is the class's own `callSC` method, which orchestrates Service Component invocations. Each screen-level Business Screen Mapper (BS Mapper) — such as those for `DKSV0141`, `CRSV0237`, `KKSV0495`, `ZMSV0105`, `CRSV0124`, `CHSV9001`, `KKSV0557`, `CRSV0101`, and `ZMSV0076` — has its own variant of `editInMsg(param)` (overloaded with a single parameter) that internally constructs the message and delegates to this two-parameter version. The screens listed above are all part of the **e-Optical TV Channel Registration** subsystem.

## 6. Per-Branch Detail Blocks

This method has **no conditional branches** (no if/else, switch, loops, or try-catch). It executes in a single linear path.

**Block 1** — [LINEAR EXECUTION] (L816–L853)

> The entire method executes sequentially with no branching. It extracts header data from the request parameter, extracts client metadata from the control map, populates the message envelope, cleans the message schema, and returns the assembled parameter map.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | SET | `paramMap = new HashMap<String, Object>()` | Create the outbound parameter map container |
| 2 | CALL | `param.getTelegramID()` [-> `JCMConstants.TRANZACTION_ID_KEY`] | 【取得元：電文ヘッダ(ヘッダ)】Get telegram ID from request header |
| 3 | EXEC | `paramMap.put(JCMConstants.TRANZACTION_ID_KEY, param.getTelegramID())` | Store transaction ID in paramMap |
| 4 | CALL | `param.getUsecaseID()` [-> `JCMConstants.USECASE_ID_KEY`] | 【取得元：電文ヘッダ(ヘッダ)】Get use-case ID from request header |
| 5 | EXEC | `paramMap.put(JCMConstants.USECASE_ID_KEY, param.getUsecaseID())` | Store use-case ID in paramMap |
| 6 | CALL | `param.getOperationID()` [-> `JCMConstants.OPERATION_ID_KEY`] | 【取得元：電文ヘッダ(ヘッダ)】Get operation ID from request header |
| 7 | EXEC | `paramMap.put(JCMConstants.OPERATION_ID_KEY, param.getOperationID())` | Store operation ID in paramMap |
| 8 | CALL | `param.getCallType()` [-> `JCMConstants.CALL_TYPE_KEY`] | 【取得元：電文ヘッダ(ヘッダ)】Get service call type classification |
| 9 | EXEC | `paramMap.put(JCMConstants.CALL_TYPE_KEY, param.getCallType())` | Store call type in paramMap |
| 10 | CALL | `param.getControlMapData(SCControlMapKeys.REQ_HOSTNAME)` [-> `JCMConstants.CLIENT_HOST_NAME_KEY`] | 【取得元：ユーザエリア(コントロールマップ)】Get client hostname from control map |
| 11 | EXEC | `paramMap.put(JCMConstants.CLIENT_HOST_NAME_KEY, ...)` | Store client hostname in paramMap |
| 12 | CALL | `param.getControlMapData(SCControlMapKeys.REQ_HOSTIP)` [-> `JCMConstants.CLIENT_IP_ADDRESS_KEY`] | 【取得元：ユーザエリア(コントロールマップ)】Get client IP address from control map |
| 13 | EXEC | `paramMap.put(JCMConstants.CLIENT_IP_ADDRESS_KEY, ...)` | Store client IP address in paramMap |
| 14 | CALL | `param.getControlMapData(SCControlMapKeys.REQ_VIEWID)` [-> `JCMConstants.INVOKE_GAMEN_ID_KEY`] | 【取得元：ユーザエリア(コントロールマップ)】Get screen ID from control map |
| 15 | EXEC | `paramMap.put(JCMConstants.INVOKE_GAMEN_ID_KEY, ...)` | Store screen ID in paramMap |
| 16 | CALL | `param.getControlMapData(SCControlMapKeys.OPERATOR_ID)` [-> `JCMConstants.OPERATOR_ID_KEY`] | 【取得元：ユーザエリア(コントロールマップ)】Get operator ID from control map |
| 17 | EXEC | `paramMap.put(JCMConstants.OPERATOR_ID_KEY, ...)` | Store operator ID in paramMap |
| 18 | EXEC | `msg.set(JCMConstants.OPERATOR_ID_KEY, param.getControlMapData(SCControlMapKeys.OPERATOR_ID))` | 【取得元：ユーザエリア(コントロールマップ)】Set operator ID on message envelope |
| 19 | CALL | `param.getControlMapData(SCControlMapKeys.OPE_DATE)` [-> `JCMConstants.OPERATE_DATE_KEY`] | 【取得元：電文ヘッダ(ヘッダ)】Get operation date from request |
| 20 | EXEC | `msg.set(JCMConstants.OPERATE_DATE_KEY, ...)` | 【運用日付】Set operation date on message envelope |
| 21 | CALL | `param.getControlMapData(SCControlMapKeys.OPE_TIME)` [-> `JCMConstants.OPERATE_DATETIME_KEY`] | 【取得元：電文ヘッダ(ヘッダ)】Get operation time from request |
| 22 | EXEC | `msg.set(JCMConstants.OPERATE_DATETIME_KEY, ...)` | 【運用日時】Set operation datetime on message envelope |
| 23 | CALL | `setNullToMsg(msg)` | Clean all schema keys in the message envelope for a fresh slate |
| 24 | SET | `templates = new CAANMsg[]{msg}` | Wrap processed msg into single-element CAANMsg template array |
| 25 | EXEC | `paramMap.put(JCMConstants.TEMPLATE_LIST_KEY, templates)` | Store template array in paramMap for SC consumption |
| 26 | RETURN | `return paramMap` | Return the fully constructed parameter map to the caller |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `TRANZACTION_ID_KEY` | Constant | Transaction ID — unique identifier for the request transaction/telegram |
| `USECASE_ID_KEY` | Constant | Use-case ID — identifies which business use-case scenario is being executed |
| `OPERATION_ID_KEY` | Constant | Operation ID — identifies the specific operation within a use-case |
| `CALL_TYPE_KEY` | Constant | Call type — classifies the type of service call (e.g., synchronous, asynchronous) |
| `CLIENT_HOST_NAME_KEY` | Constant | Client hostname — the DNS or network name of the client machine making the request |
| `CLIENT_IP_ADDRESS_KEY` | Constant | Client IP address — the network IP address of the requesting client |
| `INVOKE_GAMEN_ID_KEY` | Constant | Screen ID — the ID of the calling screen page (`gamen` = 画面, Japanese for "screen") |
| `OPERATOR_ID_KEY` | Constant | Operator ID — the ID of the user/operator performing the action |
| `OPERATE_DATE_KEY` | Constant | Operation date — the date the operation was performed (`oyouhin hiatu` = 運用日付, Japanese for "operation date") |
| `OPERATE_DATETIME_KEY` | Constant | Operation datetime — the timestamp of the operation (`oyouhin jiki` = 運用日時, Japanese for "operation datetime") |
| `TEMPLATE_LIST_KEY` | Constant | Template list — key under which the processed message template array is stored |
| `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/screen ID — control map key for the screen identifier |
| `IRequestParameterReadWrite` | Interface | Request parameter interface — the contract through which all request data (transaction IDs, control map data) is accessed by business logic components |
| `CAANMsg` | Class | CAAN Message envelope — a message container object used to pass structured data to and from Service Components; wraps typed message fields with schema support |
| `setNullToMsg` | Method | Null-out message schema method — clears all fields defined in the CAANMsg schema to prepare a clean message slate for reuse |
| CC | Acronym | Common Component — shared utility class in the `com.fujitsu.futurity.bp.custom.common` package, providing reusable logic for CBS (Business Screen) layers |
| SC | Acronym | Service Component — backend business logic modules (e.g., `EKK0791A010SC`) that perform actual database operations and business processing |
| BS Mapper | Acronym | Business Screen Mapper — a per-screen mapper class (e.g., `DKSV0141_DKSV0141OPBPCheck`) that prepares inbound parameters and dispatches to SCs |
| e-Optical TV | Business term | Fujitsu's e-Optical Television channel registration system — the business domain for which this subsystem manages channel registration operations |
| JCM | Acronym | Jakarta/Common Messaging — the framework defining message key constants used throughout the system |
