---

# Business Logic — JKKEmgRrksNmUpdCC.getEkk0191b001() [41 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `com.fujitsu.futurity.bp.custom.common.JKKEmgRrksNmUpdCC` |
| Layer | CC/Common Component (Custom Component — part of the business process common logic layer) |
| Module | `common` (Package: `com.fujitsu.futurity.bp.custom.common`) |

## 1. Role

### JKKEmgRrksNmUpdCC.getEkk0191b001()

This method performs a **Service Contract Details (eo Hikari Phone) List Inquiry by Service Contract Number** — it queries and retrieves a list of service contract line items associated with a given service contract number for the "eo Hikari Phone" (eo light telephone) fiber-optic phone service. The method acts as a **data retrieval wrapper** that constructs a structured input payload and dispatches it to a Service Component (SC) via the `callSC` helper, then maps the returned CAANMsg records into a list of key-value HashMaps for consumption by the calling screen (JKKEmgRrksNmUpdCC.execute()). It follows a **delegation pattern**: all business logic is pushed down to the CBS message layer (`EKK0191B001CBSMsg`) and the underlying SC, while this method is responsible solely for input assembly, invocation, and result mapping. The method is a private utility, meaning it is not a public API entry point but is called internally by the main `execute()` method to populate screen display data.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["getEkk0191b001(params)"])
    INIT["Initialize ekk0191b001List, ekk0191b001Map, scCall"]
    BUILD_INPUT["Build ekk0191b001In array: TEMPLATEID, FUNC_CODE, KEY_SVC_KEI_NO"]
    CALL_SC["callSC handle, scCall, param, ekk0191b001In, fixedText, EKK0191B001CBSMsg.getContents"]
    GET_LIST["getCAANMsgList EKK0191B001CBSMSG1LIST"]
    CHECK_NULL["null != ekk0191b001Msg1List"]
    LOOP["For each ekk0191b001Msg in ekk0191b001Msg1List"]
    NEW_MAP["ekk0191b001Map = new HashMap"]
    EXTRACT_NO["put svc_kei_ucwk_no = ekk0191b001Msg.getString SVC_KEI_UCWK_NO"]
    EXTRACT_STAT["put svc_kei_ucwk_stat = ekk0191b001Msg.getString SVC_KEI_UCWK_STAT"]
    ADD_LIST["ekk0191b001List.add(ekk0191b001Map)"]
    RETURN["Return ekk0191b001List"]

    START --> INIT
    INIT --> BUILD_INPUT
    BUILD_INPUT --> CALL_SC
    CALL_SC --> GET_LIST
    GET_LIST --> CHECK_NULL
    CHECK_NULL -->|Yes| LOOP
    CHECK_NULL -->|No| RETURN
    LOOP --> NEW_MAP
    NEW_MAP --> EXTRACT_NO
    EXTRACT_NO --> EXTRACT_STAT
    EXTRACT_STAT --> ADD_LIST
    ADD_LIST --> LOOP
    LOOP --> RETURN
```

**Processing Flow Description:**

1. **Initialization**: Creates an empty `ArrayList<HashMap<String, Object>>` to hold the result list, an empty HashMap for the current row, and a `ServiceComponentRequestInvoker` for SC invocation.
2. **Input Assembly**: Builds a 3-row input map (`ekk0191b001In`) containing the service IF template ID, function code, and service contract number — the query parameters for the CBS.
3. **Service Component Invocation**: Delegates to `callSC()` (a helper method on the same class) which dispatches the request to the underlying CBS layer (`EKK0191B001CBSMsg`). The result is retrieved as a `CAANMsg[]` array keyed by the list identifier `EKK0191B001CBSMSG1LIST`.
4. **Null Check**: If the returned message list is null (no matching records or error), the method skips processing and returns an empty list.
5. **Result Mapping**: For each `CAANMsg` record in the list, it creates a new HashMap and extracts two fields — `svc_kei_ucwk_no` (service contract work number) and `svc_kei_ucwk_stat` (service contract work status) — adding each mapped row to the result list.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `handle` | `SessionHandle` | Business session handle carrying the current user's session context, authentication information, and transaction scope for the service invocation. |
| 2 | `param` | `IRequestParameterReadWrite` | Request parameter object used to read/write screen input parameters and exchange data between the presentation layer and the business logic layer during the SC call. |
| 3 | `fixedText` | `String` | Service message text — a fixed text string used for service-level messages (e.g., error messages, display text) during the SC invocation. |
| 4 | `svcKeiNo` | `String` | **Service Contract Number** — the primary lookup key. This is the identifier for a service contract (e.g., a broadband/phone line contract), used to query all associated contract line items (details) for the eo Hikari Phone service. |
| 5 | `funcCd` | `String` | **Function Code** — identifies the specific business function being invoked. This code is passed to the CBS to determine the operation type and authorization context for the inquiry. |

**External State / Instance Fields Read:**

None. This method is self-contained and does not read any instance fields. All data is passed via parameters and constructed locally.

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `callSC` | EKK0191B001SC | KK_T_SVC_KEI_UCWK (Service Contract Work / Line Item) | Calls `callSC` to invoke the CBS layer `EKK0191B001CBSMsg`, which queries service contract details for eo Hikari Phone by service contract number |
| R | `EKK0191B001CBSMsg1List.getContents` | EKK0191B001CBSMsg1List | — | Schema definition — defines the fields (svc_kei_ucwk_no, svc_kei_ucwk_stat) returned by the CBS message list |
| R | `EKK0191B001CBSMsg.getContents` | EKK0191B001CBSMsg | — | Schema definition — defines the template for the CBS message envelope including template ID, function code, and the EKK0191B001CBSMsg1List result array |
| R | `CAANMsg.getString` | EKK0191B001CBSMsg1List | — | Reads individual string fields from each CAANMsg record in the returned list |

**CRUD Classification:**

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `callSC(handle, scCall, param, ekk0191b001In, fixedText, EKK0191B001CBSMsg.getContents)` | EKK0191B001SC | KK_T_SVC_KEI_UCWK | Read service contract line items (work records) for the given service contract number — this is the core CBS-level query that fetches contract detail records |

## 5. Dependency Trace

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

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

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Class: JKKEmgRrksNmUpdCC | `JKKEmgRrksNmUpdCC.execute()` -> `JKKEmgRrksNmUpdCC.getEkk0191b001()` | `callSC [R] KK_T_SVC_KEI_UCWK`, `getContents [R] EKK0191B001CBSMsg`, `getString [R] SVC_KEI_UCWK_NO`, `getString [R] SVC_KEI_UCWK_STAT` |

## 6. Per-Branch Detail Blocks

**Block 1** — [VARIABLE DECLARATION] (L491)

> Initialize result containers and SC request invoker.

| # | Type | Code |
|---|------|------|
| 1 | SET | `ekk0191b001List = new ArrayList<HashMap<String, Object>>()` // Empty result list |
| 2 | SET | `ekk0191b001Map = new HashMap<String, Object>()` // Row map placeholder |
| 3 | SET | `scCall = new ServiceComponentRequestInvoker()` // SC request invoker for callSC |

**Block 2** — [VARIABLE DECLARATION / INPUT ASSEMBLY] (L510)

> Build the input payload array for the CBS message. Contains 3 key-value pairs: template ID, function code, and service contract number (the query key).

| # | Type | Code |
|---|------|------|
| 1 | SET | `ekk0191b001In = { {TEMPLATEID, TEMPLATE_ID_EKK0191B001}, {FUNC_CODE, funcCd}, {KEY_SVC_KEI_NO, svcKeiNo} }` // Input map for CBS: [-> TEMPLATE_ID_EKK0191B001 = template ID for EKK0191B001 service IF, [-> FUNC_CODE = function code field, [-> KEY_SVC_KEI_NO = service contract number lookup key |

**Block 3** — [METHOD CALL / SERVICE COMPONENT INVOCATION] (L518)

> Invoke the Service Component via the `callSC` helper. This is the core data retrieval operation that queries the CBS layer for service contract details.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `callSC(handle, scCall, param, ekk0191b001In, fixedText, new EKK0191B001CBSMsg().getContents())` // Invoke SC with input parameters and message schema |
| 2 | EXEC | `.getCAANMsgList(EKK0191B001CBSMsg.EKK0191B001CBSMSG1LIST)` // Extract the EKK0191B001CBSMsg1List result array from the SC response |
| 3 | SET | `ekk0191b001Msg1List = [...]` // Store the returned CAANMsg array |

**Block 4** — [IF / NULL CHECK] (L520)

> Check whether the CBS returned any records. If null, skip processing and return the empty list.

| # | Type | Code |
|---|------|------|
| 1 | SET | `ekk0191b001Msg1List = callSC(...).getCAANMsgList(...)` |
| 2 | IF | `null != ekk0191b001Msg1List` [Condition: whether CBS returned records] |

**Block 4.1** — [FOR LOOP] `(null == result)` (L522)

> Iterate over each CAANMsg record returned by the CBS and extract the service contract work number and work status into a HashMap, adding each to the result list.

| # | Type | Code |
|---|------|------|
| 1 | SET | `ekk0191b001Map = new HashMap<String, Object>()` // Reset map for each record |
| 2 | SET | `ekk0191b001Map.put("svc_kei_ucwk_no", ekk0191b001Msg.getString(EKK0191B001CBSMsg1List.SVC_KEI_UCWK_NO))` // Extract service contract work number [-> SVC_KEI_UCWK_NO = "svc_kei_ucwk_no"] |
| 3 | SET | `ekk0191b001Map.put("svc_kei_ucwk_stat", ekk0191b001Msg.getString(EKK0191B001CBSMsg1List.SVC_KEI_UCWK_STAT))` // Extract service contract work status [-> SVC_KEI_UCWK_STAT = "svc_kei_ucwk_stat"] |
| 4 | EXEC | `ekk0191b001List.add(ekk0191b001Map)` // Add the mapped row to the result list |

**Block 5** — [RETURN] (L530)

> Return the populated result list to the caller.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return ekk0191b001List` // Returns list of service contract detail records |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `svc_kei_no` | Field | Service Contract Number — the primary identifier for a service contract (e.g., a broadband/phone line contract with the carrier) |
| `svc_kei_ucwk_no` | Field | Service Contract Work Number — the line item / sub-contract number within a service contract, identifying individual service details |
| `svc_kei_ucwk_stat` | Field | Service Contract Work Status — the current status of a service contract line item (e.g., active, suspended, canceled) |
| `func_cd` | Field | Function Code — identifies the business function or screen operation being performed |
| `fixedText` | Field | Fixed Service Message — a string used for displaying service-level messages (error/success text) |
| eo光電話 (eo Hikari Phone) | Business term | A bundled fiber-optic internet + telephone service offered by K-Opticom/eo in Japan ("eo light telephone") |
| CAANMsg | Technical | Fujitsu's CAAN (Component Application Application Network) message type — a generic message object used in the CBS message framework for structured data exchange |
| CBS | Acronym | Component Business Service — the layer responsible for business logic and data access, invoked through SC (Service Component) calls |
| SC (Service Component) | Acronym | Service Component — the intermediary layer that dispatches requests to CBS and returns results; the `callSC` method is a common dispatcher |
| EKK0191B001 | SC Code | The service component code for Service Contract Details (eo Hikari Phone) List Inquiry by Service Contract Number |
| TEMPLATE_ID_EKK0191B001 | Constant | Template identifier for the EKK0191B001 CBS message — identifies the service IF template used for this inquiry |
| ServiceComponentRequestInvoker | Technical | A request invoker object used to build and execute service component calls |
| KK_T_SVC_KEI_UCWK | Entity/DB | Service Contract Work table — the database table storing service contract line item records |
| SessionHandle | Technical | Session context object carrying user authentication, tenant, and transaction information across service calls |
| IRequestParameterReadWrite | Technical | Interface for reading and writing request parameters exchanged between screen and business logic layers |

---