# Business Logic — SCW00301SFLogic.chkItemValue2() [63 LOC]

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

## 1. Role

### SCW00301SFLogic.chkItemValue2()

This method performs **validation check step 2** (Japanese javadoc: チェック処理2) for the VLAN-ID registration issuance workflow in the EO Optical Telephone service ordering system. It is a pre-condition guard that verifies whether all upstream service states and identifiers are healthy enough to proceed with registering a VLAN-ID issuance request. Specifically, it validates four independent business preconditions: (1) the service type is EO Optical Telephone, (2) the SOD (Service Order Data) upstream notification status is not in any intermediate or error state, (3) the SOD business integration status does not indicate a pending response, and (4) the work case number obtained at request time was successfully resolved.

The method implements the **guard clause / fail-fast design pattern** -- each failing precondition immediately sets a user-facing error message via `JCCWebCommon.setMessageInfo` and returns `false`, short-circuiting the entire registration flow. Only when all four checks pass does the method return `true`, allowing the caller `confirmCreate()` to proceed to the actual service registration call (`SCSV0005`).

This method operates exclusively on a single data bean row extracted by the caller from a list (the first entry of the `ESC0021A010CBSMSG1LIST` data bean array). It does not perform any database CRUD operations itself; instead, it acts as a **state validator** -- a shared utility consumed by screen entry points that need to verify the consistency of service order data before committing registration changes.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["chkItemValue2 bean"])

    START --> G1["Get EO TEL Flag"]

    G1 --> C1{"EO TEL Flag equals 1?"}

    C1 -->|"No"| E1["Set Message EKB0780-KW Return false"]
    E1 --> RET1["Return false"]

    C1 -->|"Yes"| G2["Get SOD Status"]

    G2 --> C2{"SOD Status equals 001?"}

    C2 -->|"Yes"| E2["Set Message EKB1040-JW Return false"]
    E2 --> RET2["Return false"]

    C2 -->|"No"| C3{"SOD Status equals 002?"}

    C3 -->|"Yes"| E3["Set Message EKB1040-JW Return false"]
    E3 --> RET3["Return false"]

    C3 -->|"No"| C4{"SOD Status equals 005?"}

    C4 -->|"Yes"| E4["Set Message EKB1040-JW Return false"]
    E4 --> RET4["Return false"]

    C4 -->|"No"| C5{"SOD Status equals 007?"}

    C5 -->|"Yes"| E5["Set Message EKB1040-JW Return false"]
    E5 --> RET5["Return false"]

    C5 -->|"No"| G3["Get SOD Work Rank Status"]

    G3 --> C6{"SOD Work Rank equals 002?"}

    C6 -->|"Yes"| E6["Set Message EKB1040-JW Return false"]
    E6 --> RET6["Return false"]

    C6 -->|"No"| C7{"SOD Work Rank equals 003?"}

    C7 -->|"Yes"| E7["Set Message EKB1040-JW Return false"]
    E7 --> RET7["Return false"]

    C7 -->|"No"| G4["Get Request Work Case No"]

    G4 --> C8{"reqJiKjakNo is null or empty?"}

    C8 -->|"Yes"| E8["Set Message EKB0930-NW Return false"]
    E8 --> RET8["Return false"]

    C8 -->|"No"| RET9["Return true"]
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `bean` | `X31SDataBeanAccess` | The data bean access handle for a single row extracted from the VLAN-ID registration item list (`ESC0021A010CBSMSG1LIST`). Carries the service type flag, SOD upstream status, SOD integration status, and request-time work case number for that specific order line item. |

**Instance fields / external state read:** None. The method is stateless -- it reads all required data exclusively from the parameter bean and invokes utility methods on its class instance (`this`) only for setting error messages.

## 4. CRUD Operations / Called Services

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

This method performs **no direct CRUD operations**. All method calls are to message-setting utilities that populate error information for display on the screen. No database reads, inserts, updates, or deletes occur.

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `JCCWebCommon.setMessageInfo` | - | - | Sets error message info on the screen context (not a database operation; used for user-facing error display) |
| - | `X31SDataBeanAccess.sendMessageString` | - | - | Reads a string value from the service form bean's internal data map (in-memory retrieval only) |

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `X31SDataBeanAccess.sendMessageString` (EO_TEL_FLG_01) | - | - | Retrieves the EO Optical Telephone flag from the bean to verify the service type is EO光電話 |
| - | `X31SDataBeanAccess.sendMessageString` (TEL_VLAN_ORDER_STAT_01) | - | - | Retrieves the SOD upstream order status to check for waiting/abnormal states |
| - | `X31SDataBeanAccess.sendMessageString` (SOD_WORK_RNKI_STAT_01) | - | - | Retrieves the SOD business integration status to verify no pending responses |
| - | `X31SDataBeanAccess.sendMessageString` (REQ_JI_KJAK_NO_01) | - | - | Retrieves the work case number obtained at request time |
| - | `JCCWebCommon.setMessageInfo` (EKB0780-KW) | - | - | Sets error: registration not allowed for non-EO telephone services |
| - | `JCCWebCommon.setMessageInfo` (EKB1040-JW) | - | - | Sets error: SOD status is not in a clear state, VLAN-ID issuance request blocked |
| - | `JCCWebCommon.setMessageInfo` (EKB0930-NW) | - | - | Sets error: work case number could not be obtained, VLAN-ID issuance request blocked |

## 5. Dependency Trace

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

No screen/batch entry points found within 8 hops. Direct callers found: 1 methods.
Terminal operations from this method: `setMessageInfo` [-], `setMessageInfo` [-], `setMessageInfo` [-], `setMessageInfo` [-], `setMessageInfo` [-], `sendMessageString` [-], `sendMessageString` [-], `setMessageInfo` [-], `setMessageInfo` [-], `setMessageInfo` [-], `setMessageInfo` [-], `setMessageInfo` [-], `setMessageInfo` [-], `setMessageInfo` [-], `setMessageInfo` [-], `setMessageInfo` [-], `setMessageInfo` [-], `sendMessageString` [-], `sendMessageString` [-], `setMessageInfo` [-]

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Logic: `SCW00301SFLogic.confirmCreate()` | `confirmCreate()` -> extracts `ESC0021A010CBSMSG1LIST` data bean row 0 -> `chkItemValue2(subbean)` | `setMessageInfo [U] screen context (error display)` |

The only caller is `confirmCreate()`, which handles the "Register Confirm" button press. It extracts the first item from a data bean array representing the VLAN-ID registration items, then delegates validation to `chkItemValue2`. If validation passes, `confirmCreate()` proceeds to call the `SCSV0005` service component for pre-registration checking. No screen or batch entry point was found within 8 hops of the call graph.

## 6. Per-Branch Detail Blocks

**Block 1** — IF (Service Type Check) `(L280)`

> Verify that the service is EO Optical Telephone before allowing VLAN-ID registration.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `eoflg = bean.sendMessageString(EO_TEL_FLG_01, X31CWebConst.DATABEAN_GET_VALUE)` // Retrieve EO telephone flag [-> EO_TEL_FLG_01 = "EO電話フラグ"] |
| 2 | COND | `!("1".equals(eoflg))` // EO TEL Flag must be "1" |
| 3 | EXEC | `JCCWebCommon.setMessageInfo(this, EKB0780_KW, new String[]{"登録処理", "eo光電話以外の", "発行依頼処理"})` // Set error: Registration not allowed for non-EO telephone services [-> EKB0780-KW] |
| 4 | RETURN | `return false` |

**Block 2** — IF/ELSE-IF (SOD Status Checks) `(L290)`

> Verify that the SOD (Service Order Data) upstream notification status is not in any intermediate or error state. Four sub-statuses are checked -- if any of them match, the request is blocked.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `sodsts = bean.sendMessageString(TEL_VLAN_ORDER_STAT_01, X31CWebConst.DATABEAN_GET_VALUE)` // Retrieve SOD upstream status [-> TEL_VLAN_ORDER_STAT_01 = "電話用VLANオーダーステータス"] |
| 2 | COND | `JSCStrConstant.SOD_STAT_SND_WAIT.equals(sodsts)` // SOD Status = "001" (Sent Waiting) [-> SOD_STAT_SND_WAIT = "001"] |
| 3 | EXEC | `JCCWebCommon.setMessageInfo(this, EKB1040_JW, new String[]{"SODステータス", "送信待ち", "VLAN-ID発行依頼"})` // Error: SOD status is Sent Waiting |
| 4 | RETURN | `return false` |
| 5 | COND | `else if JSCStrConstant.SOD_STAT_ACK_WAIT.equals(sodsts)` // SOD Status = "002" (Acknowledgment Waiting) [-> SOD_STAT_ACK_WAIT = "002"] |
| 6 | EXEC | `JCCWebCommon.setMessageInfo(this, EKB1040_JW, new String[]{"SODステータス", "応答待ち", "VLAN-ID発行依頼"})` // Error: SOD status is Acknowledgment Waiting |
| 7 | RETURN | `return false` |
| 8 | COND | `else if JSCStrConstant.SOD_STAT_ACK_ABNORMAL.equals(sodsts)` // SOD Status = "005" (Acknowledgment Abnormal) [-> SOD_STAT_ACK_ABNORMAL = "005"] |
| 9 | EXEC | `JCCWebCommon.setMessageInfo(this, EKB1040_JW, new String[]{"SODステータス", "応答異常", "VLAN-ID発行依頼"})` // Error: SOD status is Acknowledgment Abnormal |
| 10 | RETURN | `return false` |
| 11 | COND | `else if JSCStrConstant.SOD_STAT_REAPPLY.equals(sodsts)` // SOD Status = "007" (Re-Request) [-> SOD_STAT_REAPPLY = "007"] |
| 12 | EXEC | `JCCWebCommon.setMessageInfo(this, EKB1040_JW, new String[]{"SODステータス", "再送依頼", "VLAN-ID発行依頼"})` // Error: SOD status is Re-Request |
| 13 | RETURN | `return false` |

**Block 3** — IF (SOD Business Integration Status Checks) `(L316)`

> Verify that the SOD business integration (work rank) status does not indicate a pending response from the upstream SOD system. Two pending sub-statuses are checked.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `sodworksts = bean.sendMessageString(SOD_WORK_RNKI_STAT_01, X31CWebConst.DATABEAN_GET_VALUE)` // Retrieve SOD work rank status [-> SOD_WORK_RNKI_STAT_01 = "SOD業務連携ステータス"] |
| 2 | COND | `JSCStrConstant.SOD_RNKI_STAT_WAIT_RES.equals(sodworksts)` // SOD Work Rank = "002" (Business Integration Waiting, SOD Ack Pending) [-> SOD_RNKI_STAT_WAIT_RES = "002"] |
| 3 | EXEC | `JCCWebCommon.setMessageInfo(this, EKB1040_JW, new String[]{"SOD業務連携ステータス", "業務連携待ちSOD応答未", "VLAN-ID発行依頼"})` // Error: Business integration waiting, SOD response not yet received |
| 4 | RETURN | `return false` |
| 5 | COND | `if JSCStrConstant.SOD_RNKI_STAT_WAIT_FIN.equals(sodworksts)` // SOD Work Rank = "003" (Business Integration Waiting, SOD Ack Complete) [-> SOD_RNKI_STAT_WAIT_FIN = "003"] |
| 6 | EXEC | `JCCWebCommon.setMessageInfo(this, EKB1040_JW, new String[]{"SOD業務連携ステータス", "業務連携待ちSOD応答済", "VLAN-ID発行依頼"})` // Error: Business integration waiting, SOD response received but further processing required |
| 7 | RETURN | `return false` |

**Block 4** — IF (Request Work Case Number Retrieval Error) `(L331)`

> Verify that the work case number obtained at request time is present. If missing, the VLAN-ID issuance cannot proceed.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `reqJiKjakNo = bean.sendMessageString(REQ_JI_KJAK_NO_01, X31CWebConst.DATABEAN_GET_VALUE)` // Retrieve request-time work case number [-> REQ_JI_KJAK_NO_01 = "依頼時工事案件番号"] |
| 2 | COND | `"".equals(reqJiKjakNo) || reqJiKjakNo == null` // Check for null or empty string |
| 3 | EXEC | `JCCWebCommon.setMessageInfo(this, EKB0930_NW, new String[]{"依頼時工事案件番号が取得出来ない", "VLAN-ID発行依頼"})` // Error: Request-time work case number could not be obtained [-> EKB0930-NW] |
| 4 | RETURN | `return false` |

**Block 5** — ELSE (All checks passed) `(L339)`

> All four validation preconditions are satisfied. The registration process may proceed.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return true` |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `chkItemValue2` | Method | Validation check step 2 -- pre-condition validator for VLAN-ID registration |
| `confirmCreate` | Method | Registration confirm button handler -- calls chkItemValue2 then invokes SCSV0005 service |
| `eoflg` | Variable | EO Telephone Flag -- indicates whether this service line is EO Optical Telephone ("1") or another service |
| `sodsts` | Variable | SOD (Service Order Data) Status -- upstream notification status of the order data |
| `sodworksts` | Variable | SOD Work Integration Status -- status of the SOD business integration work rank |
| `reqJiKjakNo` | Variable | Request-time Work Case Number -- the engineering case number obtained when the request was initiated |
| `EO_TEL_FLG_01` | Constant | Bean key "EO電話フラグ" (EO Telephone Flag) -- identifies the service type |
| `TEL_VLAN_ORDER_STAT_01` | Constant | Bean key "電話用VLANオーダーステータス" (Telephone VLAN Order Status) -- SOD upstream order status key |
| `SOD_WORK_RNKI_STAT_01` | Constant | Bean key "SOD業務連携ステータス" (SOD Business Integration Status) -- integration work rank status key |
| `REQ_JI_KJAK_NO_01` | Constant | Bean key "依頼時工事案件番号" (Request-time Work Case Number) -- work case number at request time |
| SOD | Acronym | Service Order Data -- external telecom order fulfillment system that manages service order lifecycle |
| SOD_STAT_SND_WAIT | Constant | SOD Status "001" -- Sent Waiting (order data sent, awaiting acknowledgment from upstream) |
| SOD_STAT_ACK_WAIT | Constant | SOD Status "002" -- Acknowledgment Waiting (waiting for response acknowledgment from upstream SOD) |
| SOD_STAT_ACK_ABNORMAL | Constant | SOD Status "005" -- Acknowledgment Abnormal (upstream SOD returned an error acknowledgment) |
| SOD_STAT_REAPPLY | Constant | SOD Status "007" -- Re-Request (order requires re-submission to upstream SOD) |
| SOD_RNKI_STAT_WAIT_RES | Constant | SOD Integration Status "002" -- Business Integration Waiting, SOD Acknowledgment Not Yet Received |
| SOD_RNKI_STAT_WAIT_FIN | Constant | SOD Integration Status "003" -- Business Integration Waiting, SOD Acknowledgment Received (further processing pending) |
| EKB0780-KW | Constant | Error message key -- "Registration not allowed for non-EO telephone services" |
| EKB1040-JW | Constant | Error message key -- "SOD status abnormal, VLAN-ID issuance request blocked" |
| EKB0930-NW | Constant | Error message key -- "Request-time work case number could not be obtained" |
| ESC0021A010CBSMSG1LIST | Constant | Data bean array key -- list of VLAN-ID registration item rows passed from caller |
| SCSV0005 | Use case | Service registration use case -- called by confirmCreate() for pre-registration checking |
| VLAN-ID | Business term | Virtual LAN identifier -- network segmentation identifier issued as part of EO Optical Telephone service setup |
| 工事案件番号 | Japanese field | Work Case Number -- engineering/project case number assigned to a service installation request |
| 依頼時 | Japanese term | At request time -- the point when the customer initiated the service request |
| X31SDataBeanAccess | Type | Service form data bean access handle -- provides in-memory access to service screen form data via sendMessageString |
