# Business Logic — JFUAddSvcKeiNetCC.editOutEKK0171D010Msg() [260 LOC]

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

## 1. Role

### JFUAddSvcKeiNetCC.editOutEKK0171D010Msg()

This method performs the **downstream data mapping** (下りマッピング処理) for the eo Light Net (eo光ネット) service contract line item registration screen — specifically, it transforms the raw CAANMsg template data returned from a service component call into a structured output map (`dataMap`) ready for the UI layer. It acts as a **data transformer and coordinator**, extracting each field from the `CAANMsg` template, writing nullable-safe values into the output `dataMap`, and simultaneously building a service contract list (`svcKeiListMap`) used by the discount service auto-apply feature (added in v4.00.00). The method also delegates to `editErrInfoEKK0171D010` for error info mapping, and finally assembles all error information into the control map via `TemplateErrorUtil.getErrorInfo`. Its role is a critical bridge between the business service component result and the presentation screen, ensuring consistent data flow and error reporting for the eo Light Net registration flow.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["editOutEKK0171D010Msg Start"])

    START --> GET_TEMPLATES["Get CAANMsg templates and return code from msgList"]

    GET_TEMPLATES --> INIT_MAPS["Initialize workMap, workDataMap, dataMap"]

    INIT_MAPS --> EXTRACT_FIELDS["Extract fields from template: svc_kei_ucwk_no, dtm, stat, rsv_aply, mk_flg, etc."]

    EXTRACT_FIELDS --> BUILD_SERVICE_LIST["Build svcKeiListMap: set tg_kei_skbt_cd='03', svc_kei_ucwk_stat='010', pcrs_cd, pplan_cd"]

    BUILD_SERVICE_LIST --> ADD_TO_GROUP["Add svcKeiListMap to svcKeiList and add to svcKeiGrpListMap if absent"]

    ADD_TO_GROUP --> AUTO_APPLY["Set sysid and mskm_no from work maps for auto-apply"]

    AUTO_APPLY --> ERROR_MAPPING["Call editErrInfoEKK0171D010 and map error info"]

    ERROR_MAPPING --> RETURN["Return param with mapped output data"]
```

**CRITICAL — Constant Resolution:**

Constants are defined as private static final fields within `JFUAddSvcKeiNetCC`:

| Constant Name | Resolved Value | Business Meaning |
|--------------|---------------|------------------|
| `CC_WORK_AREA_NAME` | `"JFUAddSvcKeiNetCCWork"` | Work area key for eo Light Net service detail registration work items |
| `CC_WORK_AREA_NAME_KEISHA` | `"JFUAddKeishaServiceCCWork"` | Work area key for customer information work data |
| `CC_WORK_AREA_NAME_MSKM` | `"JFUAddMskmSCWork"` | Work area key for order detail (mskm) service component data |
| `CC_WRI_SVC_AUTO_APLY_MAP` | `"JKKWrisvcAutoAplyCCMap"` | Work map key for discount service auto-apply configuration |
| `SVC_KEI_GRP_LIST` | `"svc_kei_grp_list"` | Key for service contract group list in the auto-apply map |
| `SVC_KEI_LIST` | `"svc_kei_list"` | Key for service contract list within a service group |
| `TEMPLATE_ID_NET` | `"EKK0091D010"` | Template ID for service contract eo Light Net registration |
| `TEMPLATE_ID_NET_UTC` | `"EKK0171D010"` | Template ID for service detail eo Light Net registration |

Hardcoded business values used in this method:
- `"03"` — `tg_kei_skbt_cd`: Service contract type code representing **Net (eo Light Net) service**
- `"010"` — `svc_kei_ucwk_stat`: Service detail work status meaning **"Received/Completed" (受注済)**

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `msgList` | `Map<?, ?>` | The return value map from a service component call containing the CAANMsg templates (resulting from the service contract registration request) and the return code. This map is the primary source of all field values that get mapped to output. |
| 2 | `param` | `IRequestParameterReadWrite` | The request/response parameter object that carries input data and accumulates output mappings. It provides work area maps, data storage slots (via `setData`/`getData`), and a control map for error info. It is both consumed and mutated throughout this method. |
| 3 | `fixedText` | `String` | A text key (prefix) used to retrieve/store data in `param`. It corresponds to the `fixedText` template ID (e.g., `"EKK0091D010"`), enabling the method to locate the correct data storage slot within the parameter object. |

**Instance/Static fields read:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `CC_WORK_AREA_NAME` | `String` (constant) | Key to access the eo Light Net service detail work item area |
| `CC_WORK_AREA_NAME_KEISHA` | `String` (constant) | Key to access the customer information work area |
| `CC_WORK_AREA_NAME_MSKM` | `String` (constant) | Key to access the order detail service component work area |
| `CC_WRI_SVC_AUTO_APLY_MAP` | `String` (constant) | Key to access the discount service auto-apply configuration map |
| `SVC_KEI_GRP_LIST` | `String` (constant) | Key identifying the service contract group list within the auto-apply map |
| `SVC_KEI_LIST` | `String` (constant) | Key identifying the service contract list within a group |
| `TEMPLATE_ID_NET` | `String` (constant) | Template ID for the service contract eo Light Net registration template |

## 4. CRUD Operations / Called Services

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

| 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 | `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` |
| U | `JFUAddSvcKeiNetCC.editErrInfoEKK0171D010` | JFUAddSvcKeiNetCC | - | Calls `editErrInfoEKK0171D010` to map error information from service component result |
| R | `JFUeoTelOpTransferCC.getData` | JFUeoTelOpTransferCC | - | Calls `getData` in `JFUeoTelOpTransferCC` |
| R | `JFUTransferCC.getData` | JFUTransferCC | - | Calls `getData` in `JFUTransferCC` |
| R | `JFUTransferListToListCC.getData` | JFUTransferListToListCC | - | Calls `getData` in `JFUTransferListToListCC` |
| 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` |

**Direct analysis of method calls within `editOutEKK0171D010Msg`:**

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `template.isNull(...)` | EKK0171D010CBSMsg | CAANMsg fields | Reads null-checks against template fields to determine safe value extraction |
| R | `template.getString(...)` | EKK0171D010CBSMsg | CAANMsg fields | Reads string values from CAANMsg template returned by service component |
| R | `msgList.get(JCMConstants.TEMPLATE_LIST_KEY)` | JCMConstants | - | Retrieves template list from service component return map |
| R | `msgList.get(JCMConstants.RET_CD_INT_KEY)` | JCMConstants | - | Retrieves return code integer from service component return map |
| R | `param.getData(fixedText)` | param | - | Retrieves the output data map slot identified by fixedText (template ID) |
| R | `param.getData("EKK0091D010")` | param | - | Retrieves the eo Light Net service contract map for pricing info |
| R | `param.getMappingWorkArea()` | param | - | Retrieves the work area map carrying intermediate work data |
| R | `param.getControlMapData(SCControlMapKeys.ERROR_INFO)` | param | - | Retrieves existing error info list from control map |
| U | `param.setMappingWorkArea(workMap)` | param | - | Sets the initialized work area map into the parameter object |
| U | `param.setData(fixedText, dataMap)` | param | - | Stores the populated output data map into the parameter object |
| U | `editErrInfoEKK0171D010` | EKK0171D010 | - | Delegates error info mapping from service component result to param |
| U | `param.setControlMapData(SCControlMapKeys.ERROR_INFO, ...)` | param | - | Stores final error info list into the control map for error display |
| R | `TemplateErrorUtil.getErrorInfo(msgList, errList)` | TemplateErrorUtil | - | Reads and transforms error info from msgList into the standard error format |

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Method: `JFUAddSvcKeiNetCC.addNetTrk()` | `addNetTrk()` -> `editOutEKK0171D010Msg(msgList, param, fixedText)` | `getErrorInfo [R]`, `editErrInfoEKK0171D010 [U]`, `getString [R]`, `isNull [-]`, `getData [R]` |

**Terminal operations reached from this method:**

- `getErrorInfo` [R] — Reads error info from service component result via `TemplateErrorUtil`
- `editErrInfoEKK0171D010` [U] — Updates error information mapping into param
- `getString` [R] — Reads string values from CAANMsg template fields
- `isNull` [-] — Null-checks against CAANMsg template fields
- `getData` [R] — Retrieves data maps from param (output data, work area)
- `setMappingWorkArea` [U] — Sets work area into param
- `setData` [U] — Stores output data map into param
- `setControlMapData` [U] — Stores error info into control map

## 6. Per-Branch Detail Blocks

**Block 1** — [SET] Extract CAANMsg templates and return code from msgList (L2205)

> Retrieves the template array and return code from the service component result map.

| # | Type | Code |
|---|------|------|
| 1 | SET | `CAANMsg[] templates = (CAANMsg[]) msgList.get(JCMConstants.TEMPLATE_LIST_KEY)` // Retrieve CAANMsg array from msgList |
| 2 | SET | `CAANMsg template = templates[0]` // Take the first template |
| 3 | SET | `CAANMsg[] templateArray = null` // Unused, declared for compatibility |
| 4 | SET | `Object returnCode = msgList.get(JCMConstants.RET_CD_INT_KEY)` // Retrieve return code for error handling |

**Block 2** — [IF/ELSE-SET] Initialize workMap and workDataMap (L2220)

> Ensures the mapping work area and work data map exist in the parameter object, creating them if null.

| # | Type | Code |
|---|------|------|
| 1 | SET | `Map workMap = param.getMappingWorkArea()` // Get work area from param |
| 2 | IF | `workMap == null` |
| 2.1 | SET | `workMap = new HashMap()` |
| 2.2 | EXEC | `param.setMappingWorkArea(workMap)` [-> CC_WORK_AREA_NAME="JFUAddSvcKeiNetCCWork"] |
| 3 | SET | `HashMap workDataMap = (HashMap) workMap.get(CC_WORK_AREA_NAME)` // Get work data item info |
| 4 | IF | `workDataMap == null` |
| 4.1 | SET | `workDataMap = new HashMap()` |
| 4.2 | EXEC | `workMap.put(CC_WORK_AREA_NAME, workDataMap)` |

**Block 3** — [SET] Retrieve output dataMap (L2235)

> Gets the HashMap storage slot identified by `fixedText` for writing output fields.

| # | Type | Code |
|---|------|------|
| 1 | SET | `HashMap dataMap = null` // Output data map |
| 2 | SET | `ArrayList dataList = null` // Unused, declared for compatibility |
| 3 | SET | `dataMap = (HashMap) param.getData(fixedText)` // Get data map for template |
| 4 | IF | `dataMap == null` |
| 4.1 | SET | `dataMap = new HashMap()` |
| 4.2 | EXEC | `param.setData(fixedText, dataMap)` // Store initialized map back |

**Block 4** — [SET] Initialize fields for discount service auto-apply (L2242)

> 2012/4/24 discount service auto-apply support added. Initializes sysId and mskmNo.

| # | Type | Code |
|---|------|------|
| 1 | SET | `String sysId = ""` // System ID for discount service auto-apply |
| 2 | SET | `String mskmNo = ""` // Order number for discount service auto-apply |

**Block 5** — [SET] Retrieve input context maps (L2246)

> Retrieves the eo Light Net service contract map, customer info work map, and order info work map needed for building the service list and auto-apply configuration.

| # | Type | Code |
|---|------|------|
| 1 | SET | `HashMap netMap = (HashMap) param.getData("EKK0091D010")` // Service contract: eo Light Net info |
| 2 | SET | `HashMap addKeishaServiceCCWorkMap = (HashMap) workMap.get(CC_WORK_AREA_NAME_KEISHA)` // Customer info work |
| 3 | SET | `HashMap addMskmSCWork = (HashMap) workMap.get(CC_WORK_AREA_NAME_MSKM)` // Order info work |
| 4 | SET | `HashMap wriSvcAutoAplyMap = (HashMap) param.getData(CC_WRI_SVC_AUTO_APLY_MAP)` // Discount auto-apply map |
| 5 | SET | `HashMap svcKeiGrpListMap = new HashMap()` // Service contract group list map |
| 6 | SET | `ArrayList svcKeiGrpList = (ArrayList) wriSvcAutoAplyMap.get(SVC_KEI_GRP_LIST)` // Service contract group list |
| 7 | SET | `HashMap svcKeiListMap = new HashMap()` // Service contract list map (output) |
| 8 | SET | `ArrayList svcKeiList = new ArrayList()` // Service contract list (output) |

**Block 6** — [IF/ELSE] Extract `svc_kei_ucwk_no` (Service Detail Work Number) (L2272)

> Maps the service contract line item work number from the template, with nullable-safe handling. Also populates workDataMap and svcKeiListMap.

| # | Type | Code |
|---|------|------|
| 1 | IF | `template.isNull(EKK0171D010CBSMsg.SVC_KEI_UCWK_NO)` |
| 1.1 | SET | `dataMap.put("svc_kei_ucwk_no", "")` |
| 1.2 | SET | `svcKeiListMap.put("svc_kei_ucwk_no", "")` |
| 2 | ELSE | |
| 2.1 | SET | `dataMap.put("svc_kei_ucwk_no", template.getString(EKK0171D010CBSMsg.SVC_KEI_UCWK_NO))` |
| 2.2 | SET | `workDataMap.put("svc_kei_ucwk_no", template.getString(EKK0171D010CBSMsg.SVC_KEI_UCWK_NO))` // [-> CC_WORK_AREA_NAME="JFUAddSvcKeiNetCCWork"] |
| 2.3 | SET | `svcKeiListMap.put("svc_kei_ucwk_no", template.getString(EKK0171D010CBSMsg.SVC_KEI_UCWK_NO))` |

**Block 7** — [IF/ELSE] Extract `kk0161_gene_add_dtm` (Registration Timestamp Service Detail) (L2284)

> Nullable field for the registration date/time of the service detail.

| # | Type | Code |
|---|------|------|
| 1 | IF | `template.isNull(EKK0171D010CBSMsg.KK0161_GENE_ADD_DTM)` |
| 1.1 | SET | `dataMap.put("kk0161_gene_add_dtm", "")` |
| 2 | ELSE | |
| 2.1 | SET | `dataMap.put("kk0161_gene_add_dtm", template.getString(EKK0171D010CBSMsg.KK0161_GENE_ADD_DTM))` |

**Block 8** — [IF/ELSE] Extract `svc_kei_ucwk_stat` (Service Detail Status) (L2291)

> Nullable field for the current work status of the service detail (e.g., "010" = Received/Completed).

| # | Type | Code |
|---|------|------|
| 1 | IF | `template.isNull(EKK0171D010CBSMsg.SVC_KEI_UCWK_STAT)` |
| 1.1 | SET | `dataMap.put("svc_kei_ucwk_stat", "")` |
| 2 | ELSE | |
| 2.1 | SET | `dataMap.put("svc_kei_ucwk_stat", template.getString(EKK0171D010CBSMsg.SVC_KEI_UCWK_STAT))` |

**Block 9** — [IF/ELSE] Extract `rsv_aply_ymd` (Reservation Apply Date) (L2298)

> Nullable field for the application date (YYYYMMDD format) of the reservation.

| # | Type | Code |
|---|------|------|
| 1 | IF | `template.isNull(EKK0171D010CBSMsg.RSV_APLY_YMD)` |
| 1.1 | SET | `dataMap.put("rsv_aply_ymd", "")` |
| 2 | ELSE | |
| 2.1 | SET | `dataMap.put("rsv_aply_ymd", template.getString(EKK0171D010CBSMsg.RSV_APLY_YMD))` |

**Block 10** — [IF/ELSE] Extract `rsv_aply_cd` (Reservation Apply Code) (L2305)

> Nullable field for the code identifying the reservation application type.

| # | Type | Code |
|---|------|------|
| 1 | IF | `template.isNull(EKK0171D010CBSMsg.RSV_APLY_CD)` |
| 1.1 | SET | `dataMap.put("rsv_aply_cd", "")` |
| 2 | ELSE | |
| 2.1 | SET | `dataMap.put("rsv_aply_cd", template.getString(EKK0171D010CBSMsg.RSV_APLY_CD))` |

**Block 11** — [IF/ELSE] Extract `kk0171_gene_add_dtm` (Registration Timestamp Service Detail eo Light Net) (L2312)

> Nullable field for the registration date/time specific to the eo Light Net service detail line.

| # | Type | Code |
|---|------|------|
| 1 | IF | `template.isNull(EKK0171D010CBSMsg.KK0171_GENE_ADD_DTM)` |
| 1.1 | SET | `dataMap.put("kk0171_gene_add_dtm", "")` |
| 2 | ELSE | |
| 2.1 | SET | `dataMap.put("kk0171_gene_add_dtm", template.getString(EKK0171D010CBSMsg.KK0171_GENE_ADD_DTM))` |

**Block 12** — [IF/ELSE] Extract `add_dtm` (Registration Date Timestamp) (L2319)

> Nullable field for the overall registration date/time of the order.

| # | Type | Code |
|---|------|------|
| 1 | IF | `template.isNull(EKK0171D010CBSMsg.ADD_DTM)` |
| 1.1 | SET | `dataMap.put("add_dtm", "")` |
| 2 | ELSE | |
| 2.1 | SET | `dataMap.put("add_dtm", template.getString(EKK0171D010CBSMsg.ADD_DTM))` |

**Block 13** — [IF/ELSE] Extract `add_opeacnt` (Registration Operator Account) (L2326)

> Nullable field for the operator account ID that performed the registration.

| # | Type | Code |
|---|------|------|
| 1 | IF | `template.isNull(EKK0171D010CBSMsg.ADD_OPEACNT)` |
| 1.1 | SET | `dataMap.put("add_opeacnt", "")` |
| 2 | ELSE | |
| 2.1 | SET | `dataMap.put("add_opeacnt", template.getString(EKK0171D010CBSMsg.ADD_OPEACNT))` |

**Block 14** — [IF/ELSE] Extract `upd_dtm` (Update Date Timestamp) (L2333)

> Nullable field for the last update date/time of the record.

| # | Type | Code |
|---|------|------|
| 1 | IF | `template.isNull(EKK0171D010CBSMsg.UPD_DTM)` |
| 1.1 | SET | `dataMap.put("upd_dtm", "")` |
| 2 | ELSE | |
| 2.1 | SET | `dataMap.put("upd_dtm", template.getString(EKK0171D010CBSMsg.UPD_DTM))` |

**Block 15** — [IF/ELSE] Extract `upd_opeacnt` (Update Operator Account) (L2340)

> Nullable field for the operator account ID that performed the last update.

| # | Type | Code |
|---|------|------|
| 1 | IF | `template.isNull(EKK0171D010CBSMsg.UPD_OPEACNT)` |
| 1.1 | SET | `dataMap.put("upd_opeacnt", "")` |
| 2 | ELSE | |
| 2.1 | SET | `dataMap.put("upd_opeacnt", template.getString(EKK0171D010CBSMsg.UPD_OPEACNT))` |

**Block 16** — [IF/ELSE] Extract `mk_flg` (Invalid Flag / Mark Flag) (L2347)

> Nullable boolean-like flag indicating whether the record is marked as invalid.

| # | Type | Code |
|---|------|------|
| 1 | IF | `template.isNull(EKK0171D010CBSMsg.MK_FLG)` |
| 1.1 | SET | `dataMap.put("mk_flg", "")` |
| 2 | ELSE | |
| 2.1 | SET | `dataMap.put("mk_flg", template.getString(EKK0171D010CBSMsg.MK_FLG))` |

**Block 17** — [SET] Build service contract group list and service list (L2355)

> 2012/4/24 discount service auto-apply support. Retrieves the service contract group list and extracts the first group's map.

| # | Type | Code |
|---|------|------|
| 1 | SET | `svcKeiGrpListMap = (HashMap) svcKeiGrpList.get(0)` // First service contract group |
| 2 | IF | `svcKeiGrpListMap.containsKey(SVC_KEI_LIST)` |
| 2.1 | SET | `svcKeiList = (ArrayList) svcKeiGrpListMap.get(SVC_KEI_LIST)` // Extract existing service list |

**Block 18** — [IF] Set sysId from auto-apply map (L2365)

> Retrieves system ID from the auto-apply map, falls back to customer work map if empty.

| # | Type | Code |
|---|------|------|
| 1 | IF | `wriSvcAutoAplyMap.containsKey("sysid")` |
| 1.1 | SET | `sysId = (String) wriSvcAutoAplyMap.get("sysid")` |
| 2 | IF | `"".equals(sysId)` |
| 2.1 | EXEC | `wriSvcAutoAplyMap.put("sysid", (String) addKeishaServiceCCWorkMap.get("sysid"))` // Fall back to customer work |

**Block 19** — [IF] Set mskmNo from auto-apply map (L2374)

> Retrieves order number from the auto-apply map, falls back to order SC work map if empty.

| # | Type | Code |
|---|------|------|
| 1 | IF | `wriSvcAutoAplyMap.containsKey("mskm_no")` |
| 1.1 | SET | `mskmNo = (String) wriSvcAutoAplyMap.get("mskm_no")` |
| 2 | IF | `"".equals(mskmNo)` |
| 2.1 | EXEC | `wriSvcAutoAplyMap.put("mskm_no", (String) addMskmSCWork.get("mskm_no"))` // Fall back to order SC work |

**Block 20** — [SET] Populate svcKeiListMap with fixed service contract values (L2384)

> Sets the service contract list map with hardcoded business values: service type code "03" for Net service, status "010" for Received/Completed, and pricing data from the input netMap.

| # | Type | Code |
|---|------|------|
| 1 | SET | `svcKeiListMap.put("tg_kei_skbt_cd", "03")` // [-> "03" = Net service contract type] |
| 2 | SET | `svcKeiListMap.put("svc_kei_ucwk_stat", "010")` // [-> "010" = Received/Completed / 受注済] |
| 3 | SET | `svcKeiListMap.put("pcrs_cd", netMap.get("pcrs_cd"))` // Pricing course code from eo Light Net contract |
| 4 | SET | `svcKeiListMap.put("pplan_cd", netMap.get("pplan_cd"))` // Pricing plan code from eo Light Net contract |

**Block 21** — [SET] Add svcKeiListMap to svcKeiList and optionally to group (L2391)

> Inserts the newly built service contract list map into the list, and if the group does not yet contain a service list, adds it.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `svcKeiList.add(svcKeiListMap)` // Add new entry to service list |
| 2 | IF | `!svcKeiGrpListMap.containsKey(SVC_KEI_LIST)` |
| 2.1 | EXEC | `svcKeiGrpListMap.put(SVC_KEI_LIST, svcKeiList)` // Add list to group if not present |

**Block 22** — [IF/ELSE] Extract `web_op_add_fail_flg_o` (Web Option Add Fail Flag Output) (L2401)

> 2012/05/07 service interface integration support. Nullable output flag indicating whether web option addition failed.

| # | Type | Code |
|---|------|------|
| 1 | IF | `template.isNull(EKK0171D010CBSMsg.WEB_OP_ADD_FAIL_FLG_O)` |
| 1.1 | SET | `dataMap.put("web_op_add_fail_flg_o", "")` |
| 2 | ELSE | |
| 2.1 | SET | `dataMap.put("web_op_add_fail_flg_o", template.getString(EKK0171D010CBSMsg.WEB_OP_ADD_FAIL_FLG_O))` |

**Block 23** — [CALL] Map error information (L2410)

> Delegates error handling to `editErrInfoEKK0171D010` and then assembles final error info list into the control map.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `editErrInfoEKK0171D010(param, template, (Integer) returnCode, fixedText)` // Map error info from service result |
| 2 | SET | `ArrayList<Object> errList = (ArrayList<Object>) param.getControlMapData(SCControlMapKeys.ERROR_INFO)` |
| 3 | IF | `errList == null` |
| 3.1 | SET | `errList = new ArrayList<Object>()` |
| 4 | EXEC | `param.setControlMapData(SCControlMapKeys.ERROR_INFO, TemplateErrorUtil.getErrorInfo(msgList, errList))` // Store final error info |

**Block 24** — [RETURN] Return the param (L2419)

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return param` // Return param with all output data and error info mapped |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `svc_kei_ucwk_no` | Field | Service detail work number — internal tracking ID for a service contract line item (service category work item number) |
| `svc_kei_ucwk_stat` | Field | Service detail work status — current status code of the service contract line item. "010" means "Received/Completed" (受注済) |
| `kk0161_gene_add_dtm` | Field | Registration date/time stamp (service detail) — when the service detail record was originally created |
| `kk0171_gene_add_dtm` | Field | Registration date/time stamp (service detail eo Light Net) — when the eo Light Net specific service detail line was registered |
| `rsv_aply_ymd` | Field | Reservation application date — the date (YYYYMMDD format) when the reservation was applied |
| `rsv_aply_cd` | Field | Reservation application code — code identifying the type of reservation application |
| `add_dtm` | Field | Registration date/time stamp — when the record was registered in the system |
| `add_opeacnt` | Field | Registration operator account — the user ID of the operator who registered the record |
| `upd_dtm` | Field | Update date/time stamp — when the record was last updated |
| `upd_opeacnt` | Field | Update operator account — the user ID of the operator who last updated the record |
| `mk_flg` | Field | Invalid flag / Mark flag — flag indicating whether the record is marked as invalid (無効フラグ) |
| `web_op_add_fail_flg_o` | Field | Web option add fail flag (output) — indicates whether adding the option via web interface failed |
| `tg_kei_skbt_cd` | Field | Target contract service bundle code — classifies the service bundle type. "03" = Net (eo Light Net) |
| `pcrs_cd` | Field | Pricing course code — the pricing course associated with the service contract |
| `pplan_cd` | Field | Pricing plan code — the pricing plan associated with the service contract |
| `mskm_no` | Field | Order number — the unique order identifier for the customer's order |
| `sysid` | Field | System ID — identifies the system for discount service auto-application |
| CAANMsg | Technical | CAAN message class — Fujitsu's message object used for service component input/output data transfer |
| CC | Technical | Common Component — a reusable shared component in the eo customer backbone system architecture |
| CBS | Technical | Component Business Service — the service component layer that handles business logic and database operations |
| SC Code | Technical | Service Component code — identifies the specific service component (e.g., EKK0171D010CBS) |
| eo Light Net | Business term | eo光ネット — NTT东 Japan fiber-optic broadband internet service, offered through K-Opticom resale |
| Work Map | Technical | A HashMap used as a transient workspace for passing intermediate data between components in the same request |
| Auto-apply (割引サービス) | Business term | Discount service auto-application — automatically applies eligible discount services to the contract based on system rules |
| Template ID | Technical | A string identifier (e.g., "EKK0091D010") that maps to a specific CAANMsg template for a service interface |
| TemplateErrorUtil | Technical | Utility class that transforms service component error messages into a standardized error info list |
| SCControlMapKeys | Technical | Constants class for keys used in the control map, which carries system-level data like error info across components |
| JCMConstants | Technical | Constants class for Joint Customer Module constants including template list key and return code key |
