# Business Logic — SCW00301SFLogic.chkItemValue1() [12 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.SCW00301SF.SCW00301SFLogic` |
| Layer | Controller / Web Logic (inferred from package `eo.web.webview.SCW00301SF`) |
| Module | `SCW00301SF` (Package: `eo.web.webview.SCW00301SF`) |

## 1. Role

### SCW00301SFLogic.chkItemValue1()

This method performs **input validation for the Service Contract Number (サービス契約番号)** during the VLAN-ID issuance request workflow in the eo Customer Base System (eo顧客基幹システム). It serves as the first in a chain of item-level input checks (`chkItemValue1`, `chkItemValue2`, ...) that collectively ensure required fields are populated before the search screen proceeds to data display. Specifically, it retrieves the service contract number from the service form bean, validates that it is neither `null` nor blank, and returns `false` with a user-facing error message if the value is missing. The method follows a **delegation pattern** — it delegates data extraction to `X31SDataBeanAccess.sendMessageString` and validation to `JSCCommonUtil.isValidParameter`, while error message generation is delegated to `JCCWebCommon.setMessageInfo`. Its role in the larger system is a **gatekeeper guard** within the search entry point: if this check fails, the caller (`search()`) short-circuits the entire search operation and returns the user to the input screen with an error notification.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["chkItemValue1(bean)"])
    START --> INIT["Initialize: sValue = null"]
    INIT --> GET_VALUE["Retrieve Service Contract Number from bean"]
    GET_VALUE --> VALIDATE{Is sValue valid}
    VALIDATE -- false --> SET_MSG["Set error message: EKB0010-TW with Service Contract Number"]
    SET_MSG --> RETURN_FALSE["Return false"]
    VALIDATE -- true --> RETURN_TRUE["Return true"]
    RETURN_FALSE --> END_RETURN(["Return / Next"])
    RETURN_TRUE --> END_RETURN
```

**Constant Resolution:**
- `KEY_SVC_KEI_NO = "サービス契約番号"` (Service Contract Number) — defined in `SCW00401SFConst` (imported via `import static eo.web.webview.SCW00401SF.SCW00401SFConst.*`). This key identifies the service contract number field in the data bean.
- `EKB0010_TW = "EKB0010-TW"` — a required-field missing error message code, used to notify the user that a mandatory field has not been entered.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `bean` | `X31SDataBeanAccess` | The service form bean carrying the user's input data for the VLAN-ID issuance request screen. Specifically, this bean holds the **Service Contract Number (サービス契約番号)** field that must be validated. The bean acts as the data transfer container between the web presentation layer and the business logic layer. |

No instance fields or external state are read by this method beyond the `bean` parameter.

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `JSCCommonUtil.isValidParameter` | JSCCommonUtil | - | Validates that a string value is neither `null` nor blank; returns `true` if the value contains meaningful content |
| - | `JCCWebCommon.setMessageInfo` | JCCWebCommon | - | Sets an error message (EKB0010-TW) on the web session with the localized field name "Service Contract Number" (サービス契約番号) for display to the user |
| - | `X31SDataBeanAccess.sendMessageString` | X31SDataBeanAccess | - | Retrieves the value of the "Service Contract Number" field from the service form data bean using key `KEY_SVC_KEI_NO` |

**Classification rationale:**
- `isValidParameter` — Utility method, not a database operation. Validates string content (not null/empty).
- `setMessageInfo` — Presentation-layer method, sets an error message for the web UI. No data persistence.
- `sendMessageString` — Data bean accessor, reads a field value from the form bean's internal data store. No database access.

This method performs **no Create, Read, Update, or Delete operations** against database tables. It is a pure validation method that operates entirely within the presentation/web layer.

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Controller: `SCW00301SFLogic.search()` | `search()` -> `chkItemValue1(bean)` | `isValidParameter [-]`, `setMessageInfo [-]`, `sendMessageString [-]` |

**Caller details:**
- The `search()` method in `SCW00301SFLogic` is the sole direct caller. It retrieves the service form bean via `super.getServiceFormBean()` and passes it to `chkItemValue1` as the first step of input validation (marked by comment: 入力値チェック — "Input value check"). If `chkItemValue1` returns `false`, the `search()` method returns `false` immediately, short-circuiting the search and preventing the data view clearance that follows.

**Terminal operations reachable from this method:**
- `JCCWebCommon.setMessageInfo` (error message display)
- `JSCCommonUtil.isValidParameter` (string validation)
- `X31SDataBeanAccess.sendMessageString` (data bean field access)

No database-bound terminal operations are reachable from this method — it operates entirely in the presentation/validation layer.

## 6. Per-Branch Detail Blocks

**Block 1** — [VARIABLE INITIALIZATION] `(L263)`

Initialize the local variable to hold the extracted field value.

| # | Type | Code |
|---|------|------|
| 1 | SET | `String sValue = null` // Local variable to store the extracted service contract number value |

**Block 2** — [EXEC] `(L265)`

Retrieve the Service Contract Number from the service form bean.

| # | Type | Code |
|---|------|------|
| 1 | SET | `sValue = bean.sendMessageString(KEY_SVC_KEI_NO, X31CWebConst.DATABEAN_GET_VALUE)` // Retrieves the value of the Service Contract Number field (KEY_SVC_KEI_NO = "サービス契約番号") from the data bean using GET_VALUE directive |

**Block 3** — [IF] `(condition: !JSCCommonUtil.isValidParameter(sValue))` `[isValidParameter checks null/blank]` `(L266)`

If the Service Contract Number is null or blank, report a validation error to the user and reject the operation.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `JCCWebCommon.setMessageInfo(this, JPCOnlineMessageConstant.EKB0010_TW, new String[]{"サービス契約番号"})` // Sets error message EKB0010-TW (required field missing) with field name "サービス契約番号" (Service Contract Number) on the web session [-> EKB0010_TW = "EKB0010-TW"] |
| 2 | RETURN | `return false` // Validation failed — return control to caller without proceeding to search |

**Block 4** — [ELSE-IMPLICIT / FALL-THROUGH] `(condition: sValue is valid)` `(L271)`

The Service Contract Number is present and non-blank. Validation passes.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return true` // Validation passed — caller may proceed with search processing |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `key_svc_kei_no` | Field | Service contract number — the unique identifier for a customer's service contract line item. This is the primary key that links all service-related data (contract details, billing, equipment assignments) to a specific customer agreement. |
| サービス契約番号 | Japanese field name | Japanese display label for "key_svc_kei_no" — translates to "Service Contract Number" |
| 入力値チェック | Japanese comment | "Input value check" — the validation stage that verifies user-entered form data before processing |
| チェック処理１ | Japanese comment | "Check Process 1" — first in a sequence of item-level validation checks performed before search execution |
| 成否 | Japanese return description | "Success/failure" — boolean return: `true` = validation passed, `false` = validation failed |
| EKB0010-TW | Message code | Required field missing error — displayed when a mandatory form field has not been populated by the user |
| X31SDataBeanAccess | Framework class | Fujitsu X31 framework class for accessing service form bean data. Provides `sendMessageString` for reading/writing form field values. |
| X31CWebConst | Framework constant class | X31 framework constants including `DATABEAN_GET_VALUE` directive used to read field values from the service form bean. |
| SCW00301SF | Module ID | VLAN-ID issuance request module — handles the business process for requesting phone VLAN-ID assignment in the eo Customer Base System. |
| eo 顧客基幹システム | Japanese system name | eo Customer Base System — Fujitsu's telecommunications customer management platform serving the NTT East (NTT東日本) e0 brand. |
| 電話用VLAN-ID発行 | Japanese system description | "Phone VLAN-ID issuance" — the business capability this module supports: assigning a VLAN ID for VoIP/phone services to a customer's line. |
| DATABEAN_GET_VALUE | Directive | X31 framework directive telling the data bean to return the current value of a field |
