# (DD27) Business Logic — JFUSvcOrderAddCC.setInMapOpSvcIspSearch() [11 LOC]

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

## 1. Role

### JFUSvcOrderAddCC.setInMapOpSvcIspSearch()

This method prepares and populates the request mapping data for the **Option Service Contract (ISP) Unilateral Consultation** screen (`サブオプションサービス契約<ISP>一意照会` — ISP option service contract unique lookup). It is a **setter/dispatch utility** within the Fujitsu Futurity order-fulfillment platform, responsible for initializing the in-map data structure that downstream services and CBS (Component Business Service) layers consume during ISP option service contract data retrieval.

Specifically, it performs three sequential steps: (1) sets the function code to **Cancel (機能コード 2: キャンセル)**, indicating the request operates in a read/cancel-safe mode rather than a write mode; (2) retrieves the existing `HashMap` user-data payload bound to the given service message key from the request parameter object; and (3) inserts the **KENPU Option Service Contract Number** (`ＫＥＮＰＵオプションサービス契約番号` — KENPU is the Fujitsu internal order management system) into the map under the CBS message key `KEY_OP_SVC_KEI_NO`. This method implements the **builder pattern** at a micro level: it constructs the minimal request payload required for the ISP contract lookup CBS. It is a **shared utility** called from ISP option service-related screen controllers (e.g., KKSV0004 and similar screens) as part of their data-initialization flow. The method has no conditional branches — its control flow is strictly linear.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["setInMapOpSvcIspSearch(param, fixedText, opSvcKeiNo)"])
    
    START --> STEP1["Set FuncCode to Cancel
setFuncCode(param, fixedText, FUNC_CD_2)"]
    
    STEP1 --> STEP2["Get HashMap User Data
HashMap inMap = (HashMap)param.getData(fixedText)"]
    
    STEP2 --> STEP3["Put KENPU Option Service Contract Number
inMap.put(KEY_OP_SVC_KEI_NO, opSvcKeiNo)"]
    
    STEP3 --> END_NODE(["Return (void) / Next"])
    
    START -.-> STEP1 -.-> STEP2 -.-> STEP3 -.-> END_NODE
```

**CRITICAL — Constant Resolution:**

| Constant | Resolved Value | Source Location | Business Meaning |
|----------|---------------|-----------------|------------------|
| `JPCModelConstant.FUNC_CD_2` | `"2" (Cancel)` | `JPCModelConstant.java` | Function code 2 — Cancel/Read mode for CBS requests |
| `EKK0361A010CBSMsg.KEY_OP_SVC_KEI_NO` | `"opSvcKeiNo"` | `EKK0361A010CBSMsg.java` | CBS message key for Option Service Contract Number |

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `param` | `IRequestParameterReadWrite` | The request parameter carrier object that holds user data, message context, and function code for the current CBS invocation. It is shared across the call chain and acts as the primary data conduit between screen controllers and CBS layers. |
| 2 | `fixedText` | `String` | The service message identifier/key used to namespace the user data within the request parameter. It identifies which service message's data map to read from (e.g., a message code such as `"trgt_data"`). |
| 3 | `opSvcKeiNo` | `String` | The **KENPU Option Service Contract Number** — the unique identifier for an option service contract line item in the KENPU (Fujitsu internal order management) system. This value is placed into the in-map for the ISP contract lookup CBS to query the correct option service record. |

**External State / Instance Fields:**
- None — this method is fully stateless and depends only on its parameters.

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `JFUBaseCC.setFuncCode` | (Internal) | - | Calls `setFuncCode` to set the function code (Cancel) in the request parameter |
| R | `IRequestParameterReadWrite.getData` | - | - | Retrieves the user-data `HashMap` from the request parameter |
| W | HashMap.put | - | In-Memory Map | Writes the option service contract number into the in-map |

### Method Call Analysis:

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `setFuncCode(param, fixedText, JPCModelConstant.FUNC_CD_2)` | (Internal) | - | Sets the function code to Cancel (FUNC_CD_2=2), configuring the CBS request to operate in read/cancel-safe mode |
| R | `param.getData(fixedText)` | - | - | Reads the HashMap containing user data bound to the service message key |
| W | `inMap.put(EKK0361A010CBSMsg.KEY_OP_SVC_KEI_NO, opSvcKeiNo)` | - | In-Memory Map | Inserts the KENPU Option Service Contract Number into the user data map for the ISP contract lookup CBS |

**Note:** This method does **not** directly invoke any SC (Service Component) or CBS (Component Business Service) endpoints. It only prepares the request payload. The actual database operations (reads/writes to option service contract tables) are performed by the CBS layer downstream after this method returns.

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Internal (private method) | Called from within `JFUSvcOrderAddCC` class — specific screen controllers not identified in current search scope | `setFuncCode [-]`, `getData [R]`, `inMap.put [W]` |

**Notes:**
- This method is declared `private`, so it is only called internally within the `JFUSvcOrderAddCC` class.
- No public entry points (screens, batches, or CBS) were found that call this method directly in the searched scope.
- Terminal operations from this method: `setFuncCode [-]` (function code setter), `getData [R]` (user data retrieval), `inMap.put [W]` (in-memory write).

## 6. Per-Branch Detail Blocks

> This method has a strictly linear control flow with no conditional branches. All operations execute sequentially.

**Block 1** — [LINEAR EXECUTION] `Set Function Code to Cancel` (L984)

> Sets the function code to Cancel (機能コード 2: キャンセル — Function Code 2: Cancel), configuring the CBS request to operate in read/cancel-safe mode.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `setFuncCode(param, fixedText, JPCModelConstant.FUNC_CD_2)` // Set function code to Cancel [-> FUNC_CD_2="2"] |

**Block 2** — [LINEAR EXECUTION] `Retrieve User Data HashMap` (L987)

> ユーザデータ取得 (Acquire user data) — Retrieves the existing `HashMap` from the request parameter object that holds the user data payload for the service message identified by `fixedText`.

| # | Type | Code |
|---|------|------|
| 1 | SET | `HashMap inMap = (HashMap)param.getData(fixedText)` // Get user data HashMap from request parameter |

**Block 3** — [LINEAR EXECUTION] `Insert KENPU Option Service Contract Number` (L990)

> ＫＥＮＰＵオプションサービス契約番号 (KENPU Option Service Contract Number) — Places the option service contract number into the in-map under the CBS message key so the downstream ISP contract lookup CBS can query the correct record.

| # | Type | Code |
|---|------|------|
| 1 | SET | `inMap.put(EKK0361A010CBSMsg.KEY_OP_SVC_KEI_NO, opSvcKeiNo)` // Put KENPU option service contract number into in-map [-> KEY_OP_SVC_KEI_NO="opSvcKeiNo"] |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `opSvcKeiNo` | Field | Option Service Contract Number — unique identifier for an option service contract line item in the order fulfillment system |
| `fixedText` | Field | Service message key/identifier — namespaces the user data within the request parameter for CBS invocation |
| `param` | Field | Request parameter carrier — the shared data object that transports user data and configuration between screen controllers and CBS layers |
| `inMap` | Field | In-memory HashMap — the mutable data map holding user data for the current CBS request |
| FUNC_CD_2 | Constant | Function Code 2 — Cancel/Read mode flag, indicating the CBS should operate in a read-safe or cancel-safe state rather than perform writes |
| KENPU | Acronym | Fujitsu internal Order Management System — handles order processing, contract management, and service fulfillment workflows |
| ISP | Business term | Internet Service Provider — refers to ISP-related option services in the telecom order fulfillment domain |
| Option Service Contract | Business term | A contract for additional optional services (e.g., extra features, equipment, or service tiers) attached to a primary service order |
| CBS | Acronym | Component Business Service — the enterprise service layer that handles database CRUD operations and business logic execution |
| SC | Acronym | Service Component — a code-level identifier for specific CBS endpoints (e.g., `EKK0361A010SC`) |
| EKK0361A010CBSMsg | Class | CBS message constant class — contains string keys used to populate request/response maps for the ISP option service contract CBS |
| `KEY_OP_SVC_KEI_NO` | Constant | CBS message key for the Option Service Contract Number — used to pass the contract number to the CBS layer |
| `JPCModelConstant.FUNC_CD_2` | Constant | Function code constant for Cancel mode — sets the request context to read-safe operation |
| `setFuncCode` | Method | Utility method that sets the function code in the request parameter, controlling the CBS operation mode |
| IRequestParameterReadWrite | Interface | Contract for the request parameter object that provides read/write access to user data and metadata during CBS invocation |
