---
# Business Logic — KKW02410SFLogic.executeKaihkSvc() [38 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.KKW02410SF.KKW02410SFLogic` |
| Layer | Service Component / Common Component (CC) |
| Module | `KKW02410SF` (Package: `eo.web.webview.KKW02410SF`) |

## 1. Role

### KKW02410SFLogic.executeKaihkSvc()

This method implements the **Femtocell Option Information Recovery Service execution process** (フェムトセルオプション情報回復サービス実行処理). It is the central orchestration method for restoring or recovering femtocell-related option service contract data within the K-Opticom telecom contract management system.

The method follows a **mapping-invoke-extract** design pattern: it prepares input data by mapping service contract items, DataBean items, Service Order Data (SOD), WORK tables, and femtocell abnormality registration information into structured maps; invokes the downstream batch service via `invokeService`; and finally extracts the results back into the DataBean array.

As a **shared utility method** (private visibility), it serves as a reusable business logic component called by the screen-level `actionFix()` method. It handles a single service type — femtocell option information recovery — which corresponds to the use case `KKSV0579` (Femtocell Option Update Access). There are no conditional branches; processing follows a strictly linear flow: define variables, map data, invoke service, retrieve results.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["executeKaihkSvc paramBean, func_code"])
    DEFINE_VARS["Define local variables<br/>paramMap, inputMap, outputMap as HashMap"]
    INIT_MAPS["Initialize maps<br/>paramMap = new HashMap<br/>inputMap = new HashMap<br/>outputMap = new HashMap"]
    SET_USECASE["Set use case ID<br/>paramMap.put(TELEGRAM_INFO_USECASE_ID, KKSV0579)"]
    CREATE_MAPPER["Create mapper<br/>mapper = new KKSV0579_KKSV0579OPDBMapper()"]
    SET_KAIHKCC["setOpSvcKeiKaihkCC<br/>Service contract recovery mapping"]
    SET_SODCC["setJKKHakkoSODCC<br/>SOD mapping"]
    SET_WORK["setKKSV0009WORK<br/>WORK mapping"]
    SET_FEMTOCELL["setFmtcelIdoInfAddCC<br/>Femtocell abnormality info registration CC mapping"]
    CLEAR_MSG["Clear return message<br/>paramBean[0].sendMessageString(RTN_MSG_ID, DATABEAN_SET_VALUE, empty)"]
    INVOKE_SVC["invokeService<br/>paramMap, inputMap, outputMap"]
    GET_RESULT["getOpSvcKeiKaihkCC<br/>Retrieve results into paramBean"]
    END_NODE(["Return void"])

    START --> DEFINE_VARS --> INIT_MAPS --> SET_USECASE --> CREATE_MAPPER --> SET_KAIHKCC --> SET_SODCC --> SET_WORK --> SET_FEMTOCELL --> CLEAR_MSG --> INVOKE_SVC --> GET_RESULT --> END_NODE
```

**Step-by-step processing flow:**

1. **Initialize local maps** (L509-L513): Three `HashMap<String, Object>` instances are declared and created — `paramMap` (for service invocation parameters), `inputMap` (for input data), and `outputMap` (for result storage).

2. **Set use case identification** (L516): The telecom use case ID `KKSV0579` is stored in `paramMap` under the key `TELEGRAM_INFO_USECASE_ID` (`"KKSV0579"` [-> `TELEGRAM_INFO_USECASE_ID` in `X31CWebConst`]). This identifies the service context for downstream processing.

3. **Create data mapper** (L519): A new instance of `KKSV0579_KKSV0579OPDBMapper` is instantiated to handle field-level mapping between the DataBean and the internal maps.

4. **Map service contract recovery data** (L522): Calls `setOpSvcKeiKaihkCC()` to populate the input map with option service contract recovery fields extracted from the `paramBean` array.

5. **Map SOD data** (L524): Calls `setJKKHakkoSODCC()` to populate the input map with Service Order Data (SOD) fields — order information related to service provisioning.

6. **Map WORK data** (L526): Calls `setKKSV0009WORK()` to populate the input map with WORK table fields (third parameter is an empty string `""` [-> `""` literal]).

7. **Map femtocell abnormality info** (L529-530, v5.00): Calls `setFmtcelIdoInfAddCC()` to register femtocell abnormality information fields (added in v5.00 per change request ST1-2013-0000397).

8. **Clear return message** (L532): Resets the return message ID by calling `sendMessageString()` on the first DataBean element with an empty string value, clearing any prior error or status messages.

9. **Invoke downstream service** (L535): Calls `invokeService()` with all three maps, delegating actual business processing to the service component layer.

10. **Retrieve results** (L538): Calls `getOpSvcKeiKaihkCC()` on the mapper to populate the `paramBean` array with results from the `outputMap`.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `paramBean` | `X31SDataBeanAccess[]` | Array of DataBean objects containing the form data from the femtocell option update screen. Each element carries field values for service contract numbers, option service details, femtocell IDs, abnormality flags, and return message fields. The first element (`paramBean[0]`) is used for message operations. |
| 2 | `func_code` | `String` | Functional code that identifies the specific operation context (e.g., recovery, update, add). This code is passed through to the mapper methods (`setOpSvcKeiKaihkCC`, `setJKKHakkoSODCC`, `setFmtcelIdoInfAddCC`) to determine which database fields and business rules to apply. |

**Instance fields / external state accessed:**

| Field | Access | Description |
|-------|--------|-------------|
| `JCCWebBusinessLogic.invokeService` | CALL | Inherited from the parent class; invokes the downstream batch service via `JCCBatCommon.invokeService` |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `JCCBatCommon.invokeService` | JCCBatCommon | - | Delegates to downstream service component layer for actual femtocell option recovery processing |
| - | `JBSBatKKCrsChgIktAdd.invokeService` | JBSBatKKCrsChgIktAdd | - | Called within the service chain — circuit change item addition processing |
| - | `JBSbatKKCrsChgSmtVLAdd.invokeService` | JBSbatKKCrsChgSmtVLAdd | - | Called within the service chain — circuit change short VLAN addition processing |
| - | `JBSbatKKCrsChgWribSette.invokeService` | JBSbatKKCrsChgWribSette | - | Called within the service chain — circuit change writing setting processing |
| - | `JBSbatKKEponSwchKjInfSksi.invokeService` | JBSbatKKEponSwchKjInfSksi | - | Called within the service chain — EPON switch key information transfer processing |
| - | `OneStopDataBeanAccess.sendMessageString` | OneStopDataBeanAccess | - | Sends a message string to clear the return message ID on the DataBean |
| - | `OneStopDataBeanAccess.sendMessageString` | OneStopDataBeanAccess | - | Sends a message string for the "DataBean Set Value" constant to clear the return message |
| R | `KKSV0579_KKSV0579OPDBMapper.getOpSvcKeiKaihkCC` | KKSV0579 | - | Reads recovered option service contract recovery data from the output map and writes it back to the paramBean |
| - | `KKSV0579_KKSV0579OPDBMapper.setFmtcelIdoInfAddCC` | KKSV0579 | - | Maps femtocell abnormality information registration fields into the input map |
| - | `KKSV0579_KKSV0579OPDBMapper.setJKKHakkoSODCC` | KKSV0579 | - | Maps Service Order Data (SOD) fields into the input map |
| - | `KKSV0579_KKSV0579OPDBMapper.setKKSV0009WORK` | KKSV0579 | - | Maps WORK table fields into the input map |
| - | `KKSV0579_KKSV0579OPDBMapper.setOpSvcKeiKaihkCC` | KKSV0579 | - | Maps option service contract recovery fields into the input map |

## 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: `getOpSvcKeiKaihkCC` [R], `invokeService` [-], `invokeService` [-], `invokeService` [-], `invokeService` [-], `invokeService` [-], `sendMessageString` [-], `sendMessageString` [-], `setFmtcelIdoInfAddCC` [-], `setKKSV0009WORK` [-], `setJKKHakkoSODCC` [-], `setOpSvcKeiKaihkCC` [-]

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Method:KKW02410SFLogic.actionFix() | `actionFix()` -> `executeKaihkSvc(paramBean, func_code)` | `getOpSvcKeiKaihkCC [R] KK_T_OPSVKEI_RECOVERY` |
| | | | `invokeService [-] JCCBatCommon` (chain: `JBSBatKKCrsChgIktAdd`, `JBSbatKKCrsChgSmtVLAdd`, `JBSbatKKCrsChgWribSette`, `JBSbatKKEponSwchKjInfSksi`) |
| | | | `setOpSvcKeiKaihkCC [-] KKSV0579` |
| | | | `setJKKHakkoSODCC [-] KKSV0579` |
| | | | `setKKSV0009WORK [-] KKSV0579` |
| | | | `setFmtcelIdoInfAddCC [-] KKSV0579` |

## 6. Per-Branch Detail Blocks

This method has no conditional branches (if/else, switch, loop, try-catch). It follows a purely sequential linear flow. All processing is documented below as a single top-level block with nested steps.

**Block 1** — [SEQUENTIAL] `(no condition, linear execution)` (L509)

> Initialize local variables, create maps, and prepare the parameter context for the service invocation.

| # | Type | Code |
|---|------|------|
| 1 | SET | `paramMap = null;` // Local variable declaration [-> `HashMap<String, Object>`] |
| 2 | SET | `inputMap = null;` // Local variable declaration [-> `HashMap<String, Object>`] |
| 3 | SET | `outputMap = null;` // Local variable declaration [-> `HashMap<String, Object>`] |
| 4 | SET | `paramMap = new HashMap<String, Object>();` // Parameter setting map [-> `paramMap` for paramMap.put()] |
| 5 | SET | `inputMap = new HashMap<String, Object>();` // Input map [-> `inputMap` for mapper methods] |
| 6 | SET | `outputMap = new HashMap<String, Object>();` // Result storage map [-> `outputMap` for invokeService output] |

**Block 2** — [SEQUENTIAL] `(set use case identification)` (L516)

> Set the telecom use case ID in the parameter map to identify the service context for downstream processing.

| # | Type | Code |
|---|------|------|
| 1 | SET | `paramMap.put(X31CWebConst.TELEGRAM_INFO_USECASE_ID, "KKSV0579");` // Set use case ID [-> `TELEGRAM_INFO_USECASE_ID` in `X31CWebConst`] |

**Block 3** — [SEQUENTIAL] `(create mapper instance)` (L519)

> Instantiate the data mapper for mapping between DataBean and internal maps.

| # | Type | Code |
|---|------|------|
| 1 | SET | `KKSV0579_KKSV0579OPDBMapper mapper = new KKSV0579_KKSV0579OPDBMapper();` // Mapper for KKSV0579 operations |

**Block 4** — [SEQUENTIAL] `(map service contract recovery data)` (L522)

> Populate the input map with option service contract recovery fields from the paramBean.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `mapper.setOpSvcKeiKaihkCC(paramBean, inputMap, func_code);` // Service contract recovery CC mapping [-> SC: KKSV0579] |

**Block 5** — [SEQUENTIAL] `(map SOD data)` (L524)

> Populate the input map with Service Order Data fields from the paramBean.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `mapper.setJKKHakkoSODCC(paramBean, inputMap, func_code);` // SOD mapping [-> SC: KKSV0579] |

**Block 6** — [SEQUENTIAL] `(map WORK data)` (L526)

> Populate the input map with WORK table fields. The third parameter is an empty string.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `mapper.setKKSV0009WORK(paramBean, inputMap, "");` // WORK mapping [-> empty string literal for func_code param] |

**Block 7** — [SEQUENTIAL] `(map femtocell abnormality info, v5.00)` (L529)

> Populate the input map with femtocell abnormality information registration fields. Added in v5.00 (2013/02/22) per change request ST1-2013-0000397.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `mapper.setFmtcelIdoInfAddCC(paramBean, inputMap, func_code);` // Femtocell abnormality info registration CC mapping [-> SC: KKSV0579] |

**Block 8** — [SEQUENTIAL] `(clear return message)` (L532)

> Reset the return message ID on the first DataBean element to clear any prior error or status messages before service execution.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `paramBean[0].sendMessageString(KKW02410SFConst.RTN_MSG_ID, X31CWebConst.DATABEAN_SET_VALUE, "");` // Clear return message [-> `RTN_MSG_ID` from `KKW02410SFConst`, `DATABEAN_SET_VALUE` from `X31CWebConst`] |

**Block 9** — [SEQUENTIAL] `(invoke downstream service)` (L535)

> Delegate to the service component layer for actual business processing of the femtocell option recovery.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `invokeService(paramMap, inputMap, outputMap);` // Service execution [-> parent class `JCCWebBusinessLogic.invokeService`, internally calls `JCCBatCommon.invokeService`] |

**Block 10** — [SEQUENTIAL] `(retrieve results)` (L538)

> Extract results from the output map back into the paramBean array so the calling screen can display updated values.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `mapper.getOpSvcKeiKaihkCC(paramBean, outputMap);` // Get recovered results [-> SC: KKSV0579, Read operation] |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `paramBean` | Parameter | Array of DataBean objects carrying form data from the femtocell option update screen. Contains fields like service contract number, option service details, femtocell ID, and recovery flags. |
| `func_code` | Parameter | Functional code identifying the operation context (recovery, update, add) passed through to mapper methods. |
| `KKSV0579` | Use Case ID | Femtocell Option Update — the specific business use case for femtocell option information recovery within the telecom contract management system. |
| SOD | Acronym | Service Order Data — telecom order fulfillment entity representing service orders in the system. |
| WORK | Acronym | WORK table — intermediate working table used for data transformation and staging during service processing. |
| CC | Acronym | Command & Control / Common Component — a shared business logic component that handles cross-cutting operations. |
| SC | Acronym | Service Component — a dedicated service layer component that executes specific business transactions. |
| CBS | Acronym | Common Business Service — a shared service layer component providing reusable business functionality. |
| RTN_MSG_ID | Constant | Return Message ID — field in `KKW02410SFConst` identifying the message identifier for screen return status. |
| DATABEAN_SET_VALUE | Constant | DataBean Set Value marker from `X31CWebConst` — indicates a value should be set directly on the DataBean. |
| TELEGRAM_INFO_USECASE_ID | Constant | Use case identification key from `X31CWebConst` — used to tag parameters with the business use case ID. |
| Femtocell | Business term | A small cellular base station typically used in indoor environments to improve mobile coverage. In this system, femtocell option management covers registration, modification, and recovery of femtocell-related service contracts. |
| Option Service | Business term | An optional/add-on service that can be attached to a primary service contract (e.g., femtocell, additional bandwidth, premium support). |
| Service Contract Recovery | Business term | The process of restoring or re-registering option service contract data that may have been lost, corrupted, or needs re-synchronization during update operations. |
| `getOpSvcKeiKaihkCC` | Method | Get Option Service Contract Recovery CC — reads recovered data from the output map and populates the DataBean array for screen display. |
| `setOpSvcKeiKaihkCC` | Method | Set Option Service Contract Recovery CC — maps option service contract fields from the DataBean into the input map for service invocation. |
| `setJKKHakkoSODCC` | Method | Set Jikkyo (Actual) Issuance SOD CC — maps Service Order Data fields for actual issuance operations. |
| `setKKSV0009WORK` | Method | WORK table mapping — maps fields to/from the WORK table for intermediate data processing. |
| `setFmtcelIdoInfAddCC` | Method | Set Femtocell Abnormality Information Addition CC — maps femtocell abnormality (error/deviation) registration fields added in v5.00. |
| `invokeService` | Method | Service execution delegate — inherited from `JCCWebBusinessLogic`, chains through `JCCBatCommon.invokeService` to the downstream CBS layer. |
| v5.00 | Version | Software version 5.00 released on 2013/02/22, which added femtocell abnormality information registration support (change request ST1-2013-0000397). |

---
