---
# Business Logic — KKW00191SFLogic.invokeService() [55 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.KKW00191SF.KKW00191SFLogic` |
| Layer | Service / Controller (SF = Screen Logic layer) |
| Module | `KKW00191SF` (Package: `eo.web.webview.KKW00191SF`) |

## 1. Role

### KKW00191SFLogic.invokeService()

This method is the primary service invocation entry point for the **KKW00191SF** screen, which handles **company customer service inquiry and configuration operations** for the HINOTHI (法人) telecom system. Specifically, it orchestrates the complete workflow for managing **service content inquiry status** (サービス内容照会), including retrieving service order data, controlling service item types, and recording authorization addendums for branch office additions.

The method implements a **staged mapper dispatch pattern**: it first configures a `KKSV0408_KKSV0408OPDBMapper` instance with multiple service component calls (`set*SC` methods) to prepare input data, then delegates to the underlying `invokeService(paramMap, inputMap, outputMap)` to execute the actual service logic, and finally retrieves results (`get*SC` methods) to populate the response. It also enriches the inquiry status call processing (`setJKKSvkeiShosaClCC`) with organizational context (org code and org name) pulled from the common info bean.

The method's role in the larger system is to act as the **business orchestration layer** that bridges the screen controller and the backend service components (SCs). It coordinates data preparation, service execution, result mapping, and form bean transformation in a single synchronized flow — serving as the central dispatch point for all service-side processing on this screen.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["invokeService(paramBean)"])
    STEP1["Create paramMap, inputMap, outputMap"]
    STEP2["Set reservation apply date via sendMessageString"]
    STEP3["Set paramMap usecase ID and operation ID"]
    STEP4["Create KKSV0408_KKSV0408OPDBMapper instance"]
    STEP5["Mapper: setKKSV040802SC"]
    STEP6["Mapper: setKKSV040803SC"]
    STEP7["Mapper: setKKSV040805SC"]
    STEP8["Get common info bean and org code/org name"]
    STEP9["Mapper: setJKKSvkeiShosaClCC with orgCd, orgNm"]
    STEP10["Mapper: setJKKButuryuCtrlCC"]
    STEP11["Mapper: setJKKHakkoSODCC"]
    STEP12["Mapper: setJKKTchishoAddCC"]
    STEP13["invokeService(paramMap, inputMap, outputMap)"]
    STEP14["Mapper: getKKSV040803SC"]
    STEP15["Mapper: getKKSV040804SC"]
    STEP16["Mapper: getKKSV040805SC"]
    STEP17["editServiceFormBean"]
    STEP18["DataBean dump log output"]
    END(["Return"])

    START --> STEP1
    STEP1 --> STEP2
    STEP2 --> STEP3
    STEP3 --> STEP4
    STEP4 --> STEP5
    STEP5 --> STEP6
    STEP6 --> STEP7
    STEP7 --> STEP8
    STEP8 --> STEP9
    STEP9 --> STEP10
    STEP10 --> STEP11
    STEP11 --> STEP12
    STEP12 --> STEP13
    STEP13 --> STEP14
    STEP14 --> STEP15
    STEP15 --> STEP16
    STEP16 --> STEP17
    STEP17 --> STEP18
    STEP18 --> END
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `paramBean` | `X31SDataBeanAccess[]` | An array of screen form DataBeans carrying the company customer service inquiry state. `paramBean[0]` is the primary form bean that receives the reservation apply date, sends/receives data via `sendMessageString`, and is ultimately transformed by `editServiceFormBean`. This bean carries service content codes, authorization information, organizational data, and all form fields that the screen needs to render or submit. |
| — | `this` (instance) | `KKW00191SFLogic` | The logic controller instance, used to pass `this` to `JCCWebCommon.getOpeDate()`. |

**Instance fields or external state:**
- `super.getCommonInfoBean()` — accesses the parent class method to retrieve shared/common information beans (organization code, organization name, user session context).

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `JCCWebCommon.getOpeDate` | JCCWebCommon | - | Retrieves the current operation date for the reservation apply date field |
| R | `KKSV0408_KKSV0408OPDBMapper.setKKSV040802SC` | KKSV0408_02SC | KK_T_OPSVKEI_ISP | Prepares input data for operation service detail inquiry (service item details) |
| R | `KKSV0408_KKSV0408OPDBMapper.setKKSV040803SC` | KKSV0408_03SC | KK_T_SVC_ORDER | Prepares input data for service order inquiry |
| R | `KKSV0408_KKSV0408OPDBMapper.setKKSV040805SC` | KKSV0408_05SC | KK_T_ODR_HAKKO_JOKEN | Prepares input data for order release authorization conditions inquiry |
| R | `KKSV0408_KKSV0408OPDBMapper.setJKKSvkeiShosaClCC` | JKKSvkeiShosaClCC | - | Prepares service content inquiry status call data with org code/org name |
| R | `KKSV0408_KKSV0408OPDBMapper.setJKKButuryuCtrlCC` | JKKButuryuCtrlCC | - | Prepares service item type control data |
| R | `KKSV0408_KKSV0408OPDBMapper.setJKKHakkoSODCC` | JKKHakkoSODCC | - | Prepares service order data generation/authorization data |
| R | `KKSV0408_KKSV0408OPDBMapper.setJKKTchishoAddCC` | JKKTchishoAddCC | - | Prepares branch office addition authorization addendum data |
| - | `KKW00191SFLogic.invokeService(paramMap, inputMap, outputMap)` | - | - | Internal delegation — invokes the underlying service execution with prepared parameters |
| R | `KKSV0408_KKSV0408OPDBMapper.getKKSV040803SC` | KKSV0408_03SC | KK_T_SVC_ORDER | Retrieves service order inquiry results into outputMap and populates paramBean |
| R | `KKSV0408_KKSV0408OPDBMapper.getKKSV040804SC` | KKSV0408_04SC | - | Retrieves operation detail inquiry results into paramBean |
| R | `KKSV0408_KKSV0408OPDBMapper.getKKSV040805SC` | KKSV0408_05SC | KK_T_ODR_HAKKO_JOKEN | Retrieves order release authorization conditions results into paramBean |
| U | `KKW00191SFLogic.editServiceFormBean` | KKW00191SFLogic | - | Transforms service-side DataBean results into screen display format |
| R | `X31SDataBeanAccess.sendMessageString(String, int)` | OneStopDataBeanAccess | - | Sends/receives string data on the DataBean (reservation apply date, org code, org name) |
| R | `X31SDataBeanAccess.getDataBeanArray(String)` | OneStopDataBeanAccess | - | Retrieves a DataBean array by key from common info |
| R | `X31SDataBeanAccess.getDataBean(int)` | OneStopDataBeanAccess | - | Retrieves a specific DataBean by index |

### How operations are classified:

**set*SC / set*CC calls (Preparation - "Read" / "R"):**
These `setKKSV0408*SC` and `set*CC` calls populate the `inputMap` with data from `paramBean` that will be sent to the backend SC/CB components. They gather and prepare inquiry parameters (service details, service orders, order authorization conditions, service content inquiry status, item type control, authorization data, branch addition data). The data flows from the screen bean into the mapper's input map.

**invokeService(paramMap, inputMap, outputMap) (Execution):**
Delegates to the internal overloaded `invokeService` method that actually executes the service component logic. The `paramMap` contains the usecase ID (`UCID_KKSV0408`) and operation ID (`OPID_KKSV0408OP`) identifying the specific service to invoke.

**get*SC calls (Result retrieval - "Read" / "R"):**
These `getKKSV0408*SC` calls retrieve the results from `outputMap` after service execution and populate the `paramBean` with the results. This is the output side of the SC calls.

**editServiceFormBean (Transformation - "Update" / "U"):**
Transforms the service-side DataBean data into the format expected by the screen for display.

## 5. Dependency Trace

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

No screen/batch entry points found within 8 hops. Direct callers found: 2 methods.

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | `KKW00191SFLogic.actionInit` | `actionInit` -> `invokeService` | `editServiceFormBean [U]`, `getKKSV040803SC [R] KK_T_SVC_ORDER`, `getKKSV040804SC [R]`, `getKKSV040805SC [R] KK_T_ODR_HAKKO_JOKEN` |
| 2 | `KKW00191SFLogic.invokeService` (overloaded) | `invokeService(paramBean)` -> `invokeService(paramMap, inputMap, outputMap)` | `setKKSV040802SC [R] KK_T_OPSVKEI_ISP`, `setJKKHakkoSODCC [R]`, `setJKKTchishoAddCC [R]` |
| 3 | `KKW00191SFLogic.shosaNgCl` | `shosaNgCl` -> `invokeService` | `editServiceFormBean [U]`, `getKKSV040803SC [R] KK_T_SVC_ORDER`, `getKKSV040804SC [R]`, `getKKSV040805SC [R] KK_T_ODR_HAKKO_JOKEN` |

**Terminal operations from this method:** `editServiceFormBean [U]`, `getKKSV040803SC [R] KK_T_SVC_ORDER`, `getKKSV040804SC [R]`, `getKKSV040805SC [R] KK_T_ODR_HAKKO_JOKEN`, `invokeService [-]`, `setJKKTchishoAddCC [-]`, `setJKKHakkoSODCC [-]`, `setJKKButuryuCtrlCC [-]`, `setJKKSvkeiShosaClCC [-]`, `sendMessageString [-]`, `sendMessageString [-]`, `sendMessageString [-]`, `sendMessageString [-]`, `getDataBean [R]`, `getDataBean [R]`, `getDataBeanArray [R]`, `setKKSV040805SC [-]`, `setKKSV040803SC [-]`

## 6. Per-Branch Detail Blocks

### Block 1 — INIT (variable declaration) (L171)

> Initializes three HashMaps for parameter passing, input mapping, and output results.

| # | Type | Code |
|---|------|------|
| 1 | SET | `paramMap = new HashMap<String, Object>()` // Parameter map for service invocation |
| 2 | SET | `inputMap = new HashMap<String, Object>()` // Input mapping results storage |
| 3 | SET | `outputMap = new HashMap<String, Object>()` // Service invocation results storage |

### Block 2 — SET (reservation apply date) (L177-179)

> Sets the operation date as the "reservation apply date" (予約適用年月) on the primary form bean. Uses `JCCWebCommon.getOpeDate()` to get the current business date.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `paramBean[0].sendMessageString(KKW00191SFConst.RSV_APLY_YMD, X31CWebConst.DATABEAN_SET_VALUE, JCCWebCommon.getOpeDate(this, null))` // [-> RSV_APLY_YMD] Reservation apply date field key, [-> DATABEAN_SET_VALUE] Set operation |

### Block 3 — SET (service parameter configuration) (L181-182)

> Configures the service invocation parameters with the usecase ID and operation ID.

| # | Type | Code |
|---|------|------|
| 1 | SET | `paramMap.put(X31CWebConst.TELEGRAM_INFO_USECASE_ID, JKKCommonConst.UCID_KKSV0408)` // [-> UCID_KKSV0408] Usecase ID for screen KKSV0408 |
| 2 | SET | `paramMap.put(X31CWebConst.TELEGRAM_INFO_OPERATION_ID, JKKCommonConst.OPID_KKSV0408OP)` // [-> OPID_KKSV0408OP] Operation ID for KKSV0408OP operation |

### Block 4 — INIT (mapper creation) (L184-185)

> Creates the mapper instance that coordinates all SC service calls.

| # | Type | Code |
|---|------|------|
| 1 | SET | `mapper = new KKSV0408_KKSV0408OPDBMapper()` // Service component mapper for KKSV0408 |

### Block 5 — EXEC (upper mapping preparation) (L188-190)

> Calls three SC preparation methods (set*SC) to populate `inputMap` with inquiry parameters. These gather service detail, service order, and order release authorization condition data.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `mapper.setKKSV040802SC(paramBean, inputMap, JPCModelConstant.FUNC_CD_2)` // [-> FUNC_CD_2] Function code 2 — service detail inquiry preparation |
| 2 | CALL | `mapper.setKKSV040803SC(paramBean, inputMap, JPCModelConstant.FUNC_CD_2)` // [-> FUNC_CD_2] Function code 2 — service order inquiry preparation |
| 3 | CALL | `mapper.setKKSV040805SC(paramBean, inputMap, JPCModelConstant.FUNC_CD_1)` // [-> FUNC_CD_1] Function code 1 — order authorization conditions preparation |

### Block 6 — EXEC (service content inquiry status call - enriched with org info) (L192-199)

> Handles the service content inquiry status call processing. The original call (commented out with a legacy fix tag OM-2013-0002656) used `FUNC_CD_1` without org context. The updated version retrieves organization code and organization name from the common info bean and passes them to the enriched `setJKKSvkeiShosaClCC` method.

**Block 6.1 — GET (common info bean extraction) (L195)**

> Retrieves the common info bean and extracts the subgroup code list to access organizational data.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `commoninfoBean = super.getCommonInfoBean()` // Access parent method for shared common info |
| 2 | SET | `subCfBean = commoninfoBean.getDataBeanArray(CommonInfoCFConst.KGGRP_CD_LIST).getDataBean(1)` // [-> KGGRP_CD_LIST] Subgroup code list, index 1 |

**Block 6.2 — GET (org code and org name extraction) (L197-198)**

> Extracts the organization code and organization name for use in the inquiry status call.

| # | Type | Code |
|---|------|------|
| 1 | SET | `orgCd = subCfBean.sendMessageString(CommonInfoCFConst.ORG_CD_01, X31CWebConst.DATABEAN_GET_VALUE)` // [-> ORG_CD_01] Organization code 01, [-> DATABEAN_GET_VALUE] Get operation |
| 2 | SET | `orgNm = subCfBean.sendMessageString(CommonInfoCFConst.ORG_NM_01, X31CWebConst.DATABEAN_GET_VALUE)` // [-> ORG_NM_01] Organization name 01 |

**Block 6.3 — CALL (enriched service content inquiry status) (L199)**

> Calls the enriched service content inquiry status call CC with organization context.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `mapper.setJKKSvkeiShosaClCC(paramBean, inputMap, JPCModelConstant.FUNC_CD_1, orgCd, orgNm)` // Service content inquiry status with org context |

### Block 7 — EXEC (remaining CC preparation) (L201-203)

> Calls three more service component preparation methods for item type control, authorization data, and branch office addition.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `mapper.setJKKButuryuCtrlCC(paramBean, inputMap, JPCModelConstant.FUNC_CD_1)` // Service item type control preparation |
| 2 | CALL | `mapper.setJKKHakkoSODCC(paramBean, inputMap, JPCModelConstant.FUNC_CD_1)` // Service order data authorization preparation |
| 3 | CALL | `mapper.setJKKTchishoAddCC(paramBean, inputMap, JPCModelConstant.FUNC_CD_1)` // Branch office addition authorization addendum preparation |

### Block 8 — CALL (service invocation) (L206)

> Delegates to the overloaded `invokeService` method which executes the actual service component logic using the prepared parameters.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `invokeService(paramMap, inputMap, outputMap)` // Core service execution with usecase ID UCID_KKSV0408 |

### Block 9 — EXEC (lower mapping / result retrieval) (L209-211)

> Retrieves the results from the service execution (`outputMap`) and populates `paramBean` with the results. These are the output side of the SC calls — the reverse of the set*SC calls.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `mapper.getKKSV040803SC(paramBean, outputMap)` // Service order inquiry result retrieval |
| 2 | CALL | `mapper.getKKSV040804SC(paramBean, outputMap)` // Operation detail inquiry result retrieval |
| 3 | CALL | `mapper.getKKSV040805SC(paramBean, outputMap)` // Order authorization conditions result retrieval |

### Block 10 — EXEC (form bean transformation) (L213)

> Transforms the service-side DataBean results into the format expected by the screen for display.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `editServiceFormBean(paramBean[0])` // Transform service data to screen display format |

### Block 11 — EXEC (DataBean dump logging) (L216)

> Outputs the DataBean state for debugging purposes using the logging utility.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `JSYwebLog.println(JSYwebLog.DataBean_Dump, getClass(), dumpDatabean(), null, null, null)` // Debug log output of full DataBean state |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `RSV_APLY_YMD` | Field | Reservation apply date — the date used for service reservation application, set to the current business/operation date |
| `UCID_KKSV0408` | Field | Usecase ID for KKSV0408 — identifies the specific usecase (KKSV0408) for service routing |
| `OPID_KKSV0408OP` | Field | Operation ID for KKSV0408OP — identifies the specific operation within the usecase |
| `FUNC_CD_1` | Field | Function code 1 — a function classification code passed to SC methods (used for primary service processing) |
| `FUNC_CD_2` | Field | Function code 2 — a function classification code passed to SC methods (used for inquiry/detail processing) |
| `KGGRP_CD_LIST` | Field | Group subgroup code list — stores the list of organization subgroup codes in the common info bean |
| `ORG_CD_01` | Field | Organization code 01 — the primary organization code of the logged-in user/entity |
| `ORG_NM_01` | Field | Organization name 01 — the primary organization name of the logged-in user/entity |
| `KKSV0408_02SC` | SC Code | Service Component for operation service detail inquiry — handles service item detail data |
| `KKSV0408_03SC` | SC Code | Service Component for service order inquiry — handles service order header and line item data |
| `KKSV0408_04SC` | SC Code | Service Component for operation detail inquiry — handles operation-level detail data |
| `KKSV0408_05SC` | SC Code | Service Component for order release authorization conditions — handles order authorization release condition data |
| `JKKSvkeiShosaClCC` | CC Code | Service Content Inquiry Status Call Common Component — handles service content inquiry status with organization context |
| `JKKButuryuCtrlCC` | CC Code | Service Item Type Control Common Component — handles service item type classification and control |
| `JKKHakkoSODCC` | CC Code | Service Order Data Generation/Authorization Common Component — handles SOD (Service Order Data) authorization and generation |
| `JKKTchishoAddCC` | CC Code | Branch Office Addition Authorization Addendum Common Component — handles authorization addendum records for branch office additions |
| `KK_T_OPSVKEI_ISP` | Table | Service detail ISP table — stores service item detail records |
| `KK_T_SVC_ORDER` | Table | Service order table — stores service order header information |
| `KK_T_ODR_HAKKO_JOKEN` | Table | Order release authorization conditions table — stores authorization release condition records for orders |
| HINOTHI | Business term | Corporate/Company customer — B2B telecom service customer type (法人) |
| SOD | Acronym | Service Order Data — the order data entity used in telecom service fulfillment |
| SC | Acronym | Service Component — a service-layer component that handles specific business operations (typically named `*SC`) |
| CC | Acronym | Common Component — shared business logic component used across multiple screens/services (typically named `*CC`) |
| SF | Acronym | Screen Function — the screen logic layer containing `*SFLogic` classes that orchestrate screen-specific business processing |
| CP | Acronym | Common Processing — shared utility classes (e.g., `JCCWebCommon`, `JKKCommon`) used across the system |