# Business Logic — SCW00301SFLogic.fix() [28 LOC]

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

## 1. Role

### SCW00301SFLogic.fix()

This method implements the **Confirm button press processing** (確定ボタン押下処理 — *kakutei botan oshashi shori*) for the VLAN-ID issuance request registration screen. When a user fills in the VLAN-ID issuance request form and clicks the Confirm button, this method is invoked to persist the request data to the back-end system via the SCSV0005 service component, and then route the user to the completion screen.

The method follows the **delegation pattern**: it extracts the form data from the web bean, delegates the actual persistence work to the `SCSV0005_SCSV0005OPDBMapper` (which invokes the back-end SCSCSV000501SC service with function code `"5"`, representing continuation-of-contract-change-processing confirmation), and handles the result by either displaying an error message (on failure) or a success message and navigating to the completion screen (on success).

As the confirm/finish handler for the VLAN-ID issuance request workflow, it serves as the final step in the registration process initiated by the SCW00301 screen. Upon successful registration it redirects to the SCW00303 (VLAN-ID issuance request registration completion) screen, completing the end-to-end VLAN-ID request lifecycle.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["fix()"])
    START --> INIT["Initialize paramMap, inputMap, outputMap"]
    INIT --> GETBEAN["Get service form bean via getServiceFormBean()"]
    GETBEAN --> PUTCASE["Put SCSV0005 as TELEGRAM_INFO_USECASE_ID into paramMap"]
    PUTCASE --> MAPPER["Create SCSV0005_SCSV0005OPDBMapper"]
    MAPPER --> SETMAPPER["Set SCSCSV000501SC on mapper with paramBean, inputMap, FUNC_CD_5"]
    SETMAPPER --> INVOKE["Invoke service via invokeService(paramMap, inputMap, outputMap)"]
    INVOKE --> RESULT{msgResult is null?}
    RESULT -->|No - Error| SETERR["Set error message via JCCWebCommon.setMessageInfo()"]
    SETERR --> RETFALSE["Return false"]
    RESULT -->|Yes - Success| SETOK["Set success message via JCCWebCommon.setMessageInfo()"]
    SETOK --> SETSCREEN["Set next screen to SCW00303"]
    SETSCREEN --> RETTRUE["Return true"]
```

**Constant Resolution:**

| Constant | Actual Value | Business Meaning |
|----------|-------------|------------------|
| `X31CWebConst.TELEGRAM_INFO_USECASE_ID` | `TELEGRAM_INFO_USECASE_ID` | Key for use-case identification in the invocation parameter map |
| `FUNC_CD_5` | `"5"` | Continuation-of-contract-change-processing confirmation number (変更手続中じゃない)番号変更確定後抽出 — indicates the service is processing a final confirmation step for contract change continuation |
| `EKB0380__I` | `"EKB0380--I"` | Information-level system message template indicating successful registration |
| `SCREEN_ID_SCW00303` | `"SCW00303"` | VLAN-ID issuance request registration completion screen ID |
| `SCREEN_NAME_SCW00303` | `VLAN-ID発行依頼登録完了` | VLAN-ID issuance request registration completion screen name |
| `MSG_REGISTER_VLAN_ID` | `VLAN-ID発行依頼の登録` | VLAN-ID issuance request registration message value |

**Processing Summary:**

1. **Initialization**: Create three `HashMap` instances — `paramMap` (for service invocation parameters), `inputMap` (for service input data), and `outputMap` (for service output data).
2. **Form Bean Extraction**: Obtain the current form data from `super.getServiceFormBean()`, which retrieves the `X31SDataBeanAccess` containing the user-entered VLAN-ID registration data.
3. **Service Invocation Setup**: Set the use-case ID to `"SCSV0005"` in `paramMap`, create the SCSV0005 mapper, and set the SCSCSV000501SC service code on the mapper.
4. **Service Execution**: Call `invokeService()` which dispatches to the back-end service identified by the use-case ID (`SCSV0005`) and function code (`"5"`).
5. **Result Handling** — Branch on whether `invokeService` returned an error:
   - **Error path**: If `msgResult` is not null, set the error message on the web page via `JCCWebCommon.setMessageInfo()` and return `false` (indicating the operation failed).
   - **Success path**: If `msgResult` is null, set the success message (`"VLAN-ID issuance request registration"`) and navigate to the SCW00303 completion screen, then return `true`.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| - | (none) | - | This method takes no explicit parameters. It reads data from the web form bean populated by the SCW00301 screen. |

**Instance fields / external state read by this method:**

| Source | Field / Method | Business Description |
|--------|---------------|---------------------|
| `super.getServiceFormBean()` | `X31SDataBeanAccess` | The current form data containing VLAN-ID issuance request fields entered by the user on the SCW00301 screen |
| `this` | JCCWebBusinessLogic instance | Current business logic context used for `setMessageInfo()` and `setNextScreen()` calls |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| C | `SCSV0005_SCSV0005OPDBMapper.setSCSV000501SC` | SCSV0005 | SCCS_M_TBL (VLAN-ID management table) | Registers the VLAN-ID issuance request by calling the SCSCSV000501SC service component with function code "5" (contract change confirmation) |
| - | `JCCWebCommon.setMessageInfo` | JCCWebCommon | - | Sets the error or success message to display on the next screen |
| - | `JCCWebBusinessLogic.setNextScreen` | JCCWebBusinessLogic | - | Configures the next screen destination (SCW00303 completion screen) |

**Classification Rationale:**
- `SCSV0005_SCSV0005OPDBMapper.setSCSV000501SC` — The method name `setSCSV000501SC` indicates a service call to the SCSV0005 SC Code. Function code `"5"` in this context represents final confirmation processing for VLAN-ID issuance registration, which performs a **Create** operation (inserts the VLAN-ID request record into the management table).
- `JCCWebCommon.setMessageInfo` — A utility method that sets message information on the session/request for display to the user. Not a CRUD operation.
- `JCCWebBusinessLogic.setNextScreen` — A utility method that configures screen navigation. Not a CRUD operation.

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Screen:SCW00301 | `SCW00301Screen` (Confirm button) -> `SCW00301SFLogic.fix` | `setSCSV000501SC [C] SCCS_M_TBL (VLAN-ID management)` |

**Notes:** The `fix()` method is the standard confirm-button handler for the SCW00301 screen in the K-Opticom customer base system. It is invoked by the web framework when the user clicks the Confirm button on the VLAN-ID issuance request registration screen. No other classes were found that directly reference `SCW00301SFLogic.fix()`, confirming it is accessed exclusively through the screen's standard event binding mechanism.

## 6. Per-Branch Detail Blocks

**Block 1** — [SET] (L169-171)

Initialize the parameter maps used for service invocation.

| # | Type | Code |
|---|------|------|
| 1 | SET | `paramMap = new HashMap()` |
| 2 | SET | `inputMap = new HashMap()` |
| 3 | SET | `outputMap = new HashMap()` |

**Block 2** — [EXEC] (L173-174)

Extract the form data from the web session.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `bean = super.getServiceFormBean()` |
| 2 | SET | `paramBean[] = {bean}` |

**Block 3** — [SET/EXEC] (L177-180)

Prepare the service invocation: set the use-case ID, create the mapper, and configure it with the SC code and function code.

| # | Type | Code |
|---|------|------|
| 1 | SET | `paramMap.put(TELEGRAM_INFO_USECASE_ID, "SCSV0005")` [-> use-case ID for service dispatch] |
| 2 | SET | `mapper = new SCSV0005_SCSV0005OPDBMapper()` |
| 3 | CALL | `mapper.setSCSV000501SC(paramBean, inputMap, FUNC_CD_5)` [-> FUNC_CD_5 = "5" (contract change confirmation)] |

**Block 4** — [CALL] (L181)

Invoke the back-end service.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `msgResult = invokeService(paramMap, inputMap, outputMap)` |

**Block 5** — [IF] `(msgResult != null)` (L182-186)

Error handling branch: the service returned an error result. Display the error message and abort processing.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `JCCWebCommon.setMessageInfo(this, msgResult)` |
| 2 | RETURN | `return false` |

**Block 6** — [ELSE] (L188-193)

Success branch: the service completed without error. Display the success message and navigate to the completion screen.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `JCCWebCommon.setMessageInfo(this, EKB0380__I, new String[] { MSG_REGISTER_VLAN_ID })` [-> message = "VLAN-ID発行依頼の登録" = VLAN-ID issuance request registration] |
| 2 | CALL | `setNextScreen(SCREEN_ID_SCW00303, SCREEN_NAME_SCW00303)` [-> navigates to "VLAN-ID発行依頼登録完了" completion screen] |
| 3 | RETURN | `return true` |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `SCW00301` | Screen ID | VLAN-ID issuance request new registration screen — the entry point where users input VLAN-ID request details |
| `SCW00303` | Screen ID | VLAN-ID issuance request registration completion screen — displayed after successful registration |
| `SCSV0005` | SC Code | Service Component for VLAN-ID management operations |
| `SCSCSV000501SC` | SC Code | Specific service code within SCSV0005 for VLAN-ID request processing |
| `FUNC_CD_5` | Constant | Function code `"5"` — continuation-of-contract-change-processing confirmation (変更手続中じゃない番号変更確定後抽出), used to indicate this is a final registration confirmation |
| `TELEGRAM_INFO_USECASE_ID` | Constant | Key name for identifying the use-case in service invocation parameter maps |
| `X31SDataBeanAccess` | Class | Web form bean class used to carry user-entered data between the screen and the business logic |
| `X31CMessageResult` | Class | Result object returned by service invocations; null indicates success, non-null indicates an error |
| `EKB0380__I` | Constant | Information-level message template code (`"EKB0380--I"`) used for successful registration notifications |
| `MSG_REGISTER_VLAN_ID` | Constant | Message value `"VLAN-ID発行依頼の登録"` — VLAN-ID issuance request registration |
| `invokeService` | Method | Inherited method from `JCCWebBusinessLogic` that dispatches to the appropriate back-end service based on `TELEGRAM_INFO_USECASE_ID` |
| `JCCWebCommon` | Class | Common web utility class for setting messages and handling web-layer concerns |
| `JCCWebBusinessLogic` | Class | Base class for all web business logic in the K-Opticom system, providing shared service invocation and screen navigation utilities |
| VLAN-ID | Business term | Virtual LAN Identifier — a network segment identifier assigned to fiber-optic subscribers for network isolation |
| SCSV0005 | SC Code | Service Component for VLAN-ID (VLAN) management operations within the K-Opticom customer base system |
