# Business Logic — KKW00816SFLogic.actionFixAddMltise() [87 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.KKW00816SF.KKW00816SFLogic` |
| Layer | Screen Logic (Controller-tier business entry point) |
| Module | `KKW00816SF` (Package: `eo.web.webview.KKW00816SF`) |

## 1. Role

### KKW00816SFLogic.actionFixAddMltise()

This method performs the **"Confirm & Register" operation for Multi-Session Information** ("マルチセッション情報登録確認「確定」"). It is the final confirmation action on the multi-session registration screen, triggered when the user clicks the "確定" (Confirm/Fix) button on the KKW00816 screen. The method gathers all multi-session data from the form DataBean, maps it into a structured parameter map via the `KKSV0031OPDBMapper.setAddMltiseInfo` method, and invokes the underlying service pipeline (`invokeService`) that processes the multi-session registration as a batch of ordered sub-services (content approval, detail inquiry, ISP contract, options contract, and progress registration). Upon successful service execution, it displays a confirmation message ("Multi-session information registered" — "マルチセッション情報の登録") and navigates the user to the completion screen `KKW00818` ("マルチセッション情報登録完了画面" — Multi-Session Information Registration Completion Screen). This method implements the **screen action entry point pattern** with **delegation to a DB mapper** for data transformation and **delegation to a shared service pipeline** (`invokeService`) for business processing, serving as the terminal bridge between the web layer and the service component (SC) / component (CC) chain.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["actionFixAddMltise"])
    STEP1["Get ServiceFormBean"]
    STEP2["Create paramBean array"]
    COND1{"bean is null?"}
    THROW1["Throw Exception"]
    STEP3["Log DataBean dump"]
    STEP4["Create paramMap inputMap<br/>outputMap mapper"]
    STEP5["Set paramMap UCID OPID"]
    STEP6["SetAddMltiseInfo<br/>mapper call"]
    STEP7["Log DataBean dump"]
    STEP8["invokeService<br/>paramMap inputMap outputMap"]
    STEP9["Set message info<br/>EKB4390--I"]
    STEP10["Set next screen<br/>KKW00818"]
    STEP11["Log DataBean dump"]
    RET_TRUE["Return true"]

    START --> STEP1
    STEP1 --> STEP2
    STEP2 --> COND1
    COND1 -- true --> THROW1
    COND1 -- false --> STEP3
    STEP3 --> STEP4
    STEP4 --> STEP5
    STEP5 --> STEP6
    STEP6 --> STEP7
    STEP7 --> STEP8
    STEP8 --> STEP9
    STEP9 --> STEP10
    STEP10 --> STEP11
    STEP11 --> RET_TRUE
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| - | (none) | - | This method takes no external parameters. All input data is obtained from the screen-bound `X31SDataBeanAccess` form bean via `super.getServiceFormBean()`. |
| 1 | (implicit bean) | `X31SDataBeanAccess` | The screen form DataBean containing all multi-session registration input fields: service type code, option service codes, operation date/time, parent contract ID, service contract number, usage start date, session count, progress status, and customer contract inheritance data. |
| 2 | (implicit commonBean) | `X31SDataBeanAccess` | Retrieved via `super.getCommonInfoBean()` to store the next-screen routing info (screen ID and screen name for KKW00818). |

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `KKW00816SFLogic.getMltiseId` | - | - | Internal logic method: reads the multi-session flag from the DataBean to determine if multi-session mode is active |
| R | `KKSV0031_KKSV0031OPDBMapper.setAddMltiseInfo` | KKSV0031 | - | Maps form DataBean fields into the `inputMap` parameter map: service type code, option service codes, operation date/time, parent contract ID, billing contract number, usage start date (year/month/day), submission status code, multi-session count, progress status, progress details, customer contract inheritance (SYSID, mobility division, service contract number), mobility reason codes |
| - | `JCCBatCommon.invokeService` | - | - | Invokes the service pipeline: processes all SC/CC steps configured in `inputMap` (content approval, detail inquiry, ISP contract, options contract, progress registration, service order dispatch, record check) |

**Notes on invocation chain:**
- `setAddMltiseInfo` performs a **data mapping / Read** operation from the DataBean into the `inputMap` and `parentMap` structures. The actual SC calls (content approval, detail inquiry, ISP registration, etc.) are commented out and handled by `setAddMltiseInfo` internally via the service pipeline.
- The service pipeline (`invokeService`) triggers downstream SC/CBS calls that are defined in `setAddMltiseInfo`, which internally calls multiple SC components.

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Screen:KKW00816 | `KKW00816SFLogic` (screen entry) -> `actionFixAddMltise` | `setAddMltiseInfo [R] MultiSession registration data` |

**Notes:** This method is a screen entry action method triggered by the screen framework when the user confirms the multi-session registration. No other Java callers were found — the method is invoked via the web screen dispatch mechanism, not from other Java classes.

## 6. Per-Branch Detail Blocks

**Block 1** — [IF] `(bean == null)` (L406)

> Exception guard: if the service form bean is null, throw a generic Exception immediately. This ensures all downstream processing has valid data.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `X31SDataBeanAccess bean = super.getServiceFormBean()` // Get the screen DataBean |
| 2 | SET | `X31SDataBeanAccess[] paramBean = { bean }` // Wrap bean in array for mapper |
| 3 | IF | `bean == null` [-> TRUE: throw, FALSE: continue] (L406) |

**Block 1.1** — [IF TRUE] `bean == null` (L407)

| # | Type | Code |
|---|------|------|
| 1 | THROW | `throw new Exception()` |

**Block 1.2** — [IF FALSE] `bean != null` (L406)

> Bean is valid — proceed with processing.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `JSYwebLog.println(JSYwebLog.DataBean_Dump, getClass(), dumpDatabean(), null, null, null)` // Log DataBean dump 【日本語: 入力DataBeanの確認 - Input DataBean confirmation】 (L413) |
| 2 | SET | `HashMap<String, Object> paramMap = new HashMap<String, Object>()` // Parameter setting map 【日本語: パラメータ設定用マップ】 (L419) |
| 3 | SET | `HashMap<String, Object> inputMap = new HashMap<String, Object>()` // Search condition map 【日本語: 検索条件格納用マップ】 (L419) |
| 4 | SET | `HashMap<String, Object> outputMap = new HashMap<String, Object>()` // Result map 【日本語: 結果格納用マップ】 (L419) |
| 5 | SET | `KKSV0031_KKSV0031OPDBMapper mapper = new KKSV0031_KKSV0031OPDBMapper()` // DataBean-BP mapper 【日本語: DataBean-BPマッパー】 (L419) |
| 6 | SET | `paramMap.put(X31CWebConst.TELEGRAM_INFO_USECASE_ID, JKKCommonConst.UCID_KKSV0031)` // Set use case ID (UCID_KKSV0031) 【日本語: パラメータ設定用マップ.put()】 (L425) |
| 7 | SET | `paramMap.put(X31CWebConst.TELEGRAM_INFO_OPERATION_ID, JKKCommonConst.OPID_KKSV0031OP)` // Set operation ID (OPID_KKSV0031OP) 【日本語: パラメータ設定用マップ.put()】 (L425) |
| 8 | CALL | `mapper.setAddMltiseInfo(paramBean, inputMap, JKKCommonConst.FUNC_CODE_1, getMltiseId(paramBean))` // Map DataBean to inputMap, get multi-session flag 【日本語: マルチセッション情報登録確認「確定」 — 申込内容承認登録SC等】 (L432) |
| 9 | EXEC | `JSYwebLog.println(JSYwebLog.DataBean_Dump, getClass(), dumpDatabean(), null, null, null)` // Log DataBean dump after mapping 【日本語: DataBeanロギング出力】 (L438) |
| 10 | CALL | `invokeService(paramMap, inputMap, outputMap)` // Execute the full service pipeline 【日本語: サービス実行】 (L445) |
| 11 | SET | `String[] str = { "マルチセッション情報の登録" }` // Confirmation message text 【日本語: メッセージ表示処理】 (L464) |
| 12 | CALL | `JCCWebCommon.setMessageInfo(this, "EKB4390--I", str)` // Display success message EKB4390--I 【日本語: メッセージ表示処理】 (L465) |
| 13 | SET | `X31SDataBeanAccess commonBean = super.getCommonInfoBean()` // Get common info bean 【日本語: 遷移先画面の設定】 (L468) |
| 14 | EXEC | `commonBean.sendMessageString(CommonInfoCFConst.NEXT_SCREEN_ID, X31CWebConst.DATABEAN_SET_VALUE, JKKScreenConst.SCREEN_ID_KKW00818)` // Set next screen ID 【日本語: 遷移先画面(マルチセッション情報登録完了画面)の設定】 (L469) |
| 15 | EXEC | `commonBean.sendMessageString(CommonInfoCFConst.NEXT_SCREEN_NAME, X31CWebConst.DATABEAN_SET_VALUE, JKKScreenConst.SCREEN_NAME_KKW00818)` // Set next screen name (KKW00818) 【日本語: 遷移先画面(マルチセッション情報登録完了画面)の設定】 (L469) |
| 16 | EXEC | `JSYwebLog.println(JSYwebLog.DataBean_Dump, getClass(), dumpDatabean(), null, null, null)` // Final DataBean dump 【日本語: DataBeanロギング出力】 (L472) |
| 17 | RETURN | `return true` // Registration completed successfully 【日本語: マルチセッション情報登録確認「確定」 — @return true/false】 (L474) |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `mltise_session_cnt` | Field | Multi-session count — the number of session lines being registered in this multi-session operation |
| `mskm_sbt_cd` | Field | Multi-session type code — classifies the type of multi-session registration |
| `op_svc_cd` | Field | Option service code — identifies the specific option service (e.g., ISP, additional features) associated with this registration |
| `unyo_ymd` | Field | Operation year-month-day — the effective date of the service registration |
| `unyo_dtm` | Field | Operation date-time — the full timestamp of the service registration |
| `oya_kei_skbt_cd` | Field | Parent contract identification code — links to the parent/master contract under which this registration is performed |
| `seik_kei_no` | Field | Billing contract number — the contract number associated with billing for this service |
| `use_staymd_year` / `use_staymd_mon` / `use_staymd_day` | Field | Usage start date (year/month/day) — the date the service begins |
| `consmbsn_mskm_stat_skbt_cd` | Field | Submission status code (approval) — marks the submission as approved (`MSKM_STAT_SKBT_CD_SHONIN`) |
| `prg_stat` | Field | Progress status — tracks the current state of the registration workflow |
| `prg_tkjk_1` | Field | Progress special item 1 — additional progress detail field |
| `ido_div` | Field | Mobility division — indicates the type of contract transfer (e.g., port-in, port-out) |
| `svc_kei_no` | Field | Service contract number — the unique identifier for the service contract |
| `sysid` | Field | System ID — internal system identifier for the customer contract |
| UCID | Acronym | Use Case ID — identifies the business use case (e.g., UCID_KKSV0031) |
| OPID | Acronym | Operation ID — identifies the screen operation (e.g., OPID_KKSV0031OP) |
| FUNC_CODE_1 | Constant | Function code "1" — indicates a standard (non-discounted) service registration mode |
| `FUNC_CODE_2` | Constant | Function code "2" — reserved for discounted service registration mode (commented out in this method) |
| EKB4390--I | Message ID | Success message code for "Multi-session information registered" |
| KKW00816 | Screen ID | Multi-session information registration confirmation screen |
| KKW00818 | Screen ID | Multi-session information registration completion screen (next screen after confirmation) |
| KKSV0031 | Module code | Core service registration module — contains the shared mappers and SC definitions for service registration |
| KKSV0031OPDBMapper | Class | DataBean-to-Parameter Map mapper — transforms the screen form DataBean into structured parameter maps for service invocation |
| setAddMltiseInfo | Method | Maps multi-session registration data from the DataBean into the input parameter map, including service type, option services, dates, and customer contract inheritance info |
| invokeService | Method | Shared service pipeline invoker — triggers the chain of SC/CC components defined for the use case |
| `getMltiseId` | Method | Internal helper that reads the multi-session flag from the DataBean to determine if multi-session mode is active |
| Multi-Session | Business term | Registration of multiple service lines (option services, ISP contracts) under a single operation in one batch |
| DataBean | Technical term | Web form data container — holds user input from the screen for processing |
| paramMap / inputMap / outputMap | Technical term | Three HashMaps: paramMap carries UCID/OPID routing info, inputMap carries search/data parameters for SCs, outputMap receives results from SCs |

---

*Document generated from source: `KKW00816SFLogic.java` lines 400–486 (87 LOC).*