---

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

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.SCW00401SF.SCW00401SFLogic` |
| Layer | Controller / Screen Logic |
| Module | `SCW00401SF` (Package: `eo.web.webview.SCW00401SF`) |

## 1. Role

### SCW00401SFLogic.confirmCreate()

This method handles the **registration confirmation button press** (登録確認ボタン押下処理) for the Phone VLAN-ID New Registration screen (SCW00401). It is the business logic entry point that processes the user's attempt to confirm and submit a VLAN-ID registration request. Specifically, it performs a two-phase workflow: first, it validates the entered data by running dual data bean checks (`chkItemValue2` and `chkItemValue3`) on the phone VLAN-ID order list sub-bean. If validation passes, it delegates to the SCSV0005 pre-registration check service component (`setSCSV000501SC` + `invokeService`) to verify the order is eligible for registration. If the service component returns an error, the method sets an error message and returns `false` to redisplay the confirmation screen. If the service check succeeds, it sets a success message ("VLAN-IDの登録" / VLAN-ID Registration) and navigates to the next screen (SCW00402 — the VLAN-ID Registration Confirmation Screen), returning `true`. The method follows a gate-and-delegate pattern: it gates on input validation and service check results, then delegates to downstream screens and services to advance the VLAN-ID registration workflow.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["confirmCreate Entry"])
    INIT1["Create paramMap"]
    INIT2["Create inputMap"]
    INIT3["Create outputMap"]
    GET_BEAN["Get serviceFormBean"]
    WRAP["Wrap bean in paramBean array"]
    GET_SUBBEAN["Get subbean from getDataBeanArray"]
    CHK2["chkItemValue2 subbean"]
    COND_CHK1{Data validation}
    CHK3["chkItemValue3 subbean"]
    RET_FAIL1["Return false"]
    SET_USECASE["Set TELEGRAM_INFO_USECASE_ID to SCSV0005"]
    CREATE_Mapper["Create SCSV0005_SCSV0005OPDBMapper"]
    MAP_SET["mapper.setSCSV000501SC paramBean inputMap FUNC_CD4"]
    INVOKE["invokeService paramMap inputMap outputMap"]
    COND_ERR{Service returned error}
    SET_ERR_MSG["setMessageInfo msgResult"]
    RET_FAIL2["Return false"]
    SET_SUCCESS["setMessageInfo EKB0370__I with REGISTER_VLAN_ID"]
    NAV["setNextScreen SCW00402 SCW00402_SCREEN_NAME"]
    RET_OK["Return true"]
    END(["End"])

    START --> INIT1
    INIT1 --> INIT2
    INIT2 --> INIT3
    INIT3 --> GET_BEAN
    GET_BEAN --> WRAP
    WRAP --> GET_SUBBEAN
    GET_SUBBEAN --> CHK2
    CHK2 --> COND_CHK1
    COND_CHK1 -->|false| CHK3
    COND_CHK1 -->|true| RET_FAIL1
    CHK3 --> COND_ERR
    SET_USECASE --> CREATE_Mapper
    CREATE_Mapper --> MAP_SET
    MAP_SET --> INVOKE
    INVOKE --> COND_ERR
    COND_ERR -->|true| SET_ERR_MSG
    SET_ERR_MSG --> RET_FAIL2
    COND_ERR -->|false| SET_SUCCESS
    SET_SUCCESS --> NAV
    NAV --> RET_OK
    RET_FAIL1 --> END
    RET_FAIL2 --> END
    RET_OK --> END
```

**CONSTANT RESOLUTION:**

| Constant | Resolved Value | Business Meaning |
|----------|---------------|------------------|
| `ESC0021A010CBSMSG1LIST` | `"電話用VLAN-IDオーダー一覧"` | Phone VLAN-ID Order List — data bean array key for the order list item |
| `FUNC_CD_4` | `"4"` | Function code 4 — indicates pre-registration check mode for SCSV0005 |
| `TELEGRAM_INFO_USECASE_ID` | (X31CWebConst key) | Telegram info use case ID — identifies SCSV0005 as the target service case |
| `EKB0370__I` | `"EKB0370--I"` | Success message key |
| `MSG_REGISTER_VLAN_ID` | `"VLAN-IDの登録"` | "VLAN-ID Registration" — message text shown to the user on success |
| `SCREEN_ID_SCW00402` | `"SCW00402"` | Target screen ID for next-screen navigation |
| `SCREEN_NAME_SCW00402` | `"VLAN-ID登録確認画面"` | "VLAN-ID Registration Confirmation Screen" — screen display name |

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| - | `(none)` | - | This method takes no explicit parameters. It reads all data from the screen form bean (service form state) obtained via `super.getServiceFormBean()`. |

**Instance Fields / External State Read:**

| Source | Type | Business Description |
|--------|------|---------------------|
| `super.getServiceFormBean()` | `X31SDataBeanAccess` | The screen's service form bean, containing the current page state and user-entered data including the Phone VLAN-ID Order List data bean array |
| `this` (implicit) | `SCW00401SFLogic` | The logic class instance, used to pass context to `JCCWebCommon.setMessageInfo()` |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `OneStopDataBeanAccess.getDataBeanArray` | - | - | Reads the Phone VLAN-ID Order List data bean array from the form bean |
| R | `OneStopDataBeanAccess.getDataBean` | - | - | Reads the first element (index 0) of the data bean array as a sub-bean |
| R | `SCW00401SFLogic.chkItemValue2` | - | - | Validates item values in the sub-bean (data integrity check) |
| R | `SCW00401SFLogic.chkItemValue3` | - | - | Additional validation on the sub-bean (secondary data check) |
| - | `SCSV0005_SCSV0005OPDBMapper.setSCSV000501SC` | SCSV0005 | - | Maps form bean data and prepares input for the SCSV0005 pre-registration check service |
| - | `invokeService` (inherited) | SCSV0005 | - | Invokes the SCSV0005 pre-registration check service, which validates order eligibility before VLAN-ID registration |
| - | `JCCWebCommon.setMessageInfo` | - | - | Sets an error message on the form bean when service check fails |
| - | `JCCWebCommon.setMessageInfo` | - | - | Sets the success message "VLAN-IDの登録" when pre-registration check passes |
| - | `SCW00401SFLogic.setNextScreen` | - | - | Configures navigation to the next screen (SCW00402 — VLAN-ID Registration Confirmation Screen) |

**Classification rationale:**

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `OneStopDataBeanAccess.getDataBeanArray` | - | Form Bean (in-memory) | Retrieves the Phone VLAN-ID Order List array from the service form bean |
| R | `OneStopDataBeanAccess.getDataBean` | - | Form Bean (in-memory) | Retrieves the first row (index 0) of the order list as a typed sub-bean |
| R | `chkItemValue2` | - | - | Performs item-level validation on the sub-bean; returns false if validation fails |
| R | `chkItemValue3` | - | - | Performs secondary validation on the sub-bean; returns false if validation fails |
| - | `SCSV0005.setSCSV000501SC` | SCSV0005 | - | Prepares the request payload for the pre-registration check by mapping the form bean and input map |
| - | `invokeService` | SCSV0005 | SCSV0005 Service | Calls the SCSV0005 CBS (Core Business Service) for pre-registration validation; returns null on success, message result on error |
| - | `JCCWebCommon.setMessageInfo` | - | - | Stores an error message in the form bean (called when service returns error) |
| - | `JCCWebCommon.setMessageInfo` | - | - | Stores a success message ("VLAN-ID Registration") in the form bean (called when check passes) |
| - | `setNextScreen` | - | - | Sets the navigation target to screen SCW00402 (VLAN-ID Registration Confirmation Screen) |

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Screen:SCW00401 (self) | `SCW00401SFLogic.confirmCreate` (called by SCW00401 confirmation button) | `chkItemValue2 [R]`, `chkItemValue3 [R]`, `setSCSV000501SC [-] SCSV0005`, `invokeService [-] SCSV0005`, `setNextScreen [-] SCW00402` |
| 2 | Screen:SCW00401 (self) | Same as #1 — confirmation button invokes `confirmCreate()` | |

**Notes:** `confirmCreate()` is a same-screen handler — it is called by the SCW00401 screen (VLAN-ID New Registration Screen) when the user presses the registration confirmation button. Other screens (SCW00301SF, SCW00701SF) also have `confirmCreate()` methods with the same signature but are separate implementations.

## 6. Per-Branch Detail Blocks

### Block 1 — [INITIALIZATION] (L128)

> Initialize maps and obtain the service form bean.

| # | Type | Code |
|---|------|------|
| 1 | SET | `paramMap = new HashMap()` |
| 2 | SET | `inputMap = new HashMap()` |
| 3 | SET | `outputMap = new HashMap()` |
| 4 | SET | `bean = super.getServiceFormBean()` |
| 5 | SET | `paramBean = {bean}` — wraps the form bean in a single-element array |

### Block 2 — [SET] (L133)

> Obtain the list item data bean from the form bean.
> Comment: リスト項目データビューアの取得 — "Retrieve the list item data viewer."

| # | Type | Code |
|---|------|------|
| 1 | SET | `subbean = paramBean[0].getDataBeanArray(ESC0021A010CBSMSG1LIST).getDataBean(0)` — ESC0021A010CBSMSG1LIST = "電話用VLAN-IDオーダー一覧" (Phone VLAN-ID Order List). Retrieves the first row (index 0) of the order list data bean. |

### Block 3 — [IF] `!chkItemValue2(subbean) || !chkItemValue3(subbean)` (L136)

> Data bean validation check. If either validation fails, return false to keep the user on the current screen.
> Comment: データビューアのチェック — "Data bean check."

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `chkItemValue2(subbean)` — calls local validation method; returns false if item values are invalid |
| 2 | EXEC | `chkItemValue3(subbean)` — calls local validation method; returns false if item values are invalid |
| 3 | RETURN | `return false` — early exit: validation failed, user remains on current screen |

**Block 3.1 — [ELSE-FALLTHROUGH]** (Validation passed, proceed to service call)

### Block 4 — [SET] (L142)

> Prepare the service invocation parameters. This is the pre-registration check processing.
> Comment: サービスの呼び出し（登録前チェック処理） — "Service call (pre-registration check processing)."

| # | Type | Code |
|---|------|------|
| 1 | SET | `paramMap.put(TELEGRAM_INFO_USECASE_ID, "SCSV0005")` — sets use case ID to identify the SCSV0005 service component |
| 2 | SET | `mapper = new SCSV0005_SCSV0005OPDBMapper()` — creates the data mapper for SCSV0005 |
| 3 | CALL | `mapper.setSCSV000501SC(paramBean, inputMap, FUNC_CD_4)` — FUNC_CD_4 = "4". Maps form bean data into the input map for the SCSV0005 service. FUNC_CD_4 indicates pre-registration check mode. |
| 4 | CALL | `msgResult = invokeService(paramMap, inputMap, outputMap)` — invokes the SCSV0005 CBS (Core Business Service) for pre-registration validation. Returns null on success, or a `X31CMessageResult` on error. |

### Block 5 — [IF] `msgResult != null` (L147)

> Service returned an error. Display the error message and return false.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `JCCWebCommon.setMessageInfo(this, msgResult)` — sets the error message from the service result onto the form bean |
| 2 | RETURN | `return false` — early exit: service check failed, user remains on current screen to correct errors |

### Block 6 — [ELSE-FALLTHROUGH] (Service check passed, L152)

> The pre-registration check succeeded. Set the success message and navigate to the next screen.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `JCCWebCommon.setMessageInfo(this, EKB0370__I, new String[] { MSG_REGISTER_VLAN_ID })` — EKB0370__I = "EKB0370--I" (success message key). MSG_REGISTER_VLAN_ID = "VLAN-IDの登録" ("VLAN-ID Registration"). Displays a success message to the user. |
| 2 | CALL | `setNextScreen(SCREEN_ID_SCW00402, SCREEN_NAME_SCW00402)` — navigates to the next screen. SCREEN_ID_SCW00402 = "SCW00402". SCREEN_NAME_SCW00402 = "VLAN-ID登録確認画面" ("VLAN-ID Registration Confirmation Screen"). |
| 3 | RETURN | `return true` — success: the registration confirmation flow is complete, user will see the next screen. |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `svc_kei_no` | Field | Service contract number — the unique identifier for a service contract line in the K-Opticom system |
| `svc_kei_no_hoji` | Field | Service contract number retention — internal flag/field to preserve the service contract number across page transitions |
| `esc0021a010cbsmsg1list` | Field | Phone VLAN-ID order list — the data bean array key for the order list items displayed on the screen |
| `sysid_01` | Field | Customer number — the contract customer's system ID |
| `cust_nm_01` | Field | Customer name — the contract customer's name |
| `keisha_telno_01` | Field | Customer telephone number — the contact phone number for the contract customer |
| `tel_vlan_id_01` | Field | Phone VLAN-ID — the VLAN identifier assigned to a phone service order |
| `bas_host_id_01` | Field | BAS-Host ID — the Bridge Access System host identifier |
| `eo_tel_flg_01` | Field | EO telephone flag — flag indicating whether the customer uses EO telephone services |
| `sod_work_rnk_stat_01` | Field | SOT business linkage status — status of synchronization/linkage with the SOT (Service Order Terminal) system |
| `svc_cd_01` | Field | Service code — the code identifying the type of service (e.g., FTTH, mail, ENUM) |
| `svc_cd_nm_01` | Field | Service code name — the display name for the service code |
| `svc_kei_stat_01` | Field | Service contract status — the current status of the service contract |
| `svc_kei_stat_nm_01` | Field | Service contract status name — human-readable label for the service contract status |
| `tel_vlan_order_stat_01` | Field | Phone VLAN order status — the current status of a phone VLAN order |
| `req_ji_mskmsho_no_01` | Field | Order work application number — the application number for an order work request |
| `req_ji_kjak_no_01` | Field | Order work project number — the project number associated with an order work |
| SCSV0005 | SC Code | Service Component for pre-registration check — validates order eligibility before VLAN-ID registration |
| FUNC_CD_4 | Constant | Function code "4" — indicates pre-registration check mode when calling SCSV0005 |
| EKB0370--I | Constant | Success message key — message template key for successful VLAN-ID registration confirmation |
| VLAN-ID | Business term | Virtual LAN identifier — a network segment identifier used to isolate traffic for phone services on the K-Opticom fiber network |
| SCW00401 | Screen | VLAN-ID New Registration Screen — the screen where users enter phone VLAN-ID registration details |
| SCW00402 | Screen | VLAN-ID Registration Confirmation Screen — the next screen displayed after successful pre-registration check |
| CHK (Data Bean Check) | Concept | Input validation step that verifies the entered data meets business rules before proceeding with registration |
| Pre-registration Check | Concept | Service-level validation (SCSV0005) that verifies the order is eligible for VLAN-ID registration before committing |
| K-Opticom | Business entity | K-Opticom Co., Ltd. — Japanese broadband/telecom ISP; the system owner |

---
