# Business Logic — JKKSeikyKeiHenkoCC.editInMsg_EKK0441D010() [229 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `com.fujitsu.futurity.bp.custom.common.JKKSeikyKeiHenkoCC` |
| Layer | CC / Common Component (Business logic coordination layer within the custom BPM module) |
| Module | `common` (Package: `com.fujitsu.futurity.bp.custom.common`) |

## 1. Role

### JKKSeikyKeiHenkoCC.editInMsg_EKK0441D010()

This method constructs the inbound message (`CAANMsg`) for the **Billing Option Service Contract Registration** (`Kessai Opusyon Sasoyaku Touroku`) screen operation EKK0441D010. It acts as the **message builder** in a request-response workflow, transforming raw screen-derived data from `childMap` and `dataMap` into a structured CBS (Central Business System) message envelope that will be forwarded to the downstream service component via `scCall.run()`.

The method follows a **builder + routing pattern**. It starts by initializing a common message parameter map via `editInMsg(param)`, then creates a typed `CAANMsg` template using the `EKK0441D010CBSMsg` schema. It populates the template with a fixed set of metadata fields (template ID, operator ID, operate date, operate date-time), then iterates through 17 billing option service contract fields, each extracted from `childMap` under different source prefixes (`ekk0011d020_`, `kksv040516_`, or `dataMap` for SYSID). For each field, it applies a **nullability routing rule**: if the source value is null, empty string, or absent, the template receives `setNull()`; otherwise it receives `set()` with the resolved value.

The method is called exclusively by `execEKK0441D010()`, which orchestrates the full flow: call this method for message building → invoke the SC (Service Component) → call `editOutMsg_EKK0441D010()` for message parsing → check the result for errors. This makes `editInMsg_EKK0441D010()` the **entry point of the request message construction phase** in the billing option service contract registration transaction.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["editInMsg_EKK0441D010"]) --> A1["Edit common area: editInMsg(param)"]
    A1 --> A2["Create CAANMsg template EKK0441D010"]
    A2 --> A3["Set TEMPLATEID = EKK0441D010"]
    A3 --> A4["Set FUNC_CODE from dataMap"]
    A4 --> A5["Set OPERATOR_ID from param controlMap"]
    A5 --> A6["Set OPERATE_DATE from param controlMap"]
    A6 --> A7["Set OPERATE_DATETIME from param controlMap"]
    A7 --> A8["Get workMap from param"]
    A8 --> B1["Map MSKM_DTL_NO"]
    B1 --> B2{ekk0011d020_mskm_dtl_no<br/>present and non-empty?}
    B2 -- No --> B3{kksv040516_mskm_dtl_no<br/>present and non-empty?}
    B3 -- No --> B4["setNull(MSKM_DTL_NO)"]
    B3 -- Yes --> B5["set(MSKM_DTL_NO, kksv040516_mskm_dtl_no)"]
    B2 -- Yes --> B6["set(MSKM_DTL_NO, ekk0011d020_mskm_dtl_no)"]
    B4 --> B7["Map UPD_DTM_BF"]
    B5 --> B7
    B6 --> B7
    B7 --> B8{ekk0491c240_upd_dtm<br/>present and non-empty?}
    B8 -- No --> B9["setNull(UPD_DTM_BF)"]
    B8 -- Yes --> B10["set(UPD_DTM_BF, ekk0491c240_upd_dtm)"]
    B9 --> B11["Map SEIKY_KEI_NO"]
    B10 --> B11
    B11 --> B12{kksv040516_seiky_kei_no<br/>present and non-empty?}
    B12 -- No --> B13["setNull(SEIKY_KEI_NO)"]
    B12 -- Yes --> B14["set(SEIKY_KEI_NO, kksv040516_seiky_kei_no)"]
    B13 --> B15["Map SYSID"]
    B14 --> B15
    B15 --> B16{sysid from dataMap<br/>present and non-empty?}
    B16 -- No --> B17["setNull(SYSID)"]
    B16 -- Yes --> B18["set(SYSID, dataMap sysid)"]
    B17 --> B19["Map SEIOPSVC_CD"]
    B18 --> B19
    B19 --> B20{kksv040516_seiopsvc_cd<br/>present and non-empty?}
    B20 -- No --> B21["setNull(SEIOPSVC_CD)"]
    B20 -- Yes --> B22["set(SEIOPSVC_CD, kksv040516_seiopsvc_cd)"]
    B21 --> B23["Map PCRS_CD"]
    B22 --> B23
    B23 --> B24{kksv040516_pcrs_cd<br/>present and non-empty?}
    B24 -- No --> B25["setNull(PCRS_CD)"]
    B24 -- Yes --> B26["set(PCRS_CD, kksv040516_pcrs_cd)"]
    B25 --> B27["Map PPLAN_CD"]
    B26 --> B27
    B27 --> B28{kksv040516_pplan_cd<br/>present and non-empty?}
    B28 -- No --> B29["setNull(PPLAN_CD)"]
    B28 -- Yes --> B30["set(PPLAN_CD, kksv040516_pplan_cd)"]
    B29 --> B31["Map SVC_KEI_NO"]
    B30 --> B31
    B31 --> B32{kksv040516_svc_kei_no<br/>present and non-empty?}
    B32 -- No --> B33["setNull(SVC_KEI_NO)"]
    B32 -- Yes --> B34["set(SVC_KEI_NO, kksv040516_svc_kei_no)"]
    B33 --> B35["Map FTRIAL_KANYU_YMD"]
    B34 --> B35
    B35 --> B36{kksv040516_ftrial_kanyu_ymd<br/>present and non-empty?}
    B36 -- No --> B37["setNull(FTRIAL_KANYU_YMD)"]
    B36 -- Yes --> B38["set(FTRIAL_KANYU_YMD, kksv040516_ftrial_kanyu_ymd)"]
    B37 --> B39["Map FTRIAL_PRD_ENDYMD"]
    B38 --> B39
    B39 --> B40{kksv040516_ftrial_prd_endymd<br/>present and non-empty?}
    B40 -- No --> B41["setNull(FTRIAL_PRD_ENDYMD)"]
    B40 -- Yes --> B42["set(FTRIAL_PRD_ENDYMD, kksv040516_ftrial_prd_endymd)"]
    B41 --> B43["Map HONKANYU_YMD"]
    B42 --> B43
    B43 --> B44{kksv040516_honkanyu_ymd<br/>present and non-empty?}
    B44 -- No --> B45["setNull(HONKANYU_YMD)"]
    B44 -- Yes --> B46["set(HONKANYU_YMD, kksv040516_honkanyu_ymd)"]
    B45 --> B47["Map HONKANYU_IKO_KIGEN_YMD"]
    B46 --> B47
    B47 --> B48{kksv040516_honkanyu_iko_kigen_ymd<br/>present and non-empty?}
    B48 -- No --> B49["setNull(HONKANYU_IKO_KIGEN_YMD)"]
    B48 -- Yes --> B50["set(HONKANYU_IKO_KIGEN_YMD, kksv040516_honkanyu_iko_kigen_ymd)"]
    B49 --> B51["Map SVC_USE_STA_KIBO_YMD"]
    B50 --> B51
    B51 --> B52{kksv040516_svc_use_sta_kibo_ymd<br/>present and non-empty?}
    B52 -- No --> B53["setNull(SVC_USE_STA_KIBO_YMD)"]
    B52 -- Yes --> B54["set(SVC_USE_STA_KIBO_YMD, kksv040516_svc_use_sta_kibo_ymd)"]
    B53 --> B55["Map RSV_TSTA_KIBO_YMD"]
    B54 --> B55
    B55 --> B56{kksv040516_rsv_tsta_kibo_ymd<br/>present and non-empty?}
    B56 -- No --> B57["setNull(RSV_TSTA_KIBO_YMD)"]
    B56 -- Yes --> B58["set(RSV_TSTA_KIBO_YMD, kksv040516_rsv_tsta_kibo_ymd)"]
    B57 --> B59["Map PNLTY_HASSEI_CD"]
    B58 --> B59
    B59 --> B60{kksv040516_pnlty_hassei_cd<br/>present and non-empty?}
    B60 -- No --> B61["setNull(PNLTY_HASSEI_CD)"]
    B60 -- Yes --> B62["set(PNLTY_HASSEI_CD, kksv040516_pnlty_hassei_cd)"]
    B61 --> B63["Map IDO_DIV"]
    B62 --> B63
    B63 --> B64{kksv040516_ido_div<br/>present and non-empty?}
    B64 -- No --> B65["setNull(IDO_DIV)"]
    B64 -- Yes --> B66["set(IDO_DIV, kksv040516_ido_div)"]
    B65 --> B67["Map PRC_KMK_CD"]
    B66 --> B67
    B67 --> B68{kksv040516_prc_kmk_cd<br/>present and non-empty?}
    B68 -- No --> B69["setNull(PRC_KMK_CD)"]
    B68 -- Yes --> B70["set(PRC_KMK_CD, kksv040516_prc_kmk_cd)"]
    B69 --> B71["Wrap templates and set TEMPLATE_LIST_KEY"]
    B70 --> B71
    B71 --> B72["Return paramMap"]
```

**Processing Summary:**

The method executes in four distinct phases:

1. **Common metadata initialization** (lines 6428–6451): Calls `editInMsg(param)` to build the base parameter map, creates a `CAANMsg` template with the `EKK0441D010CBSMsg` schema, and sets the template ID (`"EKK0441D010"`), operator ID, operate date, and operate date-time from the request control map.

2. **Detail number mapping with fallback routing** (lines 6460–6475): Maps `MSKM_DTL_NO` (billing registration detail number). If the primary source `ekk0011d020_mskm_dtl_no` is absent or empty, it falls back to `kksv040516_mskm_dtl_no`. If both are absent/empty, the field is set to null.

3. **Sequential field mapping** (lines 6478–6616): Maps 16 additional fields in a flat sequential chain. Each field follows the identical pattern: check if the source (from `childMap` or `dataMap`) is present and non-empty; if so, call `template.set()` with the resolved value; otherwise call `template.setNull()`. Fields include: `UPD_DTM_BF`, `SEIKY_KEI_NO`, `SYSID` (sourced from `dataMap` rather than `childMap`), `SEIOPSVC_CD`, `PCRS_CD`, `PPLAN_CD`, `SVC_KEI_NO`, `FTRIAL_KANYU_YMD`, `FTRIAL_PRD_ENDYMD`, `HONKANYU_YMD`, `HONKANYU_IKO_KIGEN_YMD`, `SVC_USE_STA_KIBO_YMD`, `RSV_TSTA_KIBO_YMD`, `PNLTY_HASSEI_CD`, `IDO_DIV`, `PRC_KMK_CD`.

4. **Message assembly and return** (lines 6618–6621): Wraps the single template into a `CAANMsg[]` array, stores it under `JCMConstants.TEMPLATE_LIST_KEY` in the parameter map, and returns the map for the caller.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `param` | `IRequestParameterReadWrite` | The request parameter object carrying screen session context. It provides access to control metadata (operator ID, operate date, operate time) and the work area mapping (source data from screen-derived inputs). |
| 2 | `dataMap` | `Map<String, Object>` | Carries screen-level configuration data. Primarily used to retrieve `FUNC_CODE` (function code for the screen operation) and `sysid` (service system identifier, sourced here from `dataMap` rather than `childMap`). |
| 3 | `childMap` | `HashMap<String, Object>` | Carries the detailed screen input values for the billing option service contract registration. Contains all form fields prefixed with screen IDs (e.g., `kksv040516_`, `ekk0011d020_`, `ekk0491c240_`). Values are strings that may be null, empty, or populated based on user input. |

**External state read by this method:**

| Source | Field / Key | Business Description |
|--------|------------|---------------------|
| `EKK0441D010CBSMsg` class constants | `TEMPLATEID`, `FUNC_CODE`, `MSKM_DTL_NO`, `UPD_DTM_BF`, `SEIKY_KEI_NO`, `SYSID`, `SEIOPSVC_CD`, `PCRS_CD`, `PPLAN_CD`, `SVC_KEI_NO`, `FTRIAL_KANYU_YMD`, `FTRIAL_PRD_ENDYMD`, `HONKANYU_YMD`, `HONKANYU_IKO_KIGEN_YMD`, `SVC_USE_STA_KIBO_YMD`, `RSV_TSTA_KIBO_YMD`, `PNLTY_HASSEI_CD`, `IDO_DIV`, `PRC_KMK_CD` | Field name constants defining the CBS message schema structure. |
| `TEMPLATE_ID_EKK0441D010` | `"EKK0441D010"` | Template identifier constant, resolves to the string `"EKK0441D010"`. |
| `JCMConstants` | `OPERATOR_ID_KEY`, `OPERATE_DATE_KEY`, `OPERATE_DATETIME_KEY`, `TEMPLATE_LIST_KEY`, `FUNC_CODE_KEY` | Standard framework constants for control map key names. |
| `SCControlMapKeys` | `OPERATOR_ID`, `OPE_DATE`, `OPE_TIME` | Keys into the session control map for operator identity and timestamps. |

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| U | `JKKSeikyKeiHenkoCC.editInMsg` | JKKSeikyKeiHenkoCC | - | Calls `editInMsg(param)` to build the base common parameter map; performs initial parameter preprocessing for common session fields. |
| U | `CAANMsg.set` | EKK0441D010CBS | EKK0441D010CBSMsg schema | Sets CBS message fields with resolved values from childMap/dataMap. Called 17 times for each field in the billing contract registration. |
| U | `CAANMsg.setNull` | EKK0441D010CBS | EKK0441D010CBSMsg schema | Sets CBS message fields to null when source data is empty, null, or absent. Called as fallback in each conditional branch. |
| R | `IRequestParameterReadWrite.getControlMapData` | - | - | Reads control metadata (operator ID, operate date, operate time) from the request session context. |
| R | `IRequestParameterReadWrite.getMappingWorkArea` | - | - | Reads the work area mapping from the request parameter; result stored in `workMap` but not actively used in this method (dead code). |

**Notes on SC Code and Entity/DB:**

- This method is a **message builder** (input preparation phase). It does not directly invoke database operations or CBS service components.
- The `CAANMsg` object is a message envelope class (extends `CAANSchemaInfo`) that defines the schema for the CBS message exchanged with the `EKK0441D010` service component.
- The actual database operations (C/R/U/D) are performed by the SC component invoked by the caller `execEKK0441D010()` after this method returns.

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | CBS: `JKKSeikyKeiHenkoCC.execEKK0441D010` | `execEKK0441D010` -> `editInMsg_EKK0441D010(param, dataMap, childMap)` | `scCall.run` (SC invocation for billing option service contract registration) |

**Trace Analysis:**

- `editInMsg_EKK0441D010()` is called **exclusively** by `execEKK0441D010()`, which is a private method within `JKKSeikyKeiHenkoCC`.
- The full call chain from `execEKK0441D010` is: `editInMsg_EKK0441D010()` → builds `paramMap` → `scCall.run(paramMap, handle)` → invokes the CBS service component → `editOutMsg_EKK0441D010()` → `jdgErrRslt(result, 0)`.
- No direct screen/batch entry points (KKSV*) are found within 8 hops from the code graph. The method is a private utility serving the `execEKK0441D010` orchestration flow.
- This method's terminal operations are all `set`/`setNull` calls on the `CAANMsg` message template — it does not itself perform any CRUD. The actual database operations occur in the SC component invoked by `scCall.run()` in the caller.

## 6. Per-Branch Detail Blocks

**Block 1** — EXEC (L6428) — Common area initialization

> Initializes the base parameter map and creates the CBS message template with metadata.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `editInMsg(param)` // Returns HashMap<String, Object> paramMap [Common area setup — 請求領域の設定] |
| 2 | EXEC | `new CAANMsg(EKK0441D010CBSMsg.class.getName())` // Creates typed message template [テンプレートID作成] |
| 3 | SET | `template.set(EKK0441D010CBSMsg.TEMPLATEID, TEMPLATE_ID_EKK0441D010)` // TEMPLATE_ID_EKK0441D010 = "EKK0441D010" [テンプレートID設定] |
| 4 | SET | `template.set(EKK0441D010CBSMsg.FUNC_CODE, "1")` // Hardcoded FUNC_CODE value |
| 5 | CALL | `param.getControlMapData(SCControlMapKeys.OPERATOR_ID)` // Retrieves operator ID from control map [オペレータID取得] |
| 6 | SET | `template.set(JCMConstants.OPERATOR_ID_KEY, operatorId)` // Sets operator ID [オペレータID設定] |
| 7 | CALL | `param.getControlMapData(SCControlMapKeys.OPE_DATE)` // Retrieves operate date [運用日付取得] |
| 8 | SET | `template.set(JCMConstants.OPERATE_DATE_KEY, operateDate)` // Sets operate date [運用日付設定] |
| 9 | CALL | `param.getControlMapData(SCControlMapKeys.OPE_TIME)` // Retrieves operate date-time [運用日時取得] |
| 10 | SET | `template.set(JCMConstants.OPERATE_DATETIME_KEY, operateDateTime)` // Sets operate date-time [運用日時設定] |

**Block 2** — EXEC (L6443) — Dead code and work map acquisition

> Declares unused variables and retrieves the work area mapping.

| # | Type | Code |
|---|------|------|
| 1 | SET | `CAANMsg[] templateArray = null` // Unused local variable |
| 2 | SET | `HashMap inMap = null` // Unused local variable |
| 3 | SET | `ArrayList inList = null` // Unused local variable |
| 4 | CALL | `param.getMappingWorkArea()` // Returns Map<Object, Object> workMap [作業領域の取得] |

**Block 3** — EXEC (L6448) — Function code override

> Overrides the previously hardcoded FUNC_CODE with the value from dataMap.

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.set(EKK0441D010CBSMsg.FUNC_CODE, dataMap.get(JCMConstants.FUNC_CODE_KEY))` // Overwrites FUNC_CODE from dataMap [機能コード取得] |

**Block 4** — IF-ELSE chain (L6451–L6476) — Map MSKM_DTL_NO (Billing Registration Detail Number)

> Maps `MSKM_DTL_NO` with fallback routing. Primary source: `ekk0011d020_mskm_dtl_no`. Fallback: `kksv040516_mskm_dtl_no`. Null if neither is present. [請求契約登録マップ.申添明細番号 → 申添明細番号]

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("ekk0011d020_mskm_dtl_no")) || !childMap.containsKey("ekk0011d020_mskm_dtl_no")` |

**Block 4.1** — ELSE IF (L6454) — Fallback to kksv040516 source

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040516_mskm_dtl_no"))` |

**Block 4.1.1** — THEN (L6455)

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.setNull(EKK0441D010CBSMsg.MSKM_DTL_NO)` // Both sources empty/absent [双方ソースから値なし] |

**Block 4.1.2** — ELSE (L6457)

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.set(EKK0441D010CBSMsg.MSKM_DTL_NO, (String)childMap.get("kksv040516_mskm_dtl_no"))` // Fallback value [フォールバック値] |

**Block 4.2** — ELSE (L6463) — Primary source ekk0011d020

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.set(EKK0441D010CBSMsg.MSKM_DTL_NO, (String)childMap.get("ekk0011d020_mskm_dtl_no"))` // Primary source value [プライマリソース値] |

**Block 5** — IF-ELSE chain (L6478–L6485) — Map UPD_DTM_BF (Update Date-Time Before)

> Maps `UPD_DTM_BF` (更新年月日时分秒(更新前)) from `ekk0491c240_upd_dtm`. Work area EKK0491C060 update timestamp. [更新年月日时分秒WORK(EKK0491C060) → 更新年月日时分秒（更新前）]

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("ekk0491c240_upd_dtm")) || !childMap.containsKey("ekk0491c240_upd_dtm")` |

**Block 5.1** — THEN (L6479)

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.setNull(EKK0441D010CBSMsg.UPD_DTM_BF)` |

**Block 5.2** — ELSE (L6481)

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.set(EKK0441D010CBSMsg.UPD_DTM_BF, (String)childMap.get("ekk0491c240_upd_dtm"))` |

**Block 6** — IF-ELSE chain (L6488–L6495) — Map SEIKY_KEI_NO (Billing Contract Number)

> Maps `SEIKY_KEI_NO` (請求契約番号) from `kksv040516_seiky_kei_no`. [請求オプションサービス契約登録マップ.請求契約番号 → 請求契約番号]

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040516_seiky_kei_no"))` |

**Block 6.1** — THEN (L6489)

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.setNull(EKK0441D010CBSMsg.SEIKY_KEI_NO)` |

**Block 6.2** — ELSE (L6491)

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.set(EKK0441D010CBSMsg.SEIKY_KEI_NO, (String)childMap.get("kksv040516_seiky_kei_no"))` |

**Block 7** — IF-ELSE chain (L6499–L6506) — Map SYSID

> Maps `SYSID` from `dataMap` (NOT from `childMap`) — this is a v8.00.01 code change. [請求オプションサービス契約登録マップ.SYSID → SYSID]

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(dataMap.get("sysid"))` |

**Block 7.1** — THEN (L6500)

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.setNull(EKK0441D010CBSMsg.SYSID)` |

**Block 7.2** — ELSE (L6502)

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.set(EKK0441D010CBSMsg.SYSID, (String)dataMap.get("sysid"))` |

**Block 8** — IF-ELSE chain (L6509–L6516) — Map SEIOPSVC_CD (Billing Option Service Code)

> Maps `SEIOPSVC_CD` (請求オプションサービスコード) from `kksv040516_seiopsvc_cd`. [請求オプションサービス契約登録マップ.請求オプションサービスコード → 請求オプションサービスコード]

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040516_seiopsvc_cd"))` |

**Block 8.1** — THEN (L6510)

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.setNull(EKK0441D010CBSMsg.SEIOPSVC_CD)` |

**Block 8.2** — ELSE (L6512)

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.set(EKK0441D010CBSMsg.SEIOPSVC_CD, (String)childMap.get("kksv040516_seiopsvc_cd"))` |

**Block 9** — IF-ELSE chain (L6519–L6526) — Map PCRS_CD (Price Course Code)

> Maps `PCRS_CD` (料金コースコード) from `kksv040516_pcrs_cd`. [請求オプションサービス契約登録マップ.料金コースコード → 料金コースコード]

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040516_pcrs_cd"))` |

**Block 9.1** — THEN (L6520)

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.setNull(EKK0441D010CBSMsg.PCRS_CD)` |

**Block 9.2** — ELSE (L6522)

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.set(EKK0441D010CBSMsg.PCRS_CD, (String)childMap.get("kksv040516_pcrs_cd"))` |

**Block 10** — IF-ELSE chain (L6529–L6536) — Map PPLAN_CD (Price Plan Code)

> Maps `PPLAN_CD` (料金プランコード) from `kksv040516_pplan_cd`. [請求オプションサービス契約登録マップ.料金プランコード → 料金プランコード]

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040516_pplan_cd"))` |

**Block 10.1** — THEN (L6530)

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.setNull(EKK0441D010CBSMsg.PPLAN_CD)` |

**Block 10.2** — ELSE (L6532)

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.set(EKK0441D010CBSMsg.PPLAN_CD, (String)childMap.get("kksv040516_pplan_cd"))` |

**Block 11** — IF-ELSE chain (L6539–L6546) — Map SVC_KEI_NO (Service Contract Number)

> Maps `SVC_KEI_NO` (サービス契約番号) from `kksv040516_svc_kei_no`. [請求オプションサービス契約登録マップ.サービス契約番号 → サービス契約番号]

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040516_svc_kei_no"))` |

**Block 11.1** — THEN (L6540)

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.setNull(EKK0441D010CBSMsg.SVC_KEI_NO)` |

**Block 11.2** — ELSE (L6542)

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.set(EKK0441D010CBSMsg.SVC_KEI_NO, (String)childMap.get("kksv040516_svc_kei_no"))` |

**Block 12** — IF-ELSE chain (L6549–L6556) — Map FTRIAL_KANYU_YMD (Trial Addition Date)

> Maps `FTRIAL_KANYU_YMD` (試用加入年月日) from `kksv040516_ftrial_kanyu_ymd`. [請求オプションサービス契約登録マップ.試用加入年月日 → 試用加入年月日]

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040516_ftrial_kanyu_ymd"))` |

**Block 12.1** — THEN (L6550)

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.setNull(EKK0441D010CBSMsg.FTRIAL_KANYU_YMD)` |

**Block 12.2** — ELSE (L6552)

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.set(EKK0441D010CBSMsg.FTRIAL_KANYU_YMD, (String)childMap.get("kksv040516_ftrial_kanyu_ymd"))` |

**Block 13** — IF-ELSE chain (L6559–L6566) — Map FTRIAL_PRD_ENDYMD (Trial Period End Date)

> Maps `FTRIAL_PRD_ENDYMD` (試用期間終了年月日) from `kksv040516_ftrial_prd_endymd`. [請求オプションサービス契約登録マップ.試用期間終了年月日 → 試用期間終了年月日]

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040516_ftrial_prd_endymd"))` |

**Block 13.1** — THEN (L6560)

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.setNull(EKK0441D010CBSMsg.FTRIAL_PRD_ENDYMD)` |

**Block 13.2** — ELSE (L6562)

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.set(EKK0441D010CBSMsg.FTRIAL_PRD_ENDYMD, (String)childMap.get("kksv040516_ftrial_prd_endymd"))` |

**Block 14** — IF-ELSE chain (L6569–L6576) — Map HONKANYU_YMD (Full Addition Date)

> Maps `HONKANYU_YMD` (本加入年月日) from `kksv040516_honkanyu_ymd`. [請求オプションサービス契約登録マップ.本加入年月日 → 本加入年月日]

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040516_honkanyu_ymd"))` |

**Block 14.1** — THEN (L6570)

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.setNull(EKK0441D010CBSMsg.HONKANYU_YMD)` |

**Block 14.2** — ELSE (L6572)

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.set(EKK0441D010CBSMsg.HONKANYU_YMD, (String)childMap.get("kksv040516_honkanyu_ymd"))` |

**Block 15** — IF-ELSE chain (L6579–L6586) — Map HONKANYU_IKO_KIGEN_YMD (Full Addition Transfer Deadline Date)

> Maps `HONKANYU_IKO_KIGEN_YMD` (本加入移行期限年月日) from `kksv040516_honkanyu_iko_kigen_ymd`. [請求オプションサービス契約登録マップ.本加入移行期限年月日 → 本加入移行期限年月日]

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040516_honkanyu_iko_kigen_ymd"))` |

**Block 15.1** — THEN (L6580)

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.setNull(EKK0441D010CBSMsg.HONKANYU_IKO_KIGEN_YMD)` |

**Block 15.2** — ELSE (L6582)

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.set(EKK0441D010CBSMsg.HONKANYU_IKO_KIGEN_YMD, (String)childMap.get("kksv040516_honkanyu_iko_kigen_ymd"))` |

**Block 16** — IF-ELSE chain (L6589–L6596) — Map SVC_USE_STA_KIBO_YMD (Service Usage Start Desired Date)

> Maps `SVC_USE_STA_KIBO_YMD` (サービス利用開始希望年月日) from `kksv040516_svc_use_sta_kibo_ymd`. [請求オプションサービス契約登録マップ.サービス利用開始希望年月日 → サービス利用開始希望年月日]

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040516_svc_use_sta_kibo_ymd"))` |

**Block 16.1** — THEN (L6590)

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.setNull(EKK0441D010CBSMsg.SVC_USE_STA_KIBO_YMD)` |

**Block 16.2** — ELSE (L6592)

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.set(EKK0441D010CBSMsg.SVC_USE_STA_KIBO_YMD, (String)childMap.get("kksv040516_svc_use_sta_kibo_ymd"))` |

**Block 17** — IF-ELSE chain (L6599–L6606) — Map RSV_TSTA_KIBO_YMD (Reservation Temporary Start Desired Date)

> Maps `RSV_TSTA_KIBO_YMD` (予約適用開始希望年月日) from `kksv040516_rsv_tsta_kibo_ymd`. [請求オプションサービス契約登録マップ.予約適用開始希望年月日 → 予約適用開始希望年月日]

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040516_rsv_tsta_kibo_ymd"))` |

**Block 17.1** — THEN (L6600)

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.setNull(EKK0441D010CBSMsg.RSV_TSTA_KIBO_YMD)` |

**Block 17.2** — ELSE (L6602)

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.set(EKK0441D010CBSMsg.RSV_TSTA_KIBO_YMD, (String)childMap.get("kksv040516_rsv_tsta_kibo_ymd"))` |

**Block 18** — IF-ELSE chain (L6609–L6616) — Map PNLTY_HASSEI_CD (Penalty Occurrence Code)

> Maps `PNLTY_HASSEI_CD` (違約金発生コード) from `kksv040516_pnlty_hassei_cd`. [請求オプションサービス契約登録マップ.違約金発生コード → 違約金発生コード]

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040516_pnlty_hassei_cd"))` |

**Block 18.1** — THEN (L6610)

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.setNull(EKK0441D010CBSMsg.PNLTY_HASSEI_CD)` |

**Block 18.2** — ELSE (L6612)

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.set(EKK0441D010CBSMsg.PNLTY_HASSEI_CD, (String)childMap.get("kksv040516_pnlty_hassei_cd"))` |

**Block 19** — IF-ELSE chain (L6619–L6626) — Map IDO_DIV (Migration Division)

> Maps `IDO_DIV` (異動区分) from `kksv040516_ido_div`. [請求オプションサービス契約登録マップ.異動区分 → 異動区分]

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040516_ido_div"))` |

**Block 19.1** — THEN (L6620)

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.setNull(EKK0441D010CBSMsg.IDO_DIV)` |

**Block 19.2** — ELSE (L6622)

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.set(EKK0441D010CBSMsg.IDO_DIV, (String)childMap.get("kksv040516_ido_div"))` |

**Block 20** — IF-ELSE chain (L6629–L6636) — Map PRC_KMK_CD (Price Item Code)

> Maps `PRC_KMK_CD` (料金項目コード) from `kksv040516_prc_kmk_cd`. [請求オプションサービス契約登録マップ.料金項目コード → 料金項目コード]

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(childMap.get("kksv040516_prc_kmk_cd"))` |

**Block 20.1** — THEN (L6630)

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.setNull(EKK0441D010CBSMsg.PRC_KMK_CD)` |

**Block 20.2** — ELSE (L6632)

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.set(EKK0441D010CBSMsg.PRC_KMK_CD, (String)childMap.get("kksv040516_prc_kmk_cd"))` |

**Block 21** — EXEC (L6635–L6638) — Message assembly and return

> Wraps the template into a CAANMsg array, stores in paramMap, and returns.

| # | Type | Code |
|---|------|------|
| 1 | SET | `CAANMsg[] templates = new CAANMsg[1]` |
| 2 | SET | `templates[0] = template` |
| 3 | SET | `paramMap.put(JCMConstants.TEMPLATE_LIST_KEY, templates)` |
| 4 | RETURN | `return paramMap` |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `MSKM_DTL_NO` | Field | Billing registration detail number — sequence number identifying a detail line in the billing contract registration |
| `SEIKY_KEI_NO` | Field | Billing contract number — the unique identifier for a billing contract line in the system |
| `SYSID` | Field | System ID — the service system identifier that routes the request to the correct backend service instance |
| `SEIOPSVC_CD` | Field | Billing option service code — classifies the type of billing option service (e.g., FTTH, Mail, ENUM) |
| `PCRS_CD` | Field | Price course code — identifies the pricing tier/course for the billing option service |
| `PPLAN_CD` | Field | Price plan code — identifies the specific pricing plan within a price course |
| `SVC_KEI_NO` | Field | Service contract number — the unique identifier for a service contract |
| `FTRIAL_KANYU_YMD` | Field | Trial addition date — the date a trial service was added to the customer's account |
| `FTRIAL_PRD_ENDYMD` | Field | Trial period end date — the date the trial service period expires |
| `HONKANYU_YMD` | Field | Full addition date — the date the customer transitioned from trial to full (paid) service |
| `HONKANYU_IKO_KIGEN_YMD` | Field | Full addition transfer deadline date — the deadline by which the trial-to-full transition must be completed |
| `SVC_USE_STA_KIBO_YMD` | Field | Service usage start desired date — the customer's requested date for service activation |
| `RSV_TSTA_KIBO_YMD` | Field | Reservation temporary start desired date — the requested date for provisional service activation under reservation |
| `PNLTY_HASSEI_CD` | Field | Penalty occurrence code — indicates whether a contract cancellation penalty applies |
| `IDO_DIV` | Field | Migration division — classifies the type of service migration or change (e.g., new, transfer, change of type) |
| `PRC_KMK_CD` | Field | Price item code — identifies the specific price item line for billing |
| `UPD_DTM_BF` | Field | Update date-time (before update) — the timestamp of the last modification before the current update operation |
| `kksv040516_` | Prefix | Screen ID prefix — the KKSV040516 billing option service contract registration screen source for child data |
| `ekk0011d020_` | Prefix | Screen ID prefix — the EKK0011D020 screen source for billing registration detail data (fallback for MSKM_DTL_NO) |
| `ekk0491c240_` | Prefix | Screen ID prefix — the EKK0491C240 (work area) source for update timestamp data |
| EKK0441D010 | Screen code | Billing option service contract registration screen operation code |
| CAANMsg | Class | Message envelope class extending CAANSchemaInfo — wraps CBS request/response data |
| editInMsg | Method | Base message builder that initializes the common parameter map with session context |
| SC (Service Component) | Concept | Server-side business logic component invoked via scCall.run() to execute the CBS transaction |
| CBS (Central Business System) | Concept | Backend business system handling billing, customer, and order management operations |
| FUNC_CODE | Field | Function code — identifies the operation type within the CBS message (value "1" = registration) |
| TEMPLATE_ID_EKK0441D010 | Constant | Template ID constant, resolves to `"EKK0441D010"` |
| childMap | Parameter | HashMap carrying screen form field values keyed by source-prefixed field names |
| dataMap | Parameter | Map carrying screen-level configuration data (function code, SYSID) |
| paramMap | Local variable | The assembled parameter map returned to the caller, containing the TEMPLATE_LIST_KEY with CAANMsg[] |
| Template | Object | CAANMsg object that defines the CBS message schema for the EKK0441D010 billing contract registration transaction |
