# Business Logic — KKW00147SFLogic.doAddTelephoneNumberInfo() [402 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.KKW00147SF.KKW00147SFLogic` |
| Layer | Controller (Web view logic layer) |
| Module | `KKW00147SF` (Package: `eo.web.webview.KKW00147SF`) |

## 1. Role

### KKW00147SFLogic.doAddTelephoneNumberInfo()

This method serves as the central orchestrator for registering and managing telephone number information within the K-Opticom telecommunications service management system. It receives a function code and a movement division code (ido_div) extracted from the form, then dispatches to one of five specialized service registration pathways based on the business operation type: (1) telephone number addition (光電話・番号追加), (2) telephone information change (光電話・電話番号情報変更), (3) number change (光電話・番号変更), (4) number cancellation (光電話・番号解約), and (5) port information change (光電話・番ポ情報変更). The method implements a routing/dispatch design pattern, using the movement division code as a discriminator to select the appropriate service component mapper (DBMapper) and associated service invocation. Before dispatching, it prepares all form-level data beans including sender notification status, port existence flag, port number, and movement reason codes. After service invocation, it maps returned code values back to their display names for presentation. The method also captures the operator's organization context (organization code and name) for audit trail purposes, and performs domain-specific validation such as blocking legal entity number cancellations and ENUM switch restrictions.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["doAddTelephoneNumberInfo funcCode"])

    START --> INIT["Initialize: paramMap, inputMap, outputMap, svcFormBean"]
    INIT --> GET_HASINSHA["Get sender notification DataBean"]
    GET_HASINSHA --> CHK_IND{indStr not null}
    CHK_IND -->|Yes| MAP_IND["Map sender notification from index"]
    CHK_IND -->|No| GET_TELNO["Get telephone number transmission status"]
    MAP_IND --> POST_MAP_1["Map sender notification to display"]
    GET_TELNO --> SELECT_1["selectedPulldownIndex for sender notification"]
    SELECT_1 --> POST_MAP_1
    POST_MAP_1 --> GET_BMP["Get port existence DataBean"]
    GET_BMP --> CHK_BMP{indStrBmp not null}
    CHK_BMP -->|Yes| MAP_BMP["Map port existence from index"]
    CHK_BMP -->|No| GET_BMP_DATA["Get port existence from EKK0191A010DATA"]
    MAP_BMP --> POST_MAP_2["Map port existence to display"]
    GET_BMP_DATA --> SELECT_2["selectedPulldownIndex for port existence"]
    SELECT_2 --> POST_MAP_2
    POST_MAP_2 --> GET_PORT["Get port number DataBean"]
    GET_PORT --> CHK_PORT{portIndStr not null}
    CHK_PORT -->|Yes| MAP_PORT["Map port number from index"]
    CHK_PORT -->|No| GET_PORT_DATA["Get port number from EKK0191A010DATA"]
    GET_PORT_DATA --> SELECT_3["selectedPulldownIndex for port number"]
    MAP_PORT --> POST_MAP_3["Map port number to display"]
    SELECT_3 --> POST_MAP_3
    POST_MAP_3 --> GET_IDO["Get movement division idDiv"]
    GET_IDO --> GET_IDO_RSN["Get movement reason list and memo"]
    GET_IDO_RSN --> LOOP_IDO["Loop: copy movement reason CD and memo"]
    LOOP_IDO --> GET_ORG["Get orgCd and orgNm from common info bean"]
    GET_ORG --> CHK_IDO{ido_div branch}

    CHK_IDO -->|00041 Addition| BR_TSUIKA["Branch: Telephone number addition"]
    CHK_IDO -->|00048 Phone change| BR_HENKO["Branch: Telephone information change"]
    CHK_IDO -->|00042 Number change| BR_BANGO_HENKO["Branch: Number change"]
    CHK_IDO -->|00043 Cancellation| BR_BANGO_KAIYAKU["Branch: Number cancellation"]
    CHK_IDO -->|00045 Port change| BR_BANPO_HENKO["Branch: Port information change"]
    CHK_IDO -->|other| RET_DEFAULT["Return isErr default"]

    BR_TSUIKA --> SET_TSUIKA_PARAMS["Set service parameters UCID_KKSV0065"]
    SET_TSUIKA_PARAMS --> CREATE_MAPP1["Create KKSV0065_KKSV0065OPDBMapper"]
    CREATE_MAPP1 --> MAPPER_CC1["setKKSV006501CC"]
    MAPPER_CC1 --> INVOKE1["invokeService"]
    INVOKE1 --> CHECK_ERR1["getErrInfo check for errors"]
    CHECK_ERR1 --> POST_RETURN_1["Post processing map display names"]
    POST_RETURN_1 --> FINAL_RETURN["Return isErr"]

    BR_HENKO --> SET_HENKO_PARAMS["Set service parameters UCID_KKSV0211"]
    SET_HENKO_PARAMS --> CREATE_MAPP2["Create KKSV0211_KKSV0211OPDBMapper"]
    CREATE_MAPP2 --> MAPPER_CHAIN["Set 25 mapper SC and CC methods"]
    MAPPER_CHAIN --> CHK_FC{funcCode equals FUNC_CD_1}
    CHK_FC -->|Yes| INVOKE2["invokeService"]
    INVOKE2 --> CHK_SET_ERR{setErrorMessageInfo}
    CHK_SET_ERR -->|true| RET_ERR2["Return isErr error"]
    CHK_SET_ERR -->|false| CHK_SET_EG_ERR{setEgErrorMessageInfo}
    CHK_SET_EG_ERR -->|true| RET_ERR2
    CHK_SET_EG_ERR -->|false| POST_RETURN_2["Post processing map display names"]
    POST_RETURN_2 --> FINAL_RETURN
    CHK_FC -->|No| CHK_1{funcCode equals 1}
    CHK_1 -->|Yes| GET_ERR2["getErrInfo for KKSV021129SC"]
    CHK_1 -->|No| POST_RETURN_2

    BR_BANGO_HENKO --> SET_BH_PARAMS["Set service parameters UCID_KKSV0213"]
    SET_BH_PARAMS --> CREATE_MAPP3["Create KKSV0213_KKSV0213OPDBMapper"]
    CREATE_MAPP3 --> MAPPER_CC3["setKKSV021301CC"]
    MAPPER_CC3 --> INVOKE3["invokeService"]
    INVOKE3 --> CHECK_ERR3["getErrInfo check for errors"]
    CHECK_ERR3 --> POST_RETURN_3["Post processing map display names"]
    POST_RETURN_3 --> FINAL_RETURN

    BR_BANGO_KAIYAKU --> SET_BK_PARAMS["Set service parameters UCID_KKSV0195"]
    SET_BK_PARAMS --> CREATE_MAPP4["Create KKSV0195_KKSV0195OPDBMapper"]
    CREATE_MAPP4 --> MAPPER_CHAIN4["setKKSV019501CC147 SC CC methods"]
    MAPPER_CHAIN4 --> CHK_FC4{funcCode equals FUNC_CD_1}
    CHK_FC4 -->|Yes| INVOKE4["invokeService"]
    INVOKE4 --> CHK_KOJIN{kojinHojin_tlnTaiCd equals HOJIN}
    CHK_KOJIN -->|true| RET_ERR_KOJIN["Return error legal entity cancellation"]
    CHK_KOJIN -->|false| CHK_ERR_CD{ERR_CD is E10 or E11}
    CHK_ERR_CD -->|E10| RET_ERR_E10["Return error port suspension released"]
    CHK_ERR_CD -->|E11| RET_ERR_E11["Return error ENUM switch impossible"]
    CHK_ERR_CD -->|none| POST_RETURN_4["Post processing map display names"]
    POST_RETURN_4 --> FINAL_RETURN

    BR_BANPO_HENKO --> SET_BP_PARAMS["Set service parameters UCID_KKSV0214"]
    SET_BP_PARAMS --> CREATE_MAPP5["Create KKSV0214_KKSV0214OPDBMapper"]
    CREATE_MAPP5 --> MAPPER_CC5["setKKSV021401CC"]
    MAPPER_CC5 --> INVOKE5["invokeService"]
    INVOKE5 --> CHECK_ERR5["getErrInfo check for errors"]
    CHECK_ERR5 --> POST_RETURN_5["Post processing map display names"]
    POST_RETURN_5 --> FINAL_RETURN
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `funcCode` | `String` | Service function code that determines processing depth and invocation behavior. `"1"` (FUNC_CD_1) triggers full service invocation with error handling; `"2"` (FUNC_CD_2) sets up mapper data without invoking the service (preparation mode). |
| — | `ido_div` (instance field) | `String` | Movement division code extracted from the form. Determines which business operation path is taken: `00041` (telephone number addition), `00048` (telephone information change), `00042` (number change), `00043` (number cancellation), `00045` (port information change). |
| — | `svcFormBean` (instance field) | `X31SDataBeanAccess` | Service form bean holding all form data. Provides access to sender notification, port existence, port number, and movement reason data beans. Acts as the primary data exchange vehicle between the web layer and service layer. |
| — | `paramBean[0]` | `X31SDataBeanAccess[]` | Wrapper array containing the service form bean for passing to mapper methods and service invocations. |
| — | `commoninfoBean` | `X31SDataBeanAccess` | Common information bean accessed via `getCommonInfoBean()`. Provides organization code and name for audit trail registration in the support history. |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| C | `KKSV0065_KKSV0065OPDBMapper.setKKSV006501CC` | KKSV006501CC | - | Telephone number registration CC — maps form data for telephone number addition service |
| C | `KKSV0211_KKSV0211OPDBMapper.setKKSV021101SC` | KKSV021101SC | - | Customer consultation SC — retrieves customer consent information |
| C | `KKSV0211_KKSV0211OPDBMapper.setKKSV021102SC` | KKSV021102SC | - | Service contract details eo telephone consent SC |
| C | `KKSV0211_KKSV0211OPDBMapper.setKKSV021103SC` | KKSV021103SC | - | Service contract details eo telephone consent list SC (service contract number) |
| C | `KKSV0211_KKSV0211OPDBMapper.setKKSV021104SC` | KKSV021104SC | - | Option service contract telephone consent list SC (service contract detail number) |
| C | `KKSV0211_KKSV0211OPDBMapper.setKKSV021105SC` | KKSV021105SC | - | Application content approval registration SC |
| C | `KKSV0211_KKSV0211OPDBMapper.setKKSV021107SC` | KKSV021107SC | - | Service contract details eo telephone information change SC |
| C | `KKSV0211_KKSV0211OPDBMapper.setKKSV021109SC` | KKSV021109SC | - | Option service contract telephone registration SC |
| C | `KKSV0211_KKSV0211OPDBMapper.setKKSV021110SC` | KKSV021110SC | - | Option service contract telephone settlement SC |
| C | `KKSV0211_KKSV0211OPDBMapper.setKKSV021111SC` | KKSV021111SC | - | Option service contract telephone start SC |
| C | `KKSV0211_KKSV0211OPDBMapper.setKKSV021118SC` | KKSV021118SC | - | Option service contract cancel SC |
| C | `KKSV0211_KKSV0211OPDBMapper.setKKSV021112SC` | KKSV021112SC | - | Option service contract termination SC |
| C | `KKSV0211_KKSV0211OPDBMapper.setKKSV021115SC` | KKSV021115SC | - | Option service contract termination confirmation SC |
| C | `KKSV0211_KKSV0211OPDBMapper.setKKSV021113SC` | KKSV021113SC | - | Application detail statement follow-up work request SC |
| C | `KKSV0211_KKSV0211OPDBMapper.setKKSV021114SC` | KKSV021114SC | - | Progress information registration SC |
| C | `KKSV0211_KKSV0211OPDBMapper.setKKSV021116SC` | KKSV021116SC | - | Service contract telephone consent SC |
| C | `KKSV0211_KKSV0211OPDBMapper.setKKSV021117SC` | KKSV021117SC | - | Service contract details consent SC |
| C | `KKSV0211_KKSV0211OPDBMapper.setKKSV021119SC` | KKSV021119SC | - | Service contract eo telephone information change initiation |
| C | `KKSV0211_KKSV0211OPDBMapper.setKKSV021120SC` | KKSV021120SC | - | Service contract eo telephone consent SC |
| C | `KKSV0211_KKSV0211OPDBMapper.setKKSV021121SC` | KKSV021121SC | - | Service contract eo telephone information change SC |
| C | `KKSV0211_KKSV0211OPDBMapper.setKKSV021129SC` | KKSV021129SC | - | Invoice issuance condition list display SC |
| C | `KKSV0211_KKSV0211OPDBMapper.setKKSV021130SC` | KKSV021130SC | - | Service contract details eo telephone consent SC 2 |
| C | `KKSV0211_KKSV0211OPDBMapper.setKKSV021132SC` | KKSV021132SC | - | Equipment provision service contract list SC (service contract number) |
| C | `KKSV0211_KKSV0211OPDBMapper.setKKSV021139SC` | KKSV021139SC | - | Equipment provision service contract list SC (service contract number) equipment swap period |
| C | `KKSV0211_KKSV0211OPDBMapper.setKKSV021133SC` | KKSV021133SC | - | (Added OM-2013-0005308) |
| C | `KKSV0211_KKSV0211OPDBMapper.setKKSV021138SC` | KKSV021138SC | - | Invoice issuance condition list SC |
| C | `KKSV0211_KKSV0211OPDBMapper.setKKSV021140SC` | KKSV021140SC | - | Un-cancelled contract temporary fee list display SC |
| C | `KKSV0211_KKSV0211OPDBMapper.setKKSV021141SC` | KKSV021141SC | - | Contract temporary fee cancellation SC |
| C | `KKSV0211_KKSV0211OPDBMapper.setKKSV021142SC` | KKSV021142SC | - | Temporary fee calculation elimination SC |
| C | `KKSV0211_KKSV0211OPDBMapper.setKKSV021143SC` | KKSV021143SC | - | Temporary fee registration SC |
| C | `KKSV0211_KKSV0211OPDBMapper.setKKSV021144SC` | KKSV021144SC | - | Temporary fee modification SC |
| C | `KKSV0211_KKSV0211OPDBMapper.setWORK` | WORK | - | Work area SC |
| C | `KKSV0211_KKSV0211OPDBMapper.setJKKHakkoSODCC` | JKKHakkoSODCC | - | SODCC data gateway setting — prepares service order data for creation |
| C | `KKSV0211_KKSV0211OPDBMapper.setKKSV021199CC` | KKSV021199CC | - | Project management CC |
| C | `KKSV0213_KKSV0213OPDBMapper.setKKSV021301CC` | KKSV021301CC | - | Number change registration CC — maps form data for number change service |
| C | `KKSV0195_KKSV0195OPDBMapper.setKKSV019501CC147` | KKSV019501CC147 | - | Number cancellation registration CC |
| C | `KKSV0195_KKSV0195OPDBMapper.setKKSV019506SC` | KKSV019506SC | - | Telephone consent extraction SC — retrieves telephone consent information for validation |
| C | `KKSV0195_KKSV0195OPDBMapper.setKKSV019527CC` | KKSV019527CC | - | Port utilization suspension / ENUM related CC |
| C | `KKSV0214_KKSV0214OPDBMapper.setKKSV021401CC` | KKSV021401CC | - | Port information change registration CC |
| C | `OneStopDataBeanAccessArray.addDataBean` | - | - | Adds a data bean to the movement reason code list array |
| R | `OneStopDataBeanAccess.getDataBean` | - | - | Retrieves a DataBean from the sender notification, port existence, and port number arrays |
| R | `OneStopDataBeanAccess.getDataBeanArray` | - | - | Accesses DataBean arrays for sender notification, port existence, port number, and movement reason list |
| - | `JCCBatCommon.invokeService` | - | - | Invokes the backend service with prepared paramMap and inputMap, returns results in outputMap |
| - | `JCCWebCommon.setMessageInfo` | - | - | Sets error messages for display (e.g., legal entity number cancellation blocked, port suspension already released) |

## 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 | Logic:KKW00147SFLogic.actionFix() | `actionFix` -> `doAddTelephoneNumberInfo(FUNC_CD_2)` | KKSV006501CC [C], KKSV021101-117SC [C], KKSV021301CC [C], KKSV019501CC147 [C], KKSV021401CC [C] |
| 2 | Logic:KKW00147SFLogic.cfmTran() | `cfmTran` -> `doAddTelephoneNumberInfo(FUNC_CD_2)` | KKSV006501CC [C], KKSV021101-117SC [C], KKSV021301CC [C], KKSV019501CC147 [C], KKSV021401CC [C] |

**Terminal operations from this method:** `getErrInfo` [R], `invokeService` [C], `setKKSV021401CC` [C], `setKKSV021301CC` [C], `setKKSV019501CC147` [C], `setMessageInfo` [C], `getDisplayNameFromPulldown` [R]

## 6. Per-Branch Detail Blocks

**Block 1** — [VARIABLE INITIALIZATION] (L3777)

> Initialize all working data structures and obtain the service form bean.

| # | Type | Code |
|---|------|------|
| 1 | SET | `isErr = false` // Error flag, defaults to no error |
| 2 | SET | `svcFormBean = getServiceFormBean()` // Obtain service form bean |
| 3 | SET | `paramBean = {svcFormBean}` // Wrapper array for form bean |
| 4 | SET | `paramMap = new HashMap()` // HashMap for service invocation parameters |
| 5 | SET | `inputMap = new HashMap()` // HashMap for mapping result storage |
| 6 | SET | `outputMap = new HashMap()` // HashMap for service invocation result storage |

**Block 2** — [IF/ELSE-IF/ELSE] `(Sender Notification Status)` (L3787)

> Process the sender notification flag: if it has an index, map from index; otherwise, query the optional service list to determine status.

| # | Type | Code |
|---|------|------|
| 1 | SET | `hBBean = svcFormBean.getDataBeanArray(HASINSHA_NO_TCH).getDataBean(0)` // Get sender notification DataBean [KKW00147SFConst.HASINSHA_NO_TCH = "発信者番号通知"] |
| 2 | SET | `indStr = hBBean.sendMessageString(INDEX_01, DATABEAN_GET_VALUE)` // Get index string |
| 3 | IF | `indStr != null` (CD_DIV_LIST_01 index exists) |
| 4 | SET | `cdDiv = hBBean.sendMessageString(CD_DIV_LIST_01, DATABEAN_GET_VALUE, Integer.parseInt(indStr))` // Get code division from index |
| 5 | SET | `hasinsyaNoTchL = svcFormBean.sendMessageString(HASINSHA_NO_TCH_L, DATABEAN_GET_VALUE)` // Get sender notification long label |
| 6 | SET | `svcFormBean.sendMessageString(HASINSHA_NO_TCH_L, DATABEAN_SET_VALUE, cdDiv)` // Map display value from code |
| 7 | ELSE | `indStr == null` (CD_DIV_LIST_01 index is null) |
| 8 | SET | `no_tch = getTelNoTchUm()` // OM-2013-0003279: Get telephone number transmission status |
| 9 | SET | `hasinsyaNoTchL = no_tch` // Store transmission status |
| 10 | SET | `selectedPulldownIndex(svcFormBean, HASINSHA_NO_TCH, no_tch)` // 20120502: Set pulldown index based on status |

**Block 3** — [IF/ELSE] `(Port Existence Flag)` (L3827)

> Process the port existence flag: if index exists, map from index; otherwise, retrieve from service contract details eo telephone consent data.

| # | Type | Code |
|---|------|------|
| 1 | SET | `bmpBean = svcFormBean.getDataBeanArray(BMP_UM).getDataBean(0)` // Get port existence DataBean [KKW00147SFConst.BMP_UM = "番ポ有無"] |
| 2 | SET | `indStrBmp = bmpBean.sendMessageString(INDEX_01, DATABEAN_GET_VALUE)` // Get index |
| 3 | IF | `indStrBmp != null` |
| 4 | SET | `cdDivBmp = bmpBean.sendMessageString(CD_DIV_LIST_01, DATABEAN_GET_VALUE, Integer.parseInt(indStrBmp))` // Get code division |
| 5 | SET | `bmpUmL = svcFormBean.sendMessageString(BMP_UM_L, DATABEAN_GET_VALUE)` // Get long label |
| 6 | SET | `svcFormBean.sendMessageString(BMP_UM_L, DATABEAN_SET_VALUE, cdDivBmp)` // Map display value |
| 7 | ELSE | `indStrBmp == null` |
| 8 | SET | `svcKeiUcwkTelBean = svcFormBean.getDataBeanArray(EKK0191A010DATA).getDataBean(0)` // [KKW00147SFConst.EKK0191A010DATA = "サービス契約内況＜eo光電話＞同意書渡受データ"] |
| 9 | SET | `bmpUmL = svcKeiUcwkTelBean.sendMessageString(BMP_UM_06, DATABEAN_GET_VALUE)` // Get port existence value |
| 10 | SET | `selectedPulldownIndex(svcFormBean, BMP_UM, bmpUmL)` // Set pulldown index |

**Block 4** — [IF/ELSE] `(Port Number)` (L3852)

> Process the port number: if index exists, map from index; otherwise, retrieve from service contract details eo telephone data.

| # | Type | Code |
|---|------|------|
| 1 | SET | `portBean = svcFormBean.getDataBeanArray(PORT_NO).getDataBean(0)` // Get port number DataBean [KKW00147SFConst.PORT_NO = "ポート番号"] |
| 2 | SET | `portIndStr = portBean.sendMessageString(INDEX_01, DATABEAN_GET_VALUE)` // Get index |
| 3 | IF | `portIndStr != null` |
| 4 | SET | `portCdDiv = portBean.sendMessageString(CD_DIV_LIST_01, DATABEAN_GET_VALUE, Integer.parseInt(portIndStr))` // Get code division |
| 5 | SET | `portNoL = portCdDiv` // Port number display label equals code division |
| 6 | SET | `svcFormBean.sendMessageString(PORT_NO_L, DATABEAN_SET_VALUE, portCdDiv)` // Map port number display |
| 7 | ELSE | `portIndStr == null` |
| 8 | SET | `svcKeiUcwkTelBean = svcFormBean.getDataBeanArray(EKK0191A010DATA).getDataBean(0)` // Get from service contract data |
| 9 | SET | `portNoL = svcKeiUcwkTelBean.sendMessageString(VA_PORT_NO_06, DATABEAN_GET_VALUE)` // Get VA port number |
| 10 | SET | `selectedPulldownIndex(svcFormBean, PORT_NO, portNoL)` // Set pulldown index |

**Block 5** — [VARIABLE + LOOP] `(Movement Reason Code List)` (L3871)

> Extract the movement division code and copy all movement reason codes and their associated memo text into a list array.

| # | Type | Code |
|---|------|------|
| 1 | SET | `ido_div = svcFormBean.sendMessageString(IDO_DIV, DATABEAN_GET_VALUE)` // [KKW00147SFConst.IDO_DIV = "異動区分"] |
| 2 | SET | `hktgiBean = svcFormBean.getDataBeanArray(CUST_KEI_HKTGI_LIST).getDataBean(0)` // [KKW00147SFConst.CUST_KEI_HKTGI_LIST = "顧客契約情報リスト"] |
| 3 | SET | `ido_rsn_cd_list = svcFormBean.getDataBeanArray(EKK1091D010DATAILLIST)` // [KKW00147SFConst.EKK1091D010DATAILLIST = "異動理由データリスト"] |
| 4 | EXEC | `ido_rsn_cd_list.clearArray()` // Clear existing entries |
| 5 | SET | `maxIndex = (Integer)hktgiBean.sendMessage(IDO_RSN_CD_22, DATABEAN_GET_COUNT)` // Get count of reason entries |
| 6 | SET | `ido_rsn_memo = hktgiBean.sendMessageString(IDO_RSN_MEMO_22, DATABEAN_GET_VALUE)` // Get movement reason memo text |
| 7 | FOR | `i = 0; i < maxIndex` |
| 8 | SET | `bean = ido_rsn_cd_list.addDataBean()` // Add new entry |
| 9 | SET | `ido_rsn_cd = hktgiBean.sendMessageString(IDO_RSN_CD_22, DATABEAN_GET_VALUE, i)` // Get reason CD at index i |
| 10 | SET | `bean.sendMessageString(IDO_RSN_CD_24, DATABEAN_SET_VALUE, ido_rsn_cd)` // Set reason CD in new bean |
| 11 | SET | `bean.sendMessageString(IDO_RSN_MEMO_24, DATABEAN_SET_VALUE, ido_rsn_memo)` // Set memo in new bean |

**Block 6** — [VARIABLE INITIALIZATION] `(Organization Context)` (L3887)

> OM-2013-0002656: Retrieve organization code and name from the common info bean for audit trail registration.

| # | Type | Code |
|---|------|------|
| 1 | SET | `commoninfoBean = super.getCommonInfoBean()` // Obtain common info bean |
| 2 | SET | `subCfBean = commoninfoBean.getDataBeanArray(CommonInfoCFConst.KGGRP_CD_LIST).getDataBean(1)` // Get organization group data bean at index 1 |
| 3 | SET | `orgCd = subCfBean.sendMessageString(CommonInfoCFConst.ORG_CD_01, DATABEAN_GET_VALUE)` // Get organization code |
| 4 | SET | `orgNm = subCfBean.sendMessageString(CommonInfoCFConst.ORG_NM_01, DATABEAN_GET_VALUE)` // Get organization name |

**Block 7** — [IF] `(ido_div == IDO_DIV_BANGO_TSUIKA = "00041" / Telephone Number Addition)` (L3895)

>光電話・番号追加: Process telephone number addition. Sets up course change service codes, pricing codes, and invokes the KKSV0065 service component.

| # | Type | Code |
|---|------|------|
| 1 | SET | `svcFormBean.sendMessageString(MSKM_SBT_CD, DATABEAN_SET_VALUE, MSKM_SBT_CD_COURSE_HENKO)` // [KKW00147SFConst.MSKM_SBT_CD = "申込種別コード"]; MSKM_SBT_CD_COURSE_HENKO = "00007" |
| 2 | SET | `svcFormBean.sendMessageString(PCRS_CD, DATABEAN_SET_VALUE, PCRS_CD_2_BANGO_COURSE)` // Pricing code: number + course [PCRS_CD_2_BANGO_COURSE = JKKCommonConst.PCRS_CD_A33] |
| 3 | SET | `svcFormBean.sendMessageString(KK0341_PCRS_CD, DATABEAN_SET_VALUE, PCRS_CD_VA_PORT2)` // VA port pricing code [PCRS_CD_VA_PORT2 = JKKCommonConst.PCRS_CD_C05] |
| 4 | SET | `svcFormBean.sendMessageString(PPLAN_CD, DATABEAN_SET_VALUE, PPLAN_CD_2_BANGO_COURSE)` // Pricing plan code [PPLAN_CD_2_BANGO_COURSE = "P" + JKKCommonConst.PCRS_CD_A33 + "01"] |
| 5 | SET | `svcFormBean.sendMessageString(KK0341_PPLAN_CD, DATABEAN_SET_VALUE, PPLAN_CD_VA_PORT2)` // VA port plan code [PPLAN_CD_VA_PORT2 = "P" + JKKCommonConst.PCRS_CD_C05 + "01"] |
| 6 | SET | `svcFormBean.sendMessageString(KKTK_SVC_CD, DATABEAN_SET_VALUE, "C004")` // Equipment provision service code: Telephone VA |
| 7 | SET | `svcFormBean.sendMessageString(PRG_STAT, DATABEAN_SET_VALUE, IDO_STAT_B301)` // Progress state: telephone number addition completed [IDO_STAT_B301 = "B301"] |
| 8 | SET | `paramMap.put(TELEGRAM_INFO_USECASE_ID, JKKCommonConst.UCID_KKSV0065)` // UCID_KKSV0065 = "KKSV0065" |
| 9 | SET | `paramMap.put(TELEGRAM_INFO_OPERATION_ID, JKKCommonConst.OPID_KKSV0065OP)` // Set operation ID |
| 10 | SET | `mapper = new KKSV0065_KKSV0065OPDBMapper()` |
| 11 | SET | `inputMap = mapper.setKKSV006501CC(paramBean, inputMap, funcCode, orgCd, orgNm)` // Telephone number registration CC with org context |
| 12 | CALL | `invokeService(paramMap, inputMap, outputMap)` // Execute service |
| 13 | SET | `isErr = getErrInfo(paramBean[0], outputMap, "KKSV006501CC")` // Check for errors |

**Block 8** — [ELSE IF] `(ido_div == IDO_DIV_DENWA_HENKO = "00048" / Telephone Information Change)` (L3919)

> 光電話・電話番号情報変更: Process telephone information change. This is the most complex path with 25+ mapper SC method calls covering the full service contract lifecycle (consultation, consent, registration, settlement, start, cancel, termination). Conditionally invokes the service and performs multi-level error handling.

| # | Type | Code |
|---|------|------|
| 1 | SET | `paramMap.put(TELEGRAM_INFO_USECASE_ID, JKKCommonConst.UCID_KKSV0211)` // UCID_KKSV0211 |
| 2 | SET | `paramMap.put(TELEGRAM_INFO_OPERATION_ID, JKKCommonConst.OPID_KKSV0211OP)` // Set operation ID |
| 3 | SET | `mapper = new KKSV0211_KKSV0211OPDBMapper()` |
| 4 | CALL | `mapper.setKKSV021101SC(paramBean, inputMap, JPCModelConstant.FUNC_CD_2)` // Customer consultation [FUNC_CD_2 = "2"] |
| 5 | CALL | `mapper.setKKSV021102SC(paramBean, inputMap, JPCModelConstant.FUNC_CD_2)` // Service contract details eo telephone consent |
| 6 | CALL | `mapper.setKKSV021103SC(paramBean, inputMap, JPCModelConstant.FUNC_CD_1)` // Service contract details consent list (service contract number) [FUNC_CD_1 = "1"] |
| 7 | CALL | `mapper.setKKSV021104SC(paramBean, inputMap, JPCModelConstant.FUNC_CD_1)` // Option service contract consent list (detail number) |
| 8 | CALL | `mapper.setKKSV021105SC(paramBean, inputMap, funcCode)` // Application content approval registration |
| 9 | CALL | `mapper.setKKSV021107SC(paramBean, inputMap, funcCode)` // Service contract details eo telephone info change |
| 10 | CALL | `mapper.setKKSV021109SC(paramBean, inputMap, funcCode)` // Option service contract telephone registration |
| 11 | CALL | `mapper.setKKSV021110SC(paramBean, inputMap, funcCode)` // Option service contract telephone settlement |
| 12 | CALL | `mapper.setKKSV021111SC(paramBean, inputMap, funcCode)` // Option service contract telephone start |
| 13 | CALL | `mapper.setKKSV021118SC(paramBean, inputMap, funcCode)` // Option service contract cancel |
| 14 | CALL | `mapper.setKKSV021112SC(paramBean, inputMap, funcCode)` // Option service contract termination |
| 15 | CALL | `mapper.setKKSV021115SC(paramBean, inputMap, funcCode)` // Option service contract termination confirmation |
| 16 | CALL | `mapper.setKKSV021113SC(paramBean, inputMap, funcCode)` // Application detail statement follow-up work request |
| 17 | CALL | `mapper.setKKSV021114SC(paramBean, inputMap, funcCode)` // Progress information registration |
| 18 | CALL | `mapper.setKKSV021116SC(paramBean, inputMap, JPCModelConstant.FUNC_CD_2)` // Service contract telephone consent |
| 19 | CALL | `mapper.setKKSV021117SC(paramBean, inputMap, JPCModelConstant.FUNC_CD_2)` // Service contract details consent |
| 20 | CALL | `mapper.setWORK(paramBean, inputMap, funcCode)` // Work area |
| 21 | CALL | `mapper.setJKKHakkoSODCC(paramBean, inputMap, funcCode)` // SODCC data gateway setting |
| 22 | CALL | `mapper.setKKSV021119SC(paramBean, inputMap, JPCModelConstant.FUNC_CD_2)` // IT1-2012-0001939: Service contract eo telephone info change initiation |
| 23 | CALL | `mapper.setKKSV021120SC(paramBean, inputMap, JPCModelConstant.FUNC_CD_2)` // Service contract eo telephone consent |
| 24 | CALL | `mapper.setKKSV021121SC(paramBean, inputMap, funcCode)` // Service contract eo telephone info change |
| 25 | SET | `svcKeiUcwkBean = svcFormBean.getDataBeanArray(EKK0161A010DATA).getDataBean(0)` // OM-2017-0001122: Service contract work status bean |
| 26 | SET | `svc_kei_ucwk_stat = svcKeiUcwkBean.sendMessageString(SVC_KEI_UCWK_STAT_05, DATABEAN_GET_VALUE)` // Get work status [KKW00147SFConst.SVC_KEI_UCWK_STAT_05 = "契約作業状況"] |
| 27 | IF | `svc_kei_ucwk_stat == SVC_KEI_STAT_020 ("020") || svc_kei_ucwk_stat == SVC_KEI_STAT_030 ("030")` |
| 28 | CALL | `mapper.setKKSV021140SC(paramBean, inputMap, JPCModelConstant.FUNC_CD_1)` // Un-cancelled contract temporary fee list |
| 29 | CALL | `mapper.setKKSV021141SC(paramBean, inputMap, funcCode)` // Contract temporary fee cancellation |
| 30 | CALL | `mapper.setKKSV021142SC(paramBean, inputMap, funcCode)` // Temporary fee calculation elimination |
| 31 | CALL | `mapper.setKKSV021143SC(paramBean, inputMap, funcCode)` // Temporary fee registration |
| 32 | CALL | `mapper.setKKSV021144SC(paramBean, inputMap, funcCode)` // Temporary fee modification |
| 33 | CALL | `mapper.setKKSV021129SC(paramBean, inputMap, JPCModelConstant.FUNC_CD_2)` // OM-2013-0003595: Invoice issuance condition list |
| 34 | CALL | `mapper.setKKSV021130SC(paramBean, inputMap, JPCModelConstant.FUNC_CD_2)` // Service contract details eo telephone consent 2 |
| 35 | CALL | `mapper.setKKSV021132SC(paramBean, inputMap, JPCModelConstant.FUNC_CD_8)` // ANK-1578: Equipment provision service contract list (service contract number) |
| 36 | CALL | `mapper.setKKSV021139SC(paramBean, inputMap, "10")` // IT2-2016-0000034: Equipment provision service contract list (equipment swap period) |
| 37 | CALL | `mapper.setKKSV021199CC(paramBean, inputMap, funcCode)` // OM-2013-0002277: Project management CC |
| 38 | CALL | `mapper.setKKSV021133SC(paramBean, inputMap, JPCModelConstant.FUNC_CD_1)` // OM-2013-0005308 |
| 39 | CALL | `mapper.setKKSV021138SC(paramBean, inputMap, JPCModelConstant.FUNC_CD_2)` // OM-2015-0000564: Invoice issuance condition list |
| 40 | IF | `funcCode.equals(FUNC_CD_1 ("1"))` |
| 41 | CALL | `invokeService(paramMap, inputMap, outputMap)` // Execute service |
| 42 | IF | `setErrorMessageInfo(outputMap)` // OM-2015-0000564: Check error messages |
| 43 | SET | `isErr = true` |
| 44 | RETURN | `return isErr` // Early return on error |
| 45 | IF | `setEgErrorMessageInfo(outputMap)` // IT2-2016-0000034: Check EG error messages |
| 46 | SET | `isErr = true` |
| 47 | RETURN | `return isErr` // Early return on EG error |
| 48 | ELSE IF | `"1".equals(funcCode)` |
| 49 | SET | `isErr = getErrInfo(paramBean[0], outputMap, "KKSV021129SC")` // OM-2013-0003595: Check invoice condition SC errors |

**Block 9** — [ELSE IF] `(ido_div == IDO_DIV_BANGO_HENKO = "00042" / Number Change)` (L3984)

> 光電話・番号変更: Process number change. Creates the KKSV0213 mapper and invokes the number change service component.

| # | Type | Code |
|---|------|------|
| 1 | SET | `mapper = new KKSV0213_KKSV0213OPDBMapper()` |
| 2 | SET | `paramMap.put(TELEGRAM_INFO_USECASE_ID, JKKCommonConst.UCID_KKSV0213)` |
| 3 | SET | `paramMap.put(TELEGRAM_INFO_OPERATION_ID, JKKCommonConst.OPID_KKSV0213OP)` |
| 4 | SET | `inputMap = mapper.setKKSV021301CC(paramBean, inputMap, funcCode, orgCd, orgNm)` // Number change registration CC with org context |
| 5 | CALL | `invokeService(paramMap, inputMap, outputMap)` |
| 6 | SET | `isErr = getErrInfo(paramBean[0], outputMap, "KKSV021301CC")` // Check for errors |

**Block 10** — [ELSE IF] `(ido_div == IDO_DIV_BANGO_KAIYAKU = "00043" / Number Cancellation)` (L4008)

> 光電話・番号解約: Process number cancellation. Invokes the KKSV0195 mapper chain and performs domain-specific validation: blocks legal entity cancellations and checks for port suspension / ENUM restrictions.

| # | Type | Code |
|---|------|------|
| 1 | SET | `mapper = new KKSV0195_KKSV0195OPDBMapper()` |
| 2 | SET | `paramMap.put(TELEGRAM_INFO_USECASE_ID, JKKCommonConst.UCID_KKSV0195)` |
| 3 | SET | `paramMap.put(TELEGRAM_INFO_OPERATION_ID, JKKCommonConst.OPID_KKSV0195OP)` |
| 4 | SET | `inputMap = mapper.setKKSV019501CC147(paramBean, inputMap, funcCode, orgCd, orgNm)` // Number cancellation CC with org context |
| 5 | CALL | `mapper.setKKSV019506SC(paramBean, inputMap, funcCode)` // ANK-2956: Telephone consent extraction |
| 6 | CALL | `mapper.setKKSV019527CC(paramBean, inputMap, funcCode)` // ANK-4494: Port utilization suspension / ENUM CC |
| 7 | IF | `funcCode.equals(FUNC_CD_1 ("1"))` |
| 8 | CALL | `invokeService(paramMap, inputMap, outputMap)` |
| 9 | SET | `kksv019506sc = (Map)outputMap.get("KKSV019506SC")` // Extract output map |
| 10 | IF | `kksv019506sc != null` |
| 11 | SET | `ezm0121a010msgList = (ArrayList)kksv019506sc.get("EZM0121A010CBSMsg1List")` // Telephone consent extraction result list |
| 12 | SET | `kojinHojin_tlnTaiCd = ""` // Default: individual/person-code |
| 13 | IF | `ezm0121a010msgList != null && ezm0121a010msgList.size() > 0` |
| 14 | SET | `kojinHojin_tlnTaiCd = (String)ezm0121a010msgList.get(0).get("kojin_hojin_tln_tai_cd")` // Get individual/legal entity type code |
| 15 | IF | `kojinHojin_tlnTaiCd.equals(CD00410_HOJIN ("2"))` |
| 16 | CALL | `JCCWebCommon.setMessageInfo(this, JPCOnlineMessageConstant.EKB0290_JW, new String[]{"電話番号", "法人用", "番号解約"})` // Error: Legal entity number cancellation |
| 17 | SET | `isErr = true` |
| 18 | RETURN | `return isErr` // Block legal entity cancellation |
| 19 | SET | `kksv019527cc = (Map)outputMap.get("KKSV019527CC")` // Extract CC output |
| 20 | IF | `kksv019527cc != null` |
| 21 | SET | `errCd = (String)kksv019527cc.get("ERR_CD")` // Get error code |
| 22 | IF | `errCd.equals("E10")` |
| 23 | CALL | `JCCWebCommon.setMessageInfo(this, JPCOnlineMessageConstant.EKB1040_JW, new String[]{"電話番号", "番ポ利用停止解除済み", "解約"})` // Error: Port suspension already released |
| 24 | SET | `isErr = true` |
| 25 | RETURN | `return isErr` |
| 26 | ELSE IF | `errCd.equals("E11")` |
| 27 | CALL | `JCCWebCommon.setMessageInfo(this, JPCOnlineMessageConstant.EKB1040_JW, new String[]{"電話番号", "ENUM切替不可の状態", "同時ENUM切替"})` // Error: ENUM switch impossible |
| 28 | SET | `isErr = true` |
| 29 | RETURN | `return isErr` |

**Block 11** — [ELSE IF] `(ido_div == IDO_DIV_BANPO_HENKO = "00045" / Port Information Change)` (L4059)

> 光電話・番ポ情報変更: Process port information change. Creates the KKSV0214 mapper and invokes the port information service component.

| # | Type | Code |
|---|------|------|
| 1 | SET | `mapper = new KKSV0214_KKSV0214OPDBMapper()` |
| 2 | SET | `paramMap.put(TELEGRAM_INFO_USECASE_ID, JKKCommonConst.UCID_KKSV0214)` |
| 3 | SET | `paramMap.put(TELEGRAM_INFO_OPERATION_ID, JKKCommonConst.OPID_KKSV0214OP)` |
| 4 | SET | `inputMap = mapper.setKKSV021401CC(paramBean, inputMap, funcCode, orgCd, orgNm)` // Port info change registration CC with org context |
| 5 | CALL | `invokeService(paramMap, inputMap, outputMap)` |
| 6 | SET | `isErr = getErrInfo(paramBean[0], outputMap, "KKSV021401CC")` // Check for errors |

**Block 12** — [ELSE] `(Unrecognized movement division)` (L4081)

> 想定外の異動区分: Return default error status for unexpected movement division values.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return isErr` // Return false (no error) — unrecognized division silently accepted |

**Block 13** — [POST-PROCESSING] `(Display Name Mapping After Service Return)` (L4088)

> BP from return data editing: Map code values back to display names using pulldown display name lookup.

| # | Type | Code |
|---|------|------|
| 1 | SET | `svcFormBean.sendMessageString(HASINSHA_NO_TCH_L, DATABEAN_SET_VALUE, getDisplayNameFromPulldown(svcFormBean, HASINSHA_NO_TCH, hasinsyaNoTchL))` // Map sender notification display name |
| 2 | SET | `svcFormBean.sendMessageString(BMP_UM_L, DATABEAN_SET_VALUE, getDisplayNameFromPulldown(svcFormBean, BMP_UM, bmpUmL))` // Map port existence display name |
| 3 | SET | `svcFormBean.sendMessageString(PORT_NO_L, DATABEAN_SET_VALUE, getDisplayNameFromPulldown(svcFormBean, PORT_NO, portNoL))` // Map port number display name |
| 4 | RETURN | `return isErr` // Return error status to caller |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `ido_div` | Field | Movement division — classifies the type of telecom service change being processed |
| IDO_DIV_BANGO_TSUIKA | Constant | Movement division value "00041" — telephone number addition (adding a new phone number) |
| IDO_DIV_DENWA_HENKO | Constant | Movement division value "00048" — telephone information change (modifying existing phone details) |
| IDO_DIV_BANGO_HENKO | Constant | Movement division value "00042" — number change (changing the phone number itself, typically port-related) |
| IDO_DIV_BANGO_KAIYAKU | Constant | Movement division value "00043" — number cancellation (terminating a phone number) |
| IDO_DIV_BANPO_HENKO | Constant | Movement division value "00045" — port information change (modifying port-related data) |
| `funcCode` | Parameter | Service function code — "1" triggers full service execution, "2" is preparation-only mode |
| FUNC_CD_1 | Constant | Function code "1" — full execution mode |
| FUNC_CD_2 | Constant | Function code "2" — preparation/data mapping mode |
| UCID_KKSV0065 | Constant | Use case ID "KKSV0065" — telephone number addition use case |
| UCID_KKSV0211 | Constant | Use case ID for telephone information change |
| UCID_KKSV0213 | Constant | Use case ID for number change |
| UCID_KKSV0195 | Constant | Use case ID for number cancellation |
| UCID_KKSV0214 | Constant | Use case ID for port information change |
| HASINSHA_NO_TCH | Constant | Sender notification — caller ID display setting for outgoing calls |
| BMP_UM | Constant | Port existence (番ポ有無) — whether the number uses port-out/port-in (number portability) |
| PORT_NO | Constant | Port number — the actual port number value |
| `kojin_hojin_tln_tai_cd` | Field | Individual/legal entity telephone type code — "1" for individual, "2" (CD00410_HOJIN) for corporate/legal entity |
| CD00410_HOJIN | Constant | Corporate/legal entity code "2" — used to detect and block legal entity number cancellations |
| SODCC | Acronym | Service Order Data Creation Component — handles telecom service order data creation |
| KKSV0065 | Screen | Telephone number registration screen — handles new telephone number addition |
| KKSV0211 | Screen | Telephone information change screen — handles comprehensive telephone service modifications |
| KKSV0213 | Screen | Number change screen — handles phone number changes |
| KKSV0195 | Screen | Number cancellation screen — handles phone number termination |
| KKSV0214 | Screen | Port information change screen — handles port data modifications |
| EKB0290_JW | Constant | Error message "EKB0290-JW" — displayed when legal entity attempts number cancellation |
| EKB1040_JW | Constant | Error message "EKB1040-JW" — displayed for port suspension / ENUM related errors |
| ERR_CD | Field | Error code field returned by service components — "E10" = port suspension already released, "E11" = ENUM switch impossible |
| MSKM_SBT_CD_COURSE_HENKO | Constant | Application type code "00007" — course change type for telephone number addition |
| PCRS_CD_A33 | Constant | Pricing code constant for number addition course |
| PCRS_CD_C05 | Constant | Pricing code constant for VA port |
| PPLAN_CD_A33 | Constant | Pricing plan code prefix for number addition course |
| PPLAN_CD_C05 | Constant | Pricing plan code prefix for VA port |
| IDO_STAT_B301 | Constant | Progress state "B301" — telephone number addition completed |
| SVC_KEI_STAT_020 | Constant | Service contract work status "020" — contract work in progress |
| SVC_KEI_STAT_030 | Constant | Service contract work status "030" — contract work pending |
| `orgCd` | Field | Organization code of the operator performing the action — captured for audit trail |
| `orgNm` | Field | Organization name of the operator — captured for audit trail |
| KKTK_SVC_CD | Constant | Equipment provision service code — "C004" for telephone VA (virtual appliance) |
| ONE_STOP | Pattern | OneStop data access pattern — framework for transferring form data between web and service layers via DataBeans |
| invokeService | Method | Core service invocation method — executes the backend service component and returns results in outputMap |
