# (DD26) Business Logic — JFUSvcOrderAddCC.setInMapOdrSetSearch() [14 LOC]

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

## 1. Role

### JFUSvcOrderAddCC.setInMapOdrSetSearch()

This method prepares the **upper mapping (上りマッピング) parameter map** for the **Order Setup List Inquiry (オーダ設定一覧照会)** screen operation. It acts as a data-injection utility that populates a `HashMap` with the service contract number (`svcKeiNo`) and email address (`mlad`) so that downstream Service Component (SC) calls can retrieve the correct order setup records.

The method implements a **mapping builder pattern** — it retrieves an existing data map from the request context, injects the two inquiry keys, and returns without invoking any CBS (Common Business Service) or database layer. It carries **no conditional branches** and is a pure data-preparation step that ensures the subsequent `executeSC()` call receives properly-keyed search parameters.

Within the larger system, this method serves as a **shared CC (Custom Component) utility** used exclusively by the KKSV0004 service order add screen. Its role is to translate business-level input parameters (service contract number and customer email) into the map-based contract expected by the SC query layer.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["setInMapOdrSetSearch"])
    STEP1["SET func_code = 1"]
    STEP2["EXEC setFuncCode with FUNC_CD_1"]
    STEP3["EXEC param.getData(fixedText)"]
    STEP4["SET inMap = HashMap from param.getData"]
    STEP5["SET inMap.put svc_kei_no key = svcKeiNo"]
    STEP6["SET inMap.put mlad key = mlad"]
    END_NODE(["Return void / Next"])

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

**Block description:** This method follows a linear, branchless flow:

1. **Set function code** — calls `setFuncCode()` with `JPCModelConstant.FUNC_CD_1 = "1"` to register this operation as Function Code 1 (standard inquiry/display operation) in the request parameter context.
2. **Retrieve data map** — calls `param.getData(fixedText)` to obtain the `HashMap` used as the input carrier for downstream SC calls. The `fixedText` parameter serves as the map key.
3. **Inject service contract number** — puts the `svcKeiNo` value into the map under the key `"key_svc_kei_no"` (`EKK1041B001CBSMsg.KEY_SVC_KEI_NO`), identifying the service contract to query.
4. **Inject email address** — puts the `mlad` value into the map under the key `"key_mlad"` (`EKK1041B001CBSMsg.KEY_MLAD`), identifying the customer email associated with the contract.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `param` | `IRequestParameterReadWrite` | Request parameter carrier that holds screen-level data exchanged between the UI, CC components, and SC layers. This method reads from it via `getData()` and writes to it via `put()` on the retrieved map. |
| 2 | `fixedText` | `String` | Service message identifier / data map key used to select which data map to retrieve from the request parameter. It determines the key under which the HashMap is stored and retrieved within `param`. |
| 3 | `svcKeiNo` | `String` | Service contract number — the unique identifier for a telecom service contract line item. This is the primary search key passed to the SC to fetch the order setup records for a specific contract. |
| 4 | `mlad` | `String` | Customer email address — used as a secondary search/correlation key alongside the service contract number. The `mlad` field (Japanese: メールアドレス) identifies the email contact associated with the service contract for inquiry purposes. |

**External state / instance fields read:** None. This method is stateless — it reads no instance fields and relies entirely on its parameters.

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `setFuncCode` | JPCModelConstant | - | Calls `setFuncCode` on `param` with `FUNC_CD_1 = "1"` to set the function code for function tracking in the request parameter context |
| R | `param.getData` | - | - | Reads the HashMap from the request parameter using `fixedText` as the map key |
| W | `inMap.put` | - | - | Writes `svc_kei_no` and `mlad` entries into the retrieved HashMap |

**Classification rationale:**
- This method performs **no database operations** directly. It is purely a parameter-mapping utility.
- `setFuncCode` — **Utility call** (no CRUD), registers the function code `"1"` (display/inquiry) in the request context.
- `param.getData` — **Read** of the request parameter storage, retrieves the pre-initialized HashMap.
- `inMap.put` — **Write** to the local HashMap (in-memory data structure, not a persistent store).

**SC Code and Entity/DB:** This method does not invoke any SC or CBS layer directly. The SC calls that consume its output are made by the caller (KKSV0004) via `executeSC()` using `TEMPLATE_ID_5`.

## 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], `put` [W], `put` [W]

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Screen:KKSV0004 | `executeSC(handle, param, fixedText, ...)` -> `setInMapOdrSetSearch(param, fixedText, inParamSvcKeiNo, inParamChgBfMlad)` | `setFuncCode [-]`, `getData [R]`, `put [W]`, `put [W]` |

**Caller analysis (KKSV0004):**
- **KKSV0004** is the Service Order Add screen (`サービス注文追加`).
- Within its main flow (the "new method" branch after sending request completion), it processes:
  1. Option Service Contract <ISP> Inquiry (`オプションサービス契約<ISP>一覧照会`)
  2. **Order Setup List Inquiry** (`オーダ設定一覧照会`) — where this method is invoked.
- The call occurs at **line 617** of `JFUSvcOrderAddCC.java`: `setInMapOdrSetSearch(param, fixedText, inParamSvcKeiNo, inParamChgBfMlad)`
- After this method returns, `executeSC()` is called with `TEMPLATE_ID_5` and `TEMPLATE_ID_5_DETAIL` to execute the actual SC query, then `getTemplateList()` retrieves the results.

## 6. Per-Branch Detail Blocks

> This method contains no conditional branches (no if/else, switch, or loops). The entire method is a single linear block.

**Block 1** — [LINEAR EXECUTION] (L1071–L1084)

> Sets function code, retrieves the data map from the request parameter, and injects the service contract number and email address into the map for downstream SC query consumption.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `setFuncCode(param, fixedText, JPCModelConstant.FUNC_CD_1)` // Set function code to "1" (display/inquiry operation) [-> JPCModelConstant.FUNC_CD_1="1" (JPCModelConstant.java:29)] |
| 2 | EXEC | `HashMap inMap = (HashMap)param.getData(fixedText)` // Retrieve the data map from request parameter using fixedText as the key |
| 3 | SET | `inMap.put(EKK1041B001CBSMsg.KEY_SVC_KEI_NO, svcKeiNo)` // Inject service contract number into map [-> EKK1041B001CBSMsg.KEY_SVC_KEI_NO="key_svc_kei_no" (EKK1041B001CBSMsg.java:362)] |
| 4 | SET | `inMap.put(EKK1041B001CBSMsg.KEY_MLAD, mlad)` // Inject customer email address into map [-> EKK1041B001CBSMsg.KEY_MLAD="key_mlad" (EKK1041B001CBSMsg.java:365)] |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `svc_kei_no` | Field | Service Contract Number — the unique identifier for a telecom service contract line item. Used as the primary key to look up order setup records. |
| `mlad` | Field | Customer Email Address (Japanese: メールアドレス) — the email contact associated with a service contract. Used as a secondary correlation key for inquiry. |
| `key_svc_kei_no` | Field | Map key constant used to store/retrieve the service contract number in the CBS message parameter map. |
| `key_mlad` | Field | Map key constant used to store/retrieve the customer email address in the CBS message parameter map. |
| FUNC_CD_1 | Constant | Function Code "1" — indicates a display/inquiry operation type. Used for function tracking and audit purposes. |
| `fixedText` | Parameter | Service message identifier — serves as the key to identify and retrieve the correct data map from the request parameter context. |
| `param` | Parameter | Request Parameter ReadWrite carrier — the central data container that flows between UI screens, CC components, and SC/CBS layers. |
| CC | Acronym | Custom Component — a custom business component class that provides shared utility methods across screens and processes. |
| SC | Acronym | Service Component — a service-level component that mediates between CC components and CBS (database) operations. |
| CBS | Acronym | Common Business Service — the enterprise service layer that handles data access and business logic persistence operations. |
| upper mapping (上りマッピング) | Term | Upward parameter mapping — the process of populating input parameters in the direction from screen to SC/CBS, as opposed to lower mapping (下りマッピング) which goes from CBS result back to screen. |
| Order Setup List Inquiry (オーダ設定一覧照会) | Business term | Screen operation that displays a list of order setup records for a given service contract number and email address. |
| Service Order Add (サービス注文追加) | Business term | The KKSV0004 screen module responsible for adding/modifying telecom service orders. |
| Request Parameter ReadWrite | Type | Interface `IRequestParameterReadWrite` — defines the contract for objects that store and retrieve request-level parameters across the application layers. |
| KKSV | Prefix | Screen module prefix — "K" (product) + "K" (module) + "SV" (service) + sequence number, used for service order management screens. |
