# Business Logic — JKKCancelSvcWribCC.editRetEKK0451C070() [183 LOC]

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

## 1. Role

### JKKCancelSvcWribCC.editRetEKK0451C070()

This method performs the **downstream mapping processing for discounted service contract cancellation** (割引サービス契約キャンセルの下りマッピング処理). It is a private utility method that transforms outbound message data received from a Service Component call into a standardized parameter map for consumption by the presentation layer or subsequent processing stages. Specifically, it reads a `CAANMsg` template array from the incoming `msgList` (which carries structured CBS response data for discount service contract cancellation) and maps each relevant field into a `dataMap` and a nested `workDataMap`. The method processes 11 response fields — all via a consistent conditional null-safety pattern: if the template field is null, an empty string is stored; otherwise, the string value is extracted and placed into both the result data map and the work area. This dual-write strategy preserves the data in both the method return payload and the broader work context. The method delegates error handling to `editErrInfoEKK0451C070()` and consolidates error information via `TemplateErrorUtil.getErrorInfo()`. It functions as a shared transformation utility invoked from `cancelSvcWrib()` during the cancellation main processing flow, handling both discount (割引) and miscellaneous (汎用) service types.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["editRetEKK0451C070"])
    START --> EXTRACT["Extract templates and returnCode from msgList"]
    EXTRACT --> GET_WORKMAP["Get workMap from param.getMappingWorkArea"]
    GET_WORKMAP --> INIT_MAPS["Initialize workDataMap, workSvkeiExcCtrlMap, dataMap"]
    INIT_MAPS --> COND_GENE{"template.isNull(GENE_ADD_DTM)"}
    COND_GENE --> yes["Set empty string"]
    COND_GENE --> no["Set value from template.getString(GENE_ADD_DTM) to dataMap and workDataMap"]
    no --> COND_STAT{"template.isNull(WRIB_SVC_KEI_STAT)"}
    yes --> COND_STAT
    COND_STAT --> yes2["Set empty string"]
    COND_STAT --> no2["Set value from template.getString(WRIB_SVC_KEI_STAT)"]
    yes2 --> COND_RSV_YM{"template.isNull(RSV_APLY_YMD)"}
    no2 --> COND_RSV_YM
    COND_RSV_YM --> yes3["Set empty string"]
    COND_RSV_YM --> no3["Set value from template.getString(RSV_APLY_YMD)"]
    yes3 --> COND_RSV_CD{"template.isNull(RSV_APLY_CD)"}
    no3 --> COND_RSV_CD
    COND_RSV_CD --> yes4["Set empty string"]
    COND_RSV_CD --> no4["Set value from template.getString(RSV_APLY_CD)"]
    yes4 --> COND_SVC_CANCEL{"template.isNull(SVC_CANCEL_YMD)"}
    no4 --> COND_SVC_CANCEL
    COND_SVC_CANCEL --> yes5["Set empty string"]
    COND_SVC_CANCEL --> no5["Set value from template.getString(SVC_CANCEL_YMD)"]
    yes5 --> COND_SVC_CANCEL_CL{"template.isNull(SVC_CANCEL_CL_YMD)"}
    no5 --> COND_SVC_CANCEL_CL
    COND_SVC_CANCEL_CL --> yes6["Set empty string"]
    COND_SVC_CANCEL_CL --> no6["Set value from template.getString(SVC_CANCEL_CL_YMD)"]
    yes6 --> COND_ADD_DTM{"template.isNull(ADD_DTM)"}
    no6 --> COND_ADD_DTM
    COND_ADD_DTM --> yes7["Set empty string"]
    COND_ADD_DTM --> no7["Set value from template.getString(ADD_DTM)"]
    yes7 --> COND_ADD_OPEACNT{"template.isNull(ADD_OPEACNT)"}
    no7 --> COND_ADD_OPEACNT
    COND_ADD_OPEACNT --> yes8["Set empty string"]
    COND_ADD_OPEACNT --> no8["Set value from template.getString(ADD_OPEACNT)"]
    yes8 --> COND_UPD_DTM{"template.isNull(UPD_DTM)"}
    no8 --> COND_UPD_DTM
    COND_UPD_DTM --> yes9["Set empty string"]
    COND_UPD_DTM --> no9["Set value from template.getString(UPD_DTM)"]
    yes9 --> COND_UPD_OPEACNT{"template.isNull(UPD_OPEACNT)"}
    no9 --> COND_UPD_OPEACNT
    COND_UPD_OPEACNT --> yes10["Set empty string"]
    COND_UPD_OPEACNT --> no10["Set value from template.getString(UPD_OPEACNT)"]
    yes10 --> COND_MK_FLG{"template.isNull(MK_FLG)"}
    no10 --> COND_MK_FLG
    COND_MK_FLG --> yes11["Set empty string"]
    COND_MK_FLG --> no11["Set value from template.getString(MK_FLG)"]
    yes11 --> CALL_ERR["Call editErrInfoEKK0451C070"]
    no11 --> CALL_ERR
    CALL_ERR --> MAP_ERR["Get errList from param.getControlMapData"]
    MAP_ERR --> SET_ERR["Set control map data with TemplateErrorUtil.getErrorInfo"]
    SET_ERR --> END_NODE(["Return param"])
```

**Field Mapping Sequence:**

| # | CBS Field Constant | dataMap Key | Business Meaning |
|---|---|---|---|
| 1 | `GENE_ADD_DTM` | `gene_add_dtm` | Registration date/time (世代登録年月日時分秒) |
| 2 | `WRIB_SVC_KEI_STAT` | `wrib_svc_kei_stat` | Discount service contract status (割引サービス契約ステータス) |
| 3 | `RSV_APLY_YMD` | `rsv_aply_ymd` | Reservation application date (予約適用年月日) |
| 4 | `RSV_APLY_CD` | `rsv_aply_cd` | Reservation application code (予約適用コード) |
| 5 | `SVC_CANCEL_YMD` | `svc_cancel_ymd` | Service cancellation date (サービスキャンセル年月日) |
| 6 | `SVC_CANCEL_CL_YMD` | `svc_cancel_cl_ymd` | Service cancellation withdrawal date (サービスキャンセル取消年月日) |
| 7 | `ADD_DTM` | `add_dtm` | Registration date/time (登録年月日時分秒) |
| 8 | `ADD_OPEACNT` | `add_opeacnt` | Registration operator account (登録オペレータアカウント) |
| 9 | `UPD_DTM` | `upd_dtm` | Update date/time (更新年月日時分秒) |
| 10 | `UPD_OPEACNT` | `upd_opeacnt` | Update operator account (更新オペレータアカウント) |
| 11 | `MK_FLG` | `mk_flg` | Invalid flag (無効フラグ) |

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `msgList` | `Map<?, ?>` | The outbound message list from the CBS Service Component call. Contains the `CAANMsg[]` template array at key `JCMConstants.TEMPLATE_LIST_KEY` (holding the structured cancellation response data), and a return code at `JCMConstants.RET_CD_INT_KEY` for error handling. This carries the raw service contract cancellation results from the backend CBS layer. |
| 2 | `param` | `IRequestParameterReadWrite` | The request parameter object that serves as the primary data carrier. It holds work area mappings (`getMappingWorkArea`/`setMappingWorkArea`), the result data map (`getData`/`setData` keyed by `fixedText`), and control map data for error info (`getControlMapData`/`setControlMapData`). Modified in-place to accumulate all mapped fields. |
| 3 | `fixedText` | `String` | A string key used to scope the data map within `param`. Acts as a namespace/discriminator to allow multiple data payloads to coexist within the same parameter object. In the caller context, it identifies the specific processing block (the `ccName` passed through from `cancelSvcWrib`). |

**Instance fields read:**

| Field | Type | Business Meaning |
|-------|------|------------------|
| `wribSvcKei` | `HashMap<String, String>` | Service contract number to last update date/time mapping for discount services (サービス契約番号に対する最終更新日時分秒（割引サービス）). Iterated over during `UPD_DTM` processing to set the last update date for each service contract number. |

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `JACBatCommon.isNull` | JACBatCommon | - | Calls `isNull` in `JACBatCommon` |
| - | `JACbatRknBusinessUtil.isNull` | JACbatRknBusiness | - | Calls `isNull` in `JACbatRknBusinessUtil` |
| - | `JCHbatSeikyKaknoBusinessUtil.isNull` | JCHbatSeikyKaknoBusiness | - | Calls `isNull` in `JCHbatSeikyKaknoBusinessUtil` |
| R | `JBSbatACECBuyIfTrkm.getErrorInfo` | JBSbatACECBuyIfTrkm | - | Calls `getErrorInfo` in `JBSbatACECBuyIfTrkm` |
| - | `JBSbatACInsentetivePrcInfoSaksei.isNull` | JBSbatACInsentetivePrcInfoSaksei | - | Calls `isNull` in `JBSbatACInsentetivePrcInfoSaksei` |
| R | `JBSbatACKojiChrgInfoTrkm.getErrorInfo` | JBSbatACKojiChrgInfoTrkm | - | Calls `getErrorInfo` in `JBSbatACKojiChrgInfoTrkm` |
| - | `JBSbatAKCHSeikyYsoInfMake.isNull` | JBSbatAKCHSeikyYsoInfMake | - | Calls `isNull` in `JBSbatAKCHSeikyYsoInfMake` |
| - | `JBSbatAKKshkmRsltInfoTukiawsday.setData` | JBSbatAKKshkmRsltInfoTukiawsday | - | Calls `setData` in `JBSbatAKKshkmRsltInfoTukiawsday` |
| - | `JBSbatAKKshkmRsltInfoTukiaws.setData` | JBSbatAKKshkmRsltInfoTukiaws | - | Calls `setData` in `JBSbatAKKshkmRsltInfoTukiaws` |
| - | `JBSbatAKKshkmRsltInfoTukiawsRealSkh.setData` | JBSbatAKKshkmRsltInfoTukiawsRealSkh | - | Calls `setData` in `JBSbatAKKshkmRsltInfoTukiawsRealSkh` |
| - | `JBSbatAKKshkmRsltInfTkCvsNCnsl.setData` | JBSbatAKKshkmRsltInfTkCvsNCnsl | - | Calls `setData` in `JBSbatAKKshkmRsltInfTkCvsNCnsl` |
| R | `JBSbatCHOrosiSyokeiReShukei.getKey` | JBSbatCHOrosiSyokeiReShukei | - | Calls `getKey` in `JBSbatCHOrosiSyokeiReShukei` |
| R | `JBSbatDKNyukaFinAdd.getData` | JBSbatDKNyukaFinAdd | - | Calls `getData` in `JBSbatDKNyukaFinAdd` |
| R | `JBSbatFUCaseFileRnkData.getString` | JBSbatFUCaseFileRnkData | - | Calls `getString` in `JBSbatFUCaseFileRnkData` |
| R | `JBSbatFUMoveNaviData.getString` | JBSbatFUMoveNaviData | - | Calls `getString` in `JBSbatFUMoveNaviData` |
| - | `JBSbatKKGetCTITelno.setData` | JBSbatKKGetCTITelno | - | Calls `setData` in `JBSbatKKGetCTITelno` |
| R | `JBSbatZMAdDataSet.getString` | JBSbatZMAdDataSet | - | Calls `getString` in `JBSbatZMAdDataSet` |
| R | `JFUeoTelOpTransferCC.getData` | JFUeoTelOpTransferCC | - | Calls `getData` in `JFUeoTelOpTransferCC` |
| R | `JFUTransferCC.getData` | JFUTransferCC | - | Calls `getData` in `JFUTransferCC` |
| R | `JFUTransferListToListCC.getData` | JFUTransferListToListCC | - | Calls `getData` in `JFUTransferListToListCC` |
| - | `JKKBpCommon.setLastDtmBySvcKeiNo` | JKKBpCommon | - | Calls `setLastDtmBySvcKeiNo` in `JKKBpCommon` to set the last update date for each service contract number from `wribSvcKei` |
| U | `JKKCancelSvcWribCC.editErrInfoEKK0451C070` | JKKCancelSvcWribCC | - | Calls `editErrInfoEKK0451C070` to set error information for discount service contract cancellation |
| - | `JKKHdlSvkeiWorkArea.setLastDtmBySvcKeiNo` | JKKHdlSvkeiWorkArea | - | Calls `setLastDtmBySvcKeiNo` in `JKKHdlSvkeiWorkArea` |
| R | `JESC0101B010TPMA.getString` | JESC0101B010TPMA | - | Calls `getString` in `JESC0101B010TPMA` |
| R | `JESC0101B020TPMA.getString` | JESC0101B020TPMA | - | Calls `getString` in `JESC0101B020TPMA` |
| R | `KKW12701SFLogic.getData` | KKW12701SFLogic | - | Calls `getData` in `KKW12701SFLogic` |
| R | `ApiBpInterface.getErrorInfo` | ApiBpInterface | - | Calls `getErrorInfo` in `ApiBpInterface` |
| - | `TemplateErrorUtil.getErrorInfo` | TemplateErrorUtil | - | Static utility call that extracts error info from the msgList combined with the error list, returns error info map |

**Notes on direct calls within `editRetEKK0451C070`:**

This method directly invokes the following methods (noted by usage of `template.isNull()` and `template.getString()` from the `EKK0451C070CBSMsg` class, plus `editErrInfoEKK0451C070`, `JKKBpCommon.setLastDtmBySvcKeiNo`, and `TemplateErrorUtil.getErrorInfo`):

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `template.isNull(field)` | EKK0451C070CBSMsg | - | Checks if each CBS response field is null before extracting value |
| - | `template.getString(field)` | EKK0451C070CBSMsg | - | Extracts string value from CBS response template |
| U | `editErrInfoEKK0451C070` | JKKCancelSvcWribCC | - | Updates error info for cancellation processing |
| U | `JKKBpCommon.setLastDtmBySvcKeiNo` | JKKBpCommon | - | Sets the last update date/time per service contract number |
| R | `TemplateErrorUtil.getErrorInfo` | TemplateErrorUtil | - | Retrieves error info from msgList combined with error list |
| - | `param.getMappingWorkArea()` | IRequestParameterReadWrite | - | Reads the work area mapping from param |
| - | `param.setMappingWorkArea()` | IRequestParameterReadWrite | - | Writes the work area mapping to param |
| - | `param.getData(key)` | IRequestParameterReadWrite | - | Reads data map keyed by fixedText from param |
| - | `param.setData(key, map)` | IRequestParameterReadWrite | - | Writes data map keyed by fixedText to param |
| - | `param.getControlMapData(key)` | IRequestParameterReadWrite | - | Reads control map data for ERROR_INFO |
| - | `param.setControlMapData(key, data)` | IRequestParameterReadWrite | - | Writes control map data for ERROR_INFO |

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | CBS: `cancelSvcWrib` (JKKCancelSvcWribCC) | `cancelSvcWrib` -> `editRetEKK0451C070(msgList, param, fixedText)` | `editErrInfoEKK0451C070 [U] -`, `setLastDtmBySvcKeiNo [U] -`, `TemplateErrorUtil.getErrorInfo [R] -`, `isNull [R] -`, `getString [R] -` |

**Instructions:**

The only direct caller of `editRetEKK0451C070()` is the sibling method `cancelSvcWrib()` within `JKKCancelSvcWribCC`. `cancelSvcWrib()` is the main cancellation processing entry point for discount service contracts. It invokes a Service Component via `ServiceComponentRequestInvoker`, receives the response in `msgList`, and calls `editRetEKK0451C070()` to map the CBS response fields to the parameter structure. The method iterates over service contract lists (`wribSvcCdList`, `hanyoCdList`) and dispatches the downstream mapping for each entry.

Terminal operations from this method: `setData` [-], `getErrorInfo` [R], `getErrorInfo` [R], `getErrorInfo` [R], `editErrInfoEKK0451C070` [U], `getString` [R], `getString` [R], `getString` [R], `getString` [R], `getString` [R], `getString` [R], `getString` [R], `getString` [R], `getString` [R], `getString` [R], `isNull` [-], `isNull` [-], `isNull` [-], `isNull` [-], `isNull` [-]

## 6. Per-Branch Detail Blocks

### Block 1 — IF (null check) `workMap == null` (L526)

> Acquire the work area map from param. If null, create a new HashMap and store it.

| # | Type | Code |
|---|------|------|
| 1 | SET | `workMap = param.getMappingWorkArea();` // Get work area mapping [-> getMappingWorkArea] |
| 2 | IF | `workMap == null` |
| 3 | SET | `workMap = new HashMap();` // Create new work map |
| 4 | SET | `param.setMappingWorkArea(workMap);` // Store work map [-> setMappingWorkArea] |

### Block 2 — IF (null check) `workDataMap == null` (L535)

> Acquire the discount service cancellation work area (CC_WORK_AREA_NAME_WRIB = "JKKCancelSvcWribCCWork"). If null, create and store it.

| # | Type | Code |
|---|------|------|
| 1 | SET | `workDataMap = (HashMap)workMap.get(CC_WORK_AREA_NAME_WRIB);` // [-> CC_WORK_AREA_NAME_WRIB="JKKCancelSvcWribCCWork"] |
| 2 | IF | `workDataMap == null` |
| 3 | SET | `workDataMap = new HashMap();` |
| 4 | SET | `workMap.put(CC_WORK_AREA_NAME_WRIB, workDataMap);` |

### Block 3 — IF (null check) `workSvkeiExcCtrlMap == null` (L542)

> Acquire the service contract dispatch control work area (CC_WORK_AREA_NAME_SVKEI_EXC_CTRL = "svkei_exc_ctrl"). If null, create and store it.

| # | Type | Code |
|---|------|------|
| 1 | SET | `workSvkeiExcCtrlMap = (HashMap)workMap.get(CC_WORK_AREA_NAME_SVKEI_EXC_CTRL);` // [-> CC_WORK_AREA_NAME_SVKEI_EXC_CTRL="svkei_exc_ctrl"] |
| 2 | IF | `workSvkeiExcCtrlMap == null` |
| 3 | SET | `workSvkeiExcCtrlMap = new HashMap();` |
| 4 | SET | `workMap.put(CC_WORK_AREA_NAME_SVKEI_EXC_CTRL, workSvkeiExcCtrlMap);` |

### Block 4 — IF (null check) `dataMap == null` (L550)

> Acquire the result data map keyed by `fixedText`. If null, create and store it.

| # | Type | Code |
|---|------|------|
| 1 | SET | `dataMap = (HashMap)param.getData(fixedText);` // Get data map by key |
| 2 | IF | `dataMap == null` |
| 3 | SET | `dataMap = new HashMap();` |
| 4 | SET | `param.setData(fixedText, dataMap);` |

### Block 5 — IF/ELSE `template.isNull(GENE_ADD_DTM)` (L557)

> 世代登録年月日時分秒 <-- 世代登録年月日時分秒 (Registration date/time)

| # | Type | Code |
|---|------|------|
| 1 | IF | `template.isNull(EKK0451C070CBSMsg.GENE_ADD_DTM)` [-> CBS field: 世代登録年月日時分秒] |
| 2 | SET | `dataMap.put("gene_add_dtm", new String());` // Empty string on null |
| 3 | ELSE | |
| 4 | SET | `dataMap.put("gene_add_dtm", template.getString(EKK0451C070CBSMsg.GENE_ADD_DTM));` |
| 5 | SET | `workDataMap.put("gene_add_dtm", template.getString(EKK0451C070CBSMsg.GENE_ADD_DTM));` |

### Block 6 — IF/ELSE `template.isNull(WRIB_SVC_KEI_STAT)` (L565)

> 割引サービス契約ステータス <-- 割引サービス契約ステータス (Discount service contract status)

| # | Type | Code |
|---|------|------|
| 1 | IF | `template.isNull(EKK0451C070CBSMsg.WRIB_SVC_KEI_STAT)` [-> CBS field: 割引サービス契約ステータス] |
| 2 | SET | `dataMap.put("wrib_svc_kei_stat", new String());` |
| 3 | ELSE | |
| 4 | SET | `dataMap.put("wrib_svc_kei_stat", template.getString(EKK0451C070CBSMsg.WRIB_SVC_KEI_STAT));` |
| 5 | SET | `workDataMap.put("wrib_svc_kei_stat", template.getString(EKK0451C070CBSMsg.WRIB_SVC_KEI_STAT));` |

### Block 7 — IF/ELSE `template.isNull(RSV_APLY_YMD)` (L573)

> 予約適用年月日 <-- 予約適用年月日 (Reservation application date)

| # | Type | Code |
|---|------|------|
| 1 | IF | `template.isNull(EKK0451C070CBSMsg.RSV_APLY_YMD)` [-> CBS field: 予約適用年月日] |
| 2 | SET | `dataMap.put("rsv_aply_ymd", new String());` |
| 3 | ELSE | |
| 4 | SET | `dataMap.put("rsv_aply_ymd", template.getString(EKK0451C070CBSMsg.RSV_APLY_YMD));` |
| 5 | SET | `workDataMap.put("rsv_aply_ymd", template.getString(EKK0451C070CBSMsg.RSV_APLY_YMD));` |

### Block 8 — IF/ELSE `template.isNull(RSV_APLY_CD)` (L581)

> 予約適用コード <-- 予約適用コード (Reservation application code)

| # | Type | Code |
|---|------|------|
| 1 | IF | `template.isNull(EKK0451C070CBSMsg.RSV_APLY_CD)` [-> CBS field: 予約適用コード] |
| 2 | SET | `dataMap.put("rsv_aply_cd", new String());` |
| 3 | ELSE | |
| 4 | SET | `dataMap.put("rsv_aply_cd", template.getString(EKK0451C070CBSMsg.RSV_APLY_CD));` |
| 5 | SET | `workDataMap.put("rsv_aply_cd", template.getString(EKK0451C070CBSMsg.RSV_APLY_CD));` |

### Block 9 — IF/ELSE `template.isNull(SVC_CANCEL_YMD)` (L589)

> サービスキャンセル年月日 <-- サービスキャンセル年月日 (Service cancellation date)

| # | Type | Code |
|---|------|------|
| 1 | IF | `template.isNull(EKK0451C070CBSMsg.SVC_CANCEL_YMD)` [-> CBS field: サービスキャンセル年月日] |
| 2 | SET | `dataMap.put("svc_cancel_ymd", new String());` |
| 3 | ELSE | |
| 4 | SET | `dataMap.put("svc_cancel_ymd", template.getString(EKK0451C070CBSMsg.SVC_CANCEL_YMD));` |
| 5 | SET | `workDataMap.put("svc_cancel_ymd", template.getString(EKK0451C070CBSMsg.SVC_CANCEL_YMD));` |

### Block 10 — IF/ELSE `template.isNull(SVC_CANCEL_CL_YMD)` (L597)

> サービスキャンセル取消年月日 <-- サービスキャンセル取消年月日 (Service cancellation withdrawal date)

| # | Type | Code |
|---|------|------|
| 1 | IF | `template.isNull(EKK0451C070CBSMsg.SVC_CANCEL_CL_YMD)` [-> CBS field: サービスキャンセル取消年月日] |
| 2 | SET | `dataMap.put("svc_cancel_cl_ymd", new String());` |
| 3 | ELSE | |
| 4 | SET | `dataMap.put("svc_cancel_cl_ymd", template.getString(EKK0451C070CBSMsg.SVC_CANCEL_CL_YMD));` |
| 5 | SET | `workDataMap.put("svc_cancel_cl_ymd", template.getString(EKK0451C070CBSMsg.SVC_CANCEL_CL_YMD));` |

### Block 11 — IF/ELSE `template.isNull(ADD_DTM)` (L605)

> 登録年月日時分秒 <-- 登録年月日時分秒 (Registration date/time)

| # | Type | Code |
|---|------|------|
| 1 | IF | `template.isNull(EKK0451C070CBSMsg.ADD_DTM)` [-> CBS field: 登録年月日時分秒] |
| 2 | SET | `dataMap.put("add_dtm", new String());` |
| 3 | ELSE | |
| 4 | SET | `dataMap.put("add_dtm", template.getString(EKK0451C070CBSMsg.ADD_DTM));` |
| 5 | SET | `workDataMap.put("add_dtm", template.getString(EKK0451C070CBSMsg.ADD_DTM));` |

### Block 12 — IF/ELSE `template.isNull(ADD_OPEACNT)` (L613)

> 登録オペレータアカウント <-- 登録オペレータアカウント (Registration operator account)

| # | Type | Code |
|---|------|------|
| 1 | IF | `template.isNull(EKK0451C070CBSMsg.ADD_OPEACNT)` [-> CBS field: 登録オペレータアカウント] |
| 2 | SET | `dataMap.put("add_opeacnt", new String());` |
| 3 | ELSE | |
| 4 | SET | `dataMap.put("add_opeacnt", template.getString(EKK0451C070CBSMsg.ADD_OPEACNT));` |
| 5 | SET | `workDataMap.put("add_opeacnt", template.getString(EKK0451C070CBSMsg.ADD_OPEACNT));` |

### Block 13 — IF/ELSE `template.isNull(UPD_DTM)` (L621)

> 更新年月日時分秒 <-- 更新年月日時分秒 (Update date/time)

> Special: When the field is non-null, additionally iterates over `wribSvcKei` entries to set the last update date/time for each service contract number.

| # | Type | Code |
|---|------|------|
| 1 | IF | `template.isNull(EKK0451C070CBSMsg.UPD_DTM)` [-> CBS field: 更新年月日時分秒] |
| 2 | SET | `dataMap.put("upd_dtm", new String());` |
| 3 | ELSE | |
| 4 | SET | `dataMap.put("upd_dtm", template.getString(EKK0451C070CBSMsg.UPD_DTM));` |
| 5 | SET | `workDataMap.put("upd_dtm", template.getString(EKK0451C070CBSMsg.UPD_DTM));` |
| 6 | EXEC | 処理対象となったサービス契約番号の最終更新日をセットする（作業領域に対して）(Set the last update date of the service contract numbers that were processed (in the work area)) |
| 7 | FOR | `Iterator<Map.Entry<String, String>> iterator = wribSvcKei.entrySet().iterator();` |
| 8 | WHILE | `iterator.hasNext()` |
| 9 | SET | `Map.Entry<String, String> mapEntry = iterator.next();` |
| 10 | CALL | `JKKBpCommon.setLastDtmBySvcKeiNo(param, mapEntry.getKey(), template.getString(EKK0451C070CBSMsg.UPD_DTM));` |

### Block 14 — IF/ELSE `template.isNull(UPD_OPEACNT)` (L637)

> 更新オペレータアカウント <-- 更新オペレータアカウント (Update operator account)

| # | Type | Code |
|---|------|------|
| 1 | IF | `template.isNull(EKK0451C070CBSMsg.UPD_OPEACNT)` [-> CBS field: 更新オペレータアカウント] |
| 2 | SET | `dataMap.put("upd_opeacnt", new String());` |
| 3 | ELSE | |
| 4 | SET | `dataMap.put("upd_opeacnt", template.getString(EKK0451C070CBSMsg.UPD_OPEACNT));` |
| 5 | SET | `workDataMap.put("upd_opeacnt", template.getString(EKK0451C070CBSMsg.UPD_OPEACNT));` |

### Block 15 — IF/ELSE `template.isNull(MK_FLG)` (L645)

> 無効フラグ <-- 無効フラグ (Invalid flag)

| # | Type | Code |
|---|------|------|
| 1 | IF | `template.isNull(EKK0451C070CBSMsg.MK_FLG)` [-> CBS field: 無効フラグ] |
| 2 | SET | `dataMap.put("mk_flg", new String());` |
| 3 | ELSE | |
| 4 | SET | `dataMap.put("mk_flg", template.getString(EKK0451C070CBSMsg.MK_FLG));` |
| 5 | SET | `workDataMap.put("mk_flg", template.getString(EKK0451C070CBSMsg.MK_FLG));` |

### Block 16 — EXEC `editErrInfoEKK0451C070` (L653)

> エラー情報の設定 (Set error information)

| # | Type | Code |
|---|------|------|
| 1 | CALL | `editErrInfoEKK0451C070(param, templates, (Integer)returnCode, fixedText);` // Delegates error info setup |

### Block 17 — IF/ELSE `errList == null` (L657)

> エラー情報のマップを取得 (Acquire error information map)

| # | Type | Code |
|---|------|------|
| 1 | SET | `ArrayList<Object> errList = (ArrayList<Object>)param.getControlMapData(SCControlMapKeys.ERROR_INFO);` |
| 2 | IF | `errList == null` |
| 3 | SET | `errList = new ArrayList<Object>();` |
| 4 | SET | `param.setControlMapData(SCControlMapKeys.ERROR_INFO, TemplateErrorUtil.getErrorInfo(msgList, errList));` // Set error info into control map |

### Block 18 — RETURN (L660)

> リクエストパラメータを返す (Return request parameters)

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return param;` |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `GENE_ADD_DTM` | Field | Registration date/time (世代登録年月日時分秒) — When the service contract generation record was registered |
| `WRIB_SVC_KEI_STAT` | Field | Discount service contract status (割引サービス契約ステータス) — Current status of the discount service contract (e.g., active, cancelled) |
| `RSV_APLY_YMD` | Field | Reservation application date (予約適用年月日) — Date when the reservation application is applied |
| `RSV_APLY_CD` | Field | Reservation application code (予約適用コード) — Code indicating the type of reservation application |
| `SVC_CANCEL_YMD` | Field | Service cancellation date (サービスキャンセル年月日) — Date when the service contract was cancelled |
| `SVC_CANCEL_CL_YMD` | Field | Service cancellation withdrawal date (サービスキャンセル取消年月日) — Date when the cancellation was withdrawn/reversed |
| `ADD_DTM` | Field | Registration date/time (登録年月日時分秒) — When the record was last registered |
| `ADD_OPEACNT` | Field | Registration operator account (登録オペレータアカウント) — Operator who performed the registration |
| `UPD_DTM` | Field | Update date/time (更新年月日時分秒) — When the record was last updated |
| `UPD_OPEACNT` | Field | Update operator account (更新オペレータアカウント) — Operator who performed the update |
| `MK_FLG` | Field | Invalid flag (無効フラグ) — Flag indicating whether the record is marked as invalid/nullified |
| `wribSvcKei` | Field | Service contract number to last update date/time mapping for discount services (サービス契約番号に対する最終更新日時分秒（割引サービス）) |
| `hanyoSvcKei` | Field | Service contract number to last update date/time mapping for miscellaneous services (サービス契約番号に対する最終更新日時分秒（汎用）) |
| `CC_WORK_AREA_NAME_WRIB` | Constant | Work area key name for discount cancellation ("JKKCancelSvcWribCCWork") |
| `CC_WORK_AREA_NAME_SVKEI_EXC_CTRL` | Constant | Work area key name for service contract dispatch control ("svkei_exc_ctrl") |
| `wrib` | Abbreviation | Discount (割引) — Short for 割引, referring to discounted service contracts |
| `hanyo` | Abbreviation | Miscellaneous (汎用) — Short for 汎用, referring to general-purpose/miscellaneous services |
| `KEI` | Abbreviation | Service detail/category (契約種目) — From 契約種目 (keiyaku shukumu), referring to service contract category |
| CBS | Abbreviation | Call By System / Business processing system — Backend service component layer |
| CAANMsg | Class | Fujitura message model — Carrier of CBS request/response data with field accessor methods like `getString()` and `isNull()` |
| TemplateErrorUtil | Class | Error template utility — Extracts and consolidates error information from CBS response messages |
| SC | Abbreviation | Service Component — Backend business logic component invoked via ServiceComponentRequestInvoker |
| SCControlMapKeys | Class | Control map key constants — Defines keys like `ERROR_INFO` for control data management |
| EKK0451C070CBSMsg | Class | CBS message constants for discount service contract cancellation — Defines field keys for CBS response data |
| JCMConstants | Class | Common message constants — Defines keys like `TEMPLATE_LIST_KEY` and `RET_CD_INT_KEY` for the message list structure |
| `JACBatCommon.isNull` | Method | Null-check utility in JACBatCommon |
| `JACbatRknBusinessUtil.isNull` | Method | Null-check utility in JACbatRknBusinessUtil |
| `JKKBpCommon.setLastDtmBySvcKeiNo` | Method | Sets the last update date/time per service contract number in the work area |
| `editErrInfoEKK0451C070` | Method | Sets error information for discount service contract cancellation processing |
