# Business Logic — KKW00191SFLogic.actionComp() [22 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.KKW00191SF.KKW00191SFLogic` |
| Layer | Controller (Webview Logic — screen-level business logic) |
| Module | `KKW00191SF` (Package: `eo.web.webview.KKW00191SF`) |

## 1. Role

### KKW00191SFLogic.actionComp()

`actionComp()` is the event handler invoked when the user presses the **Completion button** (完了ボタン) on the service order confirmation screen (KKW00191). Its sole business purpose is to redirect the user back to the **Service Contract Overview Screen** (KKW01101 — サービス契約一覧照会) after a service order has been successfully processed and confirmed. The method follows a simple redirect-dispatch pattern: it acquires the shared session data bean (`X31SDataBeanAccess`) via the inherited `getCommonInfoBean()` method, then writes the target screen's identifier and display name into the bean's message pipeline so that the framework's navigation dispatcher can route the user to the correct screen on the next request. No data mutation, validation, or service invocation occurs — the actual business processing (order registration, update, or deletion) is already complete by the time this handler runs. The method unconditionally returns `true`, signaling successful handler execution to the calling framework. A legacy block (lines 141–151) was removed in 2012 to fix a bug where pressing the return button after a deletion caused an error on the overview screen; the fix ensured the KKW01101 screen is always the correct return destination.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["actionComp()"])
    STEP1["Get X31SDataBeanAccess commonInfoBean from super.getCommonInfoBean()"]
    STEP2["Set NEXT_SCREEN_ID to KKW01101 in commonInfoBean"]
    STEP3["Set NEXT_SCREEN_NAME to サービス契約一覧照会 in commonInfoBean"]
    STEP4["return true"]
    END(["Continue screen flow"])

    START --> STEP1
    STEP1 --> STEP2
    STEP2 --> STEP3
    STEP3 --> STEP4
    STEP4 --> END
```

**Processing flow:**

1. **Acquire shared bean** — The method retrieves the common session data bean (`X31SDataBeanAccess`) by calling the inherited `super.getCommonInfoBean()`. This bean acts as a shared message context between the current screen (KKW00191) and the next screen.

2. **Set next screen ID** — The method calls `commonInfoBean.sendMessageString()` with the key `NEXT_SCREEN_ID` ("遷移先画面ID") and value `KKW01101` (the screen ID for the Service Contract Overview screen). The `DATABEAN_SET_VALUE` constant indicates the value should be stored as a plain string in the bean.

3. **Set next screen name** — The method calls `commonInfoBean.sendMessageString()` with the key `NEXT_SCREEN_NAME` ("遷移先画面名") and value `サービス契約一覧照会` (the Japanese display name for the KKW01101 screen). This provides the target screen's human-readable label.

4. **Return true** — The method returns `true`, indicating successful handler execution. The calling framework will use the navigation data set in the shared bean to route the user to the KKW01101 screen.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| - | (none) | - | This method takes no parameters. All navigation context is derived from hardcoded screen constants or obtained from the shared session bean. |

**Instance fields / external state read:**

| Source | Field / Method | Business Description |
|--------|---------------|---------------------|
| `super.getCommonInfoBean()` | — | Retrieves the shared `X31SDataBeanAccess` session bean that carries navigation state between screens in the KKW00191 flow. |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| W | `X31SDataBeanAccess.sendMessageString` | OneStopDataBeanAccess | - | Sets a string value in the shared data bean's message pipeline for navigation. `sendMessageString` is a write (W) operation on the session bean. |

**Analysis of called methods:**

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| W | `X31SDataBeanAccess.sendMessageString` | OneStopDataBeanAccess | - (Session Bean) | Writes the next screen ID (`KKW01101`) into the shared session data bean's message map. This is a session-state write, not a database operation. |
| W | `X31SDataBeanAccess.sendMessageString` | OneStopDataBeanAccess | - (Session Bean) | Writes the next screen display name (`サービス契約一覧照会`) into the shared session data bean's message map. This is a session-state write, not a database operation. |
| R | `super.getCommonInfoBean()` | — | — | Reads (retrieves) the existing `X31SDataBeanAccess` session bean from the parent class. No new data is created or modified beyond the navigation keys. |

**Classification rationale:**
- Both `sendMessageString` calls are **W (Write)** operations — they modify the session bean's internal message map to carry navigation data to the target screen.
- No database reads, creates, updates, or deletes occur in this method.
- The actual database operations for the service order are performed by other methods called earlier in the screen flow (e.g., `executeOdrHakkoJokenAdd` or similar CBS/SC methods), not within `actionComp()`.

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Screen:KKW00191 | `KKW00191SFLogic.invokeService()` -> `KKW00191SFLogic.actionComp` | `sendMessageString [W] Session Bean (NEXT_SCREEN_ID)`, `sendMessageString [W] Session Bean (NEXT_SCREEN_NAME)` |

**Notes:**
- The sole caller is the same class (`KKW00191SFLogic`), invoked from the `invokeService()` method which serves as the screen's main dispatch handler.
- `KKW00191SFLogic` follows the standard screen logic pattern: `invokeService()` is the entry point called by the framework, which then dispatches to specific handler methods like `actionComp()` based on the button or action that triggered the request.
- The "terminal" column shows the session bean writes — the only side effects of this method.

## 6. Per-Branch Detail Blocks

> **Block 1** — [SET] `(Acquire shared session bean)` (L149)
>
> Retrieves the shared `X31SDataBeanAccess` data bean from the parent class. This bean carries message keys and values between screens in the webview navigation framework.

| # | Type | Code |
|---|------|------|
| 1 | SET | `X31SDataBeanAccess commonInfoBean = super.getCommonInfoBean()` // Acquire shared session data bean [-> shared bean reference] |

> **Block 2** — [EXEC] `(Set next screen ID)` (L152–153)
>
> Configures the navigation target's screen ID. The key `NEXT_SCREEN_ID` ("遷移先画面ID") is paired with value `KKW01101` to tell the framework which screen to display next. The constant `DATABEAN_SET_VALUE` is a flag indicating the value type is a plain string.

| # | Type | Code |
|---|------|------|
| 1 | SET | `commonInfoBean.sendMessageString(CommonInfoCFConst.NEXT_SCREEN_ID, X31CWebConst.DATABEAN_SET_VALUE, JKKScreenConst.SCREEN_ID_KKW01101)` // Set next screen ID to KKW01101 [-> NEXT_SCREEN_ID="遷移先画面ID"], [-> SCREEN_ID_KKW01101="KKW01101"] |

> **Block 3** — [EXEC] `(Set next screen name)` (L154–155)
>
> Configures the navigation target's display name. The key `NEXT_SCREEN_NAME` ("遷移先画面名") is paired with the Japanese display name `サービス契約一覧照会` (Service Contract Overview) so the target screen can render its header/title correctly.

| # | Type | Code |
|---|------|------|
| 1 | SET | `commonInfoBean.sendMessageString(CommonInfoCFConst.NEXT_SCREEN_NAME, X31CWebConst.DATABEAN_SET_VALUE, JKKScreenConst.SCREEN_NAME_KKW01101)` // Set next screen name to サービス契約一覧照会 [-> NEXT_SCREEN_NAME="遷移先画面名"], [-> SCREEN_NAME_KKW01101="サービス契約一覧照会"] |

> **Block 4** — [RETURN] `(Return true)` (L157)
>
> Returns `true` to indicate successful handler execution. The framework interprets this as successful completion and proceeds with navigation using the data set in the shared bean.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return true` // Handler executed successfully; navigation proceeds |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `actionComp` | Method | Completion button press event handler — invoked when the user confirms and completes a service order on the KKW00191 screen |
| `X31SDataBeanAccess` | Class | Shared session data bean — carries message keys/values (screen IDs, form data, flags) between screens in the OneStop webview framework |
| `getCommonInfoBean()` | Method | Retrieves the shared session data bean from the parent class; provides access to cross-screen communication state |
| `sendMessageString` | Method | Writes a string value into the session data bean's message map under a given key |
| `CommonInfoCFConst` | Class | Constant definitions for the Common Info Control Framework (CF) — holds key names like `NEXT_SCREEN_ID`, `NEXT_SCREEN_NAME` |
| `NEXT_SCREEN_ID` | Constant | "遷移先画面ID" — Key name for the next screen's identifier in the session bean message map |
| `NEXT_SCREEN_NAME` | Constant | "遷移先画面名" — Key name for the next screen's display name in the session bean message map |
| `X31CWebConst` | Class | Web constant definitions for the X31 common framework — holds value markers like `DATABEAN_SET_VALUE` |
| `DATABEAN_SET_VALUE` | Constant | Marker indicating a plain string value to be stored in the data bean (as opposed to a bean reference or boolean) |
| `JKKScreenConst` | Class | Screen constant definitions — holds screen IDs and display names for all KKW-series screens |
| `SCREEN_ID_KKW01101` | Constant | "KKW01101" — Screen identifier for the Service Contract Overview screen |
| `SCREEN_NAME_KKW01101` | Constant | "サービス契約一覧照会" — Japanese display name for the KKW01101 screen |
| KKW00191 | Screen | Service order confirmation screen — displays the details of an order to be registered/updated before final submission |
| KKW01101 | Screen | Service Contract Overview Screen — displays a list of all service contracts for browsing and management |
| 完了ボタン | Field | Completion button — the user-facing button that triggers `actionComp()` when pressed to finalize and return from the order confirmation |
| サービス契約一覧照会 | Field | Service Contract Overview Lookup — the Japanese screen title for the contract listing screen (KKW01101) |
| 遷移先画面ID | Field | Transition destination screen ID — internal key for identifying where to navigate next in the screen flow |
| 遷移先画面名 | Field | Transition destination screen name — internal key for the display name of the target screen |
| OneStop | Technology | OneStop data bean access framework — the enterprise session management system used across KKW screens for cross-screen data sharing |
| `invokeService` | Method | Screen dispatch entry point — called by the framework; routes to specific handler methods (`actionComp`, etc.) based on user action |

---
