# Business Logic — KKW00816SFLogic.actionAddMltise() [89 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.KKW00816SF.KKW00816SFLogic` |
| Layer | Controller (Web Logic / Validation Screen Layer) |
| Module | `KKW00816SF` (Package: `eo.web.webview.KKW00816SF`) |

## 1. Role

### KKW00816SFLogic.actionAddMltise()

This method implements the **confirmation ("Register Confirm")** step of the **Multi-Session Information Registration** workflow in the K-Opticom telecom service order management system. When a customer operates multiple service contracts (e.g., FTTH internet, mail service, optional ISP service), this screen allows the operator to register all those services under a single consolidated customer contract. The method is triggered when the operator clicks the confirmation button ("toki_cfm_btn") on screen KKW00816 "Multi-Session Information Registration".

The method performs a **linear dispatch pattern**: it retrieves the service form DataBean from the web layer, validates it by mapping into internal business structures via `mappingDataBean()`, configures parameter and input/output maps with the use-case and operation identifiers (`UCID_KKSV0031`, `OPID_KKSV0031OP`), then invokes the `setAddMltiseInfo()` DB mapper method which populates the business parameter map with all multi-session registration fields (service type code, operation service code, operation dates, parent contract ID, request type code, order content code, etc.). After that, it calls the generic `invokeService()` to dispatch to the backend service pipeline (CBS layer) for the actual persistence of multi-session data, displays a confirmation message ("Multi-Session Information Registered"), and sets the next-screen navigation to **KKW00817 "Multi-Session Information Registration Confirmation"**.

The method has **no conditional branches** within the `actionAddMltise` body itself — it is a straightforward linear flow. If the bean is null or mapping fails, it throws an exception and aborts. All conditional logic is delegated to internal helper methods like `getMltiseId()` (which determines fixed Global IP address contract type and sets `odr_naiyo_cd` accordingly) and `mappingDataBean()` (which validates the DataBean content). This method acts as the **primary entry point** from the KKW00816 screen's confirmation button and is the central orchestration point for multi-session registration confirmation.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["actionAddMltise"])
    START --> GETBEAN["Get X31SDataBeanAccess bean = getServiceFormBean()"]
    GETBEAN --> CHECKBEAN{"bean == null?"}
    CHECKBEAN -->|true| THROWBEAN["throw new Exception()"]
    CHECKBEAN -->|false| MAPDATA["mappingDataBean(bean)"]
    MAPDATA --> MAPCHECK{"mappingDataBean() == false?"}
    MAPCHECK -->|true| THROWMAP["throw new Exception()"]
    MAPCHECK -->|false| LOGINPUT["JSYwebLog.println(DataBean_Dump)"]
    LOGINPUT --> INITHASH["Init paramMap, inputMap, outputMap, mapper"]
    INITHASH --> INITMAP["paramMap.put(UCID_KKSV0031, OPID_KKSV0031OP)"]
    INITMAP --> MAPINFO["mapper.setAddMltiseInfo(paramBean, inputMap, FUNC_CODE_2, getMltiseId(paramBean))"]
    MAPINFO --> LOGOUTPUT["JSYwebLog.println(DataBean_Dump)"]
    LOGOUTPUT --> SETERRNAV["Set error recovery screen to KKW00816"]
    SETERRNAV --> RUNSERVICE["invokeService(paramMap, inputMap, outputMap)"]
    RUNSERVICE --> SETMSG["JCCWebCommon.setMessageInfo(EKB0370--I)"]
    SETMSG --> SETNAV["Set next screen to KKW00817"]
    SETNAV --> LOGFINAL["JSYwebLog.println(DataBean_Dump)"]
    LOGFINAL --> RETTRUE["return true"]
    RETTRUE --> END(["END"])
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| - | (none) | - | This method takes no explicit parameters. All input data is obtained from the web session via `getServiceFormBean()`. |

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

| Field | Type | Business Description |
|-------|------|---------------------|
| (implicit) | Service Form Bean | The service form DataBean obtained via `super.getServiceFormBean()` containing the multi-session registration form data from screen KKW00816 |
| (implicit) | Common Info Bean | The common info DataBean obtained via `super.getCommonInfoBean()` used to set navigation and error recovery screen IDs |
| `getMltiseId()` result | boolean | Determines if a Fixed Global IP Address option contract exists — used to set `odr_naiyo_cd` (order content code) |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| CALL | `KKW00816SFLogic.getMltiseId` | - | - | Internal helper: Determines if Fixed Global IP Address option contract exists; sets `yokyu_sbt_cd` (request type code) and `odr_naiyo_cd` (order content code) |
| CALL | `KKW00816SFLogic.mappingDataBean` | - | - | Maps service form DataBean values into internal business parameter structures |
| R | `KKSV0031_KKSV0031OPDBMapper.setAddMltiseInfo` | KKW00816SF | Multi-Session Registration Map | Reads all fields from the DataBean and maps them into the parentMap for the multi-session registration business process. Fields include: service type code, operation service code, operation date, operation date-time, parent contract ID, rule0059 auto-apply flag, billing contract number, usage start date, session count, progress status, customer contract inheritance list (SYSID, diversion code, service contract number), and fixed Global IP flag. |
| C | `JCCBatCommon.invokeService` | Multi-Session Registration CBS | KK_T_MLTISE_NINSHO, KK_T_MLTISE_INFO (inferred) | Invokes the backend service pipeline via `invokeService()` which routes through the configured SC/CBS chain for persistence of multi-session registration data |

**Notes on SC Code and Entity inference:**
- The `invokeService()` call delegates to the standard service invocation chain. Based on the use-case ID `UCID_KKSV0031` and operation ID `OPID_KKSV0031OP`, the service target is the **KKSV0031 Multi-Session Registration** business process.
- The `setAddMltiseInfo` mapper reads field names directly from the DataBean: `申し種別コード` (service type code), `オプションサービスコード` (option service code), `運用年月日` (operation date), `運用年月日时分秒` (operation date-time), `親契約識別コード` (parent contract ID), `請求契約番号` (billing contract number), `利用開始日` (usage start date), `セッション数` (session count), `進捗ステータス` (progress status), `顧客契約引継リスト` (customer contract inheritance list).
- The `KKSV0031` use case maps to backend CBS components that perform the actual database CRUD operations on multi-session registration tables. These specific table names are not directly visible from this method's source code and would require reading the CBS implementation.

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Screen:KKW00816 | `KKW008160PJP.xml` (toki_cfm_btn) -> `KKW00816SFLogic.actionAddMltise` | `setAddMltiseInfo [R] Multi-Session Registration Map`, `invokeService [C] Multi-Session CBS` |

**Caller details:**
- **KKW00816 "Multi-Session Information Registration"** — The confirmation button (`toki_cfm_btn`) on page `KKW008160PJP` is wired to invoke `actionAddMltise` via the `WEBVLCOMMANDMAP_KKW008160PJP.xml` configuration file. This is the sole entry point for this method.
- After execution, the method sets the next screen to **KKW00817 "Multi-Session Information Registration Confirmation"**.

## 6. Per-Branch Detail Blocks

**Block 1** — [SET] Get service form DataBean (L282)

> Retrieve the service form DataBean from the web session layer.

| # | Type | Code |
|---|------|------|
| 1 | SET | `X31SDataBeanAccess bean = super.getServiceFormBean()` |
| 2 | SET | `X31SDataBeanAccess[] paramBean = { bean }` // Wrap single bean in array for downstream methods |

**Block 2** — [IF] Null check on DataBean (L284)

> Validate that the service form DataBean was successfully obtained. If null, throw an exception to abort processing.

| # | Type | Code |
|---|------|------|
| 1 | SET | `X31SDataBeanAccess bean = super.getServiceFormBean()` (from Block 1) |
| 2 | IF | `if (bean == null)` → `throw new Exception()` |

**Block 3** — [IF] Map DataBean (L297)

> Map the raw DataBean values into internal business parameter structures. This is a validation step — if mapping fails, an exception is thrown.

| # | Type | Code |
|---|------|------|
| 1 | IF | `if (!mappingDataBean(bean))` → `throw new Exception()` |
| 2 | EXEC | `mappingDataBean(bean)` // Internal validation of DataBean content |

**Block 4** — [EXEC] Log input DataBean (L303)

> Output the input DataBean state for debugging and audit logging purposes.

| # | Type | Code |
|---|------|------|
| 1 | SET | `HashMap<String, Object> paramMap = new HashMap<String, Object>()` // Parameter setting map |
| 2 | SET | `HashMap<String, Object> inputMap = new HashMap<String, Object>()` // Search conditions map |
| 3 | SET | `HashMap<String, Object> outputMap = new HashMap<String, Object>()` // Result map |
| 4 | SET | `KKSV0031_KKSV0031OPDBMapper mapper = new KKSV0031_KKSV0031OPDBMapper()` // DataBean-BP mapper |
| 5 | EXEC | `JSYwebLog.println(JSYwebLog.DataBean_Dump, getClass(), dumpDatabean(), null, null, null)` // Input data logging |

**Block 5** — [SET] Upper-level mapping (L311-L312)

> Set the use-case ID and operation ID in the parameter map. These identifiers route the service call to the correct KKSV0031 registration pipeline.

| # | Type | Code |
|---|------|------|
| 1 | SET | `paramMap.put(X31CWebConst.TELEGRAM_INFO_USECASE_ID, JKKCommonConst.UCID_KKSV0031)` // Use-case: KKW00816 Multi-Session Registration [-> UCID_KKSV0031] |
| 2 | SET | `paramMap.put(X31CWebConst.TELEGRAM_INFO_OPERATION_ID, JKKCommonConst.OPID_KKSV0031OP)` // Operation: KKW00816OP |

**Block 6** — [CALL] Set multi-session info (L316)

> Populate the input map with all multi-session registration fields by calling the DB mapper. The `getMltiseId()` helper determines the Fixed Global IP Address flag and sets `yokyu_sbt_cd` (request type code) and `odr_naiyo_cd` (order content code).

| # | Type | Code |
|---|------|------|
| 1 | CALL | `mapper.setAddMltiseInfo(paramBean, inputMap, JKKCommonConst.FUNC_CODE_2, getMltiseId(paramBean))` // Map DataBean to multi-session registration business map. FUNC_CODE_2 = "2" [-> FUNC_CODE_2] |
| 2 | CALL | `getMltiseId(paramBean)` // Internal helper: Determines Fixed Global IP Address flag, sets `yokyu_sbt_cd` (YOKYU_SBT_CD_02 for new / YOKYU_SBT_CD_04 for change) and `odr_naiyo_cd` (ODR_NAIYO_CD_144 for static multi / ODR_NAIYO_CD_142 for dynamic multi) |
| 3 | EXEC | `paramBean[0].sendMessageString()` calls for all multi-session fields [called within `setAddMltiseInfo`] |
| 4 | EXEC | `paramBean[0].sendMessageLong()` for session count [called within `setAddMltiseInfo`] |

**Block 7** — [EXEC] Log output DataBean (L330)

> Output the DataBean state after mapping for debugging and audit logging.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `JSYwebLog.println(JSYwebLog.DataBean_Dump, getClass(), dumpDatabean(), null, null, null)` // Output data logging |

**Block 8** — [SET] Set error recovery navigation (L335-L337)

> Configure the error recovery screen. If an error occurs during service execution, the system will navigate back to KKW00816 (the same screen) to allow re-entry.

| # | Type | Code |
|---|------|------|
| 1 | SET | `X31SDataBeanAccess commonBean = super.getCommonInfoBean()` |
| 2 | EXEC | `commonBean.sendMessageString(CommonInfoCFConst.NEXT_SCREEN_ID, X31CWebConst.DATABEAN_SET_VALUE, JKKScreenConst.SCREEN_ID_KKW00816)` // Error recovery -> KKW00816 [-> SCREEN_ID_KKW00816="KKW00816"] |
| 3 | EXEC | `commonBean.sendMessageString(CommonInfoCFConst.NEXT_SCREEN_NAME, X31CWebConst.DATABEAN_SET_VALUE, JKKScreenConst.SCREEN_NAME_KKW00816)` // Error recovery name -> "Multi-Session Information Registration" [-> SCREEN_NAME_KKW00816="マルチセッション情報登録"] |

**Block 9** — [CALL] Execute service (L342)

> Invoke the backend service pipeline to persist the multi-session registration data. The `invokeService()` method dispatches to the configured CBS chain based on the use-case and operation IDs set in `paramMap`.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `invokeService(paramMap, inputMap, outputMap)` // Dispatch to backend CBS pipeline |

**Block 10** — [SET] Display confirmation message (L347-L348)

> Set an informational message displayed to the operator after successful registration.

| # | Type | Code |
|---|------|------|
| 1 | SET | `String[] str = { "Multi-Session Information Registered" }` |
| 2 | CALL | `JCCWebCommon.setMessageInfo(this, "EKB0370--I", str)` // Set info message EKB0370--I |

**Block 11** — [SET] Set next screen navigation (L353-L355)

> Configure the next screen to navigate to after successful completion: KKW00817 "Multi-Session Information Registration Confirmation".

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `commonBean.sendMessageString(CommonInfoCFConst.NEXT_SCREEN_ID, X31CWebConst.DATABEAN_SET_VALUE, JKKScreenConst.SCREEN_ID_KKW00817)` // Next screen -> KKW00817 [-> SCREEN_ID_KKW00817="KKW00817"] |
| 2 | EXEC | `commonBean.sendMessageString(CommonInfoCFConst.NEXT_SCREEN_NAME, X31CWebConst.DATABEAN_SET_VALUE, JKKScreenConst.SCREEN_NAME_KKW00817)` // Next screen name -> "Multi-Session Information Registration Confirmation" [-> SCREEN_NAME_KKW00817="マルチセッション情報登録確認"] |

**Block 12** — [EXEC/RETURN] Final log and return (L360-L364)

> Output the final DataBean state and return success.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `JSYwebLog.println(JSYwebLog.DataBean_Dump, getClass(), dumpDatabean(), null, null, null)` // Final data logging |
| 2 | RETURN | `return true` // Processing successful |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `multi-session` | Business term | Multi-Session Information — a consolidation mechanism that allows multiple service contracts (FTTH, mail, optional services) to be registered under a single parent customer contract |
| `UCID_KKSV0031` | Constant | Use-case ID for the KKW00816 Multi-Session Registration business process |
| `OPID_KKSV0031OP` | Constant | Operation ID for the KKW00816OP operation (confirmation step) |
| `FUNC_CODE_2` | Constant | Function code "2" — indicates the confirmation/registration function (as opposed to function code "1" which is typically inquiry) |
| `UCID` | Acronym | Use-case ID — identifies which business use-case the service invocation targets |
| `OPID` | Acronym | Operation ID — identifies which specific operation within a use-case |
| `KKW00816` | Screen ID | "Multi-Session Information Registration" — the confirmation screen where the operator reviews and registers multi-session data |
| `KKW00817` | Screen ID | "Multi-Session Information Registration Confirmation" — the next screen shown after successful registration, displaying confirmation details |
| `KKSV0031` | Use-case | Multi-Session Registration use-case — the backend business process that handles the database operations for multi-session data persistence |
| `SERVICE_FORM_BEAN` | Technical term | X31SDataBeanAccess — the web-layer DataBean that carries form data between the screen and the logic layer |
| `CommonInfoCFConst.NEXT_SCREEN_ID` | Technical term | Navigation field in the common info bean specifying which screen to navigate to after processing |
| `CommonInfoCFConst.NEXT_SCREEN_NAME` | Technical term | Navigation field specifying the display name of the next screen |
| `EKB0370--I` | Message Code | Information message code for "Multi-Session Information Registered" — displayed to the operator on success |
| `shk_mltise_ninsho_id_pwd` | Field | Multi-Session Authentication ID with Password — the authentication ID used for the multi-session registration |
| `mltise_ninsho_id` | Field | Multi-Session Authentication ID — the base authentication identifier for the multi-session registration |
| `svc_kei_ucwk_no` | Field | Service detail work number — internal tracking ID for service contract line items |
| `kk0161_gene_add_dtm` | Field | Generation addition date-time — date-time stamp for service contract generation |
| `yokyu_sbt_cd` | Field | Request type code — classifies the request as "new" (YOKYU_SBT_CD_02) or "change" (YOKYU_SBT_CD_04) |
| `odr_naiyo_cd` | Field | Order content code — classifies the order type; for multi-session registration: ODR_NAIYO_CD_144 (static) or ODR_NAIYO_CD_142 (dynamic) |
| `OP_SVC_CD_02` | Field | Option service code field — identifies the type of option service (e.g., "0040" = Fixed Global IP Address option) |
| `OP_SVC_KEI_STAT_02` | Field | Option service contract status — status of the option service contract (100, 030, 020) |
| `OP_SVC_KEI_LIST` | Field | Option service contract list — list/array of option services associated with the contract |
| `ido_div` | Field | Diversion code — indicates the type of contract change (e.g., transfer, renewal, new connection) |
| `SVC_KEI_STAT_100` | Constant | Service contract status "100" — indicates active/normal status |
| `SVC_KEI_STAT_030` | Constant | Service contract status "030" — an additional status check for option services |
| `SVC_KEI_STAT_020` | Constant | Service contract status "020" — another status check for option services |
| `OP_SVC_CD_VALUE_0040` | Constant | Option service code "0040" — identifies Fixed Global IP Address option service |
| `YOKYU_SBT_CD_02` | Constant | Request type "02" — new request (new service contract) |
| `YOKYU_SBT_CD_04` | Constant | Request type "04" — change request (modify existing service contract) |
| `ODR_NAIYO_CD_144` | Constant | Order content "144" — Multi-Session (static) registration |
| `ODR_NAIYO_CD_142` | Constant | Order content "142" — Multi-Session (dynamic) registration |
| `CONSMBSN_MSKM_STAT_SKBT_CD_SHONIN` | Constant | Submission state: "accepted" — indicates the application has been approved |
| MSKM_SBT_CD | Field | Service type code — classifies the type of service (FTTH, Mail, ENUM, etc.) |
| OP_SVC_CD | Field | Option service code — identifies optional services like ISP |
| UNYO_YMD | Field | Operation date (year-month-day) — the business date for the operation |
| UNYO_DTM | Field | Operation date-time (year-month-day with time) — full timestamp for the operation |
| OYA_KEI_SKBT_CD | Field | Parent contract identification code — identifies the parent/master contract |
| RULE0059_AUTO_APLY | Field | Rule 0059 automatic application flag — indicates whether service fee automatic application is enabled |
| SEIK_KEI_NO | Field | Billing contract number — the billing account contract identifier |
| USE_STAYMD_YEAR/MON/DAY | Fields | Usage start date (year, month, day) — the date when the service starts |
| MLTISE_SESSION_CNT | Field | Session count — the number of sessions in the multi-session registration |
| PRG_STAT | Field | Progress status — current processing status of the multi-session registration |
| PRG_TKJK_1 | Field | Progress special item 1 — special progress-related item field |
| SYSID | Field | System ID — unique identifier for the customer contract inheritance record |
| IDO_RSN_MEMO_01 | Field | Diversion reason memo — reason for contract transfer/diversion |
| KKW00816SFChecker | Class | Validation layer checker — validates the KKW00816SF logic class for GUI checks |
| JCCWebBusinessLogic | Class | Base class for web business logic — parent class providing common web layer functionality |
| JCCWebCommon | Class | Common web utility class — provides shared web-layer methods like `setMessageInfo` and `getScreenInfo` |
| JSYwebLog | Class | Web logging utility — used for DataBean dump logging during processing |
| X31CWebConst.DATABEAN_SET_VALUE | Constant | DataBean set operation constant — indicates a write operation on the DataBean |
| X31CWebConst.DATABEAN_GET_VALUE | Constant | DataBean get operation constant — indicates a read operation on the DataBean |
| EKK1091D010CBS | CBS | Diversion CBS — service component handling diversion-related operations (referenced in mapper code) |
