# Business Logic — SCW00401SFLogic.chkItemValue3() [13 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.SCW00401SF.SCW00401SFLogic` |
| Layer | Controller (webview layer — web-facing presentation logic) |
| Module | `SCW00401SF` (Package: `eo.web.webview.SCW00401SF`) |

## 1. Role

SCW00401SFLogic.chkItemValue3() is a private input validation method responsible for verifying that the telephone VLAN-ID field has been properly filled in by the user on a service contract form. It belongs to a family of validation methods (chkItemValue1, chkItemValue2, chkItemValue3) that each check a distinct set of required fields before the system proceeds with service registration or modification. The method retrieves the telephone VLAN-ID value from the service form data bean using a key constant (TEL_VLAN_ID_01, which resolves to "電話VLAN-ID"), passes it through `JSCCommonUtil.isValidParameter()` to ensure it is neither null nor empty, and if validation fails, registers an appropriate error message via `JCCWebCommon.setMessageInfo()` before returning false to abort further processing. This is a shared, reusable validation gate called during the confirm step of a service contract screen flow, ensuring that the telephone service provisioning data includes the required VLAN identification before any downstream service orders are issued.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["chkItemValue3 bean"])
    CHECK(["Retrieve TEL VLAN ID value"])
    VALIDATE(["JSCCommonUtil.isValidParameter sValue"])
    FAIL(["Set error: 電話VLAN-ID"])
    RET_FALSE(["Return false"])
    RET_TRUE(["Return true"])
    END_NODE(["End"])

    START --> CHECK
    CHECK --> VALIDATE
    VALIDATE -- "invalid" --> FAIL
    VALIDATE -- "valid" --> RET_TRUE
    FAIL --> RET_FALSE
    RET_FALSE --> END_NODE
    RET_TRUE --> END_NODE
```

**Processing Summary:**

The method follows a simple two-step validation pattern:

1. **Retrieve** — Extract the value associated with the key `TEL_VLAN_ID_01` ("電話VLAN-ID" / Telephone VLAN-ID) from the `X31SDataBeanAccess` service form bean via `bean.sendMessageString()`. The value is stored in a local `String` variable `sValue`.

2. **Validate** — Pass the retrieved value to `JSCCommonUtil.isValidParameter(sValue)`, which checks that the string is not null and not empty. If the parameter is deemed invalid:
   - The method calls `JCCWebCommon.setMessageInfo()` to register an error message referencing "電話VLAN-ID" (Telephone VLAN-ID) as the problematic field, then returns `false` to signal validation failure.
   - If the parameter is valid, the method returns `true` to allow the calling method to proceed with subsequent processing.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `bean` | `X31SDataBeanAccess` | Service form data bean — carries all form input values (including the telephone VLAN-ID field) submitted by the user on the service contract screen. Used for both retrieving user-provided values and posting error/success messages back to the UI. |

**Instance fields / external state accessed:**
- None — the method reads only the passed-in `bean` parameter and uses static utility methods.

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `JSCCommonUtil.isValidParameter` | - | - | Validates whether the telephone VLAN-ID string is non-null and non-empty |
| - | `JCCWebCommon.setMessageInfo` | - | - | Posts an error message to the web response indicating the telephone VLAN-ID field is required |

**Analysis:**

This method performs **no database or service component CRUD operations**. It is a purely in-memory input validation routine that:

- **Reads** the telephone VLAN-ID value from the data bean (in-memory, no DB access).
- **Validates** the value using a utility method (`JSCCommonUtil.isValidParameter`).
- **Writes** an error message to the web response context via `JCCWebCommon.setMessageInfo` if validation fails.

There are no entity reads, service code calls (SC), or business component service calls (CBS) invoked from this method.

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Controller: SCW00401SFLogic | `confirmCreate()` -> `chkItemValue3(bean)` | `isValidParameter [-]`, `setMessageInfo [-]` |

**Notes:**
- This method is called exclusively from `SCW00401SFLogic.confirmCreate()`, which is part of the same class.
- It is invoked as part of the service creation confirmation flow. The caller accumulates results from multiple `chkItemValue*` methods and proceeds only if all validations pass (all return true).
- No screen/batch entry points (e.g., `KKSV*`) call this method directly; it is an internal private validation helper.

## 6. Per-Branch Detail Blocks

**Block 1** — [SET] `(local variable initialization)` (L325)

> Initialize the local string variable to hold the retrieved telephone VLAN-ID value.

| # | Type | Code |
|---|------|------|
| 1 | SET | `String sValue = null;` // Local variable to store the retrieved VLAN-ID string value |

**Block 2** — [EXEC] `(retrieve value from bean)` (L327)

> Retrieve the user-provided telephone VLAN-ID value from the service form bean using the constant key TEL_VLAN_ID_01.
> Constant resolution: `SCW00401SFConst.TEL_VLAN_ID_01 = "電話VLAN-ID"` (Telephone VLAN-ID) — the form field key.

| # | Type | Code |
|---|------|------|
| 1 | SET | `sValue = bean.sendMessageString(TEL_VLAN_ID_01, X31CWebConst.DATABEAN_GET_VALUE)` // TEL_VLAN_ID_01 = "電話VLAN-ID" (Telephone VLAN-ID), retrieves value from bean [-> CONSTANT="電話VLAN-ID"] |

**Block 3** — [IF] `(validation check — JSCCommonUtil.isValidParameter)` (L328)

> Check whether the retrieved telephone VLAN-ID value is valid (non-null and non-empty). If invalid, post an error and return false.
> The condition is negated (`!`), so the block executes when the parameter is invalid.

| # | Type | Code |
|---|------|------|
| 1 | IF | `if (!JSCCommonUtil.isValidParameter(sValue))` // Returns true if sValue is non-null and non-empty; negation triggers block on invalid input |
| 2 | CALL | `JCCWebCommon.setMessageInfo(this, JPCOnlineMessageConstant.EKB0010_TW, new String[]{"電話VLAN-ID"})` // Sets error message for the telephone VLAN-ID field [-> CONSTANT="電話VLAN-ID"] |
| 3 | RETURN | `return false;` // Validation failed — reject and propagate error to caller |

**Block 4** — [ELSE / FALL-THROUGH] `(validation passed)` (L334)

> If the telephone VLAN-ID value is valid (non-null and non-empty), return true to allow the calling method to proceed.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return true;` // Validation passed — this field is acceptable |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `TEL_VLAN_ID_01` | Constant | Telephone VLAN-ID form field key — used to retrieve the telephone VLAN-ID value from the service form bean |
| `電話VLAN-ID` | Field (Japanese) | Telephone VLAN-ID — the VLAN identifier assigned to telephone service lines; required for voice-over-IP service provisioning |
| VLAN-ID | Business term | Virtual LAN Identifier — a network segmentation identifier used to isolate voice traffic from data traffic on shared infrastructure |
| `X31SDataBeanAccess` | Class | Service form data bean — the data transfer object carrying all form input values between the web screen and business logic layer |
| `X31CWebConst.DATABEAN_GET_VALUE` | Constant | Data bean access mode — specifies that the bean should return the current user-entered value for the given key |
| `JSCCommonUtil.isValidParameter` | Method | Standard parameter validation utility — checks whether a string value is non-null and non-empty |
| `JCCWebCommon.setMessageInfo` | Method | Web error/success message registration utility — posts a message (error, warning, info) to the web response for display on the screen |
| `JPCOnlineMessageConstant.EKB0010_TW` | Constant | Error message code — a predefined system message template indicating a required field is missing or invalid, with the field name passed as a parameter |
| `chkItemValue3` | Method | The third in a series of item-level validation checks (chkItemValue1, chkItemValue2, chkItemValue3) that validate individual form fields during service contract confirmation |
| SCW00401SF | Module | Service contract screen module — handles the service creation/registration workflow for telecommunications services |
| `confirmCreate` | Method | Confirmation handler — called during the service creation flow to validate all form inputs before proceeding to actual service registration |
