# Business Logic — JKKPauseReceptCC.svkeiInfoStkuTran() [19 LOC]

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

## 1. Role

### JKKPauseReceptCC.svkeiInfoStkuTran()

This method performs a **service agreement query** (サービス契約一致照会) as a dedicated step within the broader **service suspension reception workflow** (休止受付処理). It is responsible for looking up existing service contract records matching the current request context and returning the query results into the caller's result hash. The method acts as a **delegated data retrieval utility** — it does not contain business decision logic itself, but rather orchestrates a single service component call (`EKK0081A010`), validates that the response is non-empty, and extracts the first matching service agreement record. Its role in the larger system is to **populate the caller's result context** with service agreement information, which the calling method (`pauseReceptuCtrlTran`) then uses to determine service state and branch to further processing (e.g., suspension reception for active services, or early return for already-cancelled services). The method implements a **fail-fast validation pattern** — if the service agreement query returns no records, it throws an `SCCallException` immediately rather than proceeding with null or empty data.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START([svkeiInfoStkuTran begin])
    CALL_SC["callEKK0081A010 handle, param, fixedText"]
    GET_WORK["getWorkCAANMsg rsltEKK0081A010"]
    GET_LIST["getCAANMsgList EKK0081A010CBSMSG1LIST"]
    CHECK_EMPTY{msgEKK0081A010List.length == 0}
    THROW_ERR["throw SCCallException INVALID_RETURN_MESSAGE, code 0, seq -1"]
    EXTRACT["msgEKK0081A010 = msgEKK0081A010List[0]"]
    PUT_RESULT["resultHash.put RESULT_KEY_EKK0081A010, msgEKK0081A010"]
    END([svkeiInfoStkuTran end — void])

    START --> CALL_SC
    CALL_SC --> GET_WORK
    GET_WORK --> GET_LIST
    GET_LIST --> CHECK_EMPTY
    CHECK_EMPTY --> |true| THROW_ERR
    CHECK_EMPTY --> |false| EXTRACT
    EXTRACT --> PUT_RESULT
    PUT_RESULT --> END
    THROW_ERR --> END
```

**Block description:**

1. **Service agreement query** — Invokes the `callEKK0081A010` helper method, which internally edits input parameters via `mapper.editInMsgEKK0081A010()`, executes the service component `EKK0081A010` via `scCall.run()`, processes the result through `mapper.editResultRPEKK0081A010()`, performs error checking, and returns the result map.

2. **Business data extraction** — Retrieves the `CAANMsg` work object from the service component result, then extracts the `EKK0081A010CBSMSG1LIST` message list from the work object.

3. **Non-empty validation** — If the returned message list is empty (length == 0), the method throws `SCCallException` with error message `"INVALID_RETURN_MESSAGE"` (constant `ERR_INVALID_RETURN_MSG`), error code `"0"`, and sequence number `-1`. This is a **fail-fast** safeguard ensuring downstream callers never receive null service agreement data.

4. **First record extraction** — The first element of the message list is assigned to `msgEKK0081A010` (service agreement matching is expected to return exactly one record in this context).

5. **Result population** — The extracted `CAANMsg` is stored in the caller's `resultHash` under the key `RESULT_KEY_EKK0081A010 = "EKK0081A010"`, enabling the caller (`pauseReceptuCtrlTran`) to access the service agreement data.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `handle` | `SessionHandle` | Database session handle carrying connection context (transaction session, data source reference) used by the service component invocation layer to execute the `EKK0081A010` service component query. |
| 2 | `param` | `IRequestParameterReadWrite` | Request parameter object containing the model group and control map for the current screen/batch operation. It carries the request context (e.g., service contract number, customer identifiers) needed to construct the input message for the service agreement query. |
| 3 | `fixedText` | `String` | User-defined arbitrary string used as a mapping key for data extraction from the request parameters (e.g., identifies which model group or data section to use as the query input payload). |
| 4 | `resultHash` | `HashMap<String, Object>` | Output result container. The method populates this map with the queried service agreement data under the key `RESULT_KEY_EKK0081A010` ("EKK0081A010"). The caller (`pauseReceptuCtrlTran`) retrieves the `CAANMsg` from this hash to determine service state and make branching decisions. |

**Instance fields read:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `mapper` | `JKKPauseReceptMapperCC` | Input/output message mapper for the `JKKPauseReceptCC` component. Used by the called `callEKK0081A010` method to transform request parameters into the CBS input message and vice versa. |
| `scCall` | `ServiceComponentRequestInvoker` | Service component invocation dispatcher. Used to execute CBS calls (e.g., `EKK0081A010`) within the application layer. |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `JKKPauseReceptCC.callEKK0081A010` | EKK0081A010SC | - | Calls `callEKK0081A010` in `JKKPauseReceptCC` (service agreement query) |
| R | `JKKPauseReceptCC.getWorkCAANMsg` | - | - | Calls `getWorkCAANMsg` in `JKKPauseReceptCC` (extracts `CAANMsg` from result map) |

### Method call detail:

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `callEKK0081A010` (internal) | EKK0081A010SC | `KK_T_SVC_KEI` (Service Contract) | Queries service agreement records matching the request criteria (service contract number, customer, etc.). The CBS `EKK0081A010` is a service agreement query service that searches the service contract master table for matching records. The method internally calls `mapper.editInMsgEKK0081A010()` to transform input parameters, then `scCall.run()` to invoke the CBS, and finally `mapper.editResultRPEKK0081A010()` to process the result. |

**Classification rationale:**
- `callEKK0081A010` is classified as **Read (R)** — the method name and CBS naming convention (`EKK0081A010`) indicate a service agreement inquiry (一致照会 = exact-match query). The CBS is a SELECT operation on the service contract master table.
- `getWorkCAANMsg` is classified as **Read (R)** — it extracts a `CAANMsg` object from a result map (no database operation, in-memory data extraction).

## 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: `getWorkCAANMsg` [R], `callEKK0081A010` [-]

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | CCC: `JKKPauseReceptCC.pauseReceptuCtrlTran` | `pauseReceptuCtrlTran` -> `svkeiInfoStkuTran` | `callEKK0081A010 [R] KK_T_SVC_KEI` |

**Call chain detail for row 1:**
`pauseReceptuCtrlTran(handle, param, fixedText, resultHash)` is the control entry point within `JKKPauseReceptCC`. It retrieves the pause reception map from request parameters, then calls `svkeiInfoStkuTran(handle, param, fixedText, resultHash)` to query service agreement information. After `svkeiInfoStkuTran` returns, `pauseReceptuCtrlTran` retrieves the service agreement data from `resultHash` (key: `"EKK0081A010"`), extracts the service status (`SVC_KEI_STAT`), and branches based on the service state (suspended, cancelled, or active).

## 6. Per-Branch Detail Blocks

**Block 1** — [CALL] `(service agreement query)` (L377)

> Invokes the internal helper method `callEKK0081A010` which orchestrates the full service agreement query cycle: input message editing, CBS invocation, result processing, and error checking.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `callEKK0081A010(handle, param, fixedText)` // Returns `Map<?, ?>` — service agreement query result [-> `editInMsgEKK0081A010()` -> `scCall.run()` -> `editResultRPEKK0081A010()` -> `errChk()`] |

**Block 2** — [SET, EXEC] `(business data extraction)` (L380–L381)

> Extracts the `CAANMsg` work object from the service component result and retrieves the message list containing the service agreement records.

| # | Type | Code |
|---|------|------|
| 1 | SET | `workEKK0081A010 = getWorkCAANMsg(rsltEKK0081A010)` // Extract `CAANMsg` from result map |
| 2 | EXEC | `msgEKK0081A010List = workEKK0081A010.getCAANMsgList(EKK0081A010CBSMsg.EKK0081A010CBSMSG1LIST)` // Extract service agreement list [-> constant `EKK0081A010CBSMSG1LIST`] |

**Block 3** — [IF] `(empty response validation — fail-fast)` (L383)

> Validates that the service agreement query returned at least one record. If the list is empty, throws an exception to prevent downstream null-pointer issues.

| # | Type | Code |
|---|------|------|
| 1 | COND | `0 == msgEKK0081A010List.length` // Check if query returned zero records |

**Block 3.1** — [IF-BRANCH / THROW] `(empty result — error)` (L385–L387)

> When the service agreement query returns no records, the method throws a structured exception with error message, code, and sequence number.

| # | Type | Code |
|---|------|------|
| 1 | SET | `errMsg = "INVALID_RETURN_MESSAGE"` // Error message constant |
| 2 | EXEC | `throw new SCCallException(errMsg, "0", -1)` // Fail-fast: invalid (empty) response from service component [-> `SCCallException` with code "0", seq -1] |

**Block 3.2** — [ELSE / CONTINUE] `(result present)` (L389–L390)

> When the query returns one or more records, proceed to extract the first record and store it in the result hash.

| # | Type | Code |
|---|------|------|
| 1 | SET | `msgEKK0081A010 = msgEKK0081A010List[0]` // Extract first (and expected only) service agreement record |
| 2 | SET | `resultHash.put(RESULT_KEY_EKK0081A010, msgEKK0081A010)` // Store in result hash [-> `RESULT_KEY_EKK0081A010 = "EKK0081A010"`] |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `svkeiInfoStkuTran` | Method | Service Information Status Transaction — queries and returns service agreement information for the suspension reception workflow |
| `JKKPauseReceptCC` | Class | Pause Reception Common Component — handles all service suspension reception logic including service state verification, suspension execution, and progress registration |
| `EKK0081A010` | CBS Code | Service Agreement Query CBS — service component that queries service contract master records by match criteria (service contract number, customer ID, etc.) |
| `EKK0081A010CBSMSG1LIST` | CBS Field | Service agreement list message key — identifier for the message list containing matched service contract records |
| `SVC_KEI_STAT` | CBS Field | Service Contract Status — status code of a service contract (e.g., 100 = Active, 210 = Suspended, 220 = Stopped, 910 = Cancelled, 920 = Canceled) |
| `SERVICE_CONTRACT_STATUS_ACTIVE` | Constant | Service contract status: "100" — Service in progress (サービス提供中) |
| `SERVICE_CONTRACT_STATUS_SUSPENDED` | Constant | Service contract status: "210" — Suspended / Mid-termination (休止・中断中) |
| `SERVICE_CONTRACT_STATUS_STOPPED` | Constant | Service contract status: "220" — Stopped (停止中) |
| `SERVICE_CONTRACT_STATUS_CANCELLED` | Constant | Service contract status: "910" — Contract finished (解約済) |
| `SERVICE_CONTRACT_STATUS_CANCELED` | Constant | Service contract status: "920" — Canceled (キャンセル済) |
| `RESULT_KEY_EKK0081A010` | Constant | Result hash key: "EKK0081A010" — the key under which the queried service agreement `CAANMsg` is stored |
| `SCCallException` | Exception | Service Component Call Exception — thrown when a CBS invocation fails or returns invalid data |
| `CAANMsg` | Type | Common Application Abstract Network Message — the standard message object carrying CBS input/output data |
| `SessionHandle` | Type | Session handle — manages database session context and transaction state for CBS invocations |
| `IRequestParameterReadWrite` | Type | Request parameter interface — carries model data and control map for screen/batch operations |
| `fixedText` | Parameter | User-defined arbitrary string — serves as a mapping key to identify which data section in the request to use |
| `mapper` | Field | `JKKPauseReceptMapperCC` — message mapper that transforms request parameters to/from CBS input/output messages |
| `scCall` | Field | `ServiceComponentRequestInvoker` — dispatcher for executing service component (CBS) calls |
| `KK_T_SVC_KEI` | Table | Service Contract Master Table — stores service contract records including status, customer, and service codes |
|休止受付 (Shiusi Uketuke) | Business term | Suspension Reception — the business process of receiving and processing a service suspension request |
| サービス契約一致照会 (Saabisu Keiyaku Icchi Shoukai) | Business term | Service Agreement Exact-Match Query — querying service contract records by exact matching criteria |
| SOD | Acronym | Service Order Data — telecom order fulfillment entity |
| SOD_HAKKO_FLG | Field | SOD Issue Flag — indicates whether an SOD should be issued ("0" = Not required, "1" = Required) |
| PRG_DTM | Field | Progress DateTime — timestamp of progress registration (年日月时分秒) |
| 休止開始完了 (Shiusi Kaishi Kanryo) | Business term | Suspension Start Completion — progress status "2401" indicating suspension processing has completed |
| 休止受付完了 (Shiusi Uketuke Kanryo) | Business term | Suspension Reception Completion — progress status "1931" indicating suspension reception has been registered |
| 中断理由コード (Chudan Riyuu Koudo) | Field | Interruption Reason Code — code describing why a service was interrupted/suspended |
