# Business Logic — SCW00301SFLogic.complete() [13 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.SCW00301SF.SCW00301SFLogic` |
| Layer | Controller (Web Business Logic — extends `JCCWebBusinessLogic`) |
| Module | `SCW00301SF` (Package: `eo.web.webview.SCW00301SF`) |

## 1. Role

### SCW00301SFLogic.complete()

The `complete()` method handles the **Complete button press processing** (完了ボタン押下処理) on the Telephone VLAN-ID Request Registration screen (SCW00301), which is used to register a VLAN-ID request for telephone service in the K-Opticom customer core system. This method serves as the **cleanup and screen reset** entry point — when a user chooses to complete their interaction without submitting further changes, the method clears any service contract detail numbers (SERVICE_CONTRACT_DETAIL_NO and its persistent display counterpart) from the form bean by setting them to empty strings, invokes `clearDatabean()` to reset the service data bean state (clearing and re-initializing the ESC0021A010CBSMSG1LIST array), and redirects the user back to the initial registration screen (SCW00301). It follows the **delegation pattern**, relying entirely on framework helper methods (`getServiceFormBean`, `clearDatabean`, `setNextScreen`) to perform its duties. It does not branch on conditions — it executes a fixed, deterministic sequence of cleanup steps and always returns `true` to indicate success.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["complete()"]) --> GET_BEAN["Get X31SDataBeanAccess from getServiceFormBean()"]
    GET_BEAN --> CLEAR_KEY1["sendMessageString(KEY_SVC_KEI_NO, DATABEAN_SET_VALUE, \"\")"]
    CLEAR_KEY1 --> CLEAR_KEY2["sendMessageString(KEY_SVC_KEI_NO_HOJI, DATABEAN_SET_VALUE, \"\")"]
    CLEAR_KEY2 --> CLEAR_DB["clearDatabean()"]
    CLEAR_DB --> NAVIGATE["setNextScreen(SCREEN_ID_SCW00301, SCREEN_NAME_SCW00301)"]
    NAVIGATE --> RETURN["Return true"]
    RETURN --> END(["complete() done"])
```

**Processing summary:**
1. Retrieve the service form data bean via `getServiceFormBean()`.
2. Clear the service contract detail number (`KEY_SVC_KEI_NO`) from the bean by setting it to an empty string.
3. Clear the service contract detail number display retention field (`KEY_SVC_KEI_NO_HOJI`) from the bean by setting it to an empty string.
4. Clear the service data bean by invoking `clearDatabean()`, which clears and re-initializes the `ESC0021A010CBSMSG1LIST` array.
5. Set the next screen to the initial screen (`SCW00301`) via `setNextScreen()`.
6. Return `true` to indicate successful completion.

No conditional branches exist in this method — the flow is strictly sequential.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| - | (none) | - | This method takes no parameters. It operates entirely on instance state inherited from `JCCWebBusinessLogic` (the service form bean, common info bean). |

**External state / instance fields read:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `bean` (via `getServiceFormBean()`) | `X31SDataBeanAccess` | The form-bound data bean carrying the current screen state, including the service contract detail number and its display retention flag. |
| `commoninfoBean` (via `getCommonInfoBean()`, called inside `setNextScreen`) | `X31SDataBeanAccess` | The common information bean used to set the next screen destination ID and name for navigation. |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `X31SDataBeanAccess.sendMessageString` | X31SDataBeanAccess | - | Sets the service contract detail number (`KEY_SVC_KEI_NO`) to empty string in the form bean. |
| - | `X31SDataBeanAccess.sendMessageString` | X31SDataBeanAccess | - | Sets the service contract detail number retention field (`KEY_SVC_KEI_NO_HOJI`) to empty string in the form bean. |
| - | `SCW00301SFLogic.clearDatabean` | SCW00301SFLogic | - | Clears and re-initializes the `ESC0021A010CBSMSG1LIST` data bean array. |
| - | `X31SDataBeanAccess.getDataBeanArray` | ESC0021A010CBSMSG1 | - | Invoked by `clearDatabean()` — clears and re-adds a blank data bean in the message list array. |
| - | `SCW00301SFLogic.setNextScreen` | SCW00301SFLogic | - | Sets the next screen destination ID and name for navigation back to the initial screen. |
| - | `X31SDataBeanAccess.sendMessageString` | X31SDataBeanAccess | - | Called by `setNextScreen()` to set `NEXT_SCREEN_ID` to `SCW00301`. |
| - | `X31SDataBeanAccess.sendMessageString` | X31SDataBeanAccess | - | Called by `setNextScreen()` to set `NEXT_SCREEN_NAME` to the initial screen name. |

**Classification notes:**
- This method performs **no database CRUD operations**. It is a pure UI-level cleanup and navigation handler.
- All operations are in-memory state manipulation on the `X31SDataBeanAccess` form bean.
- The `clearDatabean()` method accesses the `ESC0021A010CBSMSG1LIST` array, which is a data bean list for message display (ESC0021A010CBSMSG1 is a message-type data bean used in the VLAN-ID request flow). No persistent table is modified.

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Screen:SCW00301SF | `SCW00301SFLogic.complete` | `clearDatabean` -> `ESC0021A010CBSMSG1LIST` array manipulation |

**Note:** The `complete()` method is defined within `SCW00301SFLogic` and is invoked by the screen/controller layer (`SCW00301SF`) when the user presses the Complete (完了) button. No other external caller references this method in the codebase. The call chain is direct: screen event dispatch -> `SCW00301SFLogic.complete()`.

## 6. Per-Branch Detail Blocks

> This method has no conditional branches (if/else, switch, loop). The execution is a flat sequential flow of 7 steps.

**Block 1** — [SEQUENTIAL] (L214)

> Retrieve the service form bean from the framework.

| # | Type | Code |
|---|------|------|
| 1 | SET | `bean = super.getServiceFormBean()` // Obtain the X31SDataBeanAccess instance for the current form |

**Block 2** — [SEQUENTIAL] (L215)

> Clear the service contract detail number from the form bean.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `bean.sendMessageString(KEY_SVC_KEI_NO, X31CWebConst.DATABEAN_SET_VALUE, "")` // Clears SERVICE_CONTRACT_DETAIL_NO — sets it to empty string |
| | | `[-> DATABEAN_SET_VALUE: "SET_VALUE" (constant for setting a data bean value)]` |

**Block 3** — [SEQUENTIAL] (L216)

> Clear the service contract detail number display retention field.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `bean.sendMessageString(KEY_SVC_KEI_NO_HOJI, X31CWebConst.DATABEAN_SET_VALUE, "")` // Clears KEY_SVC_KEI_NO_HOJI — sets it to empty string |

**Block 4** — [SEQUENTIAL] (L218)

> Clear the service data bean state.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `clearDatabean()` // Clears and re-initializes the ESC0021A010CBSMSG1LIST data bean array |

**Block 5** — [SEQUENTIAL] (L220)

> Navigate to the initial screen (screen reset after completion).

| # | Type | Code |
|---|------|------|
| 1 | CALL | `setNextScreen(SCREEN_ID_SCW00301, SCREEN_NAME_SCW00301)` // Redirects to the initial VLAN-ID request registration screen |
| | | `[-> SCREEN_ID_SCW00301: "SCW00301" (from JSCScreenConst)]` |
| | | `[-> SCREEN_NAME_SCW00301: "SCW00301" (from JSCScreenConst)]` |
| | | `[-> NEXT_SCREEN_ID: "NEXT_SCREEN_ID" (from JPCModelConstant)]` |
| | | `[-> NEXT_SCREEN_NAME: "NEXT_SCREEN_NAME" (from JPCModelConstant)]` |

**Block 6** — [RETURN] (L221)

> Return success indicator to the caller.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return true` // Indicates successful completion processing |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `KEY_SVC_KEI_NO` | Field | Service contract detail number — the key identifying a specific service contract line item within the VLAN-ID request flow. Cleared on completion to prevent stale data. |
| `KEY_SVC_KEI_NO_HOJI` | Field | Service contract detail number display retention — a flag/field controlling whether the service contract detail number should persist across screen transitions. Cleared on completion. |
| `SVC_KEI_NO` | Field | Service contract detail number (svc_kei_no) — short for "service keiyaku detail number"; uniquely identifies a service contract line item in the K-Opticom billing system. |
| `HOJI` | Acronym | 保持 (hoji) — retention/preservation. In this context, whether the service contract detail number is preserved across screen transitions. |
| VLAN-ID | Business term | Virtual LAN Identifier — a network segmentation identifier assigned to telephone service lines for dedicated virtual network isolation. |
| SCW00301 | Screen ID | VLAN-ID Request Registration screen — the initial screen where users register a request to issue a VLAN-ID for telephone service. |
| ESC0021A010CBSMSG1LIST | Field | Message data bean list — a data bean array used to carry message-type display items in the ESC0021A010CBSMSG1 entity (message list for VLAN-ID request processing). |
| X31SDataBeanAccess | Class | X31 framework service form bean access class — the data access handle for the current screen's form bean, providing `sendMessageString`, `sendMessageBoolean`, and `getDataBeanArray` operations. |
| X31CWebConst.DATABEAN_SET_VALUE | Constant | "SET_VALUE" — constant indicating a write/set operation on a data bean field. |
| `JCCWebBusinessLogic` | Class | Common web business logic base class — the parent class providing `getServiceFormBean()`, `getCommonInfoBean()`, and other framework-level accessors for web screens. |
| `clearDatabean` | Method | Clears the service data bean state — specifically clears and re-initializes the ESC0021A010CBSMSG1LIST array to a fresh empty state. |
| `setNextScreen` | Method | Sets the navigation destination — configures the next screen ID and screen name in the common info bean for screen transition routing. |
| NEXT_SCREEN_ID | Constant | "NEXT_SCREEN_ID" — key used to store the target screen ID for navigation. |
| NEXT_SCREEN_NAME | Constant | "NEXT_SCREEN_NAME" — key used to store the target screen name (label) for navigation. |
| K-Opticom | Business term | NTT East's fiber-to-the-home broadband internet service brand in the Kanto region of Japan. |
| 完了ボタン押下処理 | Japanese comment | Complete button press processing — the action triggered when the user clicks the "Complete" (完了) button on the form. |
