# (DD25) Business Logic — JFUSvcOrderAddCC.setInMapSbopSvcIspSearch() [14 LOC]

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

## 1. Role

### JFUSvcOrderAddCC.setInMapSbopSvcIspSearch()

This method serves as an **input mapping utility** for the **Sub-Option Service Contract ISP uniqueness check** workflow (Japanese comment: "上りマッピング項目設定(サブオプションサービス契約<ISP>一意照会)" — "Upstream mapping item setting (Sub-option service contract <ISP> uniqueness check)"). It prepares the request payload by setting the function code to mode 2 ("Clear") and populating a HashMap with the optional service contract number (`opSvcKeiNo`) and the sub-option service contract number (`sbopSvcKeiNo`) as key-value pairs. The method implements a **builder/setter pattern** — it is a shared utility called by the parent workflow method in `JFUSvcOrderAddCC` (line 516) when the caller provides a sub-option service contract number, triggering the ISP uniqueness validation path. It has no conditional branches, making it a deterministic data preparation step before the downstream service IF (`executeSC`) is invoked with the `EKK0411A010` template IDs.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["setInMapSbopSvcIspSearch(param, fixedText, opSvcKeiNo, sbopSvcKeiNo)"])
    SET_FUNC["setFuncCode(param, fixedText, FUNC_CD_2 = \"2\")"]
    GET_DATA["inMap = param.getData(fixedText)"]
    PUT_OP["inMap.put(KEY_OP_SVC_KEI_NO, opSvcKeiNo)"]
    PUT_SBOP["inMap.put(KEY_SBOP_SVC_KEI_NO, sbopSvcKeiNo)"]
    END_NODE(["Return / Next"])

    START --> SET_FUNC
    SET_FUNC --> GET_DATA
    GET_DATA --> PUT_OP
    PUT_OP --> PUT_SBOP
    PUT_SBOP --> END_NODE
```

**Processing Flow:**
1. **Set Function Code**: Configure the request parameter with function code `FUNC_CD_2 = "2"` (Clear mode). This tells downstream processing that the data should be cleared/reset before being used for the ISP uniqueness search.
2. **Retrieve Input Map**: Fetch the HashMap from the request parameter object under the key specified by `fixedText`. This map serves as the shared input container for CBS message exchange.
3. **Put Optional Service Contract Number**: Store the optional service contract number (`opSvcKeiNo`) into the input map using the key `KEY_OP_SVC_KEI_NO = "key_op_svc_kei_no"`.
4. **Put Sub-Option Service Contract Number**: Store the sub-option service contract number (`sbopSvcKeiNo`) into the input map using the key `KEY_SBOP_SVC_KEI_NO = "key_sbop_svc_kei_no"`.
5. **Return**: Method completes — the prepared map is now ready for the calling method to pass to `executeSC` for service IF execution.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `param` | `IRequestParameterReadWrite` | Request parameter container — the I/O channel for all screen-to-CBS data exchange. Holds the function code, input maps, and template data. The method retrieves its internal HashMap via `getData(fixedText)` and sets function code via `setFuncCode`. |
| 2 | `fixedText` | `String` | Service message identifier — used as the key to retrieve the correct input HashMap from `param.getData()`. In this context, it references the `EKK0411A010` CBS message template. |
| 3 | `opSvcKeiNo` | `String` | Optional Service Contract Number (Japanese: オプションサービス契約番号) — the parent-level service contract identifier that groups sub-option services. This number is used to scope the ISP uniqueness check. |
| 4 | `sbopSvcKeiNo` | `String` | Sub-Option Service Contract Number (Japanese: サブオプションサービス契約番号) — the specific sub-option service contract being validated for ISP uniqueness. This is the target of the uniqueness search. |

**External state referenced:**
- `FUNC_CD_2` → `"2"` (JPCModelConstant.java:32) — Function code for "Clear" mode
- `KEY_OP_SVC_KEI_NO` → `"key_op_svc_kei_no"` (EKK0411A010CBSMsg.java) — Map key for optional service contract number
- `KEY_SBOP_SVC_KEI_NO` → `"key_sbop_svc_kei_no"` (EKK0411A010CBSMsg.java) — Map key for sub-option service contract number

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `setFuncCode(param, fixedText, FUNC_CD_2)` | JPCModelConstant | - | Sets the function code to `"2"` (Clear) on the request parameter, configuring downstream processing to clear/reset data before the ISP uniqueness search |
| R | `param.getData(fixedText)` | IRequestParameterReadWrite | - | Retrieves the HashMap from the request parameter container, used as the input payload for CBS message exchange |
| C | `inMap.put(KEY_OP_SVC_KEI_NO, opSvcKeiNo)` | HashMap | - | Inserts the optional service contract number into the input map as a key-value pair for CBS message transmission |
| C | `inMap.put(KEY_SBOP_SVC_KEI_NO, sbopSvcKeiNo)` | HashMap | - | Inserts the sub-option service contract number into the input map as a key-value pair for CBS message transmission |

**Classification rationale:**
- **setFuncCode**: Not a CRUD operation — it sets a metadata flag (`"2"` = Clear mode) on the request parameter.
- **getData**: Read — retrieves existing data from the parameter container.
- **inMap.put()**: Classified as Create (C) because it adds new key-value entries to the map that form the CBS input payload.

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | `JFUSvcOrderAddCC` (same class, line 516) | `...` -> `setInMapSbopSvcIspSearch(param, fixedText, inParamOpSvcKeiNo, inParamSbopSvcKeiNo)` | `setFuncCode [-]`, `param.getData [-]`, `inMap.put [-]` |

**Call Context:**
The method is called at line 516 of `JFUSvcOrderAddCC.java` when `inParamSbopSvcKeiNo != null` — i.e., when a sub-option service contract number is provided. The caller:
1. First initializes data with `initData(param, fixedText, IN_COLUMN_LIST_EKK0411A010)`
2. Then calls `setInMapSbopSvcIspSearch` to populate the input map
3. Finally invokes `executeSC(handle, param, fixedText, TEMPLATE_ID_EKK0411A010, ...)` to execute the service IF

The method has **no conditional branches** and **no terminal database operations** of its own — it purely prepares the input map and delegates all database/cross-component logic to the caller's subsequent `executeSC` invocation.

## 6. Per-Branch Detail Blocks

**Block 1** — [EXEC] (setFuncCode) (L1011)

> Sets the function code to "2" (Clear mode) on the request parameter. This configures downstream processing to clear/reset the data before the ISP uniqueness check.

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

**Block 2** — [EXEC] (getData) (L1014)

> Retrieves the HashMap from the request parameter container. This map is the shared input payload for CBS message exchange.

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

**Block 3** — [EXEC] (put optional service contract number) (L1017)

> Stores the optional service contract number into the input map. This key is used by the CBS layer to identify the parent service contract context.

| # | Type | Code |
|---|------|------|
| 1 | SET | `String key = EKK0411A010CBSMsg.KEY_OP_SVC_KEI_NO` [-> KEY_OP_SVC_KEI_NO="key_op_svc_kei_no"] |
| 2 | EXEC | `inMap.put(EKK0411A010CBSMsg.KEY_OP_SVC_KEI_NO, opSvcKeiNo)` // Set optional service contract number |

**Block 4** — [EXEC] (put sub-option service contract number) (L1018)

> Stores the sub-option service contract number into the input map. This key is used by the CBS layer to identify the specific sub-option service contract being checked for uniqueness.

| # | Type | Code |
|---|------|------|
| 1 | SET | `String key = EKK0411A010CBSMsg.KEY_SBOP_SVC_KEI_NO` [-> KEY_SBOP_SVC_KEI_NO="key_sbop_svc_kei_no"] |
| 2 | EXEC | `inMap.put(EKK0411A010CBSMsg.KEY_SBOP_SVC_KEI_NO, sbopSvcKeiNo)` // Set sub-option service contract number |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `opSvcKeiNo` | Field | Optional Service Contract Number — the parent-level contract identifier that groups one or more sub-option service contracts within a service order |
| `sbopSvcKeiNo` | Field | Sub-Option Service Contract Number — the specific sub-option service contract identifier used for granular service management |
| `fixedText` | Field | Service message identifier — a string key used to select the correct CBS message template/input map from the request parameter container |
| FUNC_CD_2 | Constant | Function Code "2" (Clear) — instructs downstream processing to clear/reset data before operation |
| KEY_OP_SVC_KEI_NO | Constant | Map key `"key_op_svc_kei_no"` — used to store/retrieve the optional service contract number in CBS input maps |
| KEY_SBOP_SVC_KEI_NO | Constant | Map key `"key_sbop_svc_kei_no"` — used to store/retrieve the sub-option service contract number in CBS input maps |
| ISP | Business term | Uniqueness check (一意照会) — a validation operation that verifies a record does not already exist in the system before allowing a new entry |
| Sub-Option Service | Business term | A sub-tier service contract nested under an Optional Service Contract, representing a more granular service offering (e.g., additional line extensions, supplementary features) |
| SOD | Acronym | Service Order Data — the core entity model used for telecom service order processing in the K-Opticom system |
| CBS | Acronym | Central Business System — the backend system that handles core order management and service contract operations |
| SC | Acronym | Service Component — a component-level service layer (e.g., `EKK0411A010SC`) that mediates between the presentation layer and the CBS backend |
| `EKK0411A010` | SC Code | CBS Service Component for Sub-Option Service Contract ISP Uniqueness Check — handles the validation and data preparation for sub-option service contract uniqueness verification |
| `IRequestParameterReadWrite` | Interface | Request/Response parameter container interface — provides `getData()`, `setData()`, and `setFuncCode()` methods for screen-to-CBS data exchange |
| HashMap | Type | Java HashMap — used as the shared key-value map structure for CBS message input/output between tiers |
