# Business Logic — JKKEmgRrksNmUpdCC.getEkk0081B004() [46 LOC]

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

## 1. Role

### JKKEmgRrksNmUpdCC.getEkk0081B004()

This method performs a **service contract list query by SYSID** (Japanese: サービス契約一覧照会（SYSID）2), which is a read-only data retrieval operation used by screens that need to display a paginated list of service contracts associated with a specific SYSID (system identifier). It acts as a **delegation wrapper** around the `EKK0081B004` CBS (Center Business System) message, constructing the request input mapping and then extracting only two fields — the service contract number (`svc_kei_no`) and service contract status (`svc_kei_stat`) — from each row of the returned result set. The method follows a **single-responsibility query pattern**: it builds fixed pagination parameters (max 1000 results, 100 per page, page 1), passes them to the shared `callSC` infrastructure, and maps the response into a simple list of `HashMap<String, Object>` for consumption by the calling screen. It is a shared utility called by the `execute()` method of the same class, indicating it is invoked during the processing of service contract update/add screens.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["getEkk0081B004"]) --> INIT["Initialize ekk0081b004List and ekk0081b004Map"]
    INIT --> SCALL["Create ServiceComponentRequestInvoker scCall"]
    SCALL --> MAP["Build ekk0081b004In input mapping with 8 entries"]
    MAP --> CALL["callSC to EKK0081B004CBSMsg"]
    CALL --> GET_LIST["getCAANMsgList EKK0081B004CBSMsg1List"]
    GET_LIST --> CHECK{"null != ekk0081b004Msg1List"}
    CHECK -->|No| RETURN["Return empty ekk0081b004List"]
    CHECK -->|Yes| FOR["For each ekk0081b004Msg in ekk0081b004Msg1List"]
    FOR --> REINIT["Reinit ekk0081b004Map = new HashMap"]
    REINIT --> PUT1["Put trgt_svc_kei_no"]
    PUT1 --> PUT2["Put trgt_svc_kei_stat"]
    PUT2 --> ADD["Add ekk0081b004Map to ekk0081b004List"]
    ADD --> FOR_END{"More msgs?"}
    FOR_END -->|Yes| REINIT
    FOR_END -->|No| END2(["End"])
    RETURN --> END2
```

**Constant Resolution:**

| Constant | Resolved Value | Business Meaning |
|----------|---------------|-----------------|
| `TEMPLATE_ID_EKK0081B004` | `"EKK0081B004"` | Template ID for the Service Contract List Inquiry (SYSID) 2 CBS message |
| `JPCModelConstant.FUNC_CD_1` | `"1"` | Function code = Display (一覧照会) |
| `JKKStrConst.CD00133_10` | `"10"` | Pricing group code filter (料金グループリコード) |
| `MAX_SEARCH_NUM` | `"1000"` | Maximum number of search results |
| `DISPLAY_NUM` | `"100"` | Number of records per page |
| `SEARCH_TYPE` | `"1"` | Search type parameter (検索処理パターン) |
| `DISPLAY_PAGE_NUM` | `"1"` | Display page number (first page) |

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `handle` | `SessionHandle` | Session handle for the EJB transaction context, carrying security, tenant, and language context |
| 2 | `param` | `IRequestParameterReadWrite` | Request/response parameter object used to pass data to and from the CBS message during `callSC` invocation |
| 3 | `fixedText` | `String` | Service message text (サービスメッセージ) used for i18n message formatting and error text substitution |
| 4 | `sysid` | `String` | SYSID (システム識別子) — the system identifier used as the primary filter to select which service contracts to return; each SYSID corresponds to a specific customer or equipment system |
| 5 | `funcCd` | `String` | Function code (機能コード) — passed through to the CBS infrastructure, though the method hardcodes `FUNC_CD_1 = "1"` for display operations |

**External state read:** None. The method reads no instance fields and creates all objects locally.

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `callSC` (JKKEmgRrksNmUpdCC) | EKK0081B004 | EKK0081B004 (Service Contract List by SYSID) | Calls the shared `callSC` method to invoke the EKK0081B004 CBS message for querying service contracts filtered by SYSID, pricing group code "10", and display function code "1". Returns a list of `CAANMsg` objects representing service contract detail rows. |

**Analysis details:**
- The method calls `callSC(handle, scCall, param, ekk0081b004In, fixedText, new EKK0081B004CBSMsg().getContents())` which delegates to the standard Service Component request invoker. The CBS message `EKK0081B004` queries the service contract table (typically a customer backbone service contract table keyed by SYSID) and returns paginated results.
- SC Code: `EKK0081B004` (inferred from the CBS message class name `EKK0081B004CBSMsg` and the template ID).
- The method is purely a **Read (R)** operation — it retrieves and maps data with no create, update, or delete semantics.

## 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: `getContents` [R], `getString` [R], `getString` [R]

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Component:JKKEmgRrksNmUpdCC.execute() | `execute()` -> `getEkk0081B004(handle, param, fixedText, sysid, funcCd)` | `EKK0081B004CBSMsg.getContents [R]`, `CAANMsg.getString(SVC_KEI_NO) [R]`, `CAANMsg.getString(SVC_KEI_STAT) [R]` |

**Trace Analysis:**
- The method is called by `execute()` in the same class `JKKEmgRrksNmUpdCC`, which serves as a business component (CC) orchestrating service contract update/add operations.
- `execute()` is typically invoked as part of a screen processing flow in a K-Opticom service management UI (the class name `JKKEmgRrksNmUpdCC` indicates a service contract update/add component).
- The terminal operations are: the CBS message schema definition (`getContents`), and two field extractions from each result row (`getString` for service contract number and status).
- No direct screen entry points (KKSV*) are found within 8 hops; the method operates as a supporting data access utility.

## 6. Per-Branch Detail Blocks

**Block 1** — [SET] `(local variable initialization)` (L335-L337)

> Initialize local collections for accumulating results.

| # | Type | Code |
|---|------|------|
| 1 | SET | `ekk0081b004List = new ArrayList<HashMap<String, Object>>()` |
| 2 | SET | `ekk0081b004Map = new HashMap<String, Object>()` |

**Block 2** — [SET] `(create request invoker)` (L339)

> Instantiate the Service Component request invoker for the CBS call.

| # | Type | Code |
|---|------|------|
| 1 | SET | `scCall = new ServiceComponentRequestInvoker()` |

**Block 3** — [SET] `(build input mapping — サービス契約一覧照会（SYSID）2)` (L343-L351)

> Construct the input parameter array for the EKK0081B004 CBS message. This is the "upper mapping" (上マッピング) phase where all 8 input fields are populated.

| # | Type | Code |
|---|------|------|
| 1 | SET | `ekk0081b004In[...] = {TEMPLATEID, "EKK0081B004"}` [-> TEMPLATE_ID_EKK0081B004 = "EKK0081B004"] |
| 2 | SET | `ekk0081b004In[...] = {FUNC_CODE, "1"}` [-> JPCModelConstant.FUNC_CD_1 = "1"] |
| 3 | SET | `ekk0081b004In[...] = {KEY_SYSID, sysid}` — input parameter from caller |
| 4 | SET | `ekk0081b004In[...] = {KEY_PRC_GRP_CD, "10"}` [-> JKKStrConst.CD00133_10 = "10"] |
| 5 | SET | `ekk0081b004In[...] = {MAX_SEARCH_NUM, "1000"}` — hardcoded max records |
| 6 | SET | `ekk0081b004In[...] = {DISPLAY_NUM, "100"}` — page size |
| 7 | SET | `ekk0081b004In[...] = {SEARCH_TYPE, "1"}` — search type |
| 8 | SET | `ekk0081b004In[...] = {DISPLAY_PAGE_NUM, "1"}` — page number 1 |

**Block 4** — [CALL] `(execute CBS service IF)` (L354-L355)

> Execute the Service Contract List Inquiry (SYSID) 2 CBS message via `callSC`, then extract the result list.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `callSC(handle, scCall, param, ekk0081b004In, fixedText, new EKK0081B004CBSMsg().getContents())` |
| 2 | EXEC | `.getCAANMsgList(EKK0081B004CBSMsg.EKK0081B004CBSMSG1LIST)` — extract detail list from response |
| 3 | SET | `ekk0081b004Msg1List = [result of getCAANMsgList]` |

**Block 5** — [IF] `(null != ekk0081b004Msg1List)` (L357)

> Guard: process only if the CBS returned at least one result row. If the list is null, the method skips iteration and returns an empty list.

**Block 5.1** — [FOR] `(each ekk0081b004Msg in ekk0081b004Msg1List)` (L359)

> Iterate over each service contract detail row returned by the CBS message.

**Block 5.1.1** — [SET] `(reinitialize map per row)` (L361)

| # | Type | Code |
|---|------|------|
| 1 | SET | `ekk0081b004Map = new HashMap<String, Object>()` |

**Block 5.1.2** — [EXEC] `(extract service contract number)` (L363)

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `ekk0081b004Map.put("trgt_svc_kei_no", ekk0081b004Msg.getString(EKK0081B004CBSMsg1List.SVC_KEI_NO))` — extract service contract number from CBS result |

**Block 5.1.3** — [EXEC] `(extract service contract status)` (L364)

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `ekk0081b004Map.put("trgt_svc_kei_stat", ekk0081b004Msg.getString(EKK0081B004CBSMsg1List.SVC_KEI_STAT))` — extract service contract status from CBS result |

**Block 5.1.4** — [EXEC] `(add row to result list)` (L366)

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `ekk0081b004List.add(ekk0081b004Map)` |

**Block 6** — [RETURN] `(return result list)` (L369)

> Return the accumulated list of maps. Each map contains exactly two keys: `trgt_svc_kei_no` and `trgt_svc_kei_stat`. If the CBS returned no results or null, an empty list is returned.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return ekk0081b004List` |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `svc_kei_no` | Field | Service contract number (サービス契約番号) — unique identifier for a service contract line item in the customer backbone system |
| `svc_kei_stat` | Field | Service contract status (サービス契約ステータス) — current lifecycle status of the service contract (e.g., active, suspended, cancelled) |
| `trgt_svc_kei_no` | Field | Target service contract number — mapped key in the return HashMap, indicating the service contract number of the queried result |
| `trgt_svc_kei_stat` | Field | Target service contract status — mapped key in the return HashMap, indicating the current status of the queried result |
| `sysid` | Field | System ID (システム識別子) — a customer/equipment identifier used to filter service contracts belonging to a specific system |
| `funcCd` | Field | Function code (機能コード) — UI function identifier used for access control and screen routing |
| `prc_grp_cd` | Field | Pricing group code (料金グループコード) — classifies pricing structures; code `"10"` is used as a filter in this query |
| EKK0081B004 | SC Code | Service Contract List Inquiry (SYSID) 2 — CBS message for querying service contracts by SYSID |
| EKK0081B004CBSMsg | CBS Message | Request schema for the EKK0081B004 service call, defining input parameters |
| EKK0081B004CBSMsg1List | CBS Message List | Response detail list schema containing individual service contract rows |
| FUNC_CD_1 | Constant | Function code `"1"` — represents a display/inquiry operation (一覧照会) |
| CD00133_10 | Constant | Pricing group code `"10"` — a specific pricing group used as a query filter |
| TEMPLATE_ID_EKK0081B004 | Constant | `"EKK0081B004"` — the CBS template identifier for the service contract list inquiry message |
| ServiceComponentRequestInvoker | Class | Infrastructure class for invoking CBS (Center Business System) service components |
| callSC | Method | Shared service component call method in `JKKEmgRrksNmUpdCC` that wraps the SC invocation with session, parameter, and error handling |
| CAANMsg | Class | Base message class for CBS request/response payloads; provides `getString(field)` for field extraction |
| SessionHandle | Class | EJB session context handle carrying transaction, security, and localization context |
| IRequestParameterReadWrite | Interface | Request/response parameter interface used to pass data between the business component and CBS messages |
| K-Opticom | Business term | Japanese telecommunications service provider; the domain context for this codebase |
| CBS | Acronym | Center Business System — the backend enterprise system handling core telecom operations |
| SYSID | Acronym | System Identifier — a key entity in the customer backbone system identifying a customer's installed system/equipment |
| サービス契約一覧照会 | Japanese term | Service contract list inquiry — the business operation of retrieving and displaying a list of service contracts |
| 料金グループ | Japanese term | Pricing group — a classification of pricing plans and fee structures |
