# Business Logic — JKKEmgRrksNmUpdCC.getEck0011a010() [42 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `com.fujitsu.futurity.bp.custom.common.JKKEmgRrksNmUpdCC` |
| Layer | CC / Common Component (Shared business logic layer — custom processing component) |
| Module | `common` (Package: `com.fujitsu.futurity.bp.custom.common`) |

## 1. Role

### JKKEmgRrksNmUpdCC.getEck0011a010()

This method performs a **Customer Unique Lookup** (お客様一意照会) — a CBS (Central Business System) query that retrieves detailed customer information for a specific customer identified by their SYSID. It acts as a data aggregation and transformation layer, invoking the ECK0011A010 CBS service to fetch the customer master record and then mapping the full response payload into a simplified `List<HashMap<String, Object>>` format containing only the customer name (`cust_nm`) and customer kana name (`cust_kana`) fields. The method follows a **builder** pattern for constructing the CBS input mapping and a **delegation** pattern for the actual service call via `callSC()`. It serves as a shared utility within the order processing module (`JKKEmgRrksNmUpdCC`), enabling business screens to resolve and display customer identity details during order creation, modification, or inquiry workflows. The method uses a `ServiceComponentRequestInvoker` as the service call carrier and delegates all CBS communication to the `callSC` helper method, maintaining a consistent service invocation pattern across the component.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["getEck0011a010()"])
    INIT1["Initialize eck0011a010List as ArrayList"]
    INIT2["Initialize eck0011a010In input mapping array"]
    INIT2A["TEMPLATEID = ECK0011A010"]
    INIT2B["func_code = funcCd parameter"]
    INIT2C["key_sysid = sysid parameter"]
    INIT2D["key_rsv_aply_ymd = JPCBPCommon.getOpeDate(null)"]
    CALL1["callSC - Invoke CBS ECK0011A010"]
    GETLIST["Retrieve CAANMsg[] from CBS response"]
    CHECK{"eck0011a010Msg1List != null?"}
    FOR["Loop: each CAANMsg in list"]
    NEWMAP["Create new HashMap"]
    EXTRACT1["Put cust_nm = getString(CUST_NM)"]
    EXTRACT2["Put cust_kana = getString(CUST_KANA)"]
    ADDLIST["Add map to eck0011a010List"]
    RETURN1["Return eck0011a010List"]

    START --> INIT1 --> INIT2 --> INIT2A --> INIT2B --> INIT2C --> INIT2D --> CALL1 --> GETLIST --> CHECK
    CHECK -->|Yes| FOR --> NEWMAP --> EXTRACT1 --> EXTRACT2 --> ADDLIST --> FOR
    CHECK -->|No| RETURN1
    FOR --> CHECK
```

**Processing description:**

1. **Initialization** (Lines 453-454): An empty `ArrayList<HashMap<String, Object>>` and an initial `HashMap` are created to accumulate the lookup results.
2. **ServiceInvoker construction** (Line 456): A new `ServiceComponentRequestInvoker` instance is instantiated for CBS invocation.
3. **Input mapping setup** (Lines 459-464): The CBS input parameters are assembled into a 2D Object array with four key-value pairs:
   - `TEMPLATEID` = `"ECK0011A010"` — the CBS service template identifier
   - `FUNC_CODE` = the `funcCd` parameter — the function code identifying the calling screen/context
   - `KEY_SYSID` = the `sysid` parameter — the unique customer identifier used as the search key
   - `KEY_RSV_APLY_YMD` = the current operation date from `JPCBPCommon.getOpeDate(null)` — the reservation effective date
4. **CBS invocation** (Lines 467-468): The `callSC` helper method is invoked with the handle, service invoker, request parameters, input mapping, and CBS message contents. The response is cast to `CAANMsg[]` by extracting the list keyed by `ECK0011A010CBSMsg.ECK0011A010CBSMSG1LIST`.
5. **Null check** (Line 470): If the CBS returned no records (null), the method skips processing and returns the empty list.
6. **Result extraction** (Lines 472-479): For each `CAANMsg` record, a new HashMap is created, and the `cust_nm` (customer name) and `cust_kana` (customer kana name) fields are extracted via `getString()` and stored in the map before adding it to the result list.
7. **Return** (Line 481): The populated list is returned to the caller.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `handle` | `SessionHandle` | Business session context providing transaction and security context for the CBS call. Carries the user's authentication and session state required for service component invocation. |
| 2 | `param` | `IRequestParameterReadWrite` | Request parameter object used for bi-directional data exchange during the CBS service call. Allows the CBS to populate request-side parameters and enables the method to access request-scoped data. |
| 3 | `fixedText` | `String` | Service message text — a predefined message string used for CBS response messaging and error handling. Typically contains screen-specific UI text or message templates. |
| 4 | `sysid` | `String` | SYSID — the unique system-issued customer identifier used as the primary search key for the customer lookup. Each customer in the K-Opticom system has exactly one SYSID. |
| 5 | `funcCd` | `String` | Function code — identifies the calling business function or screen context (e.g., inquiry, registration, modification). Used by the CBS to determine access permissions and processing behavior. |

**External state accessed:**

| Field | Type | Business Description |
|-------|------|---------------------|
| (none — all state is local) | — | This method reads no instance fields; it is fully stateless. |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `callSC` | ECK0011A010SC | ECK0011A010 (Customer Master) | Invokes CBS ECK0011A010 to perform customer unique lookup — reads customer record identified by SYSID, returning customer name, kana, and full detail fields |

**Analysis details:**

- **`callSC(handle, scCall, param, eck0011a010In, fixedText, new ECK0011A010CBSMsg().getContents())`** — This is a Read (R) operation. It calls the CBS framework via `callSC`, which internally invokes the ECK0011A010 CBS (Customer Unique Lookup Service). The CBS queries the customer master table for the record matching the given `sysid` and returns structured data in the `ECK0011A010CBSMsg1List` array. The entity/table accessed is the customer master (`ECK0011A010`), which stores the customer identity and demographic information.

- **`ECK0011A010CBSMsg1List.getString(CUST_NM)`** / **`ECK0011A010CBSMsg1List.getString(CUST_KANA)`** — These are Read (R) operations on the in-memory CBS response object, extracting the customer name and customer kana name fields respectively from each record in the returned message list.

## 5. Dependency Trace

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

No screen/batch entry points found within 8 hops. Direct callers found: 1 methods.
Terminal operations from this method: `callSC` [R], `getString` [R], `getString` [R]

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Class: `JKKEmgRrksNmUpdCC` | `JKKEmgRrksNmUpdCC.execute()` → `getEck0011a010(handle, param, fixedText, sysid, funcCd)` | `callSC [R] ECK0011A010 (Customer Master)` |
| 2 | Class: `JKKEmgRrksNmUpdCC` | `getEck0011a010` terminal: `getString(CUST_NM)` [R], `getString(CUST_KANA)` [R] | — |

**Notes:**
- The method is called from within its own class `JKKEmgRrksNmUpdCC`, specifically from the `execute()` method, which is the main entry point for the emergency registration/update business process.
- The terminal operation reaches the CBS layer (ECK0011A010) which queries the customer master data store.
- The extracted fields (`cust_nm`, `cust_kana`) are in-memory reads from the CBS response payload, not direct DB accesses.

## 6. Per-Branch Detail Blocks

**Block 1** — INIT (Initialization) (L453)

> Initialize result collection structures.

| # | Type | Code |
|---|------|------|
| 1 | SET | `eck0011a010List = new ArrayList<HashMap<String, Object>>()` // Empty result list |
| 2 | SET | `eck0011a010Map = new HashMap<String, Object>()` // Initial map (subsequently replaced in loop) |

**Block 2** — INIT (ServiceInvoker setup) (L456)

> Prepare the CBS service call carrier.

| # | Type | Code |
|---|------|------|
| 1 | SET | `scCall = new ServiceComponentRequestInvoker()` // Service invocation container |

**Block 3** — INIT (Input mapping) — お客様一意照会上のマッピング (Customer Unique Lookup — Mapping) (L459)

> Build the 2D input mapping array for the CBS request. Each inner array defines a key-value pair passed to the CBS.

| # | Type | Code |
|---|------|------|
| 1 | SET | `eck0011a010In[0][0] = ECK0011A010CBSMsg.TEMPLATEID` // Key: template ID |
| 2 | SET | `eck0011a010In[0][1] = TEMPLATE_ID_ECK0011A010` // Value: "ECK0011A010" [-> TEMPLATE_ID_ECK0011A010 = "ECK0011A010"] |
| 3 | SET | `eck0011a010In[1][0] = ECK0011A010CBSMsg.FUNC_CODE` // Key: function code |
| 4 | SET | `eck0011a010In[1][1] = funcCd` // Value: function code parameter |
| 5 | SET | `eck0011a010In[2][0] = ECK0011A010CBSMsg.KEY_SYSID` // Key: SYSID |
| 6 | SET | `eck0011a010In[2][1] = sysid` // Value: SYSID parameter |
| 7 | SET | `eck0011a010In[3][0] = ECK0011A010CBSMsg.KEY_RSV_APLY_YMD` // Key: reservation effective date |
| 8 | SET | `eck0011a010In[3][1] = JPCBPCommon.getOpeDate(null)` // Value: current operation date [-> getOpeDate returns YYYYMMDD format] |

**Block 4** — EXEC (CBS invocation) — サービスIF実行 (Service IF Execution) (L467)

> Invoke the CBS service and retrieve the response message list.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `callSC(handle, scCall, param, eck0011a010In, fixedText, new ECK0011A010CBSMsg().getContents())` // Invoke CBS, get CAANMsg[] response |
| 2 | SET | `eck0011a010Msg1List = response.getCAANMsgList(ECK0011A010CBSMsg.ECK0011A010CBSMSG1LIST)` // Extract customer detail list from response |

**Block 5** — IF (Null check) (L470)

> Check whether the CBS returned any customer records.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `null != eck0011a010Msg1List` // Condition: list is not null |

**Block 5.1** — FOR (Loop over results) — NULL case (L471)

> Iterate over each customer record returned by the CBS and extract customer name and kana.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `for (CAANMsg eck0011a010Msg : eck0011a010Msg1List)` // Loop: for each customer record |
| 2 | SET | `eck0011a010Map = new HashMap<String, Object>()` // Reinitialize map per record |
| 3 | EXEC | `eck0011a010Map.put("cust_nm", eck0011a010Msg.getString(ECK0011A010CBSMsg1List.CUST_NM))` // Extract customer name |
| 4 | EXEC | `eck0011a010Map.put("cust_kana", eck0011a010Msg.getString(ECK0011A010CBSMsg1List.CUST_KANA))` // Extract customer kana name |
| 5 | EXEC | `eck0011a010List.add(eck0011a010Map)` // Add to result list |

**Block 6** — RETURN (Return) (L481)

> Return the populated result list to the caller.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return eck0011a010List` // Returns list of customer name/kana maps (may be empty) |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `sysid` | Field | SYSID — System-issued unique customer identifier. The primary key used to identify a customer in the K-Opticom customer master. |
| `cust_nm` | Field | Customer Name — the legal registered name of the customer (e.g., "山田太郎"). |
| `cust_kana` | Field | Customer Kana Name — the phonetic kana reading of the customer's name (e.g., "ヤマダタロウ"), used for display and name verification. |
| `funcCd` | Field | Function Code — identifies the calling business function/screen, used for access control and CBS routing. |
| `TEMPLATE_ID_ECK0011A010` | Constant | CBS Template ID = "ECK0011A010" — the unique identifier for the Customer Unique Lookup CBS service template. |
| `eck0011a010Msg1List` | Field | Customer Unique Lookup Detail List — the array of customer records returned by the CBS, each containing full customer detail fields. |
| CBS | Acronym | Central Business System — the core transactional system handling customer, order, and service management. |
| CAANMsg | Acronym | Callback/Response Message — the standard message format used for CBS response payloads in the Fujitsu middleware framework. |
| SC (Service Component) | Acronym | Service Component — the middleware layer (`ServiceComponentRequestInvoker` / `callSC`) that dispatches CBS requests and processes responses. |
| Customer Unique Lookup | Business term | お客様一意照会 — a CBS transaction that retrieves a customer's complete master record by their SYSID. |
| `key_rsv_aply_ymd` | Field | Reservation Application Effective Date — the date the reservation/service takes effect, set to the current operation date. |
| JPCBPCommon | Class | JP Common Business Processing — a utility class providing common business operations such as date retrieval (`getOpeDate`). |
| `getOpeDate` | Method | Operation Date — returns the current business operation date in YYYYMMDD string format. |
