# (DD30) Business Logic — JFUSvcOrderAddCC.setInMapEKK1081B501Search() [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.setInMapEKK1081B501Search()

This method is a **mapping helper** that configures the request parameter map for the "Order Issue Condition List Inquiry 2" (上りマッピング項目設定(オーダ発行条件一覧照会２)) screen operation. It is a private utility method that prepares the inbound data envelope so that the subsequent CBS (CBS component) call can execute a database query against the order issuance condition table. Specifically, it sets the **function code** to value `1` (indicating a search/inquiry operation) and then stores the **Option Service Contract Number** (`opSvcKeiNo`) into the request map using the key `KEY_OP_SVC_KEI_NO` (`"op_svc_kei_no"`). The method implements a **delegation pattern** — it delegates the function code setting to `setFuncCode()` and directly manipulates the request parameter map. It is called exclusively by the parent method that orchestrates the EKK1081B501 search flow (which initializes data, sets up error handling, invokes the SC via `executeSC`, and retrieves result templates). As a shared common component, it is reused across multiple screens that display the order issue condition list (KKSV0004, KKSV0050, KKSV0101, KKSV0136, KKSV0194, KKSV0211, KKSV0370, and others).

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["setInMapEKK1081B501Search(param, fixedText, opSvcKeiNo)"])
    STEP1["Set func code to 1 via setFuncCode(param, fixedText, FUNC_CD_1)"]
    STEP2["Get HashMap inMap from param.getData(fixedText)"]
    STEP3["Put opSvcKeiNo into inMap with key KEY_OP_SVC_KEI_NO = \"op_svc_kei_no\""]
    END(["Return void"])

    START --> STEP1
    STEP1 --> STEP2
    STEP2 --> STEP3
    STEP3 --> END
```

**Block descriptions:**

1. **Set Function Code** — Sets the function code to `1` (inquiry/search mode) on the request parameter map. This tells downstream CBS components that the request is a data retrieval operation rather than a screen display initialization (which uses code `2`).

2. **Retrieve Data Map** — Extracts the HashMap from the request parameter object under the `fixedText` key. This map serves as the shared data carrier between the calling business component and the CBS layer.

3. **Store Option Service Contract Number** — Puts the `opSvcKeiNo` (Option Service Contract Number) into the map using the key `"op_svc_kei_no"`. This key value is used as the WHERE clause filter in the CBS SQL query (see Section 4).

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `param` | `IRequestParameterReadWrite` | The request parameter object that acts as the universal data carrier throughout the request lifecycle. It holds the function code, search filters, and error flags as key-value pairs. This object is passed through all layers from the screen entry point down to the CBS component. |
| 2 | `fixedText` | `String` | A service message identifier / template key used to namespace data within the request parameter map. It identifies which CBS message template or screen context this operation belongs to (e.g., the EKK1081B501 template group). |
| 3 | `opSvcKeiNo` | `String` | The Option Service Contract Number (オプションサービス契約番号). This is the business key used to filter the order issuance condition list query. It represents a service contract number assigned to an optional/additional service associated with a primary service contract. |

**External state used:** None. This method does not read any instance fields. It is stateless.

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| U | `JFUSvcOrderAddCC.setFuncCode` | EKK1081B501SC | Request Parameter Map | Sets function code `FUNC_CD_1` on the request parameter map, indicating this is an inquiry/search operation. |
| R | `IRequestParameterReadWrite.getData` | EKK1081B501SC | Request Parameter Map | Retrieves the HashMap data carrier from the request parameter object, used to pass data to CBS. |
| C | `HashMap.put` | EKK1081B501SC | Request Parameter Map | Inserts the Option Service Contract Number into the map as a filter value for the CBS query. |

### Downstream CBS (EKK1081B501) — called by the parent method:

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `JSYejbEKK1081B501TPDA.invoke` | EKK1081B501TPDA | `KK_T_ODR_HAKKO_JOKEN` | Reads order issuance condition records (filtered by Option Service Contract Number from KK_T_ODR_INF_SKSI_WK join). |
| R | `JSYejbEKK1081B501TPDA.invoke` | EKK1081B501TPDA | `KK_T_ODR_INF_SKSI_WK` | Reads order information subsidiary data via inner join to resolve ODR_NAIYO_CD (order content code). |

**How this method fits into the call chain:**

1. `setInMapEKK1081B501Search` prepares the inbound map (function code + contract number filter).
2. The parent method then calls `executeSC(handle, param, fixedText, ...)` which invokes the CBS component `EKK1081B501`.
3. The CBS component's SQL facility `JSYejbEKK1081B501TPDA` reads from the `KK_T_ODR_HAKKO_JOKEN` and `KK_T_ODR_INF_SKSI_WK` tables, filtering by the `op_svc_kei_no` value set in this method.

## 5. Dependency Trace

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

Direct callers found: 1 methods.
Terminal operations from this method: `setFuncCode` [-], `getData` [R], `put` [C] (map operation).

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | CC: `JFUSvcOrderAddCC.executeEKK1081B501Search` (L358) | `executeEKK1081B501Search` -> `initData` -> `ignoreSearchError` -> `setInMapEKK1081B501Search` | `setFuncCode [U] Request Param Map`, `getData [R] Request Param Map` |

**Call chain detail for row 1:**
- The parent method `executeEKK1081B501Search` first initializes data via `initData(param, fixedText, IN_COLUMN_LIST_EKK1081B501)`, then configures error tolerance via `ignoreSearchError(param, fixedText)`, then calls `setInMapEKK1081B501Search(param, fixedText, inParamOpSvcKeiNo)` to populate the contract number filter.
- The caller passes `inParamOpSvcKeiNo` (extracted from the request map as `"sbop_svc_kei_no"`) as the `opSvcKeiNo` argument.

This is a **private method** — it is only invoked internally by `JFUSvcOrderAddCC` itself (line 358). No external screens or batches call this method directly. All screen entry points reach it indirectly through the `JFUSvcOrderAddCC` common component's orchestration methods.

## 6. Per-Branch Detail Blocks

This method has no conditional branches (no if/else, switch, or loop). It executes three sequential statements.

---

**Block 1** — [EXEC] `setFuncCode(param, fixedText, JPCModelConstant.FUNC_CD_1)` (L789)

> Sets the function code on the request parameter map to `FUNC_CD_1` (`"1"`). This indicates the CBS component that this is an inquiry/search operation (function code `1`) as opposed to a screen initialization (function code `2`). The function code influences the SQL generation path in the CBS component — code `1` enables WHERE clause filtering, while code `2` returns data without filters.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `setFuncCode(param, fixedText, JPCModelConstant.FUNC_CD_1)` // Set function code to inquiry mode [-> FUNC_CD_1="1"] |

---

**Block 2** — [EXEC] `HashMap inMap = (HashMap)param.getData(fixedText)` (L792)

> Retrieves the HashMap data carrier from the request parameter object using the `fixedText` template key. This HashMap serves as the shared data exchange container between the business component and the CBS layer. The cast to `HashMap` is a runtime type assertion that relies on the calling code having already initialized the data under this key.

| # | Type | Code |
|---|------|------|
| 1 | SET | `HashMap inMap = (HashMap) param.getData(fixedText)` // Retrieve the shared data map for this template context |

---

**Block 3** — [EXEC] `inMap.put(EKK1081B501CBSMsg.KEY_OP_SVC_KEI_NO, opSvcKeiNo)` (L795)

> Stores the Option Service Contract Number into the request map. The key `KEY_OP_SVC_KEI_NO` (resolved to `"op_svc_kei_no"`) is the exact column name used in the CBS SQL WHERE clause filter (`KK1551.OP_SVC_KEI_NO = ?`). This value is ultimately passed as a prepared statement parameter in `JSYejbEKK1081B501TPDA.invoke()` (line 138), filtering the `KK_T_ODR_HAKKO_JOKEN` table to return only order issue conditions associated with the specified Option Service Contract Number.

| # | Type | Code |
|---|------|------|
| 1 | SET | `inMap.put(EKK1081B501CBSMsg.KEY_OP_SVC_KEI_NO, opSvcKeiNo)` // Store Option Service Contract Number as query filter [-> KEY_OP_SVC_KEI_NO="op_svc_kei_no"] |

---

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `opSvcKeiNo` | Field | Option Service Contract Number — the business key identifying an optional/additional service contract. Used as the primary filter for querying order issuance conditions. |
| `fixedText` | Parameter | Service message / template identifier — namespaces data within the request parameter map, identifying which CBS message template group this operation belongs to. |
| `param` | Parameter | Request parameter read-write interface — the universal data carrier object that flows through all layers (screen -> CC -> CBS -> TPDA). Holds function codes, search filters, error flags, and result data. |
| FUNC_CD_1 | Constant | Function code "1" — indicates an inquiry/search operation in the CBS layer. Triggers WHERE clause filtering in SQL generation. |
| FUNC_CD_2 | Constant | Function code "2" — indicates screen initialization mode. Returns data without filter conditions. |
| KEY_OP_SVC_KEI_NO | Constant | Map key `"op_svc_kei_no"` — used to store and retrieve the Option Service Contract Number in CBS message maps. |
| EKK1081B501 | CBS Code | Order Issue Condition List Inquiry 2 — a CBS component that queries order issuance conditions filtered by Option Service Contract Number. |
| KK_T_ODR_HAKKO_JOKEN | Table | Order Issuance Condition table — stores order issuance conditions (オーダ発行条件), including service contract numbers, order codes, and service type information. |
| KK_T_ODR_INF_SKSI_WK | Table | Order Information Subsidy Work table — temporary/work table holding order content details, joined with KK_T_ODR_HAKKO_JOKEN to resolve the ODR_NAIYO_CD field. |
| EKK1081B501CBSMsg | Message Class | CBS message schema for EKK1081B501 — defines field keys (KEY_OP_SVC_KEI_NO, etc.) and structure constants for request/response messaging. |
| EKK1081B501CBSMsg1List | Message Class | List message schema for EKK1081B501 — defines the fields returned in each row of the order issue condition list result set (ODR_HAKKO_JOKEN_NO, SVC_KEI_NO, OP_SVC_KEI_NO, etc.). |
| JSYejbEKK1081B501TPDA | SQL Facility | Template DB Access component for EKK1081B501 — dynamically constructs and executes SQL queries against KK_T_ODR_HAKKO_JOKEN and KK_T_ODR_INF_SKSI_WK tables. |
| 上りマッピング項目設定 | Japanese term | Upstream mapping item setting — the Javadoc comment describing this method's purpose: configuring the inbound mapping for the search operation. |
| オーダ発行条件一覧照会２ | Japanese term | Order Issue Condition List Inquiry 2 — the screen/function name for querying the list of order issuance conditions. |
| オプションサービス契約番号 | Japanese term | Option Service Contract Number — a service contract number associated with optional/additional services (e.g., additional phone lines, premium services) linked to a primary contract. |
| スキーマ | Japanese term | Schema — the database schema or table group context for the EKK1081 family of components. |
| initData | Method | Data initialization method — clears and prepares the request parameter map with empty templates before population. |
| ignoreSearchError | Method | Error tolerance configuration method — suppresses search-related errors so the screen gracefully displays empty results instead of throwing exceptions. |
| executeSC | Method | Execute Service Component — the generic method that invokes CBS/SC components with the prepared request parameter map. |
