---

# Business Logic — SCW00301SFLogic.setNextScreen() [9 LOC]

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

## 1. Role

### SCW00301SFLogic.setNextScreen()

The `setNextScreen` method is a private UI navigation helper that establishes the target screen destination for the subsequent screen transition within the SCW00301SF screen module. In the business domain, this screen module handles screen control operations (SCW00301SF), and after any processing step such as initialization, search, modify, fix, confirm, or complete, the system needs to know which screen to present to the user next. This method fulfills that role by writing the next screen identifier and its display name into the common information data bean, which acts as shared state accessible across the screen's processing pipeline.

The method implements a **delegation pattern**: it delegates to the common info data bean (`X31SDataBeanAccess`) to propagate screen navigation data via a messaging mechanism (`sendMessageString`), and to the underlying framework's logging subsystem for audit/debug purposes. It is a **shared utility** called by all major processing entry points within the same logic class (`complete`, `confirmCreate`, `fix`, `init`, `modify`, `search`), ensuring consistent screen transition behavior across the entire lifecycle of the SCW00301SF screen.

The design follows the framework convention of using a common information data bean as a cross-method state carrier — the next screen ID and name written here are consumed by the framework's screen routing logic after the current processing method returns.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["setNextScreen(nextScreenId, nextScreenName)"])
    START --> GETBEAN["getCommonInfoBean() : X31SDataBeanAccess"]
    GETBEAN --> SETID["sendMessageString(NEXT_SCREEN_ID, DATABEAN_SET_VALUE, nextScreenId)"]
    SETID --> SETNAME["sendMessageString(NEXT_SCREEN_NAME, DATABEAN_SET_VALUE, nextScreenName)"]
    SETNAME --> LOG["DEBUG_LOG: Log next screen CD and NM"]
    LOG --> END_NODE(["Return (void)"])
```

**Constant Resolution:**
- `NEXT_SCREEN_ID` = `"遷移先画面ＩＤ"` (Next Screen ID) — the data bean key used to store the target screen identifier
- `NEXT_SCREEN_NAME` = `"遷移先画面名"` (Next Screen Name) — the data bean key used to store the target screen display name
- `X31CWebConst.DATABEAN_SET_VALUE` — standard framework constant indicating the value type for data bean write operations

**Processing Flow:**
1. Retrieve the common information data bean (`X31SDataBeanAccess`) from the superclass.
2. Write the `nextScreenId` parameter value into the data bean under the key `NEXT_SCREEN_ID`.
3. Write the `nextScreenName` parameter value into the data bean under the key `NEXT_SCREEN_NAME`.
4. Log the screen transition parameters at DEBUG level for troubleshooting.
5. Return without any further processing.

This method has **no conditional branches** — it executes a linear write-and-log sequence regardless of calling context.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `nextScreenId` | `String` | The unique identifier of the target screen that the user will be navigated to next. This identifier is used by the framework's screen routing logic to determine which screen view to render after the current processing completes. The value typically matches a screen definition ID registered in the framework's screen management configuration. |
| 2 | `nextScreenName` | `String` | The human-readable display name of the target screen, used for UI purposes such as breadcrumbs, page titles, or debug logging. This provides a user-friendly label corresponding to the `nextScreenId`. |

**Instance Fields / External State Read:**

| Source | Field / Method | Business Description |
|--------|---------------|---------------------|
| `super.getCommonInfoBean()` | Returns `X31SDataBeanAccess` | Retrieves the shared common information data bean instance that carries screen state across the processing lifecycle of the SCW00301SF module. |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| W | `super.getCommonInfoBean` | - | - | Retrieves the common information data bean from the parent class (in-memory state access) |
| W | `X31SDataBeanAccess.sendMessageString` | - | In-Memory Data Bean (CommonInfo) | Writes the next screen ID into the common information data bean under the key `NEXT_SCREEN_ID` |
| W | `X31SDataBeanAccess.sendMessageString` | - | In-Memory Data Bean (CommonInfo) | Writes the next screen name into the common information data bean under the key `NEXT_SCREEN_NAME` |
| D | `DEBUG_LOG.debug` | - | - | Framework debug logging utility — writes log output to the application log (no persistence) |

**Classification:**
- **W** (Write): In-memory data bean operations — no database persistence occurs in this method.
- **D** (Debug): Logging operation — no data mutation.

**Note:** This method performs **no database CRUD operations**. It operates entirely on in-memory data beans and framework logging infrastructure. The data bean values written here are consumed by the framework's screen routing mechanism during the response phase.

## 5. Dependency Trace

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

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

All callers reside within the same logic class (`SCW00301SFLogic`). This method is a private helper invoked by every major processing entry point of the SCW00301SF screen.

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | SCW00301SFLogic.complete() | `complete()` -> `setNextScreen(nextScreenId, nextScreenName)` | `sendMessageString [-]` |
| 2 | SCW00301SFLogic.confirmCreate() | `confirmCreate()` -> `setNextScreen(nextScreenId, nextScreenName)` | `sendMessageString [-]` |
| 3 | SCW00301SFLogic.fix() | `fix()` -> `setNextScreen(nextScreenId, nextScreenName)` | `sendMessageString [-]` |
| 4 | SCW00301SFLogic.init() | `init()` -> `setNextScreen(nextScreenId, nextScreenName)` | `sendMessageString [-]` |
| 5 | SCW00301SFLogic.modify() | `modify()` -> `setNextScreen(nextScreenId, nextScreenName)` | `sendMessageString [-]` |
| 6 | SCW00301SFLogic.search() | `search()` -> `setNextScreen(nextScreenId, nextScreenName)` | `sendMessageString [-]` |

**Context:** The SCW00301SF screen module covers a complete CRUD-like lifecycle for its business domain: `init()` (read/create), `search()` (read), `modify()` (update), `fix()` (correction/rework), `confirmCreate()` (confirmation before creation), and `complete()` (finalization). The `setNextScreen` method is called by each to specify the next screen in their respective flows, enabling consistent screen routing across the full user interaction cycle.

## 6. Per-Branch Detail Blocks

> The method has no conditional branches — it follows a single linear execution path.

**Block 1** — [LINEAR EXECUTION] `(no condition)` (L247)

> Retrieve the common information data bean from the superclass to access shared screen state.

| # | Type | Code |
|---|------|------|
| 1 | SET | `X31SDataBeanAccess commoninfoBean = super.getCommonInfoBean();` // Obtain the common info data bean instance |

**Block 2** — [LINEAR EXECUTION] `(no condition)` (L249)

> Write the target screen ID into the common information data bean. The key `NEXT_SCREEN_ID` resolves to `"遷移先画面ＩＤ"` (Next Screen ID), which the framework uses to identify the destination screen.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `commoninfoBean.sendMessageString(NEXT_SCREEN_ID, X31CWebConst.DATABEAN_SET_VALUE, nextScreenId);` // Write nextScreenId to data bean [-> NEXT_SCREEN_ID = "遷移先画面ＩＤ"] |

**Block 3** — [LINEAR EXECUTION] `(no condition)` (L250)

> Write the target screen's display name into the common information data bean. The key `NEXT_SCREEN_NAME` resolves to `"遷移先画面名"` (Next Screen Name).

| # | Type | Code |
|---|------|------|
| 1 | CALL | `commoninfoBean.sendMessageString(NEXT_SCREEN_NAME, X31CWebConst.DATABEAN_SET_VALUE, nextScreenName);` // Write nextScreenName to data bean [-> NEXT_SCREEN_NAME = "遷移先画面名"] |

**Block 4** — [LINEAR EXECUTION] `(no condition)` (L252)

> Log the screen transition details at DEBUG level for operational troubleshooting. The original Japanese log message "遷移先 CD：" means "Transition destination CD:" and "NM：" means "Name:".

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `DEBUG_LOG.debug(String.format("遷移先 CD：%s NM：%s", nextScreenId, nextScreenName));` // Log: Transition destination ID and Name (遷移先 CD = Next screen ID, NM = Name) |

**Block 5** — [RETURN] `(void)` (L246)

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `(void)` // No return value — all state propagated via data bean |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `遷移先画面ＩＤ` | Field/Constant | Next Screen ID — the internal identifier for the destination screen in the framework's screen navigation system |
| `遷移先画面名` | Field/Constant | Next Screen Name — the human-readable label for the destination screen, used for display and logging |
| `SCW00301SF` | Module | Screen Controller Module — the screen processing module responsible for screen control / navigation operations |
| `X31SDataBeanAccess` | Class | Common Information Data Bean Access — the data bean class that carries shared screen state (including navigation targets) across the processing pipeline |
| `X31CWebConst` | Class | Web Framework Constants — shared constant definitions for the web presentation layer framework |
| `DATABEAN_SET_VALUE` | Constant | Standard framework signal indicating a data bean write operation (set a value into the data bean) |
| `NEXT_SCREEN_ID` | Constant | Data bean key for storing the target screen identifier |
| `NEXT_SCREEN_NAME` | Constant | Data bean key for storing the target screen display name |
| `super.getCommonInfoBean()` | Method | Framework method inherited from the parent logic class — returns the common information data bean instance shared across all processing methods in the screen |
| `sendMessageString` | Method | Data bean messaging method — writes a string value into the data bean under a specified key |
| `complete()` | Method | Screen processing entry point — finalizes the current screen operation and commits data |
| `confirmCreate()` | Method | Screen processing entry point — displays confirmation screen before creating new records |
| `fix()` | Method | Screen processing entry point — handles correction/rework of existing data |
| `init()` | Method | Screen processing entry point — initializes the screen on first load |
| `modify()` | Method | Screen processing entry point — handles update/modification of existing records |
| `search()` | Method | Screen processing entry point — performs search/query operations |
| DEBUG_LOG | Field | SLF4J or equivalent logging instance — framework debug logger for runtime diagnostic output |

---