# Business Logic — JFUAddSvcKeiTelCC.editInEKK0371D010() [269 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `com.fujitsu.futurity.bp.custom.common.JFUAddSvcKeiTelCC` |
| Layer | Common Component (CC) — shared mapping utility in the `com.fujitsu.futurity.bp.custom.common` package |
| Module | `common` |

## 1. Role

### JFUAddSvcKeiTelCC.editInEKK0371D010()

This method performs **upper-level mapping** (上りマッピング処理) for the **Optional Service Contract — Telephone Registration** business process. It takes input data from a screen's request parameters and transforms it into a structured `CAANMsg` template (`EKK0371D010CBSMsg`) that is passed downstream to the CBS (Core Business System) layer for persistence.

The method implements a **conditional field routing pattern**: for each target template field, it first checks whether the value exists in the input working map (extracted from the `EKK0371D010TelList` list at the given `index`). If the map value is present and non-empty, it is copied directly to the template; if absent, `template.setNull(...)` is called to explicitly nullify the output field. This design supports both **new registrations** (where fields may be null) and **updates/fallbacks** (where existing values may be carried forward).

Three fields have **fallback logic**: `sysid` falls back to the Keisha work map (`getKeishaWorkMapValue`), `mskm_dtl_no` falls back to the Mskm work map (`getMskmWorkMapValue`), and `seiky_kei_no` falls back to the Skk work map area (`getWorkMapValue` with `CC_WORK_AREA_NAME_SKK`). This allows the method to recover data from alternative sources when the primary input map is empty — a common pattern during partial screen data flows (e.g., service re-registration or emergency contract creation).

Additionally, four fields are populated **directly** from business parameter lists via `JFUBPCommon.getBPValueString` and `JFUBPCommon.getBPListValueString`, pulling from different screen contexts (`EKK0191D010`, `EKK0111D010`, `EZM0321A010`). This means the method acts as an **integration point** that stitches together data from multiple screen screens/working areas into a single CBS-ready message.

In the larger system, this method is called from `addTelTrk()` in the same class, which serves as the entry point for telephone service addition workflows. The method has **no CRUD operations** — it is purely a data transformation/mapping layer, with all database interactions delegated to downstream CBS components that consume the returned `CAANMsg`.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["editInEKK0371D010(params, fixedText, index)"])
    CREATE["Create CAANMsg template<br/>set TEMPLATE_ID, FUNC_CODE, OPERATOR_ID<br/>OPERATE_DATE, OPERATE_DATETIME"]
    GET_DATA["Get dataMap from param.getData(fixedText)"]
    CHECK_DATA["dataMap != null?"]
    GET_LIST["inList = dataMap.get(EKK0371D010TelList)"]
    CHECK_LIST["inList != null?"]
    GET_MAP["inMap = inList.get(index)"]
    CHECK_FUNC_CODE["inMap null or FUNC_CODE_KEY empty?"]
    MAP_FIELDS["Map inMap fields to template<br/>OP_SVC_CD, PCRSCD, PPLANCd, OYA_KEI_SKBT_CD<br/>FTRIAL_KANYU_YMD, FTRIAL_PRD_ENDYMD<br/>HONKANYU_YMD, HONKANYU_IKO_KIGEN_YMD<br/>SVC_USE_STA_KIBO_YMD, RSV_TSTA_KIBO_YMD<br/>PNLTY_HASSEI_CD, IDO_DIV<br/>N_050_OP_TELNO, PRC_KMK_CD"]
    MAP_SYSID["Get sysid from inMap or<br/>getKeishaWorkMapValue(param, sysid)"]
    MAP_MSKM_DTL["Get mskm_dtl_no from inMap or<br/>getMskmWorkMapValue(param, ekk0111_mskm_dtl_no)"]
    MAP_SEIKY["Get seiky_kei_no from inMap or<br/>getWorkMapValue(param, seiky_kei_no, CC_WORK_AREA_NAME_SKK)"]
    MAP_DIRECT_1["JFUBPCommon.getBPListValueString(param, EKK0191D010,<br/>EKK0191D010List, index, svc_kei_ucwk_no)"]
    MAP_DIRECT_2["JFUBPCommon.getBPValueString(param, EKK0111D010, upd_dtm)"]
    MAP_DIRECT_3["JFUBPCommon.getBPListValueString(param, EZM0321A010,<br/>EZM0321A010CBSMsg1List, 0, work_param_sette_value)"]
    RETURN["Return template CAANMsg"]

    START --> CREATE --> GET_DATA --> CHECK_DATA
    CHECK_DATA -- true --> GET_LIST
    CHECK_DATA -- false --> MAP_FIELDS
    GET_LIST --> CHECK_LIST
    CHECK_LIST -- true --> GET_MAP --> MAP_FIELDS
    CHECK_LIST -- false --> MAP_FIELDS
    GET_MAP --> CHECK_FUNC_CODE
    CHECK_FUNC_CODE -- false --> MAP_FIELDS
    CHECK_FUNC_CODE -- true --> MAP_FIELDS

    MAP_SYSID --> CHECK_FUNC_CODE
    MAP_MSKM_DTL --> CHECK_SYSID_NULL
    CHECK_FUNC_CODE --> MAP_SYSID

    CHECK_DATA -- false --> MAP_MSKM_DTL
    MAP_MSKM_DTL --> CHECK_MSKM_NULL
    CHECK_MSKM_NULL -- true --> SET_MSKM_NULL
    CHECK_MSKM_NULL -- false --> SET_MSKM

    CHECK_DATA -- false --> MAP_SEIKY
    MAP_SEIKY --> CHECK_SEIKY_NULL
    CHECK_SEIKY_NULL -- true --> SET_SEIKY_NULL
    CHECK_SEIKY_NULL -- false --> SET_SEIKY

    SET_MSKM_NULL["template.setNull(MSKM_DTL_NO)"]
    SET_MSKM["template.set(MSKM_DTL_NO, mskm_dtl_no)"]
    SET_SEIKY_NULL["template.setNull(SEIKY_KEI_NO)"]
    SET_SEIKY["template.set(SEIKY_KEI_NO, seiky_kei_no)"]

    MAP_FIELDS --> MAP_DIRECT_1 --> MAP_DIRECT_2 --> MAP_DIRECT_3 --> RETURN
    SET_MSKM_NULL --> RETURN
    SET_MSKM --> RETURN
    SET_SEIKY_NULL --> RETURN
    SET_SEIKY --> RETURN
    MAP_SYSID --> MAP_DIRECT_1
```

**Constant Resolution:**

| Constant | Value | Business Meaning |
|----------|-------|-----------------|
| `TEMPLATE_ID_EKK0371D010` | `"EKK0371D010"` | Template ID for Optional Service Contract <Telephone> Registration |
| `FUNC_1` | `"1"` | Default function code (registration) |

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `param` | `IRequestParameterReadWrite` | The request parameter container that holds all screen input data, control map data (operator ID, operation date, operation time), and business parameter lists from multiple screens (EKK0191D010, EKK0111D010, EZM0321A010, EKK0191D010List). It acts as the single source of truth for the mapping, containing both working map data and business parameter list data. |
| 2 | `fixedText` | `String` | The data key used to retrieve the specific data map from `param.getData()`. It identifies which data group within the request parameter contains the `EKK0371D010TelList` — essentially a screen-context identifier that determines which working data is being mapped. |
| 3 | `index` | `int` | The row index within the `EKK0371D010TelList` ArrayList. Since a single request can contain multiple telephone service records, this index selects which record's fields are extracted from the map for mapping. |

**Instance fields read by the method:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `CC_WORK_AREA_NAME_SKK` | `String = "JFUAddSkkSCWork"` | Work map name used as the area key for billing contract number lookup (`getWorkMapValue`) |

## 4. CRUD Operations / Called Services

This method is a **pure data mapper** — it reads data from request parameters and business parameter lists, and constructs a `CAANMsg` template. It has **no direct database operations** (no C/R/U/D on entities or tables). All data is sourced from in-memory structures.

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `JFUBPCommon.getBPListValueString(param, EKK0191D010, EKK0191D010List, index, svc_kei_ucwk_no)` | EKK0191D010 | In-memory business parameter list | Retrieves the service detail work number (svc_kei_ucwk_no) from the EKK0191D010 business parameter list at the given index — identifies the internal service contract line item number. |
| R | `JFUBPCommon.getBPValueString(param, EKK0111D010, upd_dtm)` | EKK0111D010 | In-memory business parameter | Retrieves the update timestamp (upd_dtm) from the EKK0111D010 (Service Contract Registration) business parameter — carries forward the last update time from the primary contract screen. |
| R | `JFUBPCommon.getBPListValueString(param, EZM0321A010, EZM0321A010CBSMsg1List, 0, work_param_sette_value)` | EZM0321A010 | In-memory business parameter | Retrieves the call charge limit notification amount (work_param_sette_value) from the EZM0321A010 optional service business parameter list at index 0. |
| R | `IRequestParameterReadWrite.getData(fixedText)` | - | In-memory request parameter | Retrieves the HashMap of data associated with the given fixedText key, containing the EKK0371D010TelList. |
| R | `IRequestParameterReadWrite.getControlMapData(key)` | - | In-memory control map | Retrieves control data (OPERATOR_ID, OPE_DATE, OPE_TIME) from the control map. |
| R | `getKeishaWorkMapValue(param, "sysid")` | - | In-memory work map (Keisha) | Retrieves the system ID (sysid) from the Keisha (owner/shipper) work map area — fallback for sysid when not in primary map. |
| R | `getMskmWorkMapValue(param, "ekk0111_mskm_dtl_no")` | - | In-memory work map (Mskm) | Retrieves the memo detail number (ekk0111_mskm_dtl_no) from the Mskm (memo) work map area — fallback for memo detail number. |
| R | `getWorkMapValue(param, "seiky_kei_no", CC_WORK_AREA_NAME_SKK)` | - | In-memory work map (Skk) | Retrieves the billing contract number (seiky_kei_no) from the Skk (billing contract) work map area — fallback for billing contract number. |

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Method: `JFUAddSvcKeiTelCC.addTelTrk` | `addTelTrk()` -> `editInEKK0371D010(param, fixedText, index)` | `template.set* [R] CAANMsg fields` (no DB — pure mapping) |

**Call Chain Detail:**
- `addTelTrk()` in `JFUAddSvcKeiTelCC` is the sole direct caller. It is a telephone registration tracking method that orchestrates the overall telephone service addition flow. `editInEKK0371D010` is called as a sub-step to map optional service contract <telephone> registration data into the CBS message template.

**No screen/batch entry points** (KKSV*, Batch entry) were found calling this method directly. The method is a **common component utility** called by peer CC methods within the same service addition workflow, not a screen entry point.

## 6. Per-Branch Detail Blocks

**Block 1** — [SET] Template Initialization (L4140–L4155)

> Create the CAANMsg template and set standard control fields.

| # | Type | Code |
|---|------|------|
| 1 | SET | `template = new CAANMsg(EKK0371D010CBSMsg.class.getName())` |
| 2 | SET | `inMap = null` // working map reference |
| 3 | SET | `inList = null` // list reference for telephone records |
| 4 | SET | `template.set(EKK0371D010CBSMsg.TEMPLATEID, TEMPLATE_ID_EKK0371D010)` [-> `TEMPLATE_ID_EKK0371D010 = "EKK0371D010"`] // Template ID for Optional Service Contract <Telephone> Registration |
| 5 | SET | `template.set(EKK0371D010CBSMsg.FUNC_CODE, FUNC_1)` [-> `FUNC_1 = "1"`] // Function code (default: 1 = registration) |
| 6 | SET | `operatorId = param.getControlMapData(SCControlMapKeys.OPERATOR_ID)` |
| 7 | SET | `template.set(JCMConstants.OPERATOR_ID_KEY, operatorId)` // User ID of the operator performing the action |
| 8 | SET | `operateDate = param.getControlMapData(SCControlMapKeys.OPE_DATE)` |
| 9 | SET | `template.set(JCMConstants.OPERATE_DATE_KEY, operateDate)` // Operation date |
| 10 | SET | `operateDateTime = param.getControlMapData(SCControlMapKeys.OPE_TIME)` |
| 11 | SET | `template.set(JCMConstants.OPERATE_DATETIME_KEY, operateDateTime)` // Operation date-time |

**Block 2** — [IF] Data Map Extraction (L4158–L4170)

> Attempt to retrieve the telephone list from the input data map. If dataMap is null or the list is absent, inMap remains null.

| # | Type | Code |
|---|------|------|
| 1 | SET | `dataMap = (HashMap) param.getData(fixedText)` // Get the data group identified by fixedText |
| 2 | IF | `if (dataMap != null)` — Check if data group exists for the given fixedText key |
| 2.1 | SET | `inList = (ArrayList) dataMap.get("EKK0371D010TelList")` // Retrieve the telephone service record list |
| 2.2 | IF | `if (inList != null)` — Check if the telephone list has entries |
| 2.2.1 | SET | `inMap = (HashMap) inList.get(index)` // Get the specific record at the given index |

**Block 3** — [IF] FUNC_CODE Field Mapping (L4172–L4180)

> Map the function code. If the input map doesn't have a FUNC_CODE_KEY, keep the default value of "1" that was already set.

| # | Type | Code |
|---|------|------|
| 1 | IF | `if (inMap == null || inMap.get(JCMConstants.FUNC_CODE_KEY) == null || "".equals(inMap.get(JCMConstants.FUNC_CODE_KEY)))` — Check if function code is missing or empty |
| 1.1 | EXEC | *(commented out)* `// template.setNull(EKK0371D010CBSMsg.FUNC_CODE)` // No override — keep default value of "1" |
| 2 | ELSE | `else` — FUNC_CODE_KEY exists and is non-empty |
| 2.1 | SET | `template.set(EKK0371D010CBSMsg.FUNC_CODE, inMap.get(JCMConstants.FUNC_CODE_KEY))` // Use the input map's function code value |

**Block 4** — [IF] Optional Service Contract Code (OP_SVC_CD) (L4183–L4191)

> Map the optional service contract code. Japanese comment: オプションサービス契約＜電話＞登録マッピング.オプションサービスコード → オプションサービスコード (Optional Service Contract <Telephone> Registration Mapping: Option Service Code → Option Service Code)

| # | Type | Code |
|---|------|------|
| 1 | IF | `if (inMap == null || inMap.get("op_svc_cd") == null || "".equals(inMap.get("op_svc_cd")))` |
| 1.1 | EXEC | `template.setNull(EKK0371D010CBSMsg.OP_SVC_CD)` |
| 2 | ELSE | `else` |
| 2.1 | SET | `template.set(EKK0371D010CBSMsg.OP_SVC_CD, (String)inMap.get("op_svc_cd"))` |

**Block 5** — [IF] Price Course Code (PCRS_CD) (L4194–L4202)

> Map the price course code. Japanese comment: オプションサービス契約＜電話＞登録マッピング.料金コースコード → 料金コースコード (Price Course Code → Price Course Code)

| # | Type | Code |
|---|------|------|
| 1 | IF | `if (inMap == null || inMap.get("pcrs_cd") == null || "".equals(inMap.get("pcrs_cd")))` |
| 1.1 | EXEC | `template.setNull(EKK0371D010CBSMsg.PCRS_CD)` |
| 2 | ELSE | `else` |
| 2.1 | SET | `template.set(EKK0371D010CBSMsg.PCRS_CD, (String)inMap.get("pcrs_cd"))` |

**Block 6** — [IF] Price Plan Code (PPLAN_CD) (L4205–L4213)

> Map the price plan code. Japanese comment: オプションサービス契約＜電話＞登録マッピング.料金プランコード → 料金プランコード (Price Plan Code → Price Plan Code)

| # | Type | Code |
|---|------|------|
| 1 | IF | `if (inMap == null || inMap.get("pplan_cd") == null || "".equals(inMap.get("pplan_cd")))` |
| 1.1 | EXEC | `template.setNull(EKK0371D010CBSMsg.PPLAN_CD)` |
| 2 | ELSE | `else` |
| 2.1 | SET | `template.set(EKK0371D010CBSMsg.PPLAN_CD, (String)inMap.get("pplan_cd"))` |

**Block 7** — [IF] Parent Contract Classification Code (OYA_KEI_SKBT_CD) (L4216–L4224)

> Map the parent contract classification code. Japanese comment: オプションサービス契約＜電話＞登録マッピング.親契約識別コード → 親契約識別コード (Parent Contract Identification Code → Parent Contract Identification Code)

| # | Type | Code |
|---|------|------|
| 1 | IF | `if (inMap == null || inMap.get("oya_kei_skbt_cd") == null || "".equals(inMap.get("oya_kei_skbt_cd")))` |
| 1.1 | EXEC | `template.setNull(EKK0371D010CBSMsg.OYA_KEI_SKBT_CD)` |
| 2 | ELSE | `else` |
| 2.1 | SET | `template.set(EKK0371D010CBSMsg.OYA_KEI_SKBT_CD, (String)inMap.get("oya_kei_skbt_cd"))` |

**Block 8** — [IF] SYSID with Fallback (L4227–L4246)

> Map the system ID. If not in the input map, attempt to retrieve it from the Keisha (owner/shipper) work map as a fallback. Japanese comment: オプションサービス契約＜電話＞登録マッピング.SYSID → SYSID (SYSID → SYSID)

| # | Type | Code |
|---|------|------|
| 1 | IF | `if (inMap == null || inMap.get("sysid") == null || "".equals(inMap.get("sysid")))` |
| 1.1 | SET | `sysid = getKeishaWorkMapValue(param, "sysid")` // Fallback: retrieve from Keisha work map |
| 1.2 | IF | `if (sysid == null)` — Even the fallback is empty |
| 1.2.1 | EXEC | `template.setNull(EKK0371D010CBSMsg.SYSID)` |
| 1.3 | ELSE | `else` — Fallback succeeded |
| 1.3.1 | SET | `template.set(EKK0371D010CBSMsg.SYSID, sysid)` |
| 2 | ELSE | `else` — sysid found in input map |
| 2.1 | SET | `template.set(EKK0371D010CBSMsg.SYSID, (String)inMap.get("sysid"))` |

**Block 9** — [IF] Trial Registration Date (FTRIAL_KANYU_YMD) (L4249–L4257)

> Map the trial registration date. Japanese comment: オプションサービス契約＜電話＞登録マッピング.試書加入年月日 → 試書加入年月日 (Trial Registration Year/Month/Day → Trial Registration Year/Month/Day)

| # | Type | Code |
|---|------|------|
| 1 | IF | `if (inMap == null || inMap.get("ftrial_kanyu_ymd") == null || "".equals(inMap.get("ftrial_kanyu_ymd")))` |
| 1.1 | EXEC | `template.setNull(EKK0371D010CBSMsg.FTRIAL_KANYU_YMD)` |
| 2 | ELSE | `else` |
| 2.1 | SET | `template.set(EKK0371D010CBSMsg.FTRIAL_KANYU_YMD, (String)inMap.get("ftrial_kanyu_ymd"))` |

**Block 10** — [IF] Trial Period End Date (FTRIAL_PRD_ENDYMD) (L4260–L4268)

> Map the trial period end date. Japanese comment: オプションサービス契約＜電話＞登録マッピング.試用期間終了年月日 → 試用期間終了年月日 (Trial Period End Year/Month/Day → Trial Period End Year/Month/Day)

| # | Type | Code |
|---|------|------|
| 1 | IF | `if (inMap == null || inMap.get("ftrial_prd_endymd") == null || "".equals(inMap.get("ftrial_prd_endymd")))` |
| 1.1 | EXEC | `template.setNull(EKK0371D010CBSMsg.FTRIAL_PRD_ENDYMD)` |
| 2 | ELSE | `else` |
| 2.1 | SET | `template.set(EKK0371D010CBSMsg.FTRIAL_PRD_ENDYMD, (String)inMap.get("ftrial_prd_endymd"))` |

**Block 11** — [IF] Actual Registration Date (HONKANYU_YMD) (L4271–L4279)

> Map the actual (正式) registration date. Japanese comment: オプションサービス契約＜電話＞登録マッピング.本加入年月日 → 本加入年月日 (Actual Registration Year/Month/Day → Actual Registration Year/Month/Day)

| # | Type | Code |
|---|------|------|
| 1 | IF | `if (inMap == null || inMap.get("honkanyu_ymd") == null || "".equals(inMap.get("honkanyu_ymd")))` |
| 1.1 | EXEC | `template.setNull(EKK0371D010CBSMsg.HONKANYU_YMD)` |
| 2 | ELSE | `else` |
| 2.1 | SET | `template.set(EKK0371D010CBSMsg.HONKANYU_YMD, (String)inMap.get("honkanyu_ymd"))` |

**Block 12** — [IF] Actual Registration Transfer Deadline (HONKANYU_IKO_KIGEN_YMD) (L4282–L4290)

> Map the deadline for transfer to actual registration. Japanese comment: オプションサービス契約＜電話＞登録マッピング.本加入移行期限年月日 → 本加入移行期限年月日 (Actual Registration Transfer Deadline Year/Month/Day → Actual Registration Transfer Deadline Year/Month/Day)

| # | Type | Code |
|---|------|------|
| 1 | IF | `if (inMap == null || inMap.get("honkanyu_iko_kigen_ymd") == null || "".equals(inMap.get("honkanyu_iko_kigen_ymd")))` |
| 1.1 | EXEC | `template.setNull(EKK0371D010CBSMsg.HONKANYU_IKO_KIGEN_YMD)` |
| 2 | ELSE | `else` |
| 2.1 | SET | `template.set(EKK0371D010CBSMsg.HONKANYU_IKO_KIGEN_YMD, (String)inMap.get("honkanyu_iko_kigen_ymd"))` |

**Block 13** — [IF] Service Usage Start Request Date (SVC_USE_STA_KIBO_YMD) (L4293–L4301)

> Map the requested service usage start date. Japanese comment: オプションサービス契約＜電話＞登録マッピング.サービス利用開始希望年月日 → サービス利用開始希望年月日 (Service Usage Start Desired Year/Month/Day → Service Usage Start Desired Year/Month/Day)

| # | Type | Code |
|---|------|------|
| 1 | IF | `if (inMap == null || inMap.get("svc_use_sta_kibo_ymd") == null || "".equals(inMap.get("svc_use_sta_kibo_ymd")))` |
| 1.1 | EXEC | `template.setNull(EKK0371D010CBSMsg.SVC_USE_STA_KIBO_YMD)` |
| 2 | ELSE | `else` |
| 2.1 | SET | `template.set(EKK0371D010CBSMsg.SVC_USE_STA_KIBO_YMD, (String)inMap.get("svc_use_sta_kibo_ymd"))` |

**Block 14** — [IF] Reservation Applicable Start Request Date (RSV_TSTA_KIBO_YMD) (L4304–L4312)

> Map the reservation applicable start request date. Japanese comment: オプションサービス契約＜電話＞登録マッピング.予約適用開始希望年月日 → 予約適用開始希望年月日 (Reservation Application Start Desired Year/Month/Day → Reservation Application Start Desired Year/Month/Day)

| # | Type | Code |
|---|------|------|
| 1 | IF | `if (inMap == null || inMap.get("rsv_tsta_kibo_ymd") == null || "".equals(inMap.get("rsv_tsta_kibo_ymd")))` |
| 1.1 | EXEC | `template.setNull(EKK0371D010CBSMsg.RSV_TSTA_KIBO_YMD)` |
| 2 | ELSE | `else` |
| 2.1 | SET | `template.set(EKK0371D010CBSMsg.RSV_TSTA_KIBO_YMD, (String)inMap.get("rsv_tsta_kibo_ymd"))` |

**Block 15** — [IF] Penalty Occurrence Code (PNLTY_HASSEI_CD) (L4315–L4323)

> Map the penalty occurrence code. Japanese comment: オプションサービス契約＜電話＞登録マッピング.違約金発生コード → 違約金発生コード (Penalty Occurrence Code → Penalty Occurrence Code)

| # | Type | Code |
|---|------|------|
| 1 | IF | `if (inMap == null || inMap.get("pnlty_hassei_cd") == null || "".equals(inMap.get("pnlty_hassei_cd")))` |
| 1.1 | EXEC | `template.setNull(EKK0371D010CBSMsg.PNLTY_HASSEI_CD)` |
| 2 | ELSE | `else` |
| 2.1 | SET | `template.set(EKK0371D010CBSMsg.PNLTY_HASSEI_CD, (String)inMap.get("pnlty_hassei_cd"))` |

**Block 16** — [IF] Movement Classification (IDO_DIV) (L4326–L4334)

> Map the movement classification code. Japanese comment: オプションサービス契約＜電話＞登録マッピング.区分別 → 区分別 (Movement Classification → Movement Classification). Identifies the type of change (e.g., new, transfer, cancellation).

| # | Type | Code |
|---|------|------|
| 1 | IF | `if (inMap == null || inMap.get("ido_div") == null || "".equals(inMap.get("ido_div")))` |
| 1.1 | EXEC | `template.setNull(EKK0371D010CBSMsg.IDO_DIV)` |
| 2 | ELSE | `else` |
| 2.1 | SET | `template.set(EKK0371D010CBSMsg.IDO_DIV, (String)inMap.get("ido_div"))` |

**Block 17** — [IF] 050 Optional Phone Number (N_050_OP_TELNO) (L4337–L4345)

> Map the 050 optional phone number. Japanese comment: オプションサービス契約＜電話＞登録マッピング.050オプション電話番号 → 050オプション電話番号 (050 Optional Phone Number → 050 Optional Phone Number). The 050 prefix is used for IP-based VoIP phone numbers in Japan.

| # | Type | Code |
|---|------|------|
| 1 | IF | `if (inMap == null || inMap.get("n_050_op_telno") == null || "".equals(inMap.get("n_050_op_telno")))` |
| 1.1 | EXEC | `template.setNull(EKK0371D010CBSMsg.N_050_OP_TELNO)` |
| 2 | ELSE | `else` |
| 2.1 | SET | `template.set(EKK0371D010CBSMsg.N_050_OP_TELNO, (String)inMap.get("n_050_op_telno"))` |

**Block 18** — [IF] Price Item Code (PRC_KMK_CD) (L4348–L4356)

> Map the price item code. Japanese comment: オプションサービス契約＜電話＞登録マッピング.料金項目コード → 料金項目コード (Price Item Code → Price Item Code)

| # | Type | Code |
|---|------|------|
| 1 | IF | `if (inMap == null || inMap.get("prc_kmk_cd") == null || "".equals(inMap.get("prc_kmk_cd")))` |
| 1.1 | EXEC | `template.setNull(EKK0371D010CBSMsg.PRC_KMK_CD)` |
| 2 | ELSE | `else` |
| 2.1 | SET | `template.set(EKK0371D010CBSMsg.PRC_KMK_CD, (String)inMap.get("prc_kmk_cd"))` |

**Block 19** — [SET] Service Detail Work Number (Direct BP Read) (L4364–L4366)

> Unconditionally pull the service detail work number from the EKK0191D010 business parameter list via JFUBPCommon. Japanese comment: 部品呼び出し → サービス契約内訳番号 (Component Call → Service Contract Detail Number)

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.set(EKK0371D010CBSMsg.SVC_KEI_UCWK_NO, JFUBPCommon.getBPListValueString(param, "EKK0191D010", "EKK0191D010List", index, "svc_kei_ucwk_no"))` |

**Block 20** — [IF] Memo Detail Number (MSKM_DTL_NO) with Fallback (L4372–L4388)

> Map the memo detail number. If not in the input map, fall back to the Mskm work map via getMskmWorkMapValue. Note: this template uses `EKK0111D010CBSMsg.MSKM_DTL_NO` rather than `EKK0371D010CBSMsg.MSKM_DTL_NO`. Japanese comment: サービス契約＜eo光電話＞登録マッピング.申請明細番号 → 申請明細番号 (Application Detail Number → Application Detail Number)

| # | Type | Code |
|---|------|------|
| 1 | IF | `if (inMap == null || inMap.get("mskm_dtl_no") == null || "".equals(inMap.get("mskm_dtl_no")))` |
| 1.1 | SET | `mskm_dtl_no = getMskmWorkMapValue(param, "ekk0111_mskm_dtl_no")` // Fallback to Mskm work map |
| 1.2 | IF | `if (mskm_dtl_no == null)` |
| 1.2.1 | EXEC | `template.setNull(EKK0111D010CBSMsg.MSKM_DTL_NO)` |
| 1.3 | ELSE | `else` |
| 1.3.1 | SET | `template.set(EKK0111D010CBSMsg.MSKM_DTL_NO, mskm_dtl_no)` |
| 2 | ELSE | `else` |
| 2.1 | SET | `template.set(EKK0111D010CBSMsg.MSKM_DTL_NO, (String)inMap.get("mskm_dtl_no"))` |

**Block 21** — [IF] Billing Contract Number (SEIKY_KEI_NO) with Fallback (L4396–L4412)

> Map the billing contract number. If not in the input map, fall back to the Skk work map area via getWorkMapValue with `CC_WORK_AREA_NAME_SKK`. Note: this template uses `EKK0371D010CBSMsg.SEIKY_KEI_NO`. Japanese comment: 請求契約登録マッピング.請求契約番号 → 請求契約番号 (Billing Contract Registration Mapping: Billing Contract Number → Billing Contract Number)

| # | Type | Code |
|---|------|------|
| 1 | IF | `if (inMap == null || inMap.get("seiky_kei_no") == null || "".equals(inMap.get("seiky_kei_no")))` |
| 1.1 | SET | `seiky_kei_no = getWorkMapValue(param, "seiky_kei_no", CC_WORK_AREA_NAME_SKK)` [-> `CC_WORK_AREA_NAME_SKK = "JFUAddSkkSCWork"`] // Fallback to Skk work map |
| 1.2 | IF | `if (seiky_kei_no == null)` |
| 1.2.1 | EXEC | `template.setNull(EKK0371D010CBSMsg.SEIKY_KEI_NO)` |
| 1.3 | ELSE | `else` |
| 1.3.1 | SET | `template.set(EKK0371D010CBSMsg.SEIKY_KEI_NO, seiky_kei_no)` |
| 2 | ELSE | `else` |
| 2.1 | SET | `template.set(EKK0371D010CBSMsg.SEIKY_KEI_NO, (String)inMap.get("seiky_kei_no"))` |

**Block 22** — [SET] Update Timestamp (Direct BP Read) (L4415–L4417)

> Unconditionally pull the update timestamp from EKK0111D010 business parameter. Japanese comment: 部品呼び出し → 更新年月日時刻(更新前) (Component Call → Update Date-Time (Before Update))

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.set(EKK0371D010CBSMsg.UPD_DTM_BF, JFUBPCommon.getBPValueString(param, "EKK0111D010", "upd_dtm"))` |

**Block 23** — [SET] Call Charge Limit Notification Amount (Direct BP Read) (L4420–L4421)

> Unconditionally pull the call charge limit notification amount (通話料指定額到達通知指定金額) from EZM0321A010 business parameter list at index 0. Japanese comment: 部品呼び出し → 通話料指定額到達通知指定金額 (Component Call → Call Charge Limit Amount Notification Specified Amount)

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.set(EKK0371D010CBSMsg.TWRYO_STIAM_TTU_TCHI_STIAM, JFUBPCommon.getBPListValueString(param, "EZM0321A010", "EZM0321A010CBSMsg1List", 0, "work_param_sette_value"))` |

**Block 24** — [RETURN] (L4423)

> Return the fully populated CAANMsg template to the caller.

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

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `op_svc_cd` | Field | Optional Service Code — the code identifying which optional service (e.g., caller ID, call waiting) is being registered |
| `pcrs_cd` | Field | Price Course Code — the pricing tier/plan selected for the optional telephone service |
| `pplan_cd` | Field | Price Plan Code — the specific billing plan associated with the service |
| `oya_kei_skbt_cd` | Field | Parent Contract Classification Code — identifies the parent/master service contract this optional service belongs to |
| `sysid` | Field | System ID — unique identifier for the telephone line/device |
| `ftrial_kanyu_ymd` | Field | Trial Registration Date (YYYYMMDD format) — when the trial period starts |
| `ftrial_prd_endymd` | Field | Trial Period End Date (YYYYMMDD format) — when the trial period expires |
| `honkanyu_ymd` | Field | Actual Registration Date (YYYYMMDD format) — when the service becomes fully active |
| `honkanyu_iko_kigen_ymd` | Field | Actual Registration Transfer Deadline (YYYYMMDD format) — the last date to transfer from trial to full |
| `svc_use_sta_kibo_ymd` | Field | Service Usage Start Desired Date (YYYYMMDD format) — customer's requested start date |
| `rsv_tsta_kibo_ymd` | Field | Reservation Applicable Start Desired Date (YYYYMMDD format) — when reservation-based pricing starts |
| `pnlty_hassei_cd` | Field | Penalty Occurrence Code — code indicating if/when early termination penalties apply |
| `ido_div` | Field | Movement Classification — the type of change (e.g., new registration, transfer, modification, cancellation) |
| `n_050_op_telno` | Field | 050 Optional Phone Number — an IP-based VoIP phone number (050 prefix is used for VoIP in Japan) |
| `prc_kmk_cd` | Field | Price Item Code — identifies the specific charge item type |
| `svc_kei_ucwk_no` | Field | Service Detail Work Number — internal tracking ID for service contract line items |
| `mskm_dtl_no` | Field | Memo Detail Number — internal reference number for memo/notes detail records |
| `seiky_kei_no` | Field | Billing Contract Number — the contract number used for invoicing/billing purposes |
| `upd_dtm` | Field | Update Date-Time (before update) — the last modification timestamp from the primary contract screen |
| `work_param_sette_value` | Field | Work Parameter Set Value — the call charge limit notification specified amount |
| CAANMsg | Acronym | Common Abstract Application Notification Message — the framework's standard message object for inter-component communication |
| CBSMsg | Acronym | Core Business System Message — message class defining the fields for a CBS operation |
| CC | Acronym | Common Component — shared utility classes in the eo customer system framework |
| FUNC_CODE_KEY | Constant | Key name for the function code field in working maps |
| EKK0371D010 | Screen/SC ID | Optional Service Contract <Telephone> Registration — the target CBS screen/component being invoked |
| EKK0191D010 | Screen/SC ID | Service Contract Detail <eo Light Telephone> Registration — source screen for service detail work number |
| EKK0111D010 | Screen/SC ID | Service Contract <eo Light Telephone> Registration — primary contract registration screen |
| EZM0321A010 | Screen/SC ID | Optional Service Contract <Telephone> Registration — source for call charge limit parameters |
| SCControlMapKeys | Class | Framework class providing keys for control map data (OPERATOR_ID, OPE_DATE, OPE_TIME) |
| JCMConstants | Class | Framework constants class (OPERATOR_ID_KEY, OPERATE_DATE_KEY, OPERATE_DATETIME_KEY, FUNC_CODE_KEY) |
| JFUBPCommon | Class | Shared business parameter utility class for reading data from IRequestParameterReadWrite |
| REQUEST_DATA_KEY | Concept | The concept of "data" stored under a fixedText key in IRequestParameterReadWrite, containing working maps for the current screen flow |
| EKK0371D010TelList | Field Key | List key within the data map containing telephone service contract records (ArrayList of HashMaps) |
| eo光電話 | Business term | eo Hikari Denwa — NTT East's fiber-optic telephone service brand; the domain this method operates in |
| オプションサービス契約 | Business term | Optional Service Contract — supplementary services attached to a base telephone line |
| 上りマッピング | Business term | Upper-level Mapping — the process of mapping screen input data to CBS output message format (the reverse of "下り" which maps CBS response to screen) |
