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

This method is a private helper that prepares the **work parameter management unique inquiry** mapping for a business data lookup. It is invoked during the **Mail Address Change** service flow, where the system must query an existing work parameter record to determine how many utilization days remain for the old mail address add/del service. Specifically, it configures the function code to `"1"` (function code 1, used for inquiry/read operations), retrieves the working HashMap associated with the given fixedText key, and inserts a predefined work parameter identifier (`KK_OLDMLAD_YYDAYCNT`) into the map so that the subsequent service-call (SC) query knows which work parameter ID to look up. The method follows the **builder/setter pattern** — it sets up structured request data that is consumed by the downstream `executeSC()` call. It acts as a shared utility within the service order addition screen, ensuring the work parameter lookup always uses the correct constant ID and function code.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["setInMapWorkParamSearch(param, fixedText)"])
    START --> STEP1["Step 1: Set function code to FUNC_CD_1 = \"1\""]
    STEP1 --> STEP2["Step 2: Retrieve HashMap inMap = param.getData(fixedText)"]
    STEP2 --> STEP3["Step 3: inMap.put(KEY_WORK_PARAM_ID, KK_OLDMLAD_YYDAYCNT)"]
    STEP3 --> END_NODE(["Return / Next processing"])
```

**Processing overview:**

1. **Set function code**: Sets the function code to `"1"` (`FUNC_CD_1`) which designates this as a read/inquiry operation.
2. **Retrieve working data map**: Fetches the HashMap from the request parameter object keyed by the `fixedText` value (service message identifier).
3. **Insert work param ID**: Puts the pre-defined work parameter ID constant `KK_OLDMLAD_YYDAYCNT` under the key `KEY_WORK_PARAM_ID` (`key_work_param_id`) into the map. This tells the downstream service component which work parameter ID to use for the unique inquiry.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `param` | `IRequestParameterReadWrite` | Request parameter management object that holds the working data map. It provides `getData()` to retrieve the HashMap and `setFuncCode()` to configure the function code. It carries the business context for the current screen operation. |
| 2 | `fixedText` | `String` | Service message identifier used as the key to retrieve the working HashMap from `param`. In the caller context, this identifies which data slice (e.g., work parameter inquiry area) the method operates on. |

**External state / instance fields used:**
- None directly (this method is self-contained and does not reference instance fields).

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `setFuncCode(param, fixedText, FUNC_CD_1)` | - | - | Sets function code `"1"` on the request parameter for inquiry/read mode |
| R | `param.getData(fixedText)` | - | - | Retrieves the working HashMap from the request parameter |
| - | `inMap.put(KEY_WORK_PARAM_ID, KK_OLDMLAD_YYDAYCNT)` | - | - | Sets the work parameter ID into the working map for downstream SC call |

This method does not directly invoke any SC Code (Service Component) or database operations. It prepares data that is consumed by the caller's subsequent `executeSC()` invocation, which performs the actual database inquiry for work parameter management.

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

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Screen:KKSV0275 (implied) | `JFUSvcOrderAddCC.setMapInParam` -> `JFUSvcOrderAddCC.setInMapWorkParamSearch` | `param.getData` [R] |

**Caller context:** The method is called from line 732 of `JFUSvcOrderAddCC.java` within the `setMapInParam` method, specifically in the **Mail Address Change** (`else` branch of `mailAddrChgFlg` check). The full flow is: the screen sets up work parameter inquiry data, this method configures the work parameter ID, and then the caller proceeds to execute `executeSC()` to query the database for work parameter records.

## 6. Per-Branch Detail Blocks

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

> Sets the function code for inquiry/read operation.

| # | Type | Code |
|---|------|------|
| 1 | SET | `setFuncCode(param, fixedText, JPCModelConstant.FUNC_CD_1)` // Function code 1 = inquiry mode [-> FUNC_CD_1="1" (JPCModelConstant.java:29)] |

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

> Retrieves the working HashMap from the request parameter object to prepare for data insertion.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `HashMap inMap = (HashMap)param.getData(fixedText)` // Get working data map keyed by service message [-> fixedText = service message parameter] |

**Block 3** — [SET] `inMap.put(EZM0321A010CBSMsg.KEY_WORK_PARAM_ID, JFUStrConst.KK_OLDMLAD_YYDAYCNT)` (L1059)

> Inserts the work parameter ID constant into the map so the downstream SC knows which work parameter to look up.

| # | Type | Code |
|---|------|------|
| 1 | SET | `inMap.put(EZM0321A010CBSMsg.KEY_WORK_PARAM_ID, JFUStrConst.KK_OLDMLAD_YYDAYCNT)` // Set work param ID for inquiry [-> KEY_WORK_PARAM_ID="key_work_param_id" (EZM0321A010CBSMsg.java:227)] [-> KK_OLDMLAD_YYDAYCNT="KK_OLDMLAD_YYDAYCNT" (JFUStrConst.java:8745)] |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `KK_OLDMLAD_YYDAYCNT` | Constant | Old Mail Address Add/Del Year-End Count — a predefined work parameter identifier used to look up how many utilization days remain for the old mail address add/del service |
| `key_work_param_id` | Field | Work Parameter ID — the database key identifying a specific work parameter management record |
| `fixedText` | Field | Service message — a string key used to identify and retrieve the appropriate data slice (HashMap) from the request parameter object |
| FUNC_CD_1 | Constant | Function code "1" — designates this operation as an inquiry/read mode |
| `IRequestParameterReadWrite` | Interface | Request parameter management interface — provides methods to get/set function codes, retrieve and store working data maps |
| `param.getData()` | Method | Retrieves the working HashMap from the request parameter, keyed by the service message identifier |
| `setFuncCode` | Method | Configures the function code on the request parameter to specify the operation mode (inquiry, registration, etc.) |
| KKSV0275 | Screen | Mail Address Change screen — the business context in which this method is called |
| Mail Address Change | Business term | Service type for changing a customer's registered mail address |
| Work Parameter | Domain concept | A database-managed record that tracks service-specific operational parameters, such as utilization days, registration dates, and service status |
