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

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

## 1. Role

### JKKSmtvlYoSanshoFukaInfCC.getInvokeCBS()

This method serves as a **Service Component (SC) invocation preparation routine** for the EKK0081A010 Service Contract Agreement Meeting (サービス契約照会) business process within the K-Opticom customer base system. It constructs the input parameter array for the `EKK0081A010` SC, which handles service contract inquiry/agreement meetings, and delegates to `editInMsg` to template-map these parameters into a structured request map.

The method follows a **delegation/builder pattern**: it extracts a service data `HashMap` from the request parameters using the class's `SERVICE_ID` constant (`"KKSV065102CC"`), assembles an `Object[][]` input array with exactly three key-value entries (service contract number, empty generation registration datetime, and the current operation date), then passes this array to `editInMsg` for template conversion. Its return value is the mapped parameter map intended for subsequent SC invocation.

This method acts as a **shared utility** within the smart batch processing subsystem. It is called by the `KKSV0651` screen's check processor to prepare SC parameters before the actual service contract data retrieval. The method is designed to be generic enough to support any screen that needs to invoke the `EKK0081A010` service component, extracting the service context dynamically from the incoming request.

The method has no conditional branches — it follows a single straight-line path: extract data, build input array, template-map, return.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["getInvokeCBS"])
    START --> GET_DATA["Get service data: param.getData(SERVICE_ID)"]
    GET_DATA --> INIT_ARRAY["Initialize ekk0081a010IN array"]
    INIT_ARRAY --> SET_P1["Set KEY_SVC_KEI_NO from ccMsg.key_svc_kei_no"]
    SET_P1 --> SET_P2["Set KEY_GENE_ADD_DTM to empty string"]
    SET_P2 --> SET_P3["Set KEY_RSV_APLY_YMD via JPCBPCommon.getOpeDate"]
    SET_P3 --> CALL_EDIT["Call editInMsg param, TEMPLATE_ID, 2, ekk0081a010IN"]
    CALL_EDIT --> RETURN["Return paramMap"]
    RETURN --> END_NODE(["Return / Next"])
```

**Constant Resolution:**

| Constant | Resolved Value | Business Meaning |
|----------|---------------|------------------|
| `SERVICE_ID` | `"KKSV065102CC"` | The CC's service identifier key used to retrieve the service data HashMap from request parameters |
| `TEMPLATE_ID_EKK0081A010` | `"EKK0081A010"` | Template ID for the Service Contract Agreement Meeting (サービス契約照会) SC |
| `EKK0081A010CBSMsg.KEY_SVC_KEI_NO` | `"key_svc_kei_no"` | K-Opt Service Contract Number — the primary key for service contract inquiries |
| `EKK0081A010CBSMsg.KEY_GENE_ADD_DTM` | `"key_gene_add_dtm"` | K-Opt Generation Registration Datetime — left empty as this is an inquiry, not a creation |
| `EKK0081A010CBSMsg.KEY_RSV_APLY_YMD` | `"key_rsv_aply_ymd"` | K-Opt Reservation Applied Year/Month/Day — the operation date for the inquiry |

**Processing Summary:**

1. **Extract service data** from request parameters using `SERVICE_ID` as the key, casting to `HashMap<String, Object>`.
2. **Build input array** (`Object[][]`) with three entries for the `EKK0081A010` SC:
   - Entry 1: Service contract number mapped from `ccMsg.get("key_svc_kei_no")`.
   - Entry 2: Empty string for generation registration datetime (not applicable to inquiry).
   - Entry 3: Current operation date obtained via `JPCBPCommon.getOpeDate(null)`.
3. **Template-map** the input array by calling `editInMsg` with template ID `"EKK0081A010"` and funcCode `"2"`.
4. **Return** the resulting `paramMap` containing the fully mapped parameters for the SC call.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `handle` | `SessionHandle` | The session handle managing the current database session and transaction context. It provides the connection needed for the downstream SC call to execute within the same transactional boundary. |
| 2 | `param` | `IRequestParameterReadWrite` | The request parameter object carrying all incoming data from the calling screen or batch process. It contains the service data HashMap (retrievable by `SERVICE_ID`), control map data, and metadata such as operator information, transaction IDs, and client details. This object is both read from (for data extraction) and modified (the returned `paramMap` is written back). |
| 3 | `fixedText` | `String` | A service message string used for error/disambiguation purposes in the calling context. In this method, it is accepted but not directly referenced — it is passed through from the caller (e.g., `"KKSV065102CC"`) for identification in logging or traceability. |

**Instance fields / external state read:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `SERVICE_ID` | `String` (constant) | The class-level service identifier `"KKSV065102CC"`, used as the key to extract the service data HashMap from the request parameter object. |
| `TEMPLATE_ID_EKK0081A010` | `String` (constant) | The template ID `"EKK0081A010"` for the Service Contract Agreement Meeting SC template. |
| `EKK0081A010CBSMsg.KEY_*` | `String` (constant) | Field key constants defining the schema for the `EKK0081A010` SC input messages. |

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `JPCBPCommon.getOpeDate` | JPCBPCommon | - | Calls `getOpeDate` to retrieve the current operation date for the reservation applied date field |
| U | `JKKSmtvlYoSanshoFukaInfCC.editInMsg` | JKKSmtvlYoSanshoFukaInfCC | - | Calls `editInMsg` to template-map the input parameter array into a structured request map for the SC |

**Note:** The actual SC invocation (`EKK0081A010`) is NOT performed within this method. Instead, this method only prepares the mapped parameter map (`paramMap`) which is returned to the caller for subsequent invocation via `ServiceComponentRequestInvoker.run()`. The `editInMsg` call maps the raw input array to the template schema, which is a U (update) operation on the parameter structure.

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Screen:KKSV0651 | `KKSV0651OPOperation.target4` -> `JKKSmtvlYoSanshoFukaInfCC.getSmtvlYoSanshoFukaInf` -> `getInvokeCBS` (via CC broker) | `editInMsg [U] EKK0081A010 mapped params` |
| 2 | Screen:KKSV0651 | `KKSV0651OPBPCheck` (commented-out) -> `jkkSmtvlYoSanshoFukaInfCC.getInvokeCBS` | `editInMsg [U] EKK0081A010 mapped params` |

**Details:**

- **Caller #1 (KKSV0651OPOperation):** The BPM operation class `KKSV0651OPOperation` defines a `CCRequestBroker` named `target4` that points to `JKKSmtvlYoSanshoFukaInfCC` with the method `"getSmtvlYoSanshoFukaInf"` (not `getInvokeCBS`). However, `getInvokeCBS` is the underlying common method that can be invoked directly or via CC broker routing. The service ID passed is `"KKSV065102CC"`.

- **Caller #2 (KKSV0651OPBPCheck):** The check class `KKSV0651_KKSV0651OPBPCheck` contains a commented-out reference to `JKKSmtvlYoSanshoFukaInfCC.getInvokeCBS()`, indicating this was either a planned or deprecated integration point. The call would follow the same pattern: extract service data, build the EKK0081A010 input, template-map, and return.

## 6. Per-Branch Detail Blocks

**Block 1** — [EXEC] `Extract service data HashMap` (L364)

> Retrieve the service data HashMap from the request parameters using the class SERVICE_ID key. This map contains business context data populated by the screen or upstream processing.

| # | Type | Code |
|---|------|------|
| 1 | SET | `ccMsg = (HashMap<String, Object>) param.getData(SERVICE_ID)` // Cast service data map from request [-> SERVICE_ID = "KKSV065102CC"] |

**Block 2** — [EXEC] `Initialize EKK0081A010 input array` (L367–375)

> Build the `Object[][]` input array for the EKK0081A010 Service Contract Agreement Meeting SC. Each row contains a key-value pair where the key is an SC message field constant and the value is the corresponding parameter value.

| # | Type | Code |
|---|------|------|
| 1 | SET | `ekk0081a010IN = new Object[][] { ... }` // Initialize 3-row input array for EKK0081A010 |
| 1.1 | SET | `{EKK0081A010CBSMsg.KEY_SVC_KEI_NO, (String)ccMsg.get("key_svc_kei_no")}` // Row 1: K-Opt Service Contract Number from service data [-> KEY_SVC_KEI_NO = "key_svc_kei_no"] |
| 1.2 | SET | `{EKK0081A010CBSMsg.KEY_GENE_ADD_DTM, ""}` // Row 2: K-Opt Generation Registration DTM set to empty string [-> KEY_GENE_ADD_DTM = "key_gene_add_dtm"] — empty because this is an inquiry, not a creation |
| 1.3 | SET | `{EKK0081A010CBSMsg.KEY_RSV_APLY_YMD, JPCBPCommon.getOpeDate(null)}` // Row 3: K-Opt Reservation Applied YMD from operation date utility [-> KEY_RSV_APLY_YMD = "key_rsv_aply_ymd"] |

**Block 3** — [EXEC] `Template-map parameters via editInMsg` (L379)

> Call `editInMsg` to transform the raw input array into a structured `HashMap` following the `EKK0081A010` template schema. The funcCode `"2"` specifies the mapping direction (inbound).

| # | Type | Code |
|---|------|------|
| 1 | SET | `paramMap = editInMsg(param, TEMPLATE_ID_EKK0081A010, "2", ekk0081a010IN)` // Template-map input array [-> TEMPLATE_ID = "EKK0081A010", funcCode = "2"] |

**Block 4** — [RETURN] `Return mapped parameter map` (L381)

> Return the template-mapped `paramMap` to the caller, which will use it to invoke the actual `EKK0081A010` Service Component.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return paramMap` // Return the mapped parameter map for SC invocation |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `key_svc_kei_no` | Field | K-Opt Service Contract Number — the primary key identifier for a service contract, used to retrieve or reference a specific contract in the system |
| `key_gene_add_dtm` | Field | K-Opt Generation Registration Datetime — the timestamp when a service contract generation (record version) was registered; left empty for inquiry operations |
| `key_rsv_aply_ymd` | Field | K-Opt Reservation Applied Year/Month/Day — the date on which a service reservation is applied, derived from the current operation date |
| `EKK0081A010` | SC Code | Service Contract Agreement Meeting (サービス契約照会) — a service component that handles service contract inquiry and agreement meeting data retrieval |
| `KKSV065102CC` | Constant | The CC service identifier for the smart batch supplementary service information common component; used as the key to extract service data from request parameters |
| KK-Opt | Acronym | K-Opticom — the telecommunications service provider; the system domain prefix used throughout the codebase |
| CC | Acronym | Common Component — a shared reusable Java class in the `com.fujitsu.futurity.bp.custom.common` package that provides cross-screen utility methods |
| SC | Acronym | Service Component — a modular service layer unit (e.g., `EKK0081A010SC`) that implements a specific business operation, typically invoked via template-based parameter mapping |
| CBS | Acronym | Component-Based System — the overall system architecture pattern used in the K-Opticom customer base system |
| TEMPLATE_ID | Field | The template identifier string that maps to a CAAN schema definition for parameter serialization/deserialization |
| `editInMsg` | Method | An internal template-mapping method that converts a raw `Object[][]` input array into a structured `HashMap` following the SC's message schema |
| `getOpeDate` | Method | A utility method in `JPCBPCommon` that returns the current operation date, used as the basis for date-sensitive SC parameters |
| CAANMsg | Class | A message template class (`com.fujitsu.futurity.model.base.CAANMsg`) used for SC request/response schema definitions |
| ServiceComponentRequestInvoker | Class | The BPM framework class responsible for invoking Service Components with mapped parameters and a session handle |
| SmtvlYoSanshoFuka | Japanese term | Smart Batch Supplementary Information — the business domain of this CC; handles supplementary service data retrieval for smart batch processing |
