# Business Logic — JKKEmailInfoAddCfmCC.editResultRP() [213 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `com.fujitsu.futurity.bp.custom.common.JKKEmailInfoAddCfmCC` |
| Layer | CC/Common Component (Framework utility layer — called by CBS service orchestrators within the same class) |
| Module | `common` (Package: `com.fujitsu.futurity.bp.custom.common`) |

## 1. Role

### JKKEmailInfoAddCfmCC.editResultRP()

This method is a **shared result-mapping utility** invoked at the end of approximately 20+ CBS service orchestrator methods within `JKKEmailInfoAddCfmCC`. Its purpose is to take the raw response from a service component execution (carried in a `Map` containing `CAANMsg` template objects) and map structured business data and error information back into the `IRequestParameterReadWrite` request parameter object so that the calling screen can display results to the user.

It implements a **dispatch/routing pattern** based on the `templateId` returned by the service component. Each of the 22 recognized template IDs corresponds to a specific CBS (Component Business Service) message class that defines the expected error-field schema for that screen's response. The method routes to the appropriate CBS message class, retrieves its error field definitions, and maps any error messages returned by the service back into the user data map.

A **status-priority mechanism** ensures that if the service component reports a status code higher than the business process's own return code, the service component's status and associated message are propagated to the control map — guaranteeing that service-level errors take precedence over local business logic status codes.

In the larger system, this method is the **single convergence point** for error-result mapping across all email-info-add confirmation screens handled by this CC class. Every CBS service method that calls a downstream service and needs to return results to the UI delegates to `editResultRP` to package the response.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["editResultRP entry"])

    START --> EXTRACT_MSG["Extract CAANMsg[] templates and Integer returnCode from msgList"]
    EXTRACT_MSG --> GET_TEMPLATE["Get template = templates[0]"]
    GET_TEMPLATE --> GET_IDS["Get templateId, templateStatus from template"]

    GET_IDS --> CHECK_RETURN{"returnCode != 0?"}
    CHECK_RETURN -->|Yes| SET_ERROR_STATUS["Set templateStatus = 9000"]
    CHECK_RETURN -->|No| VALIDATE_STATUS["Validate templateStatus against RETURN_MESSAGE constants"]
    SET_ERROR_STATUS --> VALIDATE_STATUS

    VALIDATE_STATUS --> GET_BP_STATUS["Get bpStatus from param control map RETURN_CODE"]
    GET_BP_STATUS --> COMPARE_STATUS{"templateStatus > bpStatus?"}

    COMPARE_STATUS -->|No| GET_USER_DATA["Get inMap from param using fixedText"]
    COMPARE_STATUS -->|Yes| SET_SERVICE_STATUS["Set templateStatus into param control map with message"]
    SET_SERVICE_STATUS --> GET_USER_DATA

    GET_USER_DATA --> CHECK_TEMPLATE{"templateId is known?"}
    CHECK_TEMPLATE -->|EKK0011D020| GET_EKK0011["contents = EKK0011D020CBSMsg.getContents()"]
    CHECK_TEMPLATE -->|EKK0021C060| GET_EKK0021C["contents = EKK0021C060CBSMsg.getContents()"]
    CHECK_TEMPLATE -->|EKK0021D010| GET_EKK0021D["contents = EKK0021D010CBSMsg.getContents()"]
    CHECK_TEMPLATE -->|EKK0081A010| GET_EKK0081["contents = EKK0081A010CBSMsg.getContents()"]
    CHECK_TEMPLATE -->|EKK0361A010| GET_EKK0361A["contents = EKK0361A010CBSMsg.getContents()"]
    CHECK_TEMPLATE -->|EKK0361C010| GET_EKK0361C1["contents = EKK0361C010CBSMsg.getContents()"]
    CHECK_TEMPLATE -->|EKK0361C030| GET_EKK0361C3["contents = EKK0361C030CBSMsg.getContents()"]
    CHECK_TEMPLATE -->|EKK0361C040| GET_EKK0361C4["contents = EKK0361C040CBSMsg.getContents()"]
    CHECK_TEMPLATE -->|EKK0361D010| GET_EKK0361D1["contents = EKK0361D010CBSMsg.getContents()"]
    CHECK_TEMPLATE -->|EKK0411C020| GET_EKK0411C2["contents = EKK0411C020CBSMsg.getContents()"]
    CHECK_TEMPLATE -->|EKK0411C040| GET_EKK0411C4["contents = EKK0411C040CBSMsg.getContents()"]
    CHECK_TEMPLATE -->|EKK0411C050| GET_EKK0411C5["contents = EKK0411C050CBSMsg.getContents()"]
    CHECK_TEMPLATE -->|EKK0411D010| GET_EKK0411D1["contents = EKK0411D010CBSMsg.getContents()"]
    CHECK_TEMPLATE -->|EKK1091D010| GET_EKK1091["contents = EKK1091D010CBSMsg.getContents()"]
    CHECK_TEMPLATE -->|EZM0111D010| GET_EZM0111["contents = EZM0111D010CBSMsg.getContents()"]
    CHECK_TEMPLATE -->|ECK0011A010| GET_ECK0011["contents = ECK0011A010CBSMsg.getContents()"]
    CHECK_TEMPLATE -->|ECK0141A010| GET_ECK0141A["contents = ECK0141A010CBSMsg.getContents()"]
    CHECK_TEMPLATE -->|ECK0141B002| GET_ECK0141B["contents = ECK0141B002CBSMsg.getContents()"]
    CHECK_TEMPLATE -->|ECK0141C020| GET_ECK0141C2["contents = ECK0141C020CBSMsg.getContents()"]
    CHECK_TEMPLATE -->|ECK0141C040| GET_ECK0141C4["contents = ECK0141C040CBSMsg.getContents()"]
    CHECK_TEMPLATE -->|ECK0141D010| GET_ECK0141D["contents = ECK0141D010CBSMsg.getContents()"]
    CHECK_TEMPLATE -->|Unknown| SKIP_MAP["Skip mapping, contents remains null"]

    GET_EKK0011 --> MAP_LOOP
    GET_EKK0021C --> MAP_LOOP
    GET_EKK0021D --> MAP_LOOP
    GET_EKK0081 --> MAP_LOOP
    GET_EKK0361A --> MAP_LOOP
    GET_EKK0361C1 --> MAP_LOOP
    GET_EKK0361C3 --> MAP_LOOP
    GET_EKK0361C4 --> MAP_LOOP
    GET_EKK0361D1 --> MAP_LOOP
    GET_EKK0411C2 --> MAP_LOOP
    GET_EKK0411C4 --> MAP_LOOP
    GET_EKK0411C5 --> MAP_LOOP
    GET_EKK0411D1 --> MAP_LOOP
    GET_EKK1091 --> EKK1091_SPECIAL["EKK1091D010 special: extract ido_rsn_cd_err and ido_rsn_memo_err from nested CAANMsg"]
    GET_EZM0111 --> MAP_LOOP
    GET_ECK0011 --> MAP_LOOP
    GET_ECK0141A --> MAP_LOOP
    GET_ECK0141B --> MAP_LOOP
    GET_ECK0141C2 --> MAP_LOOP
    GET_ECK0141C4 --> MAP_LOOP
    GET_ECK0141D --> MAP_LOOP
    SKIP_MAP --> MAP_LOOP

    EKK1091_SPECIAL --> MAP_LOOP
    MAP_LOOP["For each entry in contents[], map _err fields from template to inMap"]
    MAP_LOOP --> BUILD_ERR_LIST["Build/Retrieve errList from param control map"]
    BUILD_ERR_LIST --> SET_ERROR_INFO["Set ERROR_INFO using TemplateErrorUtil.getErrorInfo(msgList, errList)"]
    SET_ERROR_INFO --> RETURN_PARAM["Return param"]
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `msgList` | `Map<?, ?>` | The result map returned from service component execution. Contains `CAANMsg[]` templates (accessible via `TEMPLATE_LIST_KEY`), an integer return code (`RET_CD_INT_KEY`), and potentially other framework-level data. The first template in the array is the primary response carrier. |
| 2 | `param` | `IRequestParameterReadWrite` | The business data read/write interface object that holds both the user data (retrievable via `fixedText` key) and the control map (containing system metadata like return code, return message, and error info). This object is populated with mapped results and returned to the caller. |
| 3 | `fixedText` | `String` | A user-specified string key used to retrieve the user data `HashMap` from `param`. Acts as the namespace/discriminator for user-level data within the request parameter object. Typically corresponds to a screen-specific identifier. |

**Instance/external state used:**
- `JCMConstants.TEMPLATE_LIST_KEY` — constant key to retrieve `CAANMsg[]` from `msgList` (value not resolvable from repo; external framework constant)
- `JCMConstants.RET_CD_INT_KEY` — constant key to retrieve return code integer from `msgList`
- `JCMConstants.TEMPLATE_ID_KEY` — constant key to retrieve template ID string from `CAANMsg`
- `JCMConstants.STATUS_INT_KEY` — constant key to retrieve template status integer from `CAANMsg`
- `SCControlMapKeys.RETURN_CODE` — constant key for retrieving the BP return code from the control map
- `SCControlMapKeys.RETURN_MESSAGE` — constant key for setting the return message in the control map
- `SCControlMapKeys.ERROR_INFO` — constant key for the error info list in the control map
- `JCMAPLConstMgr.getString()` — framework utility to retrieve internationalized/static message strings keyed by `"RETURN_MESSAGE_" + four-digit status code`
- `TemplateErrorUtil.getErrorInfo(msgList, errList)` — utility class that extracts structured error info from the msgList

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `EKK0011D020CBSMsg.getContents` | EKK0011D020CBS | - | Retrieves error-field definitions for EKK0011D020 service |
| R | `EKK0021C060CBSMsg.getContents` | EKK0021C060CBS | - | Retrieves error-field definitions for EKK0021C060 service |
| R | `EKK0021D010CBSMsg.getContents` | EKK0021D010CBS | - | Retrieves error-field definitions for EKK0021D010 service |
| R | `EKK0081A010CBSMsg.getContents` | EKK0081A010CBS | - | Retrieves error-field definitions for EKK0081A010 service |
| R | `EKK0361A010CBSMsg.getContents` | EKK0361A010CBS | - | Retrieves error-field definitions for EKK0361A010 service |
| R | `EKK0361C010CBSMsg.getContents` | EKK0361C010CBS | - | Retrieves error-field definitions for EKK0361C010 service |
| R | `EKK0361C030CBSMsg.getContents` | EKK0361C030CBS | - | Retrieves error-field definitions for EKK0361C030 service |
| R | `EKK0361C040CBSMsg.getContents` | EKK0361C040CBS | - | Retrieves error-field definitions for EKK0361C040 service |
| R | `EKK0411C050CBSMsg.getContents` | EKK0411C050CBS | - | Retrieves error-field definitions for EKK0411C050 service |
| R | `EKK0361D010CBSMsg.getContents` | EKK0361D010CBS | - | Retrieves error-field definitions for EKK0361D010 service |
| R | `EKK0411C020CBSMsg.getContents` | EKK0411C020CBS | - | Retrieves error-field definitions for EKK0411C020 service |
| R | `EKK0411C040CBSMsg.getContents` | EKK0411C040CBS | - | Retrieves error-field definitions for EKK0411C040 service |
| R | `EKK0411D010CBSMsg.getContents` | EKK0411D010CBS | - | Retrieves error-field definitions for EKK0411D010 service |
| R | `EKK1091D010CBSMsg.getContents` | EKK1091D010CBS | - | Retrieves error-field definitions for EKK1091D010 service |
| R | `EKK1091D010CBSMsg1List.getCAANMsgList` | EKK1091D010CBS | - | Retrieves nested error list messages for EKK1091D010 |
| R | `EZM0111D010CBSMsg.getContents` | EZM0111D010CBS | - | Retrieves error-field definitions for EZM0111D010 service |
| R | `ECK0011A010CBSMsg.getContents` | ECK0011A010CBS | - | Retrieves error-field definitions for ECK0011A010 service |
| R | `ECK0141B002CBSMsg.getContents` | ECK0141B002CBS | - | Retrieves error-field definitions for ECK0141B002 service |
| R | `ECK0141A010CBSMsg.getContents` | ECK0141A010CBS | - | Retrieves error-field definitions for ECK0141A010 service |
| R | `ECK0141D010CBSMsg.getContents` | ECK0141D010CBS | - | Retrieves error-field definitions for ECK0141D010 service |
| R | `ECK0141C020CBSMsg.getContents` | ECK0141C020CBS | - | Retrieves error-field definitions for ECK0141C020 service |
| R | `ECK0141C040CBSMsg.getContents` | ECK0141C040CBS | - | Retrieves error-field definitions for ECK0141C040 service |
| R | `TemplateErrorUtil.getErrorInfo(msgList, errList)` | TemplateErrorUtil | - | Extracts structured error information from msgList for error display |
| R | `CAANMsg.getString(key)` | CAANMsg | - | Reads string value from template message by key |
| R | `CAANMsg.getInt(key)` | CAANMsg | - | Reads integer status from template message by key |
| R | `CAANMsg.isNull(key)` | CAANMsg | - | Checks whether a field exists and is non-null in template |
| R | `CAANMsg.getCAANMsgList(key)` | CAANMsg | - | Retrieves nested list of CAANMsg for EKK1091D010 processing |
| - | `JKKEmailInfoAddCfmCC.isNull` | JKKEmailInfoAddCfmCC | - | Utility null-check method (if used) |

**Classification notes:**
- This method performs **no direct Create/Update/Delete** operations on entities or databases.
- All CBS message classes (`EKK*CBSMsg`, `ECK*CBSMsg`, `EZM*CBSMsg`) are **data descriptor classes** that return static arrays of expected error field names — they do not perform any DB I/O themselves.
- The actual service calls that populate `msgList` are performed by the **caller** methods (e.g., `callEKK0361A010SC`) — this method only processes the results after service completion.
- The net effect is a **pure Read** operation: it reads response data from templates and maps it into the request parameter object.

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | `callECK0011A010SC` | `callECK0011A010SC` -> `editResultRP` | `getContents [R] ECK0011A010CBSMsg` |
| 2 | `callECK0141A010SC` | `callECK0141A010SC` -> `editResultRP` | `getContents [R] ECK0141A010CBSMsg` |
| 3 | `callECK0141B002SC` | `callECK0141B002SC` -> `editResultRP` | `getContents [R] ECK0141B002CBSMsg` |
| 4 | `callECK0141C020SC` | `callECK0141C020SC` -> `editResultRP` | `getContents [R] ECK0141C020CBSMsg` |
| 5 | `callECK0141C040SC` | `callECK0141C040SC` -> `editResultRP` | `getContents [R] ECK0141C040CBSMsg` |
| 6 | `callECK0141D010SC` | `callECK0141D010SC` -> `editResultRP` | `getContents [R] ECK0141D010CBSMsg` |
| 7 | `callEKK0011D020SC` | `callEKK0011D020SC` -> `editResultRP` | `getContents [R] EKK0011D020CBSMsg` |
| 8 | `callEKK0021C060SC` | `callEKK0021C060SC` -> `editResultRP` | `getContents [R] EKK0021C060CBSMsg` |
| 9 | `callEKK0081A010SC` | `callEKK0081A010SC` -> `editResultRP` | `getContents [R] EKK0081A010CBSMsg` |
| 10 | `callEKK0361A010SC` | `callEKK0361A010SC` -> `editResultRP` | `getContents [R] EKK0361A010CBSMsg` |
| 11 | `callEKK0361C010SC` | `callEKK0361C010SC` -> `editResultRP` | `getContents [R] EKK0361C010CBSMsg` |
| 12 | `callEKK0361C030SC` | `callEKK0361C030SC` -> `editResultRP` | `getContents [R] EKK0361C030CBSMsg` |
| 13 | `callEKK0361C040SC` | `callEKK0361C040SC` -> `editResultRP` | `getContents [R] EKK0361C040CBSMsg` |
| 14 | `callEKK0361D010SC` | `callEKK0361D010SC` -> `editResultRP` | `getContents [R] EKK0361D010CBSMsg` |
| 15 | `callEKK0411C020SC` | `callEKK0411C020SC` -> `editResultRP` | `getContents [R] EKK0411C020CBSMsg` |

**Additional callers:** `callEKK0411C040SC`, `callEKK0411C050SC`, `callEKK0411D010SC`, `callEKK1091D010SC`, `callEZM0111D010SC` (21 total callers, 15 shown above).

**Dependency summary:** All callers are CBS service orchestrator methods within the same `JKKEmailInfoAddCfmCC` class. None are direct screen entry points or batch jobs — they are intermediate service-level methods. The ultimate terminal operations from this method are exclusively `getContents [R]` calls on CBS message descriptor classes, and `getErrorInfo [R]` on the `TemplateErrorUtil` utility. No Create/Update/Delete operations occur in this method.

## 6. Per-Branch Detail Blocks

**Block 1** — IF `(returnCode != 0)` (L4565)

> If the service returned a non-zero return code, override the template status to 9000 (error state).

| # | Type | Code |
|---|------|------|
| 1 | SET | `templateStatus = 9000;` // Override template status to error code when return code is non-zero |

**Block 2** — IF `(JCMAPLConstMgr.getString("RETURN_MESSAGE_" + formatted status) == null)` (L4569)

> Validates that the template status code corresponds to a registered return message. If not, resets status to 0 (success/default).
> Status is formatted as a four-digit zero-padded string (e.g., `0000`, `1000`, `9000`).

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `String.format("%1$04d", templateStatus)` // Format status as 4-digit zero-padded string |
| 2 | EXEC | `JCMAPLConstMgr.getString("RETURN_MESSAGE_" + formattedStatus)` // Check if return message constant exists |
| 3 | SET | `templateStatus = 0;` // Reset to 0 if no matching return message constant found |

**Block 3** — BP status retrieval (L4574–4581)

> Retrieves the business process's own return code from the control map. If absent, defaults to -1.

| # | Type | Code |
|---|------|------|
| 1 | SET | `obj = param.getControlMapData(SCControlMapKeys.RETURN_CODE)` |
| 2 | IF | `obj == null` |
| 3 | SET | `bpStatus = -1;` // No BP return code set; defaults to -1 |
| 4 | SET | `bpStatus = Integer.parseInt((String) obj);` // Parse BP return code |

**Block 4** — IF `(templateStatus > bpStatus)` (L4583)

> Status priority check: if the service component's status is higher (more severe) than the BP's own return code, propagate the service's status and message to the control map. Service errors take precedence.

| # | Type | Code |
|---|------|------|
| 1 | SET | `formatStatus = String.format("%1$04d", templateStatus)` |
| 2 | EXEC | `message = JCMAPLConstMgr.getString("RETURN_MESSAGE_" + formatStatus)` // Fetch localized error message |
| 3 | EXEC | `param.setControlMapData(SCControlMapKeys.RETURN_CODE, formatStatus)` |
| 4 | EXEC | `param.setControlMapData(SCControlMapKeys.RETURN_MESSAGE, message)` |

**Block 5** — User data retrieval (L4588)

| # | Type | Code |
|---|------|------|
| 1 | SET | `inMap = (HashMap) param.getData(fixedText)` // Get user data HashMap keyed by fixedText |

**Block 6** — Template ID routing chain (L4591–4687)

> Routes to the appropriate CBS message descriptor class based on the service's templateId. Each CBSMsg class defines the error-field schema for its corresponding service.
>
> Branch conditions resolve to the following templateId string constants:

| # | Type | Code |
|---|------|------|
| 1 | IF-ELSEIF | `templateId.equals("EKK0011D020")` -> `contents = new EKK0011D020CBSMsg().getContents()` |
| 2 | ELSEIF | `templateId.equals("EKK0021C060")` -> `contents = new EKK0021C060CBSMsg().getContents()` |
| 3 | ELSEIF | `templateId.equals("EKK0021D010")` -> `contents = new EKK0021D010CBSMsg().getContents()` |
| 4 | ELSEIF | `templateId.equals("EKK0081A010")` -> `contents = new EKK0081A010CBSMsg().getContents()` |
| 5 | ELSEIF | `templateId.equals("EKK0361A010")` -> `contents = new EKK0361A010CBSMsg().getContents()` |
| 6 | ELSEIF | `templateId.equals("EKK0361C010")` -> `contents = new EKK0361C010CBSMsg().getContents()` |
| 7 | ELSEIF | `templateId.equals("EKK0361C030")` -> `contents = new EKK0361C030CBSMsg().getContents()` |
| 8 | ELSEIF | `templateId.equals("EKK0361C040")` -> `contents = new EKK0361C040CBSMsg().getContents()` |
| 9 | ELSEIF | `templateId.equals("EKK0411C050")` -> `contents = new EKK0411C050CBSMsg().getContents()` |
| 10 | ELSEIF | `templateId.equals("EKK0361D010")` -> `contents = new EKK0361D010CBSMsg().getContents()` |
| 11 | ELSEIF | `templateId.equals("EKK0411C020")` -> `contents = new EKK0411C020CBSMsg().getContents()` |
| 12 | ELSEIF | `templateId.equals("EKK0411C040")` -> `contents = new EKK0411C040CBSMsg().getContents()` |
| 13 | ELSEIF | `templateId.equals("EKK0411D010")` -> `contents = new EKK0411D010CBSMsg().getContents()` |
| 14 | ELSEIF | `templateId.equals("EKK1091D010")` -> `contents = new EKK1091D010CBSMsg().getContents()` + special nested processing |
| 15 | ELSEIF | `templateId.equals("EZM0111D010")` -> `contents = new EZM0111D010CBSMsg().getContents()` |
| 16 | ELSEIF | `templateId.equals("ECK0011A010")` -> `contents = new ECK0011A010CBSMsg().getContents()` |
| 17 | ELSEIF | `templateId.equals("ECK0141A010")` -> `contents = new ECK0141A010CBSMsg.getContents()` |
| 18 | ELSEIF | `templateId.equals("ECK0141B002")` -> `contents = new ECK0141B002CBSMsg().getContents()` |
| 19 | ELSEIF | `templateId.equals("ECK0141D010")` -> `contents = new ECK0141D010CBSMsg().getContents()` |
| 20 | ELSEIF | `templateId.equals("ECK0141C020")` -> `contents = new ECK0141C020CBSMsg().getContents()` |
| 21 | ELSEIF | `templateId.equals("ECK0141C040")` -> `contents = new ECK0141C040CBSMsg().getContents()` |
| 22 | ELSE (implicit) | No assignment — `contents` remains `null`, loop at Block 7 is skipped |

**Block 6.14** — EKK1091D010 special processing (L4680–4708)

> EKK1091D010 has additional processing: it extracts nested error list data from the template's child CAANMsg array. This handles a multi-row error response where each row carries an "interruption reason code" and "interruption reason memo".

| # | Type | Code |
|---|------|------|
| 1 | SET | `inList = (ArrayList) inMap.get("EKK1091D010CBSMsg1List")` |
| 2 | IF | `inList == null` |
| 3 | SET | `inList = new ArrayList()` |
| 4 | SET | `inMap.put("EKK1091D010CBSMsg1List", inList)` |
| 5 | SET | `templateArray = template.getCAANMsgList(EKK1091D010CBSMsg1List.EKK1091D010CBSMSG1LIST)` |
| 6 | IF | `templateArray != null` |
| 7 | FOR | `for (int i = 0; i < templateArray.length; i++)` |
| 8 | IF | `i >= inList.size()` (nested loop) |
| 9 | SET | `inList.add(new HashMap())` |
| 10 | SET | `childMap = (HashMap) inList.get(i)` |
| 11 | SET | `childTemplate = templateArray[i]` |
| 12 | IF | `!childTemplate.isNull(EKK1091D010CBSMsg1List.IDO_RSN_CD_ERR)` (nested, L4694) |
| 13 | IF | `!childMap.containsKey("ido_rsn_cd_err")` (nested, L4696) |
| 14 | SET | `childMap.put("ido_rsn_cd_err", childTemplate.getString(EKK1091D010CBSMsg1List.IDO_RSN_CD_ERR))` // Map interruption reason code error |
| 15 | IF | `!childTemplate.isNull(EKK1091D010CBSMsg1List.IDO_RSN_MEMO_ERR)` (nested, L4700) |
| 16 | IF | `!childMap.containsKey("ido_rsn_memo_err")` (nested, L4702) |
| 17 | SET | `childMap.put("ido_rsn_memo_err", childTemplate.getString(EKK1091D010CBSMsg1List.IDO_RSN_MEMO_ERR))` // Map interruption reason memo error |

**Block 7** — FOR loop: map error fields from template to user data map (L4713–4725)

> Iterates over the `contents[][]` array (each entry = [fieldName, fieldType] or similar schema definition). For each entry, if the field name contains `"_err"` and the template has a non-null value for that field, maps it into the user data map — but only if the key is not already present (first-write-wins).

| # | Type | Code |
|---|------|------|
| 1 | FOR | `for (int i = 0; contents != null && i < contents.length; i++)` |
| 2 | SET | `element = (String) contents[i][0]` // Extract field name from contents entry |
| 3 | IF | `element.indexOf("_err") > 0` (only error fields) |
| 4 | IF | `!template.isNull(element)` |
| 5 | IF | `!inMap.containsKey(element)` |
| 6 | SET | `inMap.put(element, template.getString(element))` // Map error message to user data |

**Block 8** — Error list building (L4728–4733)

> Retrieves or creates the error info list from the control map.

| # | Type | Code |
|---|------|------|
| 1 | SET | `errList = (ArrayList<Object>) param.getControlMapData(SCControlMapKeys.ERROR_INFO)` |
| 2 | IF | `errList == null` |
| 3 | SET | `errList = new ArrayList<Object>()` |

**Block 9** — Set consolidated error info (L4736)

> Delegates to `TemplateErrorUtil.getErrorInfo()` to extract structured error info from `msgList`, using the built `errList` as context.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `param.setControlMapData(SCControlMapKeys.ERROR_INFO, TemplateErrorUtil.getErrorInfo(msgList, errList))` |

**Block 10** — RETURN (L4738)

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return param;` // Return the populated request parameter with mapped results and error info |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `templateId` | Field | Template identifier returned by a service component; dispatch key used to route to the appropriate CBS message descriptor class |
| `templateStatus` | Field | Status code from the service template (integer, formatted as 4-digit zero-padded string); indicates success, warning, or error state |
| `returnCode` | Field | Integer return code from the service component; non-zero indicates an error condition |
| `bpStatus` | Field | Business process's own return code, stored in the control map; used for priority comparison against the service status |
| `fixedText` | Parameter | User-specified string key used as the namespace/discriminator for user data within the request parameter object |
| `inMap` | Field | User data HashMap retrieved from `param` using `fixedText` as key; holds business data and error messages for the screen |
| `contents` | Field | 2D string array from a CBSMsg descriptor class; defines the schema of expected error fields for a given service |
| `IDO_RSN_CD_ERR` | Field | Interruption reason code error — the code identifying why an operation was interrupted/discontinued |
| `IDO_RSN_MEMO_ERR` | Field | Interruption reason memo error — free-text description of why an operation was interrupted/discontinued |
| `CAANMsg` | Class | Framework message wrapper class that holds template data; provides `getString()`, `getInt()`, `isNull()`, `getCAANMsgList()` methods for data access |
| `CBSMsg` | Class | CBS (Component Business Service) message descriptor class that returns an array of expected error field names for a specific service |
| `IRequestParameterReadWrite` | Interface | Business data read/write interface; holds user data and control map data for request/response between screens and services |
| `TemplateErrorUtil` | Class | Framework utility class that extracts structured error information from a `CAANMsg` result map |
| `JCMConstants` | Class | Framework constant definitions class (external library); defines keys like `TEMPLATE_LIST_KEY`, `RET_CD_INT_KEY`, `TEMPLATE_ID_KEY`, `STATUS_INT_KEY` |
| `SCControlMapKeys` | Class | Framework constant definitions class (external library); defines control map keys like `RETURN_CODE`, `RETURN_MESSAGE`, `ERROR_INFO` |
| `JCMAPLConstMgr` | Class | Framework constant manager (external library); retrieves static/internationalized message strings by key |
| `RETURN_MESSAGE_XXXX` | Constant pattern | Message key pattern where `XXXX` is a 4-digit zero-padded status code (e.g., `RETURN_MESSAGE_1000`, `RETURN_MESSAGE_9000`); maps status codes to human-readable messages |
| `_err` suffix | Naming convention | Field name suffix convention indicating an error message field (e.g., `field_name_err` holds the error message for `field_name`) |
| `EKK*` | Prefix | Fujitsu K. system service codes — typically related to service change/confirmation operations (K = Keiyaku/contract) |
| `ECK*` | Prefix | Fujitsu K. system service codes — typically related to order/change confirmation operations (EK = Order Confirmation/Change) |
| `EZM*` | Prefix | Fujitsu K. system service codes — typically related to maintenance/zaimu operations |
| `TEMPLATE_LIST_KEY` | Constant | Key to retrieve `CAANMsg[]` template array from the result `msgList` map |
| `RET_CD_INT_KEY` | Constant | Key to retrieve the integer return code from the result `msgList` map |
| `EKK1091D010CBSMSG1LIST` | Constant | Key for the nested child message list within the EKK1091D010 service response |
