# Business Logic — JKKKisnUwHmdkAddCC.callSC() [124 LOC]

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

## 1. Role

### JKKKisnUwHmdkAddCC.callSC()

`callSC` is the central service-component invocation gateway within the `JKKKisnUwHmdkAddCC` class — a shared utility responsible for executing **telecom service contract** service components (SC) and normalizing their results into a consistent business-response envelope. It delegates to the `ServiceComponentRequestInvoker` (`scCall`) to run the actual service component, then orchestrates a multi-step post-processing pipeline: extracting return codes and template status messages, reconciling the SC-level status against BP-level control-map status, populating return message metadata into the control map, invoking `setErrorInf` to seed error/info data into the output mapping structure, dispatching template-array iteration for three known service templates (EKK0011D020, EKK0251C050, EKK1091D010), aggregating error information via `TemplateErrorUtil.getErrorInfo`, and finally performing a terminal validation check that throws an `SCCallException` on genuine errors (while tolerating warning-level responses where return code is "0" and status is 4). This method implements the **delegation and normalization** design pattern — every screen-level exec method in this class funnels through `callSC`, making it the single point of SC result processing and error handling.

The method handles four service-template branches: **EKK0011D020** (service content change registration), **EKK0251C050** (service content change deletion), **EKK1091D010** (service content change inquiry/processing), and a catch-all path for any other service component. In all branches, it applies the same status reconciliation, error aggregation, and validation logic, with only the template-extraction and per-template error-infusion steps varying.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["callSC params"])
    START --> STEP1["editInMsg param, mappingData"]
    STEP1 --> STEP2["scCall.run paramMap, handle"]
    STEP2 --> STEP3["Extract templates from result"]
    STEP3 --> STEP4["Extract returnCode from result"]
    STEP4 --> STEP5["Extract templateStatus from msg"]
    STEP5 --> RC_CHECK{returnCode != 0?}
    RC_CHECK -->|Yes| SET9000["templateStatus = 9000"]
    RC_CHECK -->|No| MSG_CHECK
    SET9000 --> MSG_CHECK{RETURN_MESSAGE status exists?}
    MSG_CHECK -->|No| RESET_STATUS["templateStatus = 0"]
    MSG_CHECK -->|No_2| GET_BP_STATUS
    RESET_STATUS --> GET_BP_STATUS["Get bpStatus from controlMapData RETURN_CODE"]
    GET_BP_STATUS --> BP_NULL{obj == null?}
    BP_NULL -->|Yes| SET_NEG1["bpStatus = -1"]
    BP_NULL -->|No| PARSE_BP["bpStatus = Integer.parseInt returnCode"]
    SET_NEG1 --> STATUS_CMP
    PARSE_BP --> STATUS_CMP{templateStatus > bpStatus?}
    STATUS_CMP -->|Yes| SET_STATUS["Set formatStatus, message, RETURN_CODE, RETURN_MESSAGE in controlMapData"]
    STATUS_CMP -->|No| SET_ERROR_INF
    SET_STATUS --> SET_ERROR_INF["setErrorInf msg, dataMapKey data"]
    SET_ERROR_INF --> GET_SVC_IF["Get svcIf from mappingData 0 1"]
    GET_SVC_IF --> TPL_CHECK{svcIf == EKK0011D020?}
    TPL_CHECK -->|Yes| PROCESS_EKK0011["Get templateArray EKK0011D020CBSMSG1LIST"]
    TPL_CHECK -->|No| CHECK_EKK0251{svcIf == EKK0251C050?}
    CHECK_EKK0251 -->|Yes| PROCESS_EKK0251["Get templateArray EKK0251C050CBSMSG1LIST"]
    CHECK_EKK0251 -->|No| CHECK_EKK1091{svcIf == EKK1091D010?}
    CHECK_EKK1091 -->|Yes| PROCESS_EKK1091["Get templateArray EKK1091D010CBSMSG1LIST"]
    CHECK_EKK1091 -->|No| GET_ERR_LIST
    PROCESS_EKK0011 --> LOOP_EKK0011{for each templateArray}
    LOOP_EKK0011 -->|Yes| CALL_SET_ERROR["setErrorInf templateArray[i], inMap"]
    CALL_SET_ERROR --> LOOP_EKK0011
    LOOP_EKK0011 -->|No| GET_ERR_LIST
    PROCESS_EKK0251 --> LOOP_EKK0251{for each templateArray}
    LOOP_EKK0251 -->|Yes| CALL_SET_ERROR_251["setErrorInf templateArray[i], inList i"]
    CALL_SET_ERROR_251 --> LOOP_EKK0251
    LOOP_EKK0251 -->|No| GET_ERR_LIST
    PROCESS_EKK1091 --> LOOP_EKK1091{for each templateArray}
    LOOP_EKK1091 -->|Yes| CALL_SET_ERROR_1091["setErrorInf templateArray[i], inList i"]
    CALL_SET_ERROR_1091 --> LOOP_EKK1091
    LOOP_EKK1091 -->|No| GET_ERR_LIST
    GET_ERR_LIST["Get errList from controlMapData ERROR_INFO"]
    GET_ERR_LIST --> ERR_NULL{errList == null?}
    ERR_NULL -->|Yes| NEW_ERR["errList = new ArrayList"]
    ERR_NULL -->|No| SET_ERR
    NEW_ERR --> SET_ERR["param.setControlMapData ERROR_INFO TemplateErrorUtil.getErrorInfo result, errList"]
    SET_ERR --> EXTRACT_RESULT["Extract rtnCode and status from result"]
    EXTRACT_RESULT --> FINAL_CHECK{rtnCode != 0 OR status != 0?}
    FINAL_CHECK -->|Yes| WARN_CHECK{rtnCode == 0 AND status == 4?}
    WARN_CHECK -->|Yes| RETURN_MSG
    WARN_CHECK -->|No| THROW_EXCEPTION["Throw SCCallException"]
    FINAL_CHECK -->|No| RETURN_MSG
    THROW_EXCEPTION --> END_N["Exception propagates"]
    RETURN_MSG["return msg"] --> END_NODE(["Return CAANMsg"])
    END_N --> END_NODE
```

**Branch labels with constant resolution:**

| Branch | Constant / Value | Business Meaning |
|--------|-----------------|------------------|
| `TEMPLATE_ID_EKK0011D020` | `"EKK0011D020"` | Service content change registration template |
| `TEMPLATE_ID_EKK0251C050` | `"EKK0251C050"` | Service content change deletion template |
| `TEMPLATE_ID_EKK1091D010` | `"EKK1091D010"` | Service content change processing template |
| `JCMConstants.RET_CD_INT_KEY` | `"rtnCdInt"` | Return code key in SC result map |
| `JCMConstants.TEMPLATE_LIST_KEY` | `"templateList"` | Template message array key in SC result map |
| `JCMConstants.STATUS_INT_KEY` | `"status"` | Global status code from SC result |
| `EKK0011D020CBSMsg.STATUS` | `"status"` | Status field in service content change registration message |
| `SCControlMapKeys.RETURN_CODE` | `"returnCode"` | BP-level return code in control map |
| `SCControlMapKeys.RETURN_MESSAGE` | `"returnMessage"` | BP-level return message text |
| `SCControlMapKeys.ERROR_INFO` | `"errorInfo"` | Aggregated error information list |
| Status 4 | — | Warning-level (non-blocking) result — exception is NOT thrown |
| Status 0 with returnCode "0" | — | Clean success — no exception |

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `handle` | `SessionHandle` | Database session handle providing the transactional context (connection, tenant, user identity) for the service component execution. Passed directly to `scCall.run()`. |
| 2 | `scCall` | `ServiceComponentRequestInvoker` | The service-component invocation gateway that delegates the actual SC execution. It wraps the underlying CBS (CBS = Component-Based Service) call, injecting the parameter map and session handle to execute the service contract on the backend. |
| 3 | `param` | `IRequestParameterReadWrite` | The request/response parameter carrier. It holds input data (via `getData`, `editInMsg`), control-map metadata (return codes, return messages, error info), and serves as the mutable output container for status reconciliation and error aggregation. |
| 4 | `dataMapKey` | `String` | The key used to look up the target data map within `param` where the service response should be written. Used as the second argument to `setErrorInf` to bind the SC message template data to the caller's output structure. Resolves to values like `"EKK0011D020"` based on which screen's invocation path called through this method. |
| 5 | `mappingData` | `Object[][]` | A 2D mapping table that provides template IDs and data structures. `mappingData[0][1]` is the service interface template ID (e.g., `"EKK0011D020"`, `"EKK0251C050"`, `"EKK1091D010"`). The last row (`mappingData[mappingData.length - 1][1]`) holds `ArrayList` containers for per-template error injection in the deletion and processing paths. |

**External state accessed:**

| Field | Source | Description |
|-------|--------|-------------|
| `TEMPLATE_ID_EKK0011D020` | `JKKKisnUwHmdkAddCC` (static final) | Template ID constant for service content change registration |
| `TEMPLATE_ID_EKK0251C050` | `JKKKisnUwHmdkAddCC` (static final) | Template ID constant for service content change deletion |
| `TEMPLATE_ID_EKK1091D010` | `JKKKisnUwHmdkAddCC` (static final) | Template ID constant for service content change processing |
| `JCMConstants.*` | `JCMConstants` | JCM framework constants for result map keys |
| `SCControlMapKeys.*` | `SCControlMapKeys` | SC framework constants for control map keys |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `scCall.run` | (depends on caller) | (depends on SC) | Delegates to the invoked service component. SC Code is determined by the caller's `mappingData` — can be any of EKK0011D020, EKK0241A010, EKK0251C050, EKK0241C010, EKK0241D010, EKK0861B002, EKU0081C030, etc. |
| U | `editInMsg` | — | — | Prepares input parameter map from `param` and `mappingData`, returning a `HashMap` for SC invocation. Updates the control map with processed input data. |
| R | `getErrorInfo` | — | — | Extracts aggregated error information from SC result via `TemplateErrorUtil.getErrorInfo(result, errList)` |
| U | `setErrorInf` | — | — | Sets error/info fields from CAANMsg template into the output data map or list. Called for the root message and per-template entries. |

### Full detail:

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `scCall.run` | Dynamic (caller-determined) | Dynamic (SC-specific) | Core service component invocation. The actual SC Code, entity tables, and CRUD semantics are determined at call time by the caller's `svcIf` value. Common targets: EKK0011D020 (service content change reg), EKK0241A010 (service content change reg), EKK0251C050 (service content change del), EKK0241C010 (service content change del), EKK0241D010 (service content change del), EKK0861B002 (service content change), EKU0081C030 (transfer inquiry). |
| U | `editInMsg(param, mappingData)` | — | — | Internal helper — transforms `mappingData` into an input parameter map for the SC call. Modifies control map data. |
| R | `TemplateErrorUtil.getErrorInfo(result, errList)` | — | — | Reads error information from the SC result map, enriching the existing `errList` with new error entries from the service response. |

## 5. Dependency Trace

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

No screen/batch entry points found within 8 hops. Direct callers found: 10 methods.
Terminal operations from this method: `getErrorInfo` [R], `getErrorInfo` [R], `setErrorInf` [-], `setErrorInf` [-], `setErrorInf` [-], `setErrorInf` [-], `setErrorInf` [-], `setErrorInf` [-], `setErrorInf` [-], `setErrorInf` [-], `setErrorInf` [-], `setErrorInf` [-], `setErrorInf` [-]

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Method: execEKK0341A010 | `JKKKisnUwHmdkAddCC.execEKK0341A010` -> `callSC` | `scCall.run [R] (caller-determined SC)` |
| 2 | Method: execEKK0341C340 | `JKKKisnUwHmdkAddCC.execEKK0341C340` -> `callSC` | `scCall.run [R] (caller-determined SC)` |
| 3 | Method: execEKK0341C350 | `JKKKisnUwHmdkAddCC.execEKK0341C350` -> `callSC` | `scCall.run [R] (caller-determined SC)` |
| 4 | Method: execEKK0771A010 | `JKKKisnUwHmdkAddCC.execEKK0771A010` -> `callSC` | `scCall.run [R] (caller-determined SC)` |
| 5 | Method: execEKK1041B001 | `JKKKisnUwHmdkAddCC.execEKK1041B001` -> `callSC` | `scCall.run [R] (caller-determined SC)` |
| 6 | Method: execEKK2811A010 | `JKKKisnUwHmdkAddCC.execEKK2811A010` -> `callSC` | `scCall.run [R] (caller-determined SC)` |
| 7 | Method: execEKK2811B504 | `JKKKisnUwHmdkAddCC.execEKK2811B504` -> `callSC` | `scCall.run [R] (caller-determined SC)` |
| 8 | Method: execKikiOptDsl | `JKKKisnUwHmdkAddCC.execKikiOptDsl` -> `callSC` | `scCall.run [R] (caller-determined SC)` |
| 9 | Method: execKisnHeigo | `JKKKisnUwHmdkAddCC.execKisnHeigo` -> `callSC` | `scCall.run [R] (caller-determined SC)` |
| 10 | Method: execUpdSvcKeiKaisenUcwk | `JKKKisnUwHmdkAddCC.execUpdSvcKeiKaisenUcwk` -> `callSC` | `scCall.run [R] (caller-determined SC)` |

All callers are screen/operation exec methods within `JKKKisnUwHmdkAddCC` — they represent entry points for various telecom service contract operations (registration, deletion, inquiry, update). Each caller prepares its own `mappingData` with the appropriate template ID and service interface, then delegates result normalization to `callSC`.

## 6. Per-Branch Detail Blocks

**Block 1** — EXEC `(Input preparation)` (L971)

Prepare the input parameter map for the service component invocation by transforming `mappingData` through the helper method.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `HashMap<String, Object> paramMap = editInMsg(param, mappingData)` // Prepares input parameter map from param and mappingData for SC invocation |

**Block 2** — EXEC `(Service Component Invocation)` (L973)

Execute the service component through the invocation gateway.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `Map<?, ?> result = scCall.run(paramMap, handle)` // Executes the SC with prepared parameters and session handle |
| 2 | SET | `CAANMsg[] templates = (CAANMsg[]) result.get(JCMConstants.TEMPLATE_LIST_KEY)` // Extracts template message array from SC result [-> TEMPLATE_LIST_KEY = "templateList"] |
| 3 | SET | `CAANMsg msg = templates[0]` // Takes the first template as the root response message |

**Block 3** — IF / ELSE-IF chain `(Status reconciliation)` (L978–1004)

Extract return code and template status, reconcile SC-level status against BP-level status, and propagate the higher-priority status into the control map.

| # | Type | Code |
|---|------|------|
| 1 | SET | `int returnCode = (Integer) result.get(JCMConstants.RET_CD_INT_KEY)` // Extracts return code from SC result [-> RET_CD_INT_KEY = "rtnCdInt"] |
| 2 | SET | `int templateStatus = msg.getInt(EKK0011D020CBSMsg.STATUS)` // Extracts status from the root message template [-> STATUS = "status"] |

**Block 3.1** — IF `(returnCode != 0)` (L981)

If the SC returned a non-zero return code, mark the template status as 9000 (error indicator) to flag processing failure.

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

**Block 3.2** — IF `(RETURN_MESSAGE_" + templateStatus formatted exists?)` (L985)

Check if a return message template exists for the current status code. If no template exists, reset status to 0 (treat as unknown/invalid).

| # | Type | Code |
|---|------|------|
| 1 | SET | `String formatStatus = String.format("%1$04d", templateStatus)` // Formats status as 4-digit zero-padded string, e.g., "0001", "9000" |
| 2 | EXEC | `JCMAPLConstMgr.getString("RETURN_MESSAGE_" + formatStatus)` // Looks up return message template; if null, status is treated as invalid |
| 3 | SET | `templateStatus = 0` // Resets status to 0 when no message template exists for the given status code |

**Block 3.3** — IF/ELSE `(bpStatus extraction)` (L989–996)

Determine the BP-level return code from the control map. If no control map entry exists, set to -1 (below any valid status).

| # | Type | Code |
|---|------|------|
| 1 | SET | `int bpStatus = 0` // Default BP status initialized to 0 |
| 2 | SET | `Object obj = param.getControlMapData(SCControlMapKeys.RETURN_CODE)` // Retrieves BP return code from control map [-> RETURN_CODE = "returnCode"] |
| 3 | IF | `obj == null` → `bpStatus = -1` // No BP-level return code → set to -1 (lowest priority) |
| 3 | ELSE | `bpStatus = Integer.parseInt((String) param.getControlMapData(SCControlMapKeys.RETURN_CODE))` // Parse BP return code from control map |

**Block 3.4** — IF `(templateStatus > bpStatus)` (L998)

If the SC-level status is higher than the BP-level status, propagate the SC status and its associated message back into the control map so the UI shows the more-specific status.

| # | Type | Code |
|---|------|------|
| 1 | SET | `String formatStatus = String.format("%1$04d", templateStatus)` // Formats SC status as 4-digit zero-padded string |
| 2 | SET | `String message = JCMAPLConstMgr.getString("RETURN_MESSAGE_" + formatStatus)` // Retrieves localized return message text for the status |
| 3 | EXEC | `param.setControlMapData(SCControlMapKeys.RETURN_CODE, formatStatus)` // Updates BP-level return code in control map |
| 4 | EXEC | `param.setControlMapData(SCControlMapKeys.RETURN_MESSAGE, message)` // Updates BP-level return message in control map |

**Block 4** — EXEC `(Error info seeding)` (L1006)

Seed error/info data from the root message template into the caller's output data map.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `setErrorInf(msg, (HashMap<String, Object>) param.getData(dataMapKey))` // Sets error/info fields from root template into the data map keyed by dataMapKey |

**Block 5** — IF / ELSE-IF chain `(Template-specific post-processing)` (L1008–1064)

Dispatch template-specific processing based on the service interface ID from `mappingData[0][1]`. Three service templates have special handling; all others skip this section.

| # | Type | Code |
|---|------|------|
| 1 | SET | `String svcIf = (String) mappingData[0][1]` // Extracts the service interface template ID from mappingData |

**Block 5.1** — IF `(svcIf == TEMPLATE_ID_EKK0011D020 = "EKK0011D020")` (L1011)

Process the service content change registration template. Extracts the template message array and iterates to set error info for each entry into a shared `HashMap`.

| # | Type | Code |
|---|------|------|
| 1 | SET | `HashMap inMap = new HashMap()` // Creates a shared input map for EKK0011D020 template error infusion |
| 2 | SET | `CAANMsg[] templateArray = msg.getCAANMsgList(EKK0011D020CBSMsg.EKK0011D020CBSMSG1LIST)` // Extracts the template message list for EKK0011D020 |
| 3 | IF | `templateArray != null` → proceed to loop |

**Block 5.1.1** — FOR LOOP `(iterate over EKK0011D020 templateArray)` (L1015)

For each template message entry, invoke `setErrorInf` to seed error/info fields into the shared input map.

| # | Type | Code |
|---|------|------|
| 1 | SET | `for (int i = 0; i < templateArray.length; i++)` // Iterates over each template message entry |
| 2 | CALL | `setErrorInf(templateArray[i], inMap)` // Seeds error/info fields from each template entry into the shared input map |

**Block 5.2** — ELSE-IF `(svcIf == TEMPLATE_ID_EKK0251C050 = "EKK0251C050")` (L1028)

Process the service content change deletion template. Extracts template message array and iterates with per-entry `ArrayList` items from the last row of `mappingData`.

| # | Type | Code |
|---|------|------|
| 1 | SET | `ArrayList inList = (ArrayList) mappingData[mappingData.length - 1][1]` // Retrieves ArrayList from the last row of mappingData for per-entry error infusion |
| 2 | SET | `CAANMsg[] templateArray = msg.getCAANMsgList(EKK0251C050CBSMsg.EKK0251C050CBSMSG1LIST)` // Extracts the template message list for EKK0251C050 |
| 3 | IF | `templateArray != null` → proceed to loop |

**Block 5.2.1** — FOR LOOP `(iterate over EKK0251C050 templateArray)` (L1032)

For each template message entry, invoke `setErrorInf` with the corresponding item from the per-entry ArrayList.

| # | Type | Code |
|---|------|------|
| 1 | SET | `for (int i = 0; i < templateArray.length; i++)` // Iterates over each template message entry |
| 2 | CALL | `setErrorInf(templateArray[i], (HashMap) inList.get(i))` // Seeds error/info fields from each template entry using per-entry ArrayList item |

**Block 5.3** — ELSE-IF `(svcIf == TEMPLATE_ID_EKK1091D010 = "EKK1091D010")` (L1042)

Process the service content change processing template. Same pattern as EKK0251C050 — uses per-entry ArrayList from `mappingData`.

| # | Type | Code |
|---|------|------|
| 1 | SET | `ArrayList inList = (ArrayList) mappingData[mappingData.length - 1][1]` // Retrieves ArrayList from the last row of mappingData |
| 2 | SET | `CAANMsg[] templateArray = msg.getCAANMsgList(EKK1091D010CBSMsg.EKK1091D010CBSMSG1LIST)` // Extracts the template message list for EKK1091D010 |
| 3 | IF | `templateArray != null` → proceed to loop |

**Block 5.3.1** — FOR LOOP `(iterate over EKK1091D010 templateArray)` (L1046)

For each template message entry, invoke `setErrorInf` with the corresponding item from the per-entry ArrayList.

| # | Type | Code |
|---|------|------|
| 1 | SET | `for (int i = 0; i < templateArray.length; i++)` // Iterates over each template message entry |
| 2 | CALL | `setErrorInf(templateArray[i], (HashMap) inList.get(i))` // Seeds error/info fields from each template entry using per-entry ArrayList item |

**Block 6** — EXEC `(Error info aggregation)` (L1053–1060)

Retrieve existing error list from the control map (or create a new one if null), then enrich it with error information extracted from the SC result via `TemplateErrorUtil.getErrorInfo`.

| # | Type | Code |
|---|------|------|
| 1 | SET | `ArrayList<Object> errList = (ArrayList<Object>) param.getControlMapData(SCControlMapKeys.ERROR_INFO)` // Gets existing error list [-> ERROR_INFO = "errorInfo"] |
| 2 | IF | `errList == null` → `errList = new ArrayList<Object>()` // Creates new list if none exists |
| 3 | EXEC | `param.setControlMapData(SCControlMapKeys.ERROR_INFO, TemplateErrorUtil.getErrorInfo(result, errList))` // Replaces error list with enriched version from SC result |

**Block 7** — IF / ELSE chain `(Terminal validation and exception handling)` (L1062–1077)

Final result validation: checks return code and status from the SC result. On genuine errors, throws `SCCallException`. On warning (return code "0", status 4), allows the response to pass through without exception (per OM-2019-0001156 change). On clean success (return code "0", status 0), returns normally.

| # | Type | Code |
|---|------|------|
| 1 | SET | `String rtnCode = result.get(JCMConstants.RET_CD_INT_KEY).toString()` // Extracts return code as string |
| 2 | SET | `Integer status = msg.getInt(JCMConstants.STATUS_INT_KEY)` // Extracts global status from result [-> STATUS_INT_KEY = "status"] |
| 3 | IF | `!("0".equals(rtnCode) && 0 == status.intValue())` → proceed to warning check (error or warning condition detected) |

**Block 7.1** — IF (`"0".equals(rtnCode) && 4 == status.intValue()`) (L1069) [OM-2019-0001156]

Warning-level result: return code is "0" (success) but status is 4 (warning). Do NOT throw an exception — allow the response to pass through.

| # | Type | Code |
|---|------|------|
| 1 | IF (negated) | `!("0".equals(rtnCode) && 4 == status.intValue())` → else skip exception, proceed to return (warning case) |

**Block 7.2** — ELSE (error case within Block 7)

Genuine error condition. Creates and throws `SCCallException` with error message "戻値不正" (Invalid Return Value), the return code, and status.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `SCCallException scCallEx = new SCCallException("戻値不正" (Invalid Return Value), rtnCode, status)` // Constructs exception with Japanese error message "戻値不正", return code, and status |
| 2 | THROW | `throw scCallEx` // Propagates the exception to the caller |

**Block 8** — RETURN `(Normal completion)` (L1077)

Returns the root CAANMsg template, which now carries the error info from `setErrorInf` calls, the template data from the SC response, and control map entries set during status reconciliation.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return msg` // Returns the processed CAANMsg root template to the caller |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `scCall` | Parameter | Service Component Request Invoker — the gateway object that delegates execution to actual service components (SC) in the telecom service management system |
| `param` | Parameter | Request Parameter Read-Write — a dual-purpose carrier holding input data, control-map metadata (return codes, messages, error info), and output data for the screen |
| `dataMapKey` | Parameter | Data map key — the identifier used to locate the caller's output data map where the SC response template data will be written |
| `mappingData` | Parameter | Mapping data table — a 2D structure encoding the service template ID (`mappingData[0][1]`) and per-template ArrayList containers (`mappingData[last][1]`) for structured error injection |
| `handle` | Parameter | Session Handle — provides the database transaction context (connection, tenant, user identity) for service component execution |
| `CAANMsg` | Type | CAAN Message — the standardized message/template object used across the JCM (Java Component Manager) framework to carry request and response data between SC layers |
| `TEMPLATE_LIST_KEY` | Constant | `"templateList"` — key in the SC result map that holds the array of CAANMsg templates returned by the SC |
| `RET_CD_INT_KEY` | Constant | `"rtnCdInt"` — key in the SC result map that holds the integer return code (0 = success, non-zero = error) |
| `STATUS_INT_KEY` | Constant | `"status"` — key for the global status code in the SC result |
| `EKK0011D020` | SC Code | Service Content Change Registration — a service component for registering changes to service contracts (e.g., adding, modifying, or changing service plans for existing customers) |
| `EKK0251C050` | SC Code | Service Content Change Deletion — a service component for deleting service contract changes |
| `EKK1091D010` | SC Code | Service Content Change Processing — a service component for processing/inquiring about service contract changes |
| `EKK0011D020CBSMsg.STATUS` | Constant | `"status"` — the status field key in the EKK0011D020CBSMsg template message, used to extract the processing status code from the returned message |
| `SCControlMapKeys.RETURN_CODE` | Constant | `"returnCode"` — key in the control map for the BP-level return code set during status reconciliation |
| `SCControlMapKeys.RETURN_MESSAGE` | Constant | `"returnMessage"` — key in the control map for the BP-level return message text associated with the current status |
| `SCControlMapKeys.ERROR_INFO` | Constant | `"errorInfo"` — key in the control map for the aggregated error information list |
| `bpStatus` | Field | BP-level status — the status code tracked by the BP (Business Process) layer, compared against templateStatus to determine which status to display to the user |
| `templateStatus` | Field | Template status — the status code extracted from the SC response template, reflecting the actual SC processing result |
| `returnCode` | Field | SC return code — the raw return code from the service component (0 = success, non-zero = error condition) |
| `setErrorInf` | Method | Error/Info setter — internal helper that populates error and information fields from a CAANMsg template into an output data map or list |
| `editInMsg` | Method | Edit input message — internal helper that transforms `mappingData` into a parameter map for SC invocation, preparing the input payload |
| `TemplateErrorUtil.getErrorInfo` | Utility | Template error utility — extracts structured error information from the SC result map and enriches the error list |
| `SCCallException` | Exception | Service Component Call Exception — custom exception thrown when SC returns a genuine error (non-zero return code with non-warning status), carrying the error message, return code, and status |
| `JCMConstants` | Class | JCM Framework Constants — defines global constant keys for the Java Component Manager framework result map |
| `JCMAPLConstMgr` | Class | JCM Application Constants Manager — manager class for retrieving application-level constant strings, used to look up return message templates by status code |
| `STATUS = 4` | Status code | Warning status — a non-blocking warning where return code is "0" (success) but the SC indicates a warning condition. Per OM-2019-0001156, this does NOT trigger an exception |
| `STATUS = 9000` | Status code | Error override — manually set when SC return code is non-zero, flagging the response as an error for UI display |
| `OM-2019-0001156` | Change request | Change request ID — a JIRA/change ticket that modified the exception-throwing logic to tolerate warning-level (status 4) responses without throwing |
| `戻値不正` | Japanese string | "Invalid Return Value" — the Japanese error message embedded in SCCallException for genuine error conditions |
| `inList` | Field | Input list — per-entry ArrayList from `mappingData[last][1]`, used in EKK0251C050 and EKK1091D010 templates to provide per-item error injection targets |
| `inMap` | Field | Input map — shared HashMap used in EKK0011D020 template processing for per-entry error infusion |
| `errList` | Field | Error list — ArrayList of error objects aggregated from the SC result and stored in the control map |
| `rtnCode` | Field | Return code string — the return code extracted from the SC result, formatted as a string for comparison in the final validation |
| `formatStatus` | Field | Formatted status — the template status code formatted as a 4-digit zero-padded string (e.g., "0001", "0004", "9000") used for return message template lookup |
