# Business Logic — JKKKikiIchiranKkCreateCC.execKikiIchiranKikiCreate() [235 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `com.fujitsu.futurity.bp.custom.common.JKKKikiIchiranKkCreateCC` |
| Layer | CC/Common Component — shared business logic controller |
| Module | `common` (Package: `com.fujitsu.futurity.bp.custom.common`) |

## 1. Role

### JKKKikiIchiranKkCreateCC.execKikiIchiranKikiCreate()

This method is the **central equipment (terminal) registration orchestration** entry point in the Fujitsu Futurity telecom service provisioning system. It coordinates the end-to-end workflow for **registering new equipment (end-user terminals) under an existing service contract**, combining service data retrieval, equipment model determination, pricing analysis, discount service handling, agent store registration, and contract completion.

The method implements a **routing/dispatch pattern**: based on the `func_code` parameter, it routes processing into distinct functional branches — when `func_code` equals `"1"` (FUNC_CODE_1), the method performs full check-and-registration logic including optional service updates, discount service registration, special change item processing, terminal purchase notification, and ONU exchange work. When `func_code` is `"2"` (the service agreement inquiry mode), it executes a streamlined flow.

Its **role in the larger system** is that of a coordinator — this CC (Common Component) method does not directly perform database operations itself. Instead, it orchestrates approximately 20+ sub-components (inner CC methods, CBS service calls, and SC calls) that handle specific domain concerns. It is called by screen entry point CCs such as `JKKKikiIchiranIkkatsuCC` (bulk operation screen) and `JKKKikiIchiranKishuChgCC` (equipment header change screen), making it a shared workhorse for multiple equipment-related screens in the KKW009/KKSVxxxx screen family.

The method supports a wide range of **service types/categories**: FTTH (Fiber To The Home) service registration, Mail (email) service, ENUM service, smartlink premium, rental equipment (KKTK_SBT_CD_RENTAL), purchased equipment (KKTK_SBT_CD_KAITORI), and held equipment (KKTK_SBT_CD_MOTIKOMI). Each service type may trigger different optional service update branches and discount service handling.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START["execKikiIchiranKikiCreate"]
    STEP1["Initialize data map and error flags"]
    STEP2["Setup common area and init service update"]
    STEP3["Get existing svc_kei_data from ccMsg"]
    COND1["svc_kei_data == null?"]
    STEP4["Call EKK0081A010 Service Agreement Inquiry"]
    COND2["kktk_svc_cd or taknkiki_model_cd empty?"]
    STEP5["Call EKK0771B001 Equipment Service List"]
    STEP6["Call EKK0771A010 Equipment Service Agreement"]
    COND3["check_scrn_id equals KKW009?"]
    STEP7["Call isKikiInfoServerChkCC Server Check"]
    STEP8["Call getPcrsData Pricing Course Analysis"]
    STEP9["Call execKikiAddCC Equipment Registration"]
    STEP10["Call execShinchokuToroku Registration Info"]
    COND4["func_code equals FUNC_CODE_1?"]
    STEP11["Call execKikiOptSvcKeiUpdCC Opt Service Update"]
    COND5["tanmt_comps_um equals UM_U?"]
    STEP12["Call execKikiOptSvcKeiUpdCC_tamnt_conp"]
    STEP13["Call execKikiTorokuWrisvc Discount Service"]
    COND6["func_code equals FUNC_CODE_1?"]
    STEP14["Get kikiCreateCCMap and createList"]
    STEP15["Call getKktkSvcKeiData"]
    STEP16["Call setSvcUpDtm Set Update Timestamp"]
    STEP17["Store temp output to ccOutputMap"]
    STEP18["Call setReturnData Set Return Data"]
    STEP19["Call setScrnReturnData Screen Return Data"]
    COND7["func_code equals FUNC_CODE_1?"]
    STEP20["Call execKappuInfoAdd Contract Registration"]
    COND8["func_code equals FUNC_CODE_1?"]
    STEP21["Call execKikiTorokuWrisvc Discount CC"]
    COND9["tokkiChgList not null and func_code FUNC_CODE_1?"]
    STEP22["Loop tokkiChgList Special Change Items"]
    STEP23["editInEKK0071D010 Agent Store Registration"]
    STEP24["scCall.run Execute SC"]
    STEP25["editRetEKK0071D010 Process SC Result"]
    COND10["getReturnCode >= SINGLEDATA_ERR?"]
    STEP26["Throw CCException SC Error"]
    COND11["func_code equals FUNC_CODE_1?"]
    STEP27["Call execTmkntshoInfAdd Terminal Notification"]
    COND12["func_code equals FUNC_CODE_1?"]
    STEP28["Call execOnuKokankojiAdd ONU Exchange Work"]
    STEP29["Remove KIKI_CREATE_CC_PARAM and KIKI_CREATE_LIST"]
    END_NODE["Return param"]

    START --> STEP1
    STEP1 --> STEP2
    STEP2 --> STEP3
    STEP3 --> COND1
    COND1 -->|true| STEP4
    COND1 -->|false| STEP3_RET["Use existing svc_kei_data"]
    STEP3_RET --> COND2
    STEP4 --> COND2
    COND2 -->|true| STEP5
    COND2 -->|false| STEP8
    STEP5 --> STEP6
    STEP6 --> COND3
    COND3 -->|true| STEP7
    COND3 -->|false| STEP8
    STEP7 --> STEP8_RET["isKikiInfoServerChkCC passes?"]
    STEP8_RET -->|false| END_NODE
    STEP8_RET -->|true| STEP8
    STEP8 --> STEP9
    STEP9 --> STEP10
    STEP10 --> COND4
    COND4 -->|true| STEP11
    COND4 -->|false| STEP13
    STEP11 --> COND5
    COND5 -->|true| STEP12
    COND5 -->|false| STEP13
    STEP12 --> STEP13
    STEP13 --> COND6
    COND6 -->|true| STEP14
    COND6 -->|false| STEP18
    STEP14 --> STEP15
    STEP15 --> STEP16
    STEP16 --> STEP17
    STEP17 --> STEP18
    STEP18 --> STEP19
    STEP19 --> COND7
    COND7 -->|true| STEP20
    COND7 -->|false| STEP21
    STEP20 --> COND8
    COND8 -->|true| STEP21
    COND8 -->|false| COND9
    STEP21 --> COND9
    COND9 -->|true| STEP22
    COND9 -->|false| END_NODE
    STEP22 --> STEP23
    STEP23 --> STEP24
    STEP24 --> STEP25
    STEP25 --> COND10
    COND10 -->|true| STEP26
    COND10 -->|false| COND11
    STEP26 --> COND11
    COND11 -->|true| STEP27
    COND11 -->|false| END_NODE
    STEP27 --> COND12
    COND12 -->|true| STEP28
    COND12 -->|false| END_NODE
    STEP28 --> STEP29
    STEP29 --> END_NODE
```

**Processing Summary:**

1. **Initialization Phase** (L3836–L3857): The method initializes error flags, message lists, temporary data storage, and the common work area. It sets up the service contract pre-update timestamp and creates a `ServiceComponentRequestInvoker` for subsequent CBS/SC calls.

2. **Service Agreement Data Retrieval** (L3861–L3884): If `svc_kei_data` is not already in the message map, it calls the **EKK0081A010** CBS (Service Agreement Inquiry) with `func_code = "2"` to fetch the service contract agreement details keyed by `svc_kei_no` and `unyo_ymd` (operation date). The result is stored in `temporaryData`.

3. **Equipment Service Determination** (L3888–L3902): If the `kktk_svc_cd` (equipment-provided service code) or `taknkiki_model_cd` (equipment model code) is empty, the method calls **EKK0771B001** (Equipment Service List) to determine the correct service, then **EKK0771A010** (Equipment Service Agreement) to retrieve the service name and alias. These are stored back into `ccMsg`.

4. **Server Check Gate** (L3906–L3912): When called from the KKW009 sub-screen, a server check (`isKikiInfoServerChkCC`) is performed. If the server check fails, the method returns early — no further processing occurs.

5. **Pricing Analysis** (L3915–L3919): The method calls `getPcrsData` to analyze pricing courses, storing the result in `temporaryData` under `PCRS_MAP`.

6. **Equipment Registration Core** (L3922–L3929): `execKikiAddCC` performs the core equipment registration logic. Subsequently, `execShinchokuToroku` handles registration information updates (note: a v5.02.00 code change removed the `svcKeiStat != "010"` guard, so this now runs unconditionally).

7. **Optional Service Update Branch** (L3933–L3946): When `func_code == "1"`, `execKikiOptSvcKeiUpdCC` updates optional service contracts. If `tanmt_comps_um` equals `"1"` (UM_U = "has presence"), `execKikiOptSvcKeiUpdCC_tamnt_conp` performs additional tamnt_conp processing.

8. **Discount Service Registration** (L3949–L3952): `execKikiTorokuWrisvc` registers discount services (re-enabled after ANK-3217 removal in a previous version).

9. **Post-Registration Data Processing** (L3957–L3975): When `func_code == "1"`, the method retrieves the equipment registration data via `kikiCreateCCMap`, calls `getKktkSvcKeiData` to build the service data map, sets the service update timestamp via `setSvcUpDtm`, and stores HDD capacity code and movement division into `ccOutputMap` under `TEMP_OUTPUT`.

10. **Return Data Preparation** (L3979–L3981): `setReturnData` and `setScrnReturnData` prepare return values including status codes and names.

11. **Contract Information Registration** (L3985–L3988): When `func_code == "1"`, `execKappuInfoAdd` registers contract information and smartlink premium data.

12. **Special Change Item Processing** (L3998–L4033): When `tokkiChgList` is not null and `func_code == "1"`, the method iterates over special change items. For each item, it performs agent store registration via `editInEKK0071D010`, executes the SC call, processes the result, and throws a `CCException` if any item-level error is detected (error code >= `SINGLEDATA_ERR`).

13. **Terminal Purchase Notification** (L4036–L4041): When `func_code == "1"`, `execTmkntshoInfAdd` registers terminal purchase notification documents.

14. **ONU Exchange Work Registration** (L4043–L4048): When `func_code == "1"`, `execOnuKokankojiAdd` registers ONU exchange work details.

15. **Cleanup and Return** (L4051–L4061): The method removes temporary data keys (`KIKI_CREATE_CC_PARAM`, `KIKI_CREATE_LIST`) and returns the `param` object.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `handle` | `SessionHandle` | Database session handle providing transaction context for CBS/SC calls. Used to manage database connections, transactions, and commit/rollback semantics across all sub-component invocations. |
| 2 | `param` | `IRequestParameterReadWrite` | Request/response parameter carrier. Contains mapped work area data, screen input values, and output data keyed by data map keys. Serves as the primary bidirectional data bridge between the screen and business logic. Methods like `setData()`, `getData()`, `getMappingWorkArea()`, `setMappingWorkArea()`, `removeData()`, and `putParamMap()` operate on it. |
| 3 | `fixedText` | `String` | Used as the `dataMapKey` for all param data operations. Represents the screen identifier or fixed text label that serves as the namespace key for retrieving and storing data within `param`. Typically corresponds to a screen code (e.g., "KKW009"). |
| 4 | `scrnItemMap` | `HashMap<String, Object>` | Screen item map containing user-modifiable field values from the equipment list screen. Used to read screen-editable attributes like `tanmt_comps_um_edit` (terminal has presence indicator) and `tokki_chg_list` (special change item list). This map carries user input from the UI layer into the business logic. |
| 5 | `ccOutputMap` | `HashMap<String, Object>` | Output parameter map for passing computed data between CC components. After registration completes, post-registration data (HDD capacity code and movement division) is stored here under the `TEMP_OUTPUT` key for downstream components to consume. |

**Instance fields / external state read by this method:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `SVC_KEI_STAT_UKZUMI` | `String` = `"010"` | Service contract status code for "completed" (used in conditional branch, though the guard is now removed as of v5.02.00) |
| `KIKI_CREATE_LIST` | `String` = `"kikiCreateList"` | Data key for equipment registration list removal |
| `KIKI_CREATE_CC_PARAM` | `String` = `"JKKKikiAddCC"` | Data key for equipment registration CC parameter removal |
| `PCRS_MAP` | `String` = `"PCRS_MAP"` | Data key for pricing course analysis temporary data |
| `SCRN_ID_KKW009` | `String` = `"KKW009"` | Screen ID constant for the equipment list sub-screen that triggers the server check gate |
| `UM_U` | `String` = `"1"` | "Has presence" indicator for terminal presence/absence check in optional service update |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `callSC` (EKK0081A010) | EKK0081A010CBS | KKT_SERVICE_AGREEMENT (Service Agreement) | Calls CBS **EKK0081A010** (Service Agreement Inquiry) via `callSC` to retrieve the service contract agreement data by `svc_kei_no` (service detail number) and `unyo_ymd` (operation date). Used to populate `svc_kei_data` when not already cached. |
| R | `callEKK0771B001` | EKK0771B001CBS | KK_T_KKTK_SVC (Equipment-Provided Service) | Calls CBS **EKK0771B001** (Equipment Service List) to query the list of available equipment-provided services filtered by `tk_sbt_cd` (equipment type code) and `unyo_ymd`. Populates `kktk_svc_cd`. |
| R | `callEKK0771A010` | EKK0771A010CBS | KK_T_KKTK_SVC_AGREEMENT (Equipment Service Agreement) | Calls CBS **EKK0771A010** (Equipment Service Agreement) to retrieve equipment service agreement details (service name, alias) by `kktk_svc_cd`. Populates `taknkiki_model_nm` and `kktk_svc_nm`. |
| R | `isKikiInfoServerChkCC` | - | - | Performs server check validation when the calling screen is KKW009. Returns `false` to abort processing if server-side data is inconsistent. |
| R | `getPcrsData` | - | PCRS (Pricing Course Data) | Calls CBS to analyze and retrieve pricing course data for the current service context. Stores result in `temporaryData` under `PCRS_MAP`. |
| R | `execKikiAddCC` | - | KIKI_ADD (Equipment Registration) | Core equipment registration component that performs multi-step equipment data insertion. Populates `kikiCreateCCMap` with `create_list` containing registered equipment data. |
| R | `execShinchokuToroku` | - | - | Registration information update component. Handles supplementary registration data insertion. (Note: v5.02.00 changed this from conditional to unconditional execution.) |
| R | `execKikiOptSvcKeiUpdCC` | - | OPT_SVC (Optional Service Contract) | Optional service contract update component for equipment optional services. Handles service contract changes for optional services tied to equipment. |
| R | `execKikiOptSvcKeiUpdCC_tamnt_conp` | - | TAMNT_CONP (Terminal Presence Comprehensive) | Additional optional service update processing when terminal has presence (`tanmt_comps_um` = `"1"`). Handles comprehensive presence-based optional service updates. |
| R | `execKikiTorokuWrisvc` | - | WRISVC (Discount Service) | Discount service registration component. Registers discount services associated with the equipment registration. Previously disabled by ANK-3217, re-enabled in a later version. |
| R | `getKktkSvcKeiData` | - | KKT_SVC_KEI (Equipment Service Detail) | Helper method that builds a service data map from the `createList` returned by `execKikiAddCC`. Extracts `LAST_UPD_DTM` (last update timestamp), `HDD_CAPA_CD` (HDD capacity code), and `IDO_DIV` (movement division). |
| U | `editInEKK0071D010` | EKK0071D010CBS | KK_T_AO_D_SHOUTEN (Agent Store Table) | Calls CBS **EKK0071D010** to register/insert agent store (distributor) information for special change items. Called within a loop over `tokkiChgList`. |
| R | `editRetEKK0071D010` | EKK0071D010CBS | KK_T_AO_D_SHOUTEN (Agent Store Table) | Processes and maps the return data from the EKK0071D010 SC call. Performs result validation and error code extraction. |
| R | `getReturnCode` | - | - | Extracts the return status code from `param` to validate SC operation results. Compares against `JPCModelConstant.SINGLEDATA_ERR` to determine if an exception should be thrown. |
| - | `setInitSvcUpdate` | - | - | Sets up service contract pre-update timestamp in the common work area for tracking purposes. |
| - | `setSvcUpDtm` | - | - | Sets the service contract update timestamp in `param` using `LAST_UPD_DTM` from the equipment registration result. |
| - | `setReturnData` | - | - | Sets return values (status code and name) in `param` for use during update confirmation screens. |
| - | `setScrnReturnData` | - | - | Retrieves and sets screen return data including names and status information from CBS results. |
| - | `setSCInputCommonData` | - | - | Helper that prepares common SC input data structure with template ID and operation parameters. |
| - | `putParamMap` | - | - | Maps CBS input parameters into the parameter structure for the SC call. |

### SC Code Reference Summary

| SC Code | Full Name | Business Purpose |
|---------|-----------|------------------|
| EKK0081A010CBS | Service Agreement Inquiry | Retrieve service contract agreement details (service name, status, period) |
| EKK0771B001CBS | Equipment Service List | Query available equipment-provided services by type |
| EKK0771A010CBS | Equipment Service Agreement | Retrieve equipment service agreement details |
| EKK0071D010CBS | Agent Store Registration | Register/insert agent store (distributor) information |
| EKK0341A010CBSMsg1List | Equipment Service Update Data | Message list containing `LAST_UPD_DTM`, `HDD_CAPA_CD`, `IDO_DIV` from equipment registration |
| EKK0021C014 / EKK0021C040 | Application Details | Referenced in template constants; used by `execOnuKokankojiAdd` |
| EKK3271D010 | Terminal Purchase Notification | Referenced in template constant; used by `execTmkntshoInfAdd` |

## 5. Dependency Trace

### Callers

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Screen:KKSV0004 (example bulk screen) | `JKKKikiIchiranIkkatsuCC.isExecKikiIchiranKkCreate()` → `JKKKikiIchiranKkCreateCC.execKikiIchiranKikiCreate()` | `execKikiAddCC [C] KK_T_KIKI_*`, `execKappuInfoAdd [C] KK_T_KAPPU_*`, `editInEKK0071D010 [U] KK_T_AO_D_SHOUTEN`, `execTmkntshoInfAdd [C] KK_T_TMKNTSHO_*`, `execOnuKokankojiAdd [C] KK_T_ONU_*` |
| 2 | Screen:KKSVxxxx (header change screen) | `JKKKikiIchiranKishuChgCC.isExecKikiIchiranKkCreate()` → `JKKKikiIchiranKkCreateCC.execKikiIchiranKikiCreate()` | `execKikiAddCC [C] KK_T_KIKI_*`, `execKappuInfoAdd [C] KK_T_KAPPU_*`, `editInEKK0071D010 [U] KK_T_AO_D_SHOUTEN`, `execTmkntshoInfAdd [C] KK_T_TMKNTSHO_*`, `execOnuKokankojiAdd [C] KK_T_ONU_*` |

### Terminal operations from this method

| Terminal Operation | Type | Entity / SC |
|-------------------|------|-------------|
| `execKikiAddCC` | C | KK_T_KIKI_* (Equipment Registration) |
| `execShinchokuToroku` | C | Registration Info Tables |
| `execKikiOptSvcKeiUpdCC` | U | Optional Service Contracts |
| `execKikiOptSvcKeiUpdCC_tamnt_conp` | U | Terminal Presence Service Data |
| `execKikiTorokuWrisvc` | C | Discount Service Tables |
| `execKappuInfoAdd` | C | KK_T_KAPPU_* (Contract Registration) |
| `editInEKK0071D010` | C | KK_T_AO_D_SHOUTEN (Agent Store) |
| `scCall.run` (EKK0071D010) | C | KK_T_AO_D_SHOUTEN (Agent Store) |
| `execTmkntshoInfAdd` | C | KK_T_TMKNTSHO_* (Terminal Purchase Notification) |
| `execOnuKokankojiAdd` | C | KK_T_ONU_* (ONU Exchange Work) |
| `callSC` (EKK0081A010) | R | Service Agreement Tables |
| `callEKK0771B001` | R | KK_T_KKTK_SVC (Equipment-Provided Service) |
| `callEKK0771A010` | R | KK_T_KKTK_SVC_AGREEMENT |
| `getPcrsData` | R | PCRS (Pricing Course Data) |
| `getKktkSvcKeiData` | R | Equipment Service Data |
| `getReturnCode` | R | Return Status |
| `setReturnData` | R | Status/Name Return Data |
| `setScrnReturnData` | R | Screen Return Data |
| `setSvcUpDtm` | U | Service Update Timestamp |
| `putParamMap` | - | Parameter Mapping |
| `setSCInputCommonData` | - | SC Input Data Preparation |

## 6. Per-Branch Detail Blocks

### Block 1 — INITIALIZATION (L3836)

> Initialize the data map, error flags, message lists, temporary data, and common work area. Set up the service component request invoker.

| # | Type | Code |
|---|------|------|
| 1 | SET | `dataMapKey = fixedText` // Data map key derived from fixedText [L3836] |
| 2 | EXEC | `ccMsg = param.getData(dataMapKey)` // Retrieve message data map [L3838] |
| 3 | SET | `func_code = ccMsg.get("func_code")` // Extract function code [L3840] |
| 4 | SET | `ccMsg.put("err_flg", "")` // Clear error flag (set to empty) // エラーフラグ [L3843] |
| 5 | SET | `messageInfo = new ArrayList<HashMap<String, Object>>()` // Create message info list // メッセージ情報 [L3846] |
| 6 | SET | `ccMsg.put("message_list", messageInfo)` // Store message list // メッセージコードリスト [L3849] |
| 7 | SET | `temporaryData = new HashMap<String, Object>()` // Create temporary data area // 一時領域名データ [L3852] |
| 8 | SET | `workMap = param.getMappingWorkArea()` // Get common work area // 共通領域を取得 [L3855] |
| 9 | IF | `workMap == null` [L3855] |

#### Block 1.1 — workMap is null (L3857)

| # | Type | Code |
|---|------|------|
| 1 | SET | `workMap = new HashMap()` // Initialize new work area [L3857] |
| 2 | EXEC | `param.setMappingWorkArea(workMap)` // Set the work area back [L3858] |

### Block 2 — SERVICE UPDATE PREP / SC INVOKER CREATION (L3860–L3863)

> Set up service contract pre-update timestamp and create the service component request invoker.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `setInitSvcUpdate(param, ccMsg)` // 契約更新前タイムスタンプを共通領域に格納 [L3860] |
| 2 | SET | `scCall = new ServiceComponentRequestInvoker()` // SC呼び出し部品 // インスタンス生成 [L3863] |

### Block 3 — SERVICE AGREEMENT DATA RETRIEVAL (L3865–L3883)

> Check if service contract data exists. If not, call CBS EKK0081A010 to retrieve it.

| # | Type | Code |
|---|------|------|
| 1 | SET | `ekk0081a010cbsMsg = (CAANMsg)ccMsg.get("svc_kei_data")` // 存在しなかった場合取得 [L3867] |
| 2 | IF | `ekk0081a010cbsMsg == null` [L3869] |

#### Block 3.1 — Call EKK0081A010 (L3872–L3882)

> ***** EKK0081A010 (Service Agreement Inquiry) *****

| # | Type | Code |
|---|------|------|
| 1 | SET | `ekk0081a010IN[0] = {EKK0081A010CBSMsg.TEMPLATEID, TEMPLATE_ID_EKK0081A010="EKK0081A010"}` [L3873] |
| 2 | SET | `ekk0081a010IN[1] = {EKK0081A010CBSMsg.FUNC_CODE, "2"}` // func_code = "2" [L3874] |
| 3 | SET | `ekk0081a010IN[2] = {EKK0081A010CBSMsg.KEY_SVC_KEI_NO, (String)ccMsg.get("svc_kei_no")}` [L3875] |
| 4 | SET | `ekk0081a010IN[3] = {EKK0081A010CBSMsg.KEY_GENE_ADD_DTM, ""}` // empty |
| 5 | SET | `ekk0081a010IN[4] = {EKK0081A010CBSMsg.KEY_RSV_APLY_YMD, (String)ccMsg.get("unyo_ymd")}` // 運用年月日 [L3876] |
| 6 | CALL | `ekk0081a010cbsMsg = callSC(handle, scCall, param, dataMapKey, ekk0081a010IN).getCAANMsgList(...)[0]` [L3880] |
| 7 | SET | `temporaryData.put(TEMPLATE_ID_EKK0081A010, ekk0081a010cbsMsg)` // 検索結果を格納 [L3884] |

### Block 4 — SERVICE STATUS EXTRACTION (L3886–L3887)

> Extract the service contract status from the agreement data.

| # | Type | Code |
|---|------|------|
| 1 | SET | `svcKeiStat = getNullToStr(ekk0081a010cbsMsg.getString(EKK0081A010CBSMsg1List.SVC_KEI_STAT))` // SVC_KEI_STAT_UKZUMI = "010" [L3886–L3887] |

### Block 5 — EQUIPMENT SERVICE DETERMINATION (L3889–L3902)

> If kktk_svc_cd or taknkiki_model_cd is empty, determine the equipment service via CBS calls.

| # | Type | Code |
|---|------|------|
| 1 | IF | `"".equals(getNullToStr(kktk_svc_cd)) || "".equals(getNullToStr(taknkiki_model_cd))` [L3889] |

#### Block 5.1 — Call EKK0771B001 (L3891–L3892)

> 機器提供サービス一覧照会 — Equipment Service List inquiry.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `ekk0771b001cbsMsg1list = callEKK0771B001(handle, scCall, param, dataMapKey, tk_sbt_cd, unyo_ymd)` [L3891] |
| 2 | SET | `ccMsg.put("kktk_svc_cd", ekk0771b001cbsMsg1list[0].getString(EKK0771B001CBSMsg1List.KKTK_SVC_CD))` [L3893] |

#### Block 5.2 — Call EKK0771A010 (L3895–L3898)

> 機器提供サービス一意向会 — Equipment Service Agreement inquiry.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `ekk0771a010cbsMsg = callEKK0771A010(handle, scCall, param, dataMapKey, kktk_svc_cd)` [L3895] |
| 2 | SET | `ccMsg.put("taknkiki_model_nm", ekk0771a010cbsMsg.getString(EKK0771A010CBSMsg1List.KKTK_SVC_NM))` // 機器提供サービス名 [L3897] |
| 3 | SET | `ccMsg.put("kktk_svc_nm", ekk0771a010cbsMsg.getString(EKK0771A010CBSMsg1List.KKTK_SVC_ALI))` // 機器提供サービス略称 [L3899] |

### Block 6 — SERVER CHECK GATE (KKW009 SUB-SCREEN) (L3903–L3912)

> Only performs check when called from sub-screen KKW009.

| # | Type | Code |
|---|------|------|
| 1 | IF | `SCRN_ID_KKW009.equals(ccMsg.get("check_scrn_id"))` [L3905] — サーバーチェック部品呼び出し（エラーの場合は後続処理を行いません） |

#### Block 6.1 — Server Check (L3907–L3911)

> サーバーチェック部品呼び出し. If check fails, return early.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `boolean chk = isKikiInfoServerChkCC(handle, scCall, param, dataMapKey, temporaryData)` [L3907] |
| 2 | IF | `chk == false` [L3908] |

##### Block 6.1.1 — Return Early (L3909–L3911)

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return param` // Early return on server check failure [L3910] |

### Block 7 — PRICING COURSE ANALYSIS (L3915–L3919)

> 料金コース判別取得部品呼び出し — Pricing course analysis and retrieval.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `pcrsData = getPcrsData(handle, param, ccMsg)` [L3916] |
| 2 | SET | `temporaryData.put(PCRS_MAP="PCRS_MAP", pcrsData)` // 検索結果を格納 [L3919] |

### Block 8 — EQUIPMENT REGISTRATION (L3922–L3929)

> 機器登録CC呼び出し — Core equipment registration.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `execKikiAddCC(handle, scCall, param, dataMapKey, temporaryData)` [L3924] |
| 2 | EXEC | `execShinchokuToroku(handle, scCall, param, dataMapKey, temporaryData)` // v5.02.00 修正: 条件分支を削除し、常に実行 [L3929] |

### Block 9 — OPTIONAL SERVICE UPDATE (FUNC_CODE_1) (L3932–L3946)

> 機器一覧機器オプション契約更新部品呼び出し — Equipment optional service contract update.

| # | Type | Code |
|---|------|------|
| 1 | IF | `FUNC_CODE_1.equals(func_code)` — FUNC_CODE_1 = "1" 処理対象リスト格納キー [L3933] |

#### Block 9.1 — Call execKikiOptSvcKeiUpdCC (L3937)

> 多機能ルータの場合のみ処理 — Only processes for multi-function routers.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `execKikiOptSvcKeiUpdCC(handle, scCall, param, dataMapKey, temporaryData)` [L3937] |

#### Block 9.2 — Terminal Presence Check (L3939–L3944)

> 端末補償有無 — Terminal presence/absence check.

| # | Type | Code |
|---|------|------|
| 1 | SET | `tanmt_comps_um = (String)scrnItemMap.get("tanmt_comps_um_edit")` [L3941] |
| 2 | IF | `UM_U.equals(tanmt_comps_um)` — UM_U = "1" 有無（有） [L3943] |

##### Block 9.2.1 — Call tamnt_conp Update (L3944)

| # | Type | Code |
|---|------|------|
| 1 | CALL | `execKikiOptSvcKeiUpdCC_tamnt_conp(handle, scCall, param, dataMapKey, temporaryData, scrnItemMap)` [L3944] |

### Block 10 — DISCOUNT SERVICE REGISTRATION (ANK-3217) (L3949–L3952)

> 割引CC呼び出し — Discount CC call (re-enabled after previous removal).

| # | Type | Code |
|---|------|------|
| 1 | CALL | `execKikiTorokuWrisvc(handle, scCall, param, dataMapKey, temporaryData)` [L3951] |

### Block 11 — POST-REGISTRATION DATA PROCESSING (FUNC_CODE_1) (L3956–L3975)

> 登録CCで登録したデータを取得 — Retrieve data registered by equipment registration CC.

| # | Type | Code |
|---|------|------|
| 1 | IF | `FUNC_CODE_1.equals(func_code)` [L3956] |

#### Block 11.1 — Get Registration Data (L3959–L3961)

| # | Type | Code |
|---|------|------|
| 1 | SET | `kikiCreateCCMap = (HashMap)param.getData(KIKI_CREATE_CC_PARAM="JKKKikiAddCC")` [L3959] |
| 2 | SET | `createList = (ArrayList)kikiCreateCCMap.get("create_list")` [L3960] |
| 3 | CALL | `kktkSvcKeiMap = getKktkSvcKeiData(createList, ccMsg)` [L3962] |

#### Block 11.2 — Set Update Timestamp (L3965)

> 登録後の更新タイムスタンプを格納 — Store post-registration update timestamp.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `setSvcUpDtm(param, kktkSvcKeiMap.get(EKK0341A010CBSMsg1List.LAST_UPD_DTM))` [L3966] |

#### Block 11.3 — Store Temp Output (ANK-2985) (L3968–L3974)

> Output HDD capacity code and movement division for downstream components.

| # | Type | Code |
|---|------|------|
| 1 | SET | `ccOutMap = new HashMap()` [L3970] |
| 2 | SET | `ccOutMap.put("hdd_capa_cd", kktkSvcKeiMap.get(EKK0341A010CBSMsg1List.HDD_CAPA_CD))` [L3971] |
| 3 | SET | `ccOutMap.put("ido_div", kktkSvcKeiMap.get(EKK0341A010CBSMsg1List.IDO_DIV))` [L3972] |
| 4 | SET | `ccOutputMap.put("TEMP_OUTPUT", ccOutMap)` [L3973] |

### Block 12 — RETURN DATA PREPARATION (L3979–L3981)

> 返却値を設定 — Set return values (status code and name needed for update confirmation).

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `setReturnData(param, dataMapKey)` // 返却値を設定 [L3980] |
| 2 | EXEC | `setScrnReturnData(handle, scCall, param, dataMapKey, temporaryData)` // 名称データ等取得し返却 [L3981] |

### Block 13 — CONTRACT INFORMATION REGISTRATION (FUNC_CODE_1) (L3984–L3988)

> 割賦契約・スマートリンクプレミアム登録処理実行判断 — Contract registration check and execution.

| # | Type | Code |
|---|------|------|
| 1 | IF | `FUNC_CODE_1.equals(func_code)` [L3985] |
| 2 | CALL | `execKappuInfoAdd(handle, scCall, param, dataMapKey, temporaryData)` // 割賦契約登録処理 [L3987] |

### Block 14 — SPECIAL CHANGE ITEM PROCESSING (v9.00.02) (L3997–L4034)

> 機器一覧機器特許実績更新処理実行判断 — Special change item list processing.

| # | Type | Code |
|---|------|------|
| 1 | SET | `tokkiChgList = (ArrayList)scrnItemMap.get("tokki_chg_list")` [L3999] |
| 2 | IF | `FUNC_CODE_1.equals(func_code)` [L4001] |

#### Block 14.1 — Check tokkiChgList (L4003)

> 取扱コードが設定されている場合 — When handling code is set.

| # | Type | Code |
|---|------|------|
| 1 | IF | `tokkiChgList != null` [L4003] |

##### Block 14.1.1 — Loop Over Special Change Items (L4006–L4032)

> 順番だけを変更した場合を想定して、削除を行ってから登録を行う — For cases where only order is changed, delete and re-register.

| # | Type | Code |
|---|------|------|
| 1 | SET | `mskmNo = (String)workMap.get("mskm_no")` // 申請番号 [L4008] |
| 2 | FOR | `i = 0; i < tokkiChgList.size(); i++` [L4011] |

###### Block 14.1.1.A — Process Each Item (L4012–L4031)

| # | Type | Code |
|---|------|------|
| 1 | SET | `tokkiChgDetailMap = (HashMap)tokkiChgList.get(i)` [L4012] |
| 2 | SET | `paramMap = setSCInputCommonData(param, new HashMap())` [L4013] |
| 3 | IF | `tokkiChgDetailMap != null` [L4015] |

####### Block 14.1.1.A.1 — Agent Store Registration (L4017–L4027)

> 申請K代理店登録 — Application agent store registration.

| # | Type | Code |
|---|------|------|
| 1 | SET | `template = editInEKK0071D010(param, fixedText, scrnItemMap, tokkiChgDetailMap, mskmNo)` [L4018] |
| 2 | SET | `result = scCall.run(putParamMap(paramMap, template), handle)` // SC呼び出し [L4019] |
| 3 | EXEC | `editRetEKK0071D010(result, param, fixedText)` // 下マッチピング [L4020] |
| 4 | IF | `getReturnCode(param) >= JPCModelConstant.SINGLEDATA_ERR` [L4021] |

######## Block 14.1.1.A.1.a — Error Exception (L4023–L4025)

> ステータスが単項目エラー以上であれば例外をスロー — If status is single-item error or above, throw exception.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `throw new CCException(SC_ERROR_STRING="サービスコンポーネントエラー", new Exception())` [L4024] |

### Block 15 — TERMINAL PURCHASE NOTIFICATION (ANK-3987) (L4036–L4041)

> 端末購入通知書情報登録処理 — Terminal purchase notification document registration.

| # | Type | Code |
|---|------|------|
| 1 | IF | `FUNC_CODE_1.equals(func_code)` [L4038] |
| 2 | CALL | `execTmkntshoInfAdd(handle, scCall, param, dataMapKey, temporaryData)` [L4040] |

### Block 16 — ONU EXCHANGE WORK REGISTRATION (ANK-4315) (L4043–L4048)

> ONU交換工事登録処理 — ONU exchange work registration.

| # | Type | Code |
|---|------|------|
| 1 | IF | `FUNC_CODE_1.equals(func_code)` [L4045] |
| 2 | CALL | `execOnuKokankojiAdd(handle, scCall, param, dataMapKey, temporaryData)` [L4047] |

### Block 17 — CLEANUP AND RETURN (L4051–L4061)

> 機器登録CCのMapを削除 — Remove equipment registration CC maps (clear data registered by discount CC).

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `param.removeData(KIKI_CREATE_CC_PARAM="JKKKikiAddCC")` // 削除 // 割引CCで機器登録CCが登録したデータ「機器提供サービス契約情報」「サービス契約內一意向会」を使用するためここでクリア [L4056] |
| 2 | EXEC | `param.removeData(KIKI_CREATE_LIST="kikiCreateList")` // 工事連携データ削除 [L4058] |
| 3 | RETURN | `return param` [L4060] |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `svc_kei_no` | Field | Service detail number — internal tracking ID for a service contract line item |
| `svc_kei_stat` | Field | Service contract status — indicates the lifecycle state of a service (e.g., `"010"` = completed/受付済, `"020"` = inspected/照检済, `"100"` = in service/サービス提供中) |
| `svc_kei_data` | Field | Service contract agreement data — full agreement record from CBS EKK0081A010 |
| `func_code` | Field | Function code — routing parameter determining processing mode: `"1"` = check-and-register (登録時), `"2"` = inquiry-only (照会時) |
| `kktk_svc_cd` | Field | Equipment-provided service code — identifies the type of service provided with equipment |
| `kktk_svc_nm` | Field | Equipment-provided service name |
| `kktk_svc_al` | Field | Equipment-provided service alias |
| `taknkiki_model_cd` | Field | Equipment model code — identifies the specific hardware model being registered |
| `taknkiki_model_nm` | Field | Equipment model name |
| `tk_sbt_cd` | Field | Equipment type code — categorizes equipment (e.g., router, terminal) |
| `unyo_ymd` | Field | Operation date (年月日) — the business date for the operation |
| `kktk_svc_cd` | Field | Equipment-provided service code (機器提供サービスコード) — code identifying a specific equipment service type |
| `kktk_svc_nm` | Field | Equipment-provided service name (機器提供サービス名) |
| `kktk_svc_al` | Field | Equipment-provided service alias (機器提供サービス略称) |
| `tanmt_comps_um_edit` | Field | Terminal presence/absence edit indicator — `"1"` (UM_U) means terminal has presence |
| `tokki_chg_list` | Field | Special change item list — items requiring special handling (e.g., agent store changes) |
| `mskm_no` | Field | Application number (申請番号) — unique identifier for the application record |
| `hdd_capa_cd` | Field | HDD capacity code — hardware specification code for storage capacity |
| `ido_div` | Field | Movement division (異動区分) — classification of service change type |
| `func_code` | Field | Function code — routing parameter: `"1"` = check-and-register, `"2"` = inquiry only |
| `err_flg` | Field | Error flag — `"W"` = warning, empty = no error |
| `KIKI_CREATE_CC_PARAM` | Constant = `"JKKKikiAddCC"` | Data key for equipment registration CC parameter storage |
| `KIKI_CREATE_LIST` | Constant = `"kikiCreateList"` | Data key for equipment registration list storage |
| `PCRS_MAP` | Constant = `"PCRS_MAP"` | Temporary data key for pricing course analysis results |
| `SCRN_ID_KKW009` | Constant = `"KKW009"` | Screen ID for the equipment list sub-screen that triggers server validation |
| `FUNC_CODE_1` | Constant = `"1"` | Function code for "check-and-register" mode (登録時) — triggers full processing |
| `SVC_KEI_STAT_UKZUMI` | Constant = `"010"` | Service contract status = "completed" (受付済) |
| `SVC_KEI_STAT_SYSUMI` | Constant = `"020"` | Service contract status = "inspected" (照检済) |
| `UM_U` | Constant = `"1"` | "Has presence" (有) — terminal presence/absence positive indicator |
| `SC_ERROR_STRING` | Constant = "サービスコンポーネントエラー" | Error string: "Service Component Error" — thrown when SC returns error status |
| `TEMPLATE_ID_EKK0081A010` | Constant = `"EKK0081A010"` | Template ID for Service Agreement Inquiry CBS |
| `TEMPLATE_ID_EKK0771B001` | Constant = `"EKK0771B001"` | Template ID for Equipment Service List CBS |
| `TEMPLATE_ID_EKK0771A010` | Constant = `"EKK0771A010"` | Template ID for Equipment Service Agreement CBS |
| `TEMPLATE_ID_EKK3271D010` | Constant = `"EKK3271D010"` | Template ID for Terminal Purchase Notification Document registration |
| `EKK0081A010` | SC Code | Service Agreement Inquiry (サービス契約一意向会) — retrieves service contract details |
| `EKK0071D010` | SC Code | Agent Store Registration (代理店登録) — inserts/updates agent (distributor) store information |
| `EKK0771B001` | SC Code | Equipment Service List (機器提供サービス一覧) — queries available equipment services |
| `EKK0771A010` | SC Code | Equipment Service Agreement (機器提供サービス一意向会) — retrieves equipment service agreement |
| `EKK0341A010` | SC Code | Equipment Service Update (機器サービス更新) — returns update timestamp, HDD capacity, movement division |
| `CC` | Acronym | Common Component — shared business logic controller in the Fujitsu Futurity architecture |
| `CBS` | Acronym | Common Business Service — shared service component layer for business operations |
| `SC` | Acronym | Service Component — lower-level service component for specific data operations |
| `CAANMsg` | Class | CBS/SC message container — holds request/response data between layers |
| `SessionHandle` | Class | Database session handle — manages transaction context and DB connections |
| `IRequestParameterReadWrite` | Interface | Request/response parameter interface — bidirectional data carrier between screen and business logic |
| `CCException` | Class | Custom exception for CC-layer errors — wraps error strings with stack trace |
| `ServiceComponentRequestInvoker` | Class | SC invocation orchestrator — executes CBS/SC calls with parameter mapping |
| FTTH | Business term | Fiber To The Home — fiber-optic broadband internet service |
| ENUM | Business term | ENUM (Telephone Number to URI Mapping) — VoIP-based telephone service mapping phone numbers to SIP URIs |
| Smartlink Premium | Business term | Premium smartlink service (B077) — bundled discount service for contract customers |
| ONU | Business term | Optical Network Unit — fiber-optic terminal equipment for FTTH connections |
| HGW | Business term | Home Gateway — residential gateway device providing routing, WiFi, and telephony functions |
| 受付済 (UKZUMI) | Japanese term | "Accepted/Completed" — service contract status indicating the application has been processed and accepted |
| 照检済 (SYSUMI) | Japanese term | "Inspected" — service contract status indicating inspection has been completed |
| サービス提供中 (TKCHU) | Japanese term | "In Service" — service contract status indicating active service provision |
| 機器登録 (KIKI TOROKU) | Japanese term | Equipment Registration — the process of registering end-user terminal equipment to a service contract |
| 機器提供サービス (KKTK SVC) | Japanese term | Equipment-Provided Service — service type tied to specific equipment (e.g., router, ONU) |
| サービス契約 (SVC KEI) | Japanese term | Service Contract — the contractual agreement between customer and service provider for telecom services |
| 契約更新前タイムスタンプ | Japanese term | Pre-update timestamp for service contract — recorded before any contract modifications |
| 料金コース判別 (PCRS) | Japanese term | Pricing Course Determination — analysis of pricing plans associated with the service |
| オプション契約 (OPT SVC) | Japanese term | Optional Service Contract — supplementary services added to a base service |
| 割賦契約 (KAPPU) | Japanese term | Installment Contract — equipment financed via monthly installments |
| 代理店登録 (AO-D SHOUTEN) | Japanese term | Agent/Distributor Store Registration — registration of retail partner points |
| 端末購入通知書 (TMKNTSHO) | Japanese term | Terminal Purchase Notification Document — documentation of terminal equipment purchase |
| ONU交換工事 (ONU KOKANKOJI) | Japanese term | ONU Exchange Work — field work for replacing ONU equipment at customer premises |
| 特許実績 (TOKKI SEKKA) | Japanese term | Special Achievement/Record — specialized equipment records requiring special handling |
| 工事連携 (KOJI RENKEI) | Japanese term | Construction Work Linkage — data integration between equipment registration and field work systems |
| 異動区分 (IDO DIV) | Movement Division | Classification of service change type (e.g., `"00001"` = new contract, `"00002"` = service add, `"00026"` = equipment change, `"00031"` = option settings) |
| 有無 (UM) | Japanese term | Presence/Absence indicator — `"1"` = present (有), typically for terminal equipment presence status |
| 機器一覧 (KIKI ICHIRAN) | Japanese term | Equipment List — screen/feature for listing and managing registered equipment |
| 一意向会 (ICHIJIYOU-KAI) | Japanese term | Single Agreement Inquiry — CBS operation for retrieving a single agreement record |
| 運用年月日 (UNYO_YMD) | Field | Operation date — the business processing date used for record queries |
| 申請番号 (MSKM_NO) | Field | Application number — unique identifier for a service application |
| LAST_UPD_DTM | Field | Last update timestamp — datetime of the last modification to equipment service data |
| HDD_CAPA_CD | Field | HDD capacity code — hardware storage capacity specification code |
| PRG_STAT_* | Constants | Progress status codes (e.g., `"3100"` = rental registration complete, `"3601"` = purchase receipt complete, `"5102"` = option settings complete) |
| KKTK_SBT_CD_RENTAL | Constant = `"02"` | Equipment provision type code: Rental |
| KKTK_SBT_CD_KAITORI | Constant = `"01"` | Equipment provision type code: Purchase |
| KKTK_SBT_CD_MOTIKOMI | Constant = `"03"` | Equipment provision type code: Held/Owned |
| KKTK_SVC_CD_C024 | Constant = `"C024"` | Equipment-provided service code for multi-function router |
| CD_SBT_CD_01467 | Constant = `"CD01467"` | Code type code: Sales form code (販売形態コード) |
| JPCModelConstant.SINGLEDATA_ERR | Constant | Error threshold — return code at or above this value indicates a single-item error |
