# Business Logic - JKKSeikyKeiHenkoCC.editInMsg_EKK0251C030() [440 LOC]

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

## 1. Role

### JKKSeikyKeiHenkoCC.editInMsg_EKK0251C030()

This method is the message extraction and template-building component for the **Service Contract Line Detail Content Change** business screen (EKK0251C030). In Japanese business terms, it handles the サービス契約回線内訳内容変更 (Service Contract Line Detail Content Change) - the process where a user modifies the detailed content of a service contract line item (e.g., changing a phone number, address, or installation date for a fiber-optic broadband service).

The method implements the **template builder pattern** common across the Fujitsu Futurity platform: it creates a `CAANMsg` message object populated with both common runtime metadata (operator ID, operation date, operation time) and a rich set of approximately 48 service contract line detail fields extracted from the child template (`EKK0251A010CBSMsg1List`) and child map. Each field is copied using null-safe extraction logic - if the source value is null or empty, the destination field is set to null; otherwise the value is transferred verbatim.

It is a **shared utility component** called from `execEKK0251C030()` (the screen execution handler) and follows the same structural pattern as other `editInMsg_EKKxxxxx` methods in this class, each handling a different screen's message preparation. The output is a `HashMap<String, Object>` containing a `TEMPLATE_LIST_KEY` entry with the assembled `CAANMsg[]` array, ready to be passed downstream for validation or display.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["editInMsg_EKK0251C030"]) --> S1["editInMsg param - common area setup"]
    S1 --> S2["Create CAANMsg EKK0251C030CBSMsg template"]
    S2 --> S3["Set common fields: template ID, func code, operator ID, operate date/time"]
    S3 --> S4["Extract childTemplate from dataMap EKK0251A010CBSMSG1LIST"]
    S4 --> S5["Extract workMap from param"]
    S5 --> S6["svc_kei_kaisen_ucwk_no empty?"]
    S6 -->|Yes| S7["setNull SVC_KEI_KAISEN_UCWK_NO"]
    S6 -->|No| S8["set SVC_KEI_KAISEN_UCWK_NO from childMap"]
    S7 --> S9["mskm_dtl_no null?"]
    S8 --> S9
    S9 -->|Yes| S10["setNull MSKM_DTL_NO"]
    S9 -->|No| S11["set MSKM_DTL_NO from childTemplate"]
    S10 --> S12["Map remaining ~48 fields from childTemplate/childMap with null-handling"]
    S11 --> S12
    S12 --> S13["Create templates array with template"]
    S13 --> S14["paramMap put TEMPLATE_LIST_KEY"]
    S14 --> END(["Return paramMap"])
```

**Constant Resolution:**
- `TEMPLATE_ID_EKK0251C030` = "EKK0251C030" (defined in `JKKAdInfChgConstCC.TEMPLATE_ID_EKK0251C030`)
- `FUNC_CODE` is set to "1" (hardcoded in source)
- The `EKK0251A010CBSMSG1LIST` key retrieves the child template for service contract line detail items

**Processing Summary:**
The method follows a linear pipeline with no branching beyond the null-check pattern:

1. **Common area setup (共通領域の設定):** Calls `editInMsg(param)` to build a base `paramMap` with common data.
2. **Template creation:** Creates a `CAANMsg` from `EKK0251C030CBSMsg.class`.
3. **Common field population:** Sets template ID, function code, operator ID, operate date, and operate datetime.
4. **Child template extraction:** Retrieves the `EKK0251A010CBSMsg1List` child template from `dataMap`.
5. **Field-by-field mapping:** For each of ~48 fields, checks if the source is null/empty. If null/empty, calls `template.setNull(...)`. Otherwise, calls `template.set(...)` with the string value from either `childTemplate.getString(...)` or `childMap.get(...)`.
6. **Template assembly:** Wraps the template in a `CAANMsg[]` array and puts it into `paramMap` under `TEMPLATE_LIST_KEY`.
7. **Return:** Returns the populated `paramMap`.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `param` | `IRequestParameterReadWrite` | The request parameter holder carrying the user's screen input data, control map data (operator ID, operate date/time), and the mapping work area (`workMap`) used for business processing. It serves as both input and output carrier. |
| 2 | `dataMap` | `Map<String, Object>` | A key-value store carrying screen-level data including the function code (`FUNC_CODE_KEY`) and the child template list (`EKK0251A010CBSMSG1LIST`). The child template contains the service contract line detail items extracted from the preceding screen (EKK0251A010). |
| 3 | `childMap` | `HashMap<String, Object>` | A child-level data map carrying supplemental fields specific to this screen's changes, such as the service contract line change work number (`svc_kei_kaisen_ucwk_no`), telecommunication company code (`kksv040325_kaisen_tk_comp_cd`), last update timestamp (`last_upd_dtm_svc_kei`), and billing address change flags. |

**Instance fields / external state used:**
- `JCMConstants.TEMPLATE_LIST_KEY` - Key constant for placing the template array into paramMap.
- `JCMConstants.FUNC_CODE_KEY` - Key constant for retrieving function code from dataMap.
- `JCMConstants.OPERATOR_ID_KEY` - Key for operator identification in CAANMsg.
- `JCMConstants.OPERATE_DATE_KEY` - Key for operation date in CAANMsg.
- `JCMConstants.OPERATE_DATETIME_KEY` - Key for operation datetime in CAANMsg.
- `SCControlMapKeys.OPERATOR_ID` - Control map key for operator ID lookup.
- `SCControlMapKeys.OPE_DATE` - Control map key for operation date lookup.
- `SCControlMapKeys.OPE_TIME` - Control map key for operation time lookup.
- `JKKAdInfChgConstCC.TEMPLATE_ID_EKK0251C030` - Template ID constant for this screen.
