# (DD28) Business Logic — JFUSvcOrderAddCC.setInMapSbopSvcSearch() [11 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `com.fujitsu.futurity.bp.custom.common.JFUSvcOrderAddCC` |
| Layer | CC/Common Component — a common component class extending `JFUBaseNetChgCommonCC`, providing shared mapping and service orchestration utilities for the telecom service order management domain |
| Module | `common` (Package: `com.fujitsu.futurity.bp.custom.common`) |

## 1. Role

### JFUSvcOrderAddCC.setInMapSbopSvcSearch()

This method prepares and populates the in-map data for querying the **sub-option service contract list screen** (サブオプションサービス契約一覧照会). It is a private mapping utility used exclusively within the `addMladSvcOrder` service component of the email address change / mailbox capacity expansion service order flow. The method performs two core tasks: it sets the function code to `FUNC_CD_1` (Cancel/キャンセル mode) so downstream processing understands the operation context, and it injects the optional service contract number (`opSvcKeiNo`) into the request map under the key `key_op_svc_kei_no`, enabling the subsequent service call (`executeSC` for template `EKK0401B001`) to retrieve sub-option service contract details. This method acts as a data preparation bridge between the caller's business logic (which decides when to query sub-option service contracts) and the SC layer (which fetches the actual data). It implements a simple mapping/injection pattern — no conditional branches, no external I/O — making it a pure data-population utility with 11 lines of code.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["setInMapSbopSvcSearch"])
    STEP1["setFuncCode param fixedText FUNC_CD_1"]
    STEP2["param.getData fixedText"]
    STEP3["HashMap inMap cast"]
    STEP4["inMap.put KEY_OP_SVC_KEI_NO opSvcKeiNo"]
    END_NODE(["Return / Next"])

    START --> STEP1 --> STEP2 --> STEP3 --> STEP4 --> END_NODE
```

**Step-by-step processing:**

1. **Set Function Code** — Calls `setFuncCode(param, fixedText, JPCModelConstant.FUNC_CD_1)` to set the function code to `1` (Cancel/キャンセル). This signals to all downstream components that this operation runs in cancel mode, which affects validation rules, screen rendering, and data retrieval behavior.

2. **Retrieve User Data HashMap** — Calls `param.getData(fixedText)` to obtain the HashMap that carries user input data for the given service message key. This map is the shared data structure between the CC layer and the SC (Service Component) layer.

3. **Cast to HashMap** — Casts the returned Object to `HashMap` to enable key-value operations.

4. **Inject Optional Service Contract Number** — Puts the `opSvcKeiNo` parameter value into the inMap under the key `key_op_svc_kei_no` (`[-> KEY_OP_SVC_KEI_NO="key_op_svc_kei_no"]`). This is the sole data injection point of the method — the optional service contract number becomes available for the SC layer to query sub-option service contracts.

5. **Return** — Returns void. Control flows back to the caller (`addMladSvcOrder`).

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `param` | `IRequestParameterReadWrite` | Request parameter management object carrying the entire request context — function codes, user data maps, and cross-method data. Used by `getData()` and `setData()` throughout the service order flow to pass structured data between CC methods and SC calls. |
| 2 | `fixedText` | `String` | Service message identifier / data area key that scopes the parameter data. This string is used as the lookup key when retrieving the HashMap from `param.getData()`, ensuring data isolation between different business operations in the same request. |
| 3 | `opSvcKeiNo` | `String` | **Optional Service Contract Number** (オプションサービス契約番号) — the unique identifier of an optional service contract. This value is injected into the inMap so the downstream SC (`EKK0401B001`) can query the sub-option service contract list filtered by this contract number. Typically carries values like "OP-000001" format strings. |

**External state read:**
- `JPCModelConstant.FUNC_CD_1` — Constant value `"1"` (Cancel function code), imported from `JPCModelConstant`.
- `EKK0401B001CBSMsg.KEY_OP_SVC_KEI_NO` — Constant value `"key_op_svc_kei_no"` (map key for optional service contract number), imported from `EKK0401B001CBSMsg`.

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `setFuncCode` | - | - | Calls `setFuncCode(param, fixedText, JPCModelConstant.FUNC_CD_1)` — sets the function code to 1 (Cancel mode) in the request parameter. This is a parameter metadata operation, not a data access operation. |
| R | `param.getData` | - | - | Reads user data HashMap from request parameter using `fixedText` as key. Returns the map that will receive the optional service contract number. |

### Terminal operations from this method:

| CRUD | Method | Entity / DB | Description |
|------|--------|-------------|-------------|
| - | `setFuncCode` | - | Sets function code parameter (meta-operation) |
| R | `param.getData` | - | Retrieves user data HashMap from request parameter |

**Note:** This method itself does not execute any SC calls or direct database operations. It only prepares the in-map data. The actual data retrieval (R operation on sub-option service contract tables) is performed by the **caller** (`addMladSvcOrder`) through the `executeSC(handle, param, fixedText, TEMPLATE_ID_EKK0401B001, ...)` call that follows immediately after `setInMapSbopSvcSearch`.

## 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: `setFuncCode` [-], `getData` [R]

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | CC: JFUSvcOrderAddCC.addMladSvcOrder | `KKSV0275OP.addMladSvcOrder` -> `JFUSvcOrderAddCC.addMladSvcOrder` -> `setInMapSbopSvcSearch` | `setFuncCode [-]`, `getData [R]` |

**Caller details:**

The method is called from **`JFUSvcOrderAddCC.addMladSvcOrder`** (the same class) in two distinct conditional branches:

1. **When `ACTION_NAME_EXPAND.equals(inParamActionName)` and `inParamSbopSvcKeiNo == null`** (line ~688): This handles the case where a mailbox capacity expansion action is performed without a sub-option service contract number. The method prepares the map for querying the sub-option service contract list so the caller can display available options on screen.

2. **In the order issuance path** (line ~535): When an order needs to be issued and no sub-option service contract number is present, the method initializes the search map for the sub-option service contract list screen (`EKK0401B001`).

**Screen entry point flow:**
`KKSV0275` (Mail Address Change Screen) / `KKSV0285` (related screen) → `KKSV0275OP.addMladSvcOrder` → `JFUSvcOrderAddCC.addMladSvcOrder` → `setInMapSbopSvcSearch`

**Downstream flow:**
`setInMapSbopSvcSearch` → `executeSC(handle, param, fixedText, TEMPLATE_ID_EKK0401B001, ...)` → Queries sub-option service contract data (SC Code: `EKK0401B001SC`)

## 6. Per-Branch Detail Blocks

### Block 1 — [SET/EXEC] Function Code Configuration (L1032)

> Sets the function code to `1` (Cancel mode) in the request parameter. This is a metadata operation that configures downstream processing behavior.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | SET | `setFuncCode(param, fixedText, JPCModelConstant.FUNC_CD_1)` | Sets function code to `1` (Cancel/キャンセル mode) in the request parameter. The `FUNC_CD_1` constant represents the cancel operation context, which affects validation, error handling, and data retrieval behavior for the entire request. |

### Block 2 — [CAST] User Data HashMap Retrieval (L1035)

> Retrieves the user data HashMap from the request parameter using the `fixedText` service message key. This map serves as the shared data container between the CC layer and the SC layer.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | EXEC | `HashMap inMap = (HashMap)param.getData(fixedText)` | Retrieves the HashMap carrying user data for the given service message key. This is the data structure that will be passed to the SC layer for the `EKK0401B001` service call. The `fixedText` parameter acts as the namespace key to isolate data between concurrent or sequential operations. |

### Block 3 — [SET] Inject Optional Service Contract Number (L1038)

> Injects the optional service contract number into the inMap under the key `key_op_svc_kei_no`. This is the sole data preparation step — the SC layer uses this key to filter and retrieve sub-option service contract records.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | SET | `inMap.put(EKK0401B001CBSMsg.KEY_OP_SVC_KEI_NO, opSvcKeiNo)` | Stores the optional service contract number in the request map. The key resolves to `key_op_svc_kei_no` [-> `EKK0401B001CBSMsg.KEY_OP_SVC_KEI_NO="key_op_svc_kei_no" (EKK0401B001CBSMsg.java:227)`]. This allows the `EKK0401B001SC` service call to look up sub-option service contracts matching this contract number. |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `opSvcKeiNo` | Field | Optional Service Contract Number (オプションサービス契約番号) — unique identifier for an optional service contract attached to a main service contract. Used to query sub-option service contract details. |
| `key_op_svc_kei_no` | Field | Map key for optional service contract number (`"key_op_svc_kei_no"`). Used as the HashMap entry key in the request parameter data structure. |
| FUNC_CD_1 | Constant | Function code `1` — represents Cancel (キャンセル) mode. When set, indicates the operation runs in a cancel/query context rather than a full registration context. |
| `fixedText` | Field | Service message identifier — used as a data area key/scoped namespace in the request parameter to isolate data between different business operations. |
| sub-option service contract | Business term | A secondary service contract (サブオプションサービス契約) attached to a primary service contract. Examples include additional features, supplementary services, or add-on packages. |
| sub-option service contract list inquiry | Business term | The screen operation (サブオプションサービス契約一覧照会) that displays a list of sub-option service contracts associated with a given optional service contract. |
| inMap | Field | Internal HashMap — the shared data structure carrying user data between CC (Common Component) methods and SC (Service Component) calls. |
| SC (Service Component) | Technical term | Service Component — a layer component that handles business logic and database operations for a specific screen/function. Identified by SC codes like `EKK0401B001SC`. |
| CC (Common Component) | Technical term | Common Component — a shared utility class providing cross-cutting methods (mapping, initialization, validation) used by multiple screens or CBS layers. |
| SOD | Business term | Service Order Data — the core entity representing a service order in the telecom order fulfillment system. |
| `EKK0401B001` | Code | SC code for sub-option service contract list inquiry — the service component that queries sub-option service contract records. |
| MAILBOX capacity expansion | Business term | A service order type that increases the email storage capacity for a subscriber. This is the primary business context in which `setInMapSbopSvcSearch` is called. |
| `ACTION_NAME_EXPAND` | Constant | Action name constant representing the "expand" action — triggers mailbox capacity expansion logic in the service order flow. |
