# Business Logic — JKKSmtvlYoSanshoKeiInfCC.getInvokeCBS() [23 LOC]

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

## 1. Role

### JKKSmtvlYoSanshoKeiInfCC.getInvokeCBS()

The `getInvokeCBS` method is a shared utility that creates and configures a service interface parameter map for check processing in the K-Opticom customer core system. Its business purpose is to prepare the input payload for the **EKK0081A010 — Service Contract Agreement Review (サービス契約照会)** CBS (Central Business System) call, so that downstream check screens can invoke it as part of their validation workflows. The method implements a **builder + delegation** design pattern: it extracts the current service context from the request parameter, assembles a structured input array with the service contract number, generation timestamp (left empty for default), and the current operation date, then delegates to `editInMsg` to map this data onto the correct message template. It serves as a **routing/dispatch entry point** called by dozens of check screens (e.g., KKSV0568 cancellation checks, KKSV0651 smart balance reference, KKSV0791 order history checks) within the `invokeCheck` lifecycle, enabling a unified check-processing mechanism across the platform. The `fixedText` parameter acts as a service message identifier for error logging purposes. The method returns a `HashMap<String, Object>` containing the mapped input data ready for subsequent CBS invocation.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["getInvokeCBS Method"])
    START --> GET_DATA["Extract ccMsg from param using SERVICE_ID"]
    GET_DATA --> BUILD_IN["Build input array for EKK0081A010
key_svc_kei_no from ccMsg
KEY_GENE_ADD_DTM = empty string
KEY_RSV_APLY_YMD = JPCBPCommon.getOpeDate"]
    BUILD_IN --> EDIT_MSG["Call editInMsg with template EKK0081A010"]
    EDIT_MSG --> RETURN["Return paramMap HashMap"]
    RETURN --> END_NODE(["End"])
    START --> GET_DATA
    GET_DATA --> BUILD_IN
    BUILD_IN --> EDIT_MSG
    EDIT_MSG --> RETURN
```

**CRITICAL — Constant Resolution:**

| Constant | Resolved Value | Business Meaning |
|----------|---------------|------------------|
| `SERVICE_ID` | `"KKSV065101CC"` | The service contract information CC (smart balance reference) service identifier used to extract the context map from the request parameter |
| `TEMPLATE_ID_EKK0081A010` | `"EKK0081A010"` | Message template ID for the Service Contract Agreement Review (サービス契約照会) CBS |
| `EKK0081A010CBSMsg.KEY_SVC_KEI_NO` | (runtime key) | Service contract number field — the primary identifier for the service being reviewed |
| `EKK0081A010CBSMsg.KEY_GENE_ADD_DTM` | (runtime key) | Service generation registration date-time — left as empty string to let the CBS generate the default |
| `EKK0081A010CBSMsg.KEY_RSV_APLY_YMD` | (runtime key) | Reservation application date — set to the current operational date from `JPCBPCommon.getOpeDate` |
| `funcCode` (literal `"2"`) | `"2"` | Function code indicating the template mapping mode used by `editInMsg` |

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `handle` | `SessionHandle` | The database session handle providing the transactional context for database operations. It carries connection information, transaction boundaries, and user session state required for CBS invocations. |
| 2 | `param` | `IRequestParameterReadWrite` | The request parameter object carrying all business data across the check processing pipeline. It holds the service context map (retrieved via `getData(SERVICE_ID)`) which contains the `key_svc_kei_no` (service contract number) and other request-scoped fields. It is also modified in-place by `editInMsg` to embed the mapped CBS input template. |
| 3 | `fixedText` | `String` | The service message identifier (e.g., `"KKSV079101CC"`). Used as a label for logging and error message differentiation across different calling screens. Not directly used within this method's body but passed as part of the standard check-component interface contract. |

**External state read:**
- `JPCBPCommon.getOpeDate(null)` — Returns the current operational date (稼働日) used as the reservation application date (`KEY_RSV_APLY_YMD`) for the service contract agreement review.

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| M | `editInMsg` (JKKSmtvlYoSanshoKeiInfCC) | - | - | Maps the input array `ekk0081a010IN` onto the EKK0081A010 message template and generates a `HashMap<String, Object>` (`paramMap`) containing the structured CBS invocation data. Internal mapping helper. |
| R | `JPCBPCommon.getOpeDate` | - | - | Reads the current operational date (稼働日) from system configuration or database to provide the reservation application date for the CBS call. |
| R | `EKK0081A010CBSMsg` | EKK0081A010 | (Service Contract Agreement entity) | The CBS interface definition referenced for field keys — provides `KEY_SVC_KEI_NO`, `KEY_GENE_ADD_DTM`, `KEY_RSV_APLY_YMD`. The actual CBS execution is delegated via `editInMsg` to the EKK0081A010 Service Component. |

**Detailed analysis of called methods:**

- **`editInMsg(param, "EKK0081A010", "2", ekk0081a010IN)`**: This method takes the template ID `"EKK0081A010"` (Service Contract Agreement Review — サービス契約照会), the function code `"2"`, and the structured input array. It maps the 3-element array entries (service contract number, generation datetime, reservation application date) to the CBS request message structure and returns a HashMap containing the mapped parameters. This is a message-template mapping operation, not a direct database CRUD call, but the result is consumed by the CBS invocation layer.

- **`JPCBPCommon.getOpeDate(null)`**: Reads the operational date (稼働日) — the business date used for service reservation and agreement processing. The null argument indicates using the default/current system date.

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Screen:KKSV0791 | `KKSV0791OPBPCheck.invokeCheck` -> `JKKOpChUkRirekiListDlydCC.getInvokeCBS` | N/A (this is a different class instance; the pattern is identical) |
| 2 | Screen:CRSV0183 | `CRSV0183OPBPCheck.invokeCheck` -> `JcrGetDenshiFileCtl1IC.getInvokeCBS` | N/A (different class instance; same pattern) |
| 3 | Screen:KKSV0339 | `KKSV0339OPBPCheck.invokeCheck` -> `JKKNowSvcInfOC.getInvokeCBS` | N/A (different class instance; same pattern) |
| 4 | Screen:SCSV0028 | `SCSV0028OPBPCheck.invokeCheck` -> `JscsV002801CC.getInvokeCBS` | N/A (different class instance; same pattern) |
| 5 | Screen:CRSV0025 | `CRSV0025OPBPCheck.invokeCheck` -> `JcrJudgN gWordCC.getInvokeCBS` -> `JcrAddTaiOkRkDtlCallCC.getInvokeCBS` -> `JcrAddHottVoiceCC.getInvokeCBS` | N/A (different class instances; same pattern) |
| 6 | Screen:KKSV0568 | `KKSV0568OPBPCheck.invokeCheck` -> Multiple `JKKCancelSvcWriBC.getInvokeCBS`, `JKKCancelUsePlaceInfoCC.getInvokeCBS`, `JKKCancelSvcKeiMobileCC.getInvokeCBS`, `JKKCancelSvcKeiTVCC.getInvokeCBS`, `JKKCancelSvcKeiTELCC.getInvokeCBS`, `JKKCancelSvcKeiNETCC.getInvokeCBS`, `JKKCancelICJKNSetteCC.getInvokeCBS`, `JKKAplySeiOpSvcKeiCC.getInvokeCBS`, `JKKCancelMskmInfoCC.getInvokeCBS` | N/A (different class instances; same pattern) |
| 7 | Screen:KKSV0384 | `KKSV0384OPBPCheck.invokeCheck` -> `JKKSeikYiRrkiListCC.getInvokeCBS` | N/A |
| 8 | Screen:KKSV0809 | `KKSV0809OPBPCheck.invokeCheck` -> `JKKUpdSvcKeiGrpSeteCC.getInvokeCBS` | N/A |
| 9 | Screen:CNSV0051 | `CNSV0051OPBPCheck.invokeCheck` -> `ContKeiInfoGetCC.getInvokeCBS` | N/A |
| 10 | Screen:KKSV0916 | `KKSV0916OPBPCheck.invokeCheck` -> `JKKWriSvcKeiOperateCC.getInvokeCBS` | N/A |
| 11 | Screen:CKSV0017 | `CKSV0017OPBPCheck.invokeCheck` -> `JckHuryoCustListSearchCC.getInvokeCBS` | N/A |
| 12 | Screen:CHSV0008 | `CHSV0008OPBPCheck.invokeCheck` -> `CC.getInvokeCBS` | N/A |

**Note:** The `getInvokeCBS` method pattern is implemented as an interface contract across **dozens of Common Component classes** in the system. Each check screen class instantiates its own CC object and calls `getInvokeCBS` to prepare CBS input parameters. The specific CC classes differ per screen, but they all share the same method signature and pattern. The method itself (in `JKKSmtvlYoSanshoKeiInfCC`) specifically prepares the EKK0081A010 (Service Contract Agreement Review) service input.

## 6. Per-Branch Detail Blocks

The method has **no conditional branches** — it executes a linear sequence of operations. Below is the block-by-block analysis of each statement.

**Block 1** — [PROCESSING LINEAR] (L647)

> Extract the service context map from the request parameter using the SERVICE_ID constant.

| # | Type | Code |
|---|------|------|
| 1 | SET | `ccMsg = (HashMap<String, Object>) param.getData(SERVICE_ID)` // Extract service context map [-> SERVICE_ID="KKSV065101CC"] |

**Block 2** — [PROCESSING LINEAR] (L650-651)

> Prepare the input array for the EKK0081A010 CBS call. Three fields are mapped: the service contract number (from the context), an empty generation timestamp, and the operational date.

| # | Type | Code |
|---|------|------|
| 1 | SET | `ekk0081a010IN = Object[][]` // Declare the input array [-> constant resolution below] |
| 2 | SET | `{EKK0081A010CBSMsg.KEY_SVC_KEI_NO, (String)ccMsg.get("key_svc_kei_no")}` // Service contract number mapped from context => service contract number |
| 3 | SET | `{EKK0081A010CBSMsg.KEY_GENE_ADD_DTM, ""}` // Empty string => service generation registration date-time (CBS default) |
| 4 | SET | `{EKK0081A010CBSMsg.KEY_RSV_APLY_YMD, JPCBPCommon.getOpeDate(null)}` // Operational date => reservation application date |

**Block 3** — [CALL] (L654-655)

> Delegate to `editInMsg` to map the input array onto the EKK0081A010 message template and generate the result HashMap.

| # | Type | Code |
|---|------|------|
| 1 | SET | `paramMap = editInMsg(param, TEMPLATE_ID_EKK0081A010, "2", ekk0081a010IN)` // Map CBS input to template [-> TEMPLATE_ID_EKK0081A010="EKK0081A010"] |

**Block 4** — [RETURN] (L657)

> Return the mapped parameter HashMap to the caller.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return paramMap;` // Returns the mapped CBS input HashMap<String, Object> |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `key_svc_kei_no` | Field | Service contract number — the unique identifier for a service contract line item, extracted from the service context map |
| `svc_kei_no` | Field | Service contract number — the primary key used in EKK0081A010 CBS to look up the service agreement record |
| `GENE_ADD_DTM` | Field | Generation registration date-time — when the service contract record was originally created in the system |
| `RSV_APLY_YMD` | Field | Reservation application date — the date on which the service reservation is applied, used for agreement review |
| EKK0081A010 | Service | Service Contract Agreement Review (サービス契約照会) — CBS that retrieves and validates service contract agreement details |
| SERVICE_ID | Constant | `"KKSV065101CC"` — The service identifier used to extract the service context data map from the request parameter |
| TEMPLATE_ID_EKK0081A010 | Constant | `"EKK0081A010"` — Message template ID for mapping CBS input parameters |
| SERVICE_ID constant | Constant | Service Component identifier — distinguishes which data map within `param` to retrieve |
| `fixedText` | Parameter | Service message identifier — a label string passed by callers for error message differentiation and logging |
| `ccMsg` | Local Variable | Contract context message map — holds the service contract context extracted from the request parameter |
| `paramMap` | Local Variable | Parameter map — the result of `editInMsg`, containing the mapped CBS input data |
| `handle` | Parameter | Session handle — manages database connection and transaction state |
| `param` | Parameter | Request parameter — carries business data through the check processing pipeline |
| OPBPCheck | Pattern | Operation Business Process Check — the check screen class pattern; each screen (e.g., KKSV0791) has an `OPBPCheck` class that orchestrates validation |
| CBS | Acronym | Central Business System — backend service components that perform business operations |
| SC | Acronym | Service Component — a modular business logic unit in the Fujitsu Futurity framework |
| `editInMsg` | Method | Input message mapper — maps raw input arrays onto CBS message templates using a template ID and function code |
| `getOpeDate` | Method | Operational date getter — retrieves the business date (稼働日) used for date-sensitive operations |
| KKSVxxxx | Pattern | K-Opticom Screen Validator — screen-specific validation class naming convention |
| CRSVxxxx | Pattern | Customer Relation Screen Validator — customer relations screen-specific validation class |
| CNSVxxxx | Pattern | Customer Service Screen Validator — customer service screen-specific validation class |
| SCSVxxxx | Pattern | Service Change Screen Validator — service change screen-specific validation class |
