# Business Logic — SCW00301SFLogic.confirmCreate() [36 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.SCW00301SF.SCW00301SFLogic` |
| Layer | Controller (WebLogic — extends JCCWebBusinessLogic in the eo.web.webview package) |
| Module | `SCW00301SF` (Package: `eo.web.webview.SCW00301SF`) |

## 1. Role

### SCW00301SFLogic.confirmCreate()

This method implements the **registration confirmation button press processing** (登録確認ボタン押下処理) for the **Telephone VLAN-ID Request New Registration** screen (SCW003010PJP). It is the business logic layer (BL) handler invoked when a user clicks the "Registration Confirmation" button (登録確認ボタン) on the initial VLAN-ID order entry screen.

The method performs three sequential phases of business processing: First, it retrieves and validates the telephone VLAN-ID order data row (esc0021a010cbsmsg1list) from the service form data bean, ensuring all required fields are properly populated. Second, it invokes a pre-registration check service (SCSV0005) to verify the validity of the VLAN-ID allocation request against backend business rules — this includes checking service contract status, VLAN availability, and data consistency. Third, upon successful validation, it sets a success confirmation message and transitions the user to the confirmation screen (SCW00302), where the details of the VLAN-ID registration request are displayed for final review.

The method follows the **delegation design pattern**: it does not implement the pre-registration check logic itself but delegates to `SCSV0005` (a BPM-based service component) and uses the `invokeService` framework method inherited from `JCCWebBusinessLogic` to execute it. The method serves as the **entry point** for the registration confirmation flow within the SCW00301SF screen — it is bound to the `B_ADD_CFM` (Registration Confirmation button) on the SCW003010PJP page via the VLCOMMANDMAP.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["confirmCreate()"])
    START --> SETUP["Setup: Create paramMap, inputMap, outputMap, paramBean"]
    SETUP --> GET_SUBBEAN["Get subbean from getDataBeanArray(ESC0021A010CBSMSG1LIST).getDataBean(0)
Retrieve list item data bean for vision screening"]
    GET_SUBBEAN --> CHK_ITEM["chkItemValue2(subbean)
Check data bean items"]
    CHK_ITEM --> CHK_RESULT{chkItemValue2
failed?}
    CHK_RESULT -->|true| RET_FALSE1["Return false
Data bean check failed"]
    CHK_RESULT -->|false| PRE_CHECK["Set paramMap TELEGRAM_INFO_USECASE_ID = \"SCSV0005\""]
    PRE_CHECK --> MAPPER["Create SCSV0005_SCSV0005OPDBMapper
setSCSV000501SC(paramBean, inputMap, FUNC_CD_6)
FUNC_CD_6 = \"6\""]
    MAPPER --> INVOKE["invokeService(paramMap, inputMap, outputMap)
Call pre-registration check service SCSV0005"]
    INVOKE --> INVOKE_RESULT{msgResult != null?}
    INVOKE_RESULT -->|true| SET_MSG["JCCWebCommon.setMessageInfo(this, msgResult)
Set error message from service"]
    SET_MSG --> RET_FALSE2["Return false
Service returned error"]
    INVOKE_RESULT -->|false| SET_INFO["JCCWebCommon.setMessageInfo(this, EKB0370__I, MSG_REGISTER_VLAN_ID)
Set success info message"]
    SET_INFO --> SET_NEXT["setNextScreen(SCREEN_ID_SCW00302, SCREEN_NAME_SCW00302)
Set next screen for transition"]
    SET_NEXT --> RET_TRUE["Return true
Navigate to SCW00302 screen"]
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| - | `(none)` | - | This method takes no parameters. All input data is retrieved internally from the service form bean via `super.getServiceFormBean()`, which is populated by the X31 framework from the web request. |
| - | `super.getServiceFormBean()` (instance access) | `X31SDataBeanAccess` | The service form bean (`SCW00401SFBean`) carrying the web page state, including the K-Opticom Service Contract Number, the telephone VLAN-ID order list (esc0021a010cbsmsg1list), and customer information. This bean is maintained by the X31 web framework across page lifecycles. |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `SCW00301SFLogic.chkItemValue2` | SCW00301SF | - | Calls `chkItemValue2` in `SCW00301SFLogic` for input data validation |
| - | `SCW00301SFLogic.setNextScreen` | SCW00301SF | - | Calls `setNextScreen` in `SCW00301SFLogic` to set target transition screen |
| - | `JCCWebCommon.setMessageInfo` (error path) | JCCWebCommon | - | Calls `setMessageInfo` to set error/info message from pre-registration check result |
| - | `JCCWebCommon.setMessageInfo` (success path) | JCCWebCommon | - | Calls `setMessageInfo` to set the VLAN-ID request registration success message |
| R | `SCSV0005_SCSV0005OPDBMapper.setSCSV000501SC` | SCSV0005 | - | Calls `setSCSV000501SC` to map service form data to the pre-registration check request payload |
| R | `invokeService` (SCSV0005) | SCSV0005 | - | Invokes the SCSV0005 pre-registration check BPM service to validate the VLAN-ID allocation request |

**How to classify:**
- **R** (Read): Methods that query or prepare data for validation. `chkItemValue2` reads/validates local data bean fields. `SCSV0005_SCSV0005OPDBMapper.setSCSV000501SC` reads from the service form bean and maps it into the request payload. `invokeService` with SCSV0005 reads and validates VLAN-ID allocation data against the pre-registration business rules.
- **No C/U/D operations**: This method is a pre-registration check — it does not write, create, update, or delete any records. The actual registration happens on a subsequent screen (SCW00302) when the user clicks the "Fix/Confirm" button.

## 5. Dependency Trace

Trace who calls this method and what this method ultimately calls.

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Screen:SCW003010PJP | VLCOMMANDMAP SCW003010PJP → EVENT `PAGE_TRANSFER` → PART `B_ADD_CFM` → `SCW00301SFLogic.confirmCreate` | `setSCSV000501SC [R] ESC0021A010CBSMsg1List (tel_vlan_id, bas_host_id, req_ji_mskmsho_no, req_ji_kjak_no)`, `invokeService [R] SCSV0005` |

**How the call is bound:**
- The `WEBVLCOMMANDMAP_SCW003010PJP.xml` config maps the `B_ADD_CFM` button (Registration Confirmation) on page `SCW003010PJP` to the `confirmCreate` method of the `SCW00301SF` business logic class.
- The `WEBGAMEN_SCW003010PJP.xml` page definition declares `<BL id="SCW00301SF" class="eo.web.webview.SCW00301SF.SCW00301SFLogic">` and the button `<BUTTON id="B_ADD_CFM" type="direct" blid="transferButton" class="eo.web.webview.pagetransfer.NextButtonLogic" pagestack="no" name="登録確認"/>`.

**What this method calls:**
- `chkItemValue2(subbean)` — internal data bean validation
- `SCSV0005_SCSV0005OPDBMapper.setSCSV000501SC(paramBean, inputMap, FUNC_CD_6)` — data mapping to SCSV0005 service request
- `invokeService(paramMap, inputMap, outputMap)` — executes the SCSV0005 pre-registration check BPM service
- `JCCWebCommon.setMessageInfo(this, msgResult)` — error message handling
- `JCCWebCommon.setMessageInfo(this, EKB0370__I, new String[] { MSG_REGISTER_VLAN_ID })` — success message setting
- `setNextScreen(SCREEN_ID_SCW00302, SCREEN_NAME_SCW00302)` — screen navigation

## 6. Per-Branch Detail Blocks

**Block 1** — [SET] `(Initial Variable Setup)` (L130-L135)

| # | Type | Code |
|---|------|------|
| 1 | SET | `HashMap paramMap = new HashMap();` // Request parameter map for service invocation |
| 2 | SET | `HashMap inputMap = new HashMap();` // Input map for service input parameters |
| 3 | SET | `HashMap outputMap = new HashMap();` // Output map for service response data |
| 4 | SET | `X31SDataBeanAccess bean = super.getServiceFormBean();` // Get service form bean from X31 framework |
| 5 | SET | `X31SDataBeanAccess[] paramBean = {bean};` // Wrap bean in array for service call |

**Block 2** — [CALL] `(Retrieve List Item Data Bean for Vision Screening)` (L138-L139)

> Japanese comment: リスト項目データビューアの取得 — "Retrieve the list item data viewer (list item data bean)"

| # | Type | Code |
|---|------|------|
| 1 | SET | `X31SDataBeanAccess subbean = paramBean[0].getDataBeanArray(ESC0021A010CBSMSG1LIST).getDataBean(0);` // Retrieves the first row of the telephone VLAN-ID order list from the service form bean [-> ESC0021A010CBSMSG1LIST="ESC0021A010CBSMsg1List"] |

**Block 3** — [IF] `(Data Bean Item Check — chkItemValue2)` (L142-L145)

> Japanese comment: データビューアンのチェック — "Check the data bean"

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `chkItemValue2(subbean)` // Validates required fields in the subbean (telephone VLAN-ID order row) |
| 2 | IF | `if (!chkItemValue2(subbean))` // If validation fails |
| 3 | RETURN | `return false;` // Abort — data validation error displayed to user |

**Block 4** — [CALL] `(Service Invocation — Pre-Registration Check)` (L148-L157)

> Japanese comment: サービス呼び出し（登録前チェック処理） — "Service invocation (pre-registration check processing)"

**Block 4.1** — [SET] `(Set Use Case ID for Service)` (L150)

| # | Type | Code |
|---|------|------|
| 1 | SET | `paramMap.put(X31CWebConst.TELEGRAM_INFO_USECASE_ID, "SCSV0005");` // Set use case identifier for the service invocation framework |

**Block 4.2** — [SET] `(Create Service Mapper)` (L151-L152)

| # | Type | Code |
|---|------|------|
| 1 | SET | `SCSV0005_SCSV0005OPDBMapper mapper = new SCSV0005_SCSV0005OPDBMapper();` // Instantiate the data mapper for SCSV0005 service request |
| 2 | SET | `FUNC_CD_6 = "6"` (resolved from `JPCModelConstant.FUNC_CD_6`) — passed as the function code parameter to `setSCSV000501SC` |

**Block 4.3** — [CALL] `(Map Service Request Data)` (L152)

| # | Type | Code |
|---|------|------|
| 1 | CALL | `mapper.setSCSV000501SC(paramBean, inputMap, FUNC_CD_6);` // Maps service form data to SCSV0005 request payload — extracts func_code, svc_kei_no (K-Opticom Service Contract Number), tel_vlan_id, bas_host_id, req_ji_mskmsho_no (request date submission number), req_ji_kjak_no (request date work case number) |

**Block 4.4** — [CALL] `(Invoke SCSV0005 Pre-Registration Check Service)` (L153)

| # | Type | Code |
|---|------|------|
| 1 | CALL | `X31CMessageResult msgResult = invokeService(paramMap, inputMap, outputMap);` // Executes the SCSV0005 BPM service which validates the VLAN-ID allocation request against business rules |

**Block 5** — [IF] `(Check Service Result for Errors)` (L154-L157)

| # | Type | Code |
|---|------|------|
| 1 | IF | `if (msgResult != null)` // Service returned an error/non-null result |
| 2 | CALL | `JCCWebCommon.setMessageInfo(this, msgResult);` // Set error/info message from service response to be displayed to the user |
| 3 | RETURN | `return false;` // Abort — pre-registration check failed, user must correct data |

**Block 6** — [SET] `(Set Success Message)` (L160)

> Japanese comment: 次画面に表示するメッセージの設定 — "Set the message to display on the next screen"

| # | Type | Code |
|---|------|------|
| 1 | SET | `JCCWebCommon.setMessageInfo(this, EKB0370__I, new String[] { MSG_REGISTER_VLAN_ID });` // Set success information message [-> EKB0370__I = "I" type info message], [-> MSG_REGISTER_VLAN_ID = "VLAN-ID発行依頼の登録" (VLAN-ID Request Registration)] |

**Block 7** — [CALL] `(Navigate to Next Screen)` (L163-L164)

> Japanese comment: 次画面へ遷移 — "Transition to the next screen"

| # | Type | Code |
|---|------|------|
| 1 | CALL | `setNextScreen(SCREEN_ID_SCW00302, SCREEN_NAME_SCW00302);` // Set destination screen for transition [-> SCREEN_ID_SCW00302="SCW00302"], [-> SCREEN_NAME_SCW00302="VLAN-ID発行依頼登録確認" (VLAN-ID Request Registration Confirmation)] |

**Block 8** — [RETURN] `(Success)` (L165)

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return true;` // All validations passed, navigation to confirmation screen initiated |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `ESC0021A010CBSMSG1LIST` | Constant | Telephone VLAN-ID order list — the array of telephone VLAN-ID order rows displayed on the screen. Key fields: `cust_nm` (customer name), `tel_vlan_id` (telephone VLAN-ID), `bas_host_id` (BAS-host ID), `req_ji_mskmsho_no` (request date submission number), `req_ji_kjak_no` (request date work case number). |
| `svc_kei_no` | Field | K-Opticom Service Contract Number — the unique identifier for the customer's service contract line. |
| `tel_vlan_id` | Field | Telephone VLAN-ID — the VLAN identifier assigned to telephone services over the broadband network. |
| `bas_host_id` | Field | BAS-host ID — the Broadband Access Server host identifier associated with the VLAN-ID order. |
| `req_ji_mskmsho_no` | Field | Request Date Submission Number — the administrative reference number for when the request was submitted. |
| `req_ji_kjak_no` | Field | Request Date Work Case Number — the work case identifier associated with the request date. |
| `func_code` | Field | Function Code — passed as `FUNC_CD_6 = "6"` to indicate the specific operation context within the SCSV0005 service. |
| `vlan_order_cd` | Field | VLAN Order Code — set to `VLAN_NEW` to indicate a new VLAN-ID request. |
| `yokyu_sbt_cd` | Field | Request Type Code — set to `YOKYU_SBT_NEW` indicating a new request type. |
| `vlan_server_cd` | Field | VLAN Server Code — set to `VLAN_SVRCD_SETSUBI` indicating a setup/installation service. |
| SCSV0005 | SC | Pre-registration check service — validates VLAN-ID allocation requests before final registration. Part of the telephone VLAN-ID service order processing flow. |
| SCSV000501SC | SC Code | SCSV0005 operation SC (Service Component) — the specific operation within the SCSV0005 BPM service for handling the pre-registration check of telephone VLAN-ID orders. |
| ESC0021A010CBS | CBS | Telephone VLAN-ID order message structure — the CBS message template containing the order data list and error items. |
| EKB0370__I | Constant | Information message type code — used with `setMessageInfo` to display a success/information message to the user. |
| MSG_REGISTER_VLAN_ID | Constant | "VLAN-ID発行依頼の登録" (VLAN-ID Request Registration) — the success message text displayed after pre-registration check passes. |
| SCREEN_ID_SCW00302 | Constant | "SCW00302" — the destination screen ID for the VLAN-ID request registration confirmation page. |
| SCREEN_NAME_SCW00302 | Constant | "VLAN-ID発行依頼登録確認" (VLAN-ID Request Registration Confirmation) — the human-readable name of the confirmation screen. |
| B_ADD_CFM | Screen Element | Registration Confirmation button (登録確認) — the button on the SCW003010PJP screen that triggers the `confirmCreate` method. |
| SCW003010PJP | Screen | Telephone VLAN-ID Request New Registration screen — the initial entry screen for creating a new VLAN-ID order. |
| SCW003020PJP | Screen | Telephone VLAN-ID Request Registration Confirmation screen — the confirmation screen where the user reviews the VLAN-ID registration details before finalizing. |
| VLAN-ID | Business term | Virtual LAN Identifier — a network identifier used to segment Ethernet traffic; in this domain, VLAN-IDs are allocated to telephone services over the K-Opticom broadband network. |
| X31SDataBeanAccess | Technical | X31 framework data bean access class — the standard mechanism for reading/writing web form data within the Futurity X31 web framework. |
| `JPCModelConstant.FUNC_CD_6` | Constant | Function code "6" — passed to SCSV0005 to specify the operation context (pre-registration check for VLAN-ID allocation). |