---

# Business Logic — JKKMalwareBlockingNonFlgChengeOverCC.callSC() [41 LOC]

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

## 1. Role

### JKKMalwareBlockingNonFlgChengeOverCC.callSC()

`callSC` is the central service component invocation wrapper within the **Malware Blocking Data Migration** subsystem (マルウェアブロッキング データ移行の共通コンポーネント). This class was introduced in v49.00.00 (2020/04/03) to migrate malware blocking data — a compliance/migration initiative (ANK-3834-00-00) for the eo customer base system (eo顧客基幹システム).

The method serves as a **delegation layer** for invoking Service Component (SC) operations. It abstracts the common boilerplate of mapping request parameters, invoking the service component via `ServiceComponentRequestInvoker.run()`, extracting the CAANMsg response, and handling error information uniformly. This eliminates code duplication across three distinct service invocations: EKK0081A010 (Service Contract Agreement — ササービス契約一意識照会), EKK0091A010 (Service Contract eo Net Agreement Details — サービス契約<eo光ネット>一意識照会明細), and EKK0091C040 (Service Contract eo Net Information Change — サービス契約<eo光ネット>情報変更).

`callSC` implements the **template-based response extraction pattern**: the SC returns a `Map` containing a list of `CAANMsg` templates keyed by `TEMPLATE_LIST_KEY`. The first template is extracted as the primary response message. The method then performs unified error processing (`editErrorInfoCom`, `TemplateErrorUtil.getErrorInfo`) and validates the response using two criteria: the return code must be `"0"` and the message status must be `0`. If either check fails, an `SCCallException` is thrown with the actual return code and status for diagnostic purposes.

In the larger system, `callSC` is a **private shared utility** method — not a public API entry point. It is called internally by `getEKK0081A010()` and `getEKK0091A010()` to invoke their respective CBS (Business Service) layers. The class extends `AbstractCommonComponent`, placing it in the CC (Common Component) layer of the x21 framework.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["callSC params"])

    START --> B1["editInMsg param, mappingData"]

    B1 --> B2["scCall.run paramMap, handle"]

    B2 --> B3["result.get TEMPLATE_LIST_KEY"]

    B3 --> B4["templates[0] to msg"]

    B4 --> B5["result.get RET_CD_INT_KEY"]

    B5 --> B6["msg.getInt STATUS_INT_KEY"]

    B6 --> B7["editErrorInfoCom param, templates, return_code, dataMapKey, mappingData, contents"]

    B7 --> B8["param.getControlMapData ERROR_INFO"]

    B8 --> B9{null == errList}

    B9 -- true --> B10["errList = new ArrayList"]

    B10 --> B11["param.setControlMapData ERROR_INFO, TemplateErrorUtil.getErrorInfo"]

    B9 -- false --> B11

    B11 --> B12{code and status OK}

    B12 -- not OK --> B13["throw SCCallException"]

    B12 -- OK --> B14["return msg"]

    B13 --> END(["callSC end"])

    B14 --> END
```

**CRITICAL — Constant Resolution:**

| Constant | Value | Business Meaning |
|----------|-------|------------------|
| `JCMConstants.TEMPLATE_LIST_KEY` | (template list key) | Key to extract the list of `CAANMsg` template objects from the SC response Map |
| `JCMConstants.RET_CD_INT_KEY` | (return code key) | Key to extract the integer return code from the SC response Map |
| `JCMConstants.STATUS_INT_KEY` | (status key) | Key to extract the message status code from the `CAANMsg` object |
| `SCControlMapKeys.ERROR_INFO` | (error info key) | Key for storing/retrieving error information in the control map of the request parameter |

**Branch conditions:**
- **`null == errList`** — If no error list exists yet in the control map, a new `ArrayList` is created before setting the error info. This ensures the control map always has an entry for error handling downstream.
- **`"0".equals(return_code.toString()) && 0 == status`** — The success condition. Both the return code (from the SC response) and the message status (from the template) must indicate success simultaneously. If the return code is anything other than `"0"` (the standard success code) or the status is non-zero, an `SCCallException` is thrown with the label `"戻値不正"` (Invalid return value) and includes the actual return code and status for diagnostics.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `handle` | `SessionHandle` | Database session handle for the current transaction context. Carries the DB connection and transaction scope used by the SC invocation. Determines which database session the service component operation runs under. |
| 2 | `scCall` | `ServiceComponentRequestInvoker` | The service component invoker responsible for dispatching the request to the CBS layer. Provides the `.run()` method that executes the actual service component logic. |
| 3 | `param` | `IRequestParameterReadWrite` | Request parameter object carrying business input data (e.g., search conditions, change parameters) and output containers (e.g., error info lists). Modified in-place by `editInMsg`, `editErrorInfoCom`, and the SC invocation. |
| 4 | `dataMapKey` | `String` | A key identifier used to namespace data within the parameter map. Determines which data segment is read/written by `editErrorInfoCom`. Used in data mapping for distinguishing between different processing contexts. |
| 5 | `mappingData` | `Object[][]` | A 2D array of mapping metadata used by `editInMsg` to transform raw request parameters into the structured `paramMap` passed to the SC. Each row defines a field mapping (source field, target field, type). |
| 6 | `contents` | `Object[][]` | Raw content data for the CAANMsg template. Carries the actual data payload that will be populated into the service response message fields. |

**Instance fields / external state read:**
- No direct instance fields are read by `callSC`. The method is stateless and operates entirely on its parameters and the objects they reference.

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `scCall.run` | (inferred from caller — EKK0081A010 or EKK0091A010) | (inferred) | Invokes the service component via `ServiceComponentRequestInvoker.run()`, passing the mapped parameter map and session handle. Returns a result Map containing templates, return code, and other metadata. |
| U | `editErrorInfoCom` | (same class — JKKMalwareBlockingNonFlgChengeOverCC) | - | Processes error information from the SC response. Writes error details into the parameter object's control map. |
| U | `editInMsg` | (same class — JKKMalwareBlockingNonFlgChengeOverCC) | - | Maps request parameters from the raw input into a structured parameter map for SC invocation. Reads `mappingData` to determine field mappings. |
| R | `TemplateErrorUtil.getErrorInfo` | - | - | Extracts consolidated error information from the SC result Map and an existing error list. Returns a populated `ArrayList<Object>` of error entries. |

**CRUD Classification Rationale:**
- **R (Read)**: `scCall.run()` — The service component call queries data (for EKK0081A010 and EKK0091A010, these are "agreement inquiry" operations). The result Map is a read of SC response data.
- **U (Update)**: `editInMsg` transforms and populates the parameter map (write operation). `editErrorInfoCom` and `TemplateErrorUtil.getErrorInfo` both write error info back to the parameter object.
- The `TEMPLATE_LIST_KEY`, `RET_CD_INT_KEY`, and `STATUS_INT_KEY` extractions are data reads from the result Map.

## 5. Dependency Trace

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

No screen/batch entry points found within 8 hops. Direct callers found: 2 methods.
Terminal operations from this method: `editErrorInfoCom` [U], `run` [-], `editInMsg` [U], `getErrorInfo` [R]

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Method: `getEKK0081A010` | `getEKK0081A010` -> `callSC` | `scCall.run [R] EKK0081A010CBS (Service Contract Agreement Inquiry)` |
| 2 | Method: `getEKK0091A010` | `getEKK0091A010` -> `callSC` | `scCall.run [R] EKK0091A010CBS (eo Net Agreement Details Inquiry)` |

**Caller context:**
- `getEKK0081A010()` (line ~313): Invokes `callSC` with template `EKK0081A010` — the **Service Contract Single-View Inquiry** (サービス契約一意識照会). This is a read-only data retrieval operation.
- `getEKK0091A010()` (line ~364): Invokes `callSC` with template `EKK0091A010` — the **eo Net Agreement Details Single-View Inquiry** (サービス契約<eo光ネット>一意識照会明細). This is also a read-only data retrieval operation.

Both callers prepare their respective input data arrays (`eKK0081A010In`, `eKK0091A010In`) and the `fixedText` key, then delegate to `callSC` for the actual SC invocation.

## 6. Per-Branch Detail Blocks

**Block 1** — [EXEC] `editInMsg` call `(parameter mapping)` (L422)

> Prepares the parameter map by transforming raw mapping data into a structured HashMap for the SC invocation.

| # | Type | Code |
|---|------|------|
| 1 | SET | `paramMap = editInMsg(param, mappingData)` // Creates a HashMap from request parameters using mapping metadata |

**Block 2** — [EXEC] `scCall.run` call `(SC invocation)` (L424)

> Invokes the Service Component via the request invoker with the mapped parameters and session handle.

| # | Type | Code |
|---|------|------|
| 1 | SET | `result = scCall.run(paramMap, handle)` // Executes the SC operation; returns a Map with templates, return code, and metadata |

**Block 3** — [EXEC] Template extraction `(response parsing)` (L426–428)

> Extracts the list of CAANMsg templates from the SC result and retrieves the first template as the primary response message.

| # | Type | Code |
|---|------|------|
| 1 | SET | `templates = (CAANMsg[])result.get(JCMConstants.TEMPLATE_LIST_KEY)` // Extracts template list from SC response Map |
| 2 | SET | `msg = templates[0]` // Takes the first template as the primary response message |

**Block 4** — [EXEC] Return code extraction `(status retrieval)` (L431)

> Retrieves the integer return code from the SC response Map.

| # | Type | Code |
|---|------|------|
| 1 | SET | `return_code = result.get(JCMConstants.RET_CD_INT_KEY)` // Gets the return code as an Object (will be cast to Integer) |

**Block 5** — [EXEC] Status code extraction `(message status)` (L433)

> Reads the status field from the CAANMsg template.

| # | Type | Code |
|---|------|------|
| 1 | SET | `status = msg.getInt(JCMConstants.STATUS_INT_KEY)` // Reads the integer status code from the CAANMsg template |

**Block 6** — [EXEC] Error info pre-processing `(error enrichment)` (L435)

> Calls `editErrorInfoCom` to process error information from the SC response, writing error details to the parameter object.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `editErrorInfoCom(param, templates, (Integer)return_code, dataMapKey, mappingData, contents)` // Enriches error info with SC response data |

**Block 7** — [IF] `null == errList` check `(error list initialization)` (L438–443)

> Retrieves the existing error list from the control map. If no error list exists yet, a new ArrayList is created.

| # | Type | Code |
|---|------|------|
| 1 | SET | `errList = (ArrayList<Object>)param.getControlMapData(SCControlMapKeys.ERROR_INFO)` // Gets existing error list from control map |
| 2 | IF | `null == errList` // Check if error list exists |
| 2.1 | [IF-TRUE] SET | `errList = new ArrayList<Object>()` // Initialize a new error list if none exists [L441] |

**Block 8** — [EXEC] Error info assignment `(error storage)` (L446)

> Sets the consolidated error info (from both the SC result and the existing list) back into the control map for downstream error display.

| # | Type | Code |
|---|------|------|
| 1 | SET | `param.setControlMapData(SCControlMapKeys.ERROR_INFO, TemplateErrorUtil.getErrorInfo(result, errList))` // Stores error info in control map using TemplateErrorUtil |

**Block 9** — [IF] Return code and status validation `(error detection)` (L449–451)

> Validates the SC response. Both the return code must equal `"0"` and the status must equal `0`. If either check fails, throws an `SCCallException` with the diagnostic label "Invalid return value" (戻値不正).

| # | Type | Code |
|---|------|------|
| 1 | IF | `"0".equals(return_code.toString()) && 0 == status` // Checks both return code and status for success [L449] |
| 1.1 | [IF-FALSE] THROW | `throw new SCCallException("戻値不正", return_code.toString(), status)` // Throws exception with return code and status for diagnostics [L450] |

**Block 10** — [RETURN] `msg` `(successful response)` (L453)

> Returns the first CAANMsg template as the result. This is the primary response message from the SC invocation, containing the retrieved or processed data.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return msg` // Returns the CAANMsg template from the SC response |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| Malware Blocking Data Migration (マルウェアブロッキング データ移行) | Business process | Migration of malware blocking configuration data — a compliance initiative (ANK-3834-00-00) to transition malware blocking data to a new system in v49.00.00 (2020/04/03). |
| eo顧客基幹システム | Business term | eo Customer Base System — Fujitsu's core telecommunications customer management platform for service contracts, orders, and billing. |
| SC (サービスインターフェイス) | Abbreviation | Service Component — a layer in the x21 framework that encapsulates business logic invocations between screens and CBS (Business Service) layers. |
| CBS (Business Component Service) | Abbreviation | Business Component Service — the backend business logic layer that performs database operations and business rule enforcement. |
| CAANMsg | Technical | Common Application ANswer Message — a Fujitsu message structure used for passing structured data between service components. Contains typed fields and template metadata. |
| SERVICE_COMPONENT_REQUEST_INVOKER | Technical | ServiceComponentRequestInvoker — the dispatcher object that executes SC calls with a parameter map and session handle, returning a result Map. |
| TEMPLATE_LIST_KEY | Constant | Key constant in JCMConstants used to extract the CAANMsg[] template list from an SC result Map. |
| RET_CD_INT_KEY | Constant | Key constant in JCMConstants used to extract the integer return code from an SC result Map. Value `"0"` indicates success. |
| STATUS_INT_KEY | Constant | Key constant in JCMConstants used to read the status field from a CAANMsg. Value `0` indicates no error. |
| ERROR_INFO (SCControlMapKeys) | Constant | Key for error information in the parameter object's control map. Carries an ArrayList of error entries for screen-level error display. |
| EKK0081A010 | Template ID | Service Contract Single-View Inquiry (サービス契約一意識照会) — a CBS template that retrieves service contract agreement data. |
| EKK0091A010 | Template ID | eo Net Agreement Details Single-View Inquiry (サービス契約<eo光ネット>一意識照会明細) — retrieves detailed agreement data for eo Net (光ネット) services. |
| EKK0091C040 | Template ID | Service Contract eo Net Information Change (サービス契約<eo光ネット>情報変更) — processes changes to eo Net service contract information. |
| SCCallException | Technical | Exception class (`com.fujitsu.futurity.bp.x21.cc.exception.SCCallException`) thrown when a service component invocation returns an error. Carries a label, return code, and status code. |
| editInMsg | Method | Helper method in this class that maps raw request parameters into a structured HashMap for SC invocation. |
| editErrorInfoCom | Method | Helper method in this class that processes and enriches error information from SC responses. |
| AbstractCommonComponent | Technical | Base class in the x21 framework (`com.fujitsu.futurity.bp.x21.cc.AbstractCommonComponent`) that provides common functionality for all CC-layer components. |
| SessionHandle | Technical | Database session and transaction context handle carried through the call chain. Manages DB connections and transaction boundaries. |
| IRequestParameterReadWrite | Technical | Interface for bidirectional request parameter access. Used to set and get business data, control map entries, and error information. |
| 戻値不正 (Modochi Fusei) | Japanese term | Invalid return value — the error label used when SC validation fails (return code ≠ "0" or status ≠ 0). |

---
