# Business Logic — JKKCourseRkWrisvcCallCC.getInvokeCBS() [34 LOC]

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

## 1. Role

### JKKCourseRkWrisvcCallCC.getInvokeCBS()

This method is a **shared service interface builder** for CAANMsg-based CBS (Central Business System) invocation. It is called by virtually every OPBPCheck (operation business-process check) class in the Fujitsu Futurity custom business-process layer — acting as the single entry-point factory that assembles the execution parameters for downstream service-component calls.

Its primary business operation is **request-context extraction and parameter assembly**: it reads session-level identifiers (transaction, use-case, operation, call-type) from the telegram header, client-side metadata (hostname, IP address, screen ID, operator ID) from the user-area control map, and builds a fully-formed parameter map that will be passed to the CAANMsg framework for CBS invocation.

The method implements the **Builder** and **Delegation** design patterns — it builds a `HashMap<String, Object>` parameter object from fragmented inputs (header, control map, templates) and delegates the actual CBS execution to the CAANMsg runtime by wiring in an empty `templateList` for service-interface routing.

**Crucially, the method itself performs NO business logic branching.** It is a deterministic, unconditional assembler that always executes the same linear sequence of 10 key-value extractions. The conditional routing is delegated to the `param.getData(fixedText)` call at the top, which the caller has already prepared based on its specific service type.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["getInvokeCBS(handle, param, fixedText)"])
    START --> GET_DATA["Get ccMsg from param.getData(fixedText)"]
    GET_DATA --> NEW_MAP["Create new HashMap paramMap"]
    NEW_MAP --> NEW_TEMPLATES["Create empty List<CAANMsg> templates"]
    NEW_TEMPLATES --> STEP1_HEADER["Section 1 - Get from Telegram Header"]
    STEP1_HEADER --> STEP1_A["Put TRANZACTION_ID_KEY = param.getTelegramID()"]
    STEP1_A --> STEP1_B["Put USECASE_ID_KEY = param.getUsecaseID()"]
    STEP1_B --> STEP1_C["Put OPERATION_ID_KEY = param.getOperationID()"]
    STEP1_C --> STEP1_D["Put CALL_TYPE_KEY = param.getCallType()"]
    STEP1_D --> STEP2_HEADER["Section 2 - Get from User Area Control Map"]
    STEP2_HEADER --> STEP2_A["Put CLIENT_HOST_NAME_KEY = param.getControlMapData(REQ_HOSTNAME)"]
    STEP2_A --> STEP2_B["Put CLIENT_IP_ADDRESS_KEY = param.getControlMapData(REQ_HOSTIP)"]
    STEP2_B --> STEP2_C["Put INVOKE_GAMEN_ID_KEY = param.getControlMapData(REQ_VIEWID)"]
    STEP2_C --> STEP2_D["Put OPERATOR_ID_KEY = param.getControlMapData(OPERATOR_ID)"]
    STEP2_D --> STEP3["Put TEMPLATE_LIST_KEY = templates.toArray(new CAANMsg[0])"]
    STEP3 --> RETURN(["Return paramMap"])
    RETURN --> END_NODE(["END"])
```

**Processing summary:**

1. **Retrieve cached parameter data** — Calls `param.getData(fixedText)` to get a pre-built HashMap (stored in `ccMsg`, not further used). This allows callers to attach arbitrary business-specific data before the interface build.
2. **Create parameter map** — Initializes a new `HashMap<String, Object>` that will hold all keys needed by the CBS invocation framework.
3. **Initialize empty template list** — Creates an empty `ArrayList<CAANMsg>` for service-interface routing (currently unused — templates are populated by the called CBS).
4. **Section 1: Extract from telegram header** — Extracts 4 identifiers from the telegram header: transaction ID, use-case ID, operation ID, and call-type discriminator.
5. **Section 2: Extract from user-area control map** — Extracts 4 client-side metadata fields: hostname, IP address, screen ID, and operator ID.
6. **Inject template list** — Adds the empty template array as `TEMPLATE_LIST_KEY`.
7. **Return** — Returns the assembled parameter map.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `handle` | `SessionHandle` | Session manager handle carrying the user's authenticated session context. Holds session-scoped state (credentials, locale, tenant context) used throughout the business process. In this method, it is accepted for the CAANMsg framework contract but not actively accessed. |
| 2 | `param` | `IRequestParameterReadWrite` | Request parameter object that carries the model group data and control map. It is the central data conduit between the screen layer and CBS. This method reads from it (via `getData`, `getTelegramID`, `getUsecaseID`, `getOperationID`, `getCallType`, `getControlMapData`) to extract transaction context and client metadata. |
| 3 | `fixedText` | `String` | User-defined arbitrary string used as a key/identifier. Passed to `param.getData(fixedText)` to retrieve a pre-stored parameter map, and used by callers to identify which service-component CC class is being invoked (e.g., `"KKSV079101CC"`, `"HapiePointKeiReSearchForRsvCC"`). |

**Fields/External State read:**
- `JCMConstants.*` — Static constant keys from the CAANMsg framework (transaction ID, use-case ID, operation ID, call-type, client hostname/IP/screen/operator, template list).
- `SCControlMapKeys.*` — Static constant keys from the control map framework (REQ_HOSTNAME, REQ_HOSTIP, REQ_VIEWID, OPERATOR_ID).
- `param` — `IRequestParameterReadWrite` methods: `getData(String)`, `getTelegramID()`, `getUsecaseID()`, `getOperationID()`, `getCallType()`, `getControlMapData(String)`.

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `param.getData(fixedText)` | - | - | Reads a pre-built HashMap from the request parameter keyed by `fixedText`. This is a read from the caller's cached parameter store. |
| R | `param.getTelegramID()` | - | - | Reads the telegram ID from the request header — identifies the business transaction type. |
| R | `param.getUsecaseID()` | - | - | Reads the use-case ID — identifies the business use-case scenario. |
| R | `param.getOperationID()` | - | - | Reads the operation ID — identifies the specific operation being performed. |
| R | `param.getCallType()` | - | - | Reads the service call-type discriminator — determines which CBS routing path to take. |
| R | `param.getControlMapData(String)` | - | - | Reads 4 control-map fields: hostname, IP address, screen ID, operator ID. |
| - | `templates.toArray(new CAANMsg[0])` | - | - | Converts the empty `ArrayList<CAANMsg>` to an array for the CAANMsg template list wire-up. |

**Classification notes:**

This method performs **zero** direct database or CBS service-component calls. It is purely a parameter-assembler that reads from the `param` object and returns a new `HashMap`. All actual CRUD operations are performed by the downstream CBS services that receive this parameter map. The method is effectively a **pass-through data aggregator**.

## 5. Dependency Trace

This method is called by every OPBPCheck class across all screens in the Fujitsu Futurity custom business-process layer. Below are all known callers organized by screen:

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Screen:KKSV0339 | `KKSV0339OPBPCheck.invokeCheck` -> `getInvokeCBS` -> `JKKCourseRkWrisvcCallCC.getInvokeCBS` | `jkknowsvcinfocc` downstream |
| 2 | Screen:KKSV0384 | `KKSV0384OPBPCheck.invokeCheck` -> `getInvokeCBS` -> `JKKCourseRkWrisvcCallCC.getInvokeCBS` | `jkkseikykeirrkilistcc` downstream |
| 3 | Screen:KKSV0568 | `KKSV0568OPBPCheck.invokeCheck` -> multiple `getInvokeCBS` calls | `jkkcancelsvcwribcc`, `jkkcanceluseplaceinfocc`, `jkkcancelsvckeimobilecc`, `jkkcancelsvckeitvcc`, `jkkcancelsvckeitelcc`, `jkkcancelsvckeinetcc`, `jkkcancelicjknsettecc`, `jkkaplyseiopsvckeicc`, `jkkaplytajgswribkeimskmcc`, `jkkcancelmskminfocc` (10 services) |
| 4 | Screen:KKSV0630 | `KKSV0630OPBPCheck.invokeCheck` -> `getInvokeCBS` -> `JKKCourseRkWrisvcCallCC.getInvokeCBS` | `jkkhapiepointkeiresearchforrsvcc` downstream |
| 5 | Screen:KKSV0781 | `KKSV0781OPBPCheck.invokeCheck` -> multiple `getInvokeCBS` calls | `jkksamescreenheadercc`, `jkkintrinfochgcfmcc` (2 services) |
| 6 | Screen:KKSV0791 | `KKSV0791OPBPCheck.invokeCheck` -> `getInvokeCBS` -> `JKKCourseRkWrisvcCallCC.getInvokeCBS` | `jkkopchrirekilistdlydcc` downstream |
| 7 | CRSV0025 | `CRSV0025OPBPCheck.invokeCheck` -> multiple `getInvokeCBS` calls | `jcrjudgengwordcc`, `jcraddtaiokrkdtlcallcc`, `jcraddhotvoiccc` (3 services) |
| 8 | CRSV0183 | `CRSV0183OPBPCheck.invokeCheck` -> `getInvokeCBS` -> `JKKCourseRkWrisvcCallCC.getInvokeCBS` | `jcrgetdenshifilectl1icc` downstream |
| 9 | SCSV0028 | `SCSV0028OPBPCheck.invokeCheck` -> `getInvokeCBS` -> `JKKCourseRkWrisvcCallCC.getInvokeCBS` | `jscsv002801cc` downstream |
| 10 | CNSV0045 | `CNSV0045OPBPCheck.invokeCheck` -> commented-out `getInvokeCBS` call | `jcn050hakkocc` (commented out, not active) |

**Key observations:**
- **KKSV0568** is the heaviest caller, invoking this method 10 times for different cancellation-related services (service cancellation, usage-place cancellation, mobile/service cancellations for voice/TV/TEL/NET, ICJ kn-settle cancellation, application-sei-kei cancellation, charge-group cancellation, MSKM information cancellation).
- This method is used across **service cancellation** (KKSV0568), **service inquiry** (KKSV0339), **billing inquiry** (KKSV0384), **happiness-point search** (KKSV0630), **same-screen header / internal-info change** (KKSV0781), **order-history** (KKSV0791), and several CRSV/SCSV screens.
- Every call follows the same pattern: `tempMap = jxxx.getInvokeCBS(handle, param, fixedText)` where `fixedText` identifies the specific CC class name.

## 6. Per-Branch Detail Blocks

This method has **no conditional branches** (no if/else, switch, loop, or try/catch). It is a fully linear sequence.

**Block 1** — LINEAR SEQUENCE `(no branching)` (L128–161)

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | EXEC | `param.getData(fixedText)` | Get pre-built HashMap from request parameter. The result is stored in `ccMsg` (unused beyond retrieval). This allows the caller to attach business-specific data before interface building. |
| 2 | SET | `paramMap = new HashMap<String, Object>()` | Create new empty parameter map to assemble CBS invocation keys. |
| 3 | SET | `templates = new ArrayList<CAANMsg>()` | Initialize empty template list for CAANMsg service-interface routing. |
| 4 | EXEC | `param.getTelegramID()` | Read transaction ID from telegram header. |
| 5 | SET | `paramMap.put(JCMConstants.TRANZACTION_ID_KEY, param.getTelegramID())` | **【取得元：電文ヘッド(ヘッダ)】電文ID** — Key: transaction ID — stores the telegram/transaction identifier. |
| 6 | EXEC | `param.getUsecaseID()` | Read use-case ID from telegram header. |
| 7 | SET | `paramMap.put(JCMConstants.USECASE_ID_KEY, param.getUsecaseID())` | **【取得元：電文ヘッド(ヘッダ)】ユーザ(use-case)ID** — Key: use-case ID — stores the business use-case identifier. |
| 8 | EXEC | `param.getOperationID()` | Read operation ID from telegram header. |
| 9 | SET | `paramMap.put(JCMConstants.OPERATION_ID_KEY, param.getOperationID())` | **【取得元：電文ヘッド(ヘッダ)】オペレーションID** — Key: operation ID — stores the operation identifier. |
| 10 | EXEC | `param.getCallType()` | Read call-type discriminator from telegram header. |
| 11 | SET | `paramMap.put(JCMConstants.CALL_TYPE_KEY, param.getCallType())` | **【取得元：電文ヘッド(ヘッダ)】サービス呼び出し区分** — Key: call-type — determines CBS routing path. |
| 12 | EXEC | `param.getControlMapData(SCControlMapKeys.REQ_HOSTNAME)` | Read request hostname from user-area control map. |
| 13 | SET | `paramMap.put(JCMConstants.CLIENT_HOST_NAME_KEY, param.getControlMapData(SCControlMapKeys.REQ_HOSTNAME))` | **【取得元：ユーザエリア(コントロールマップ)】依頼元ホスト名** — Key: client hostname — identifies the originating host. |
| 14 | EXEC | `param.getControlMapData(SCControlMapKeys.REQ_HOSTIP)` | Read request client IP address from control map. |
| 15 | SET | `paramMap.put(JCMConstants.CLIENT_IP_ADDRESS_KEY, param.getControlMapData(SCControlMapKeys.REQ_HOSTIP))` | **【取得元：ユーザエリア(コントロールマップ)】依頼元IPアドレス** — Key: client IP address — identifies the originating IP. |
| 16 | EXEC | `param.getControlMapData(SCControlMapKeys.REQ_VIEWID)` | Read request screen ID from control map. |
| 17 | SET | `paramMap.put(JCMConstants.INVOKE_GAMEN_ID_KEY, param.getControlMapData(SCControlMapKeys.REQ_VIEWID))` | **【取得元：ユーザエリア(コントロールマップ)】依頼元画面ID** — Key: invoking screen ID — identifies the originating screen. |
| 18 | EXEC | `param.getControlMapData(SCControlMapKeys.OPERATOR_ID)` | Read operator ID from control map. |
| 19 | SET | `paramMap.put(JCMConstants.OPERATOR_ID_KEY, param.getControlMapData(SCControlMapKeys.OPERATOR_ID))` | **【取得元：ユーザエリア(コントロールマップ)】オペレータID** — Key: operator ID — identifies the acting operator. |
| 20 | EXEC | `templates.toArray(new CAANMsg[0])` | Convert empty CAANMsg list to array. |
| 21 | SET | `paramMap.put(JCMConstants.TEMPLATE_LIST_KEY, templates.toArray(new CAANMsg[0]))` | **チェック用サービスインタフェース** — Key: template list — passes an empty array for CBS service-interface wire-up. |
| 22 | RETURN | `return paramMap` | Return the fully assembled parameter map. |

**Data sources summary (source code comments):**

| Comment (JP) | Translation | Section |
|---|---|---|
| **【取得元：電文ヘッド(ヘッダ)】** | Source: Telegram Header (Header) | Lines 137–141 |
| **【取得元：ユーザエリア(コントロールマップ)】** | Source: User Area (Control Map) | Lines 144–148 |
| **チェック用サービスインタフェース** | Service interface for checking | Lines 150–151 |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `getInvokeCBS` | Method | Invoke CBS — builds the parameter map for invoking a Central Business System (CBS) service component via CAANMsg |
| `ccMsg` | Variable | CAANMsg Context — holds the pre-built HashMap retrieved from the request parameter (unused beyond retrieval) |
| `paramMap` | Variable | Parameter Map — the assembled HashMap containing all keys needed for CBS invocation |
| `templates` | Variable | CAANMsg Templates — the empty ArrayList used for service-interface routing |
| CAANMsg | Acronym | CAANMsg — Fujitsu's asynchronous message framework used for CBS service invocation in the Futurity platform |
| `TRANZACTION_ID_KEY` | Constant | Transaction ID key — maps to the telegram/transaction identifier in JCMConstants |
| `USECASE_ID_KEY` | Constant | Use-Case ID key — maps to the business use-case identifier in JCMConstants |
| `OPERATION_ID_KEY` | Constant | Operation ID key — maps to the operation identifier in JCMConstants |
| `CALL_TYPE_KEY` | Constant | Call-Type key — maps to the service-call-type discriminator in JCMConstants |
| `CLIENT_HOST_NAME_KEY` | Constant | Client Hostname key — maps to the originating hostname in JCMConstants |
| `CLIENT_IP_ADDRESS_KEY` | Constant | Client IP Address key — maps to the originating IP address in JCMConstants |
| `INVOKE_GAMEN_ID_KEY` | Constant | Invoking Screen ID key — maps to the originating screen ID in JCMConstants |
| `OPERATOR_ID_KEY` | Constant | Operator ID key — maps to the acting operator ID in JCMConstants |
| `TEMPLATE_LIST_KEY` | Constant | Template List key — maps to the CAANMsg template list array in JCMConstants |
| `REQ_HOSTNAME` | Constant | Request Hostname — control map key for the originating hostname in SCControlMapKeys |
| `REQ_HOSTIP` | Constant | Request Host IP — control map key for the originating IP address in SCControlMapKeys |
| `REQ_VIEWID` | Constant | Request View ID — control map key for the originating screen ID in SCControlMapKeys |
| `OPERATOR_ID` | Constant | Operator ID — control map key for the operator identifier in SCControlMapKeys |
| `SessionHandle` | Type | Session manager handle — carries session-scoped state (credentials, locale, tenant) for the user's current session |
| `IRequestParameterReadWrite` | Type | Request parameter interface — central data conduit between the screen layer and CBS, providing model groups and control map data |
| `fixedText` | Parameter | Fixed text — arbitrary user-defined string used as a cache key and service-class identifier |
| CBS | Acronym | Central Business System — the backend business processing engine |
| OPBPCheck | Acronym | Operation Business Process Check — the check-layer classes (e.g., `KKSV0791OPBPCheck`) that run business-process validation before CBS invocation |
| CC | Acronym | Change Controller / Common Component — shared component classes in the custom layer |
| SCControlMapKeys | Class | Service Control Map Keys — constant definitions for control map field names |
| JCMConstants | Class | JCM Constants — constant definitions for CAANMsg parameter keys |
| 電文ヘッド | Japanese term | Telegram Header — the header section of a message containing routing/identification metadata (transaction ID, use-case ID, operation ID, call-type) |
| ユーザエリア | Japanese term | User Area — the user-space portion of the control map containing client-side metadata (hostname, IP, screen ID, operator) |
| カンチンようサ | Japanese term | Service Interface for Checking — the CAANMsg service interface wire-up for CBS invocation |
| 割引 | Japanese term | Discount — refers to discount-related check processing (per Javadoc) |
| SC Code | Term | Service Component Code — identifier for a CBS service component (e.g., `EKK0361A010SC`); not used directly in this method but in downstream calls |
| KKSV* | Pattern | Screen class naming — classes prefixed with `KKSV` followed by 4 digits represent screen controller classes |
| CRSV* | Pattern | Screen class naming — classes prefixed with `CRSV` followed by 4 digits represent screen controller classes (likely contract/registration screens) |
| SCSV* | Pattern | Screen class naming — classes prefixed with `SCSV` followed by 4 digits represent screen controller classes |
| CNSV* | Pattern | Screen class naming — classes prefixed with `CNSV` followed by 4 digits represent screen controller classes |
