---
title: "Business Logic — DKW01302SFLogic.setGamen()"
description: "Detailed design document for DKW01302SFLogic.setGamen — screen display settings for the shelf move entry detail screen"
---

# Business Logic — DKW01302SFLogic.setGamen() [68 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.DKW01302SF.DKW01302SFLogic` |
| Layer | Controller (Web View Logic — sits in `eo.web.webview` package, implements screen-level display logic) |
| Module | `DKW01302SF` (Package: `eo.web.webview.DKW01302SF`) |

## 1. Role

### DKW01302SFLogic.setGamen()

This method is responsible for configuring the display state of the **Shelf Move Entry Detail Screen** (棚移動入荷詳細画面), which is the UI used by warehouse operators to record the movement of inventory items between storage locations (warehouses, worksites, or offices). The method performs four distinct display preparation tasks: (1) **aggregating origin and destination location names** by selecting the first non-empty value among three hierarchical granularity levels — warehouse, worksite company, and office — for both the source (origin) and destination of the shelf move; (2) **delegating list population** to the `setList` method to configure the shelf move basic information detail list; (3) **disabling the Confirm Create button** when the operation status code is `"005"` (Completed), preventing re-submission of already-finished transactions; and (4) **disabling the Quantity Details button** when the designation method code is `"2"` (Serial Number Designation), since quantity-level detail is not applicable when tracking items by individual serial number. This method follows a **display-preparation (gatekeeper) design pattern**: it reads state from the form bean, resolves derived display values through conditional prioritization, and mutates button enable flags — all without performing any database or service component (SC) calls. Its role in the larger system is that of a shared screen initialization/hydration method, called from multiple lifecycle entry points (confirm, fix, init, paging), ensuring the screen renders with consistent business state regardless of how the user arrived at the detail page.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["setGamen serviceFormBean"])
    START --> S1["S1: Get KIHON_LIST from serviceFormBean"]
    S1 --> S2["S2: Get first dataBean 0 as sbean"]
    S2 --> S3["S3: Initialize mtNm empty String"]
    S3 --> S4["S4: Read MV_MT_SOKO_NM_02 Origin Warehouse"]
    S4 --> S5["S5: Read MV_MT_KOJI_NM_02 Origin Worksite"]
    S5 --> S6["S6: Read MV_MT_OFFICE_NM_02 Origin Office"]
    S6 --> D1{D1: mtSokoNm not empty?}
    D1 -- Yes --> S10["S10: mtNm = mtSokoNm"]
    D1 -- No --> D2{D2: mtKojiNm not empty?}
    D2 -- Yes --> S11["S11: mtNm = mtKojiNm"]
    D2 -- No --> D3{D3: mtOfcNm not empty?}
    D3 -- Yes --> S12["S12: mtNm = mtOfcNm"]
    D3 -- No --> S13["S13: mtNm remains empty"]
    S10 --> S14["S14: Set MV_MT_NM_02 with mtNm"]
    S11 --> S14
    S12 --> S14
    S13 --> S14
    S14 --> S20["S20: Initialize skNm empty String"]
    S20 --> S21["S21: Read MV_SK_SOKO_NM_02 Dest Warehouse"]
    S21 --> S22["S22: Read MV_SK_KOJI_NM_02 Dest Worksite"]
    S22 --> S23["S23: Read MV_SK_OFFICE_NM_02 Dest Office"]
    S23 --> D4{D4: skSokoNm not empty?}
    D4 -- Yes --> S30["S30: skNm = skSokoNm"]
    D4 -- No --> D5{D5: skKojiNm not empty?}
    D5 -- Yes --> S31["S31: skNm = skKojiNm"]
    D5 -- No --> D6{D6: skOfcNm not empty?}
    D6 -- Yes --> S32["S32: skNm = skOfcNm"]
    D6 -- No --> S33["S33: skNm remains empty"]
    S30 --> S34["S34: Set MV_SK_NM_02 with skNm"]
    S31 --> S34
    S32 --> S34
    S33 --> S34
    S34 --> S40["S40: Call setList paramBean serviceFormBean"]
    S40 --> S41["S41: Read MV_STAT_CD_02 Status Code"]
    S41 --> S42["S42: Read SHITEI_WAY_CD_02 Designation Method"]
    S42 --> D7{D7: stat not null AND stat = 005?}
    D7 -- Yes --> S50["S50: Disable B_CNFRM_CREATE_DSBL_FLG Button"]
    D7 -- No --> D8{D8: stiWay not null AND stiWay = 2?}
    D8 -- Yes --> S60["S60: Disable B_CNT_DTL_DSBL_FLG Button"]
    D8 -- No --> END(["Return void"])
    S50 --> END
    S60 --> END
```

**Business Logic Description:**

The method follows a sequential, four-phase display preparation pattern:

- **Phase 1 — Origin Name Resolution (L746–L758):** Retrieves three candidate origin location names (warehouse, worksite company, office) and collapses them into a single display value (`mtNm`) by selecting the first non-empty value, prioritized from broadest scope (warehouse) to narrowest scope (office). This ensures the user always sees the most granular location available.

- **Phase 2 — Destination Name Resolution (L762–L775):** Applies the identical priority cascade to destination (移動先) location candidates, producing a consolidated `skNm` display value.

- **Phase 3 — List Population Delegation (L779):** Delegates to `setList()` to configure the shelf move detail list grid — a private helper method that populates list-related display data.

- **Phase 4 — Button State Configuration (L781–L805):** Reads the operation status code and designation method code, then disables relevant action buttons based on business rules: if the status is `"005"` (Completed), the Confirm Create button is disabled to prevent duplicate submissions; if the designation method is `"2"` (Serial Number Designation), the Quantity Details button is disabled since item tracking is by individual serial number rather than quantity.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `serviceFormBean` | `X31SDataBeanAccess` | The screen's data transfer object carrying all shelf move entry detail display data. Contains the KIHON_LIST (Shelf Move Basic Information List Detail List) which holds origin/destination location data, status codes, designation method codes, and button enable flags. This is the central data carrier that flows through the entire screen lifecycle — initialized at entry (init), refreshed on paging (pagingCommon), and re-rendered during confirm (confirmCreate) and fix (fix) operations. |

**Instance/External State Read:**

| # | Source | Access Pattern | Business Meaning |
|---|--------|----------------|------------------|
| 1 | `sbean` (derived from `serviceFormBean.getDataBeanArray(KIHON_LIST).getDataBean(0)`) | Index-based list retrieval | First item in the shelf move basic information list — the row the user is currently viewing or editing |

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `OneStopDataBeanAccessArray.getDataBean` | - | - | Calls `getDataBeanArray` on the service form bean to retrieve the KIHON_LIST detail list array |
| R | `OneStopDataBeanAccess.getDataBean` | - | - | Calls `getDataBean(0)` to extract the first row from the shelf move basic info list |
| R | `X31SDataBeanAccess.sendMessageString` | - | - | Reads string values (origin warehouse, worksite, office names; destination names; status code; designation method) from the data bean |
| - | `X31SDataBeanAccess.sendMessageString` (SET) | - | - | Writes consolidated location names (MV_MT_NM_02, MV_SK_NM_02) back to the data bean for screen rendering |
| - | `JDKCommonUtil.isNull` | - | - | Null/empty check utility used across all four read-back candidate values |
| - | `DKW01302SFLogic.setList` | - | - | Delegates list population for the shelf move detail grid (see Block 3) |
| - | `X31SDataBeanAccess.sendMessageBoolean` | - | - | Sets boolean button-disable flags (B_CNFRM_CREATE_DSBL_FLG, B_CNT_DTL_DSBL_FLG) on the form bean |

**Classification Notes:** This method performs **zero database or SC-level CRUD operations**. It is a pure display-state preparation method. All data access is local bean reads and writes via the `X31SDataBeanAccess` API, which is the web view's data binding mechanism. No SC Codes (Service Component identifiers) are invoked.

## 5. Dependency Trace

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

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

### Callers:

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | `DKW01302SFLogic.confirmCreate()` | `confirmCreate` -> `setGamen` | `setGamen [N/A] — no SC/DB calls` |
| 2 | `DKW01302SFLogic.fix()` | `fix` -> `setGamen` | `setGamen [N/A] — no SC/DB calls` |
| 3 | `DKW01302SFLogic.init()` | `init` -> `setGamen` | `setGamen [N/A] — no SC/DB calls` |
| 4 | `DKW01302SFLogic.pagingCommon()` | `pagingCommon` -> `setGamen` | `setGamen [N/A] — no SC/DB calls` |

**Dependency Notes:** All four direct callers reside within `DKW01302SFLogic` itself, indicating this method is an internal screen lifecycle helper. The screen/module `DKW01302SF` corresponds to the **Shelf Move Entry Detail Screen** (棚移動入荷詳細画面). There are no external SC/CBS or database dependencies — all operations are local bean reads/writes. The method is always called as part of screen initialization or re-rendering, never from external entry points.

## 6. Per-Branch Detail Blocks

### Block 1 — INITIALIZATION (origin data preparation) (L746)

> Prepares the origin (移動元) location name by reading three candidate fields from the basic info data bean and selecting the first non-empty value.

| # | Type | Code |
|---|------|------|
| 1 | SET | `X31SDataBeanAccess[] paramBean = {serviceFormBean};` // Wraps the form bean in an array for reuse |
| 2 | SET | `X31SDataBeanAccessArray kihonList = paramBean[0].getDataBeanArray(KIHON_LIST);` // Retrieves the Shelf Move Basic Information List [-> KIHON_LIST = "棚移動基本情報一覧照会明細リスト"] |
| 3 | SET | `X31SDataBeanAccess sbean = kihonList.getDataBean(0);` // Gets the first data bean (current row) from the list |
| 4 | SET | `String mtNm = "";` // Initializes origin display name accumulator (original comment: 移動元) |
| 5 | SET | `String mtSokoNm = sbean.sendMessageString(MV_MT_SOKO_NM_02, X31CWebConst.DATABEAN_GET_VALUE);` // Reads Origin Warehouse Name [-> MV_MT_SOKO_NM_02 = "移動元倉庫名称"] |
| 6 | SET | `String mtKojiNm = sbean.sendMessageString(MV_MT_KOJI_NM_02, X31CWebConst.DATABEAN_GET_VALUE);` // Reads Origin Worksite Company Name [-> MV_MT_KOJI_NM_02 = "移動元工事会社名称"] |
| 7 | SET | `String mtOfcNm = sbean.sendMessageString(MV_MT_OFFICE_NM_02, X31CWebConst.DATABEAN_GET_VALUE);` // Reads Origin Office Name [-> MV_MT_OFFICE_NM_02 = "移動元預り先オフィス名称"] |

### Block 2 — PRIORITY CASCADE: origin name resolution (L751–L758)

> Selects the first non-empty origin name from warehouse -> worksite -> office, implementing a broad-to-narrow scope resolution pattern. Each branch collapses into the same setter.

**Block 2.1** — IF `[!JDKCommonUtil.isNull(mtSokoNm)]` (L751)

> If origin warehouse name is not empty/null, use it as the display name. This is the highest-priority (broadest scope) candidate.

| # | Type | Code |
|---|------|------|
| 1 | SET | `mtNm = mtSokoNm;` // Origin warehouse name selected |

**Block 2.2** — ELSE-IF `[!JDKCommonUtil.isNull(mtKojiNm)]` (L755)

> If warehouse is empty but worksite company name exists, use it. Second priority.

| # | Type | Code |
|---|------|------|
| 1 | SET | `mtNm = mtKojiNm;` // Origin worksite company name selected |

**Block 2.3** — ELSE-IF `[!JDKCommonUtil.isNull(mtOfcNm)]` (L759)

> If both warehouse and worksite are empty but office name exists, use it. Lowest priority (narrowest scope).

| # | Type | Code |
|---|------|------|
| 1 | SET | `mtNm = mtOfcNm;` // Origin office name selected |

**Block 2.4** — ELSE-ELSE (implicit, L751–L761)

> If all three origin candidates are empty/null, mtNm remains the empty string. The user will see no origin location name on the screen.

### Block 3 — WRITE: origin display name (L761)

> Writes the consolidated origin location name back into the data bean for screen rendering.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `sbean.sendMessageString(MV_MT_NM_02, X31CWebConst.DATABEAN_SET_VALUE, mtNm);` // Sets consolidated Origin Name [-> MV_MT_NM_02 = "移動元名称"] |

### Block 4 — INITIALIZATION: destination name preparation (L765–L769)

> Prepares the destination (移動先) location name by reading three candidate fields — mirrors the origin resolution pattern.

| # | Type | Code |
|---|------|------|
| 1 | SET | `String skNm = "";` // Initializes destination display name accumulator (original comment: 移動先) |
| 2 | SET | `String skSokoNm = sbean.sendMessageString(MV_SK_SOKO_NM_02, X31CWebConst.DATABEAN_GET_VALUE);` // Reads Destination Warehouse Name [-> MV_SK_SOKO_NM_02 = "移動先倉庫名称"] |
| 3 | SET | `String skKojiNm = sbean.sendMessageString(MV_SK_KOJI_NM_02, X31CWebConst.DATABEAN_GET_VALUE);` // Reads Destination Worksite Company Name [-> MV_SK_KOJI_NM_02 = "移動先工事会社名称"] |
| 4 | SET | `String skOfcNm = sbean.sendMessageString(MV_SK_OFFICE_NM_02, X31CWebConst.DATABEAN_GET_VALUE);` // Reads Destination Office Name [-> MV_SK_OFFICE_NM_02 = "移動先預り先オフィス名称"] |

### Block 5 — PRIORITY CASCADE: destination name resolution (L772–L779)

> Selects the first non-empty destination name, same priority cascade as origin.

**Block 5.1** — IF `[!JDKCommonUtil.isNull(skSokoNm)]` (L772)

> If destination warehouse name is not empty, use it.

| # | Type | Code |
|---|------|------|
| 1 | SET | `skNm = skSokoNm;` // Destination warehouse name selected |

**Block 5.2** — ELSE-IF `[!JDKCommonUtil.isNull(skKojiNm)]` (L776)

> If destination worksite company name exists, use it.

| # | Type | Code |
|---|------|------|
| 1 | SET | `skNm = skKojiNm;` // Destination worksite company name selected |

**Block 5.3** — ELSE-IF `[!JDKCommonUtil.isNull(skOfcNm)]` (L780)

> If destination office name exists, use it.

| # | Type | Code |
|---|------|------|
| 1 | SET | `skNm = skOfcNm;` // Destination office name selected |

**Block 5.4** — ELSE-ELSE (implicit)

> If all destination candidates are empty, skNm remains empty.

### Block 6 — WRITE: destination display name (L779)

> Writes the consolidated destination location name back into the data bean.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `sbean.sendMessageString(MV_SK_NM_02, X31CWebConst.DATABEAN_SET_VALUE, skNm);` // Sets consolidated Destination Name [-> MV_SK_NM_02 = "移動先名称"] |

### Block 7 — DELEGATE: list population (L779)

> Delegates to the private helper method `setList` to configure the shelf move detail list grid. This is a separate method in the same class that populates list-related display fields (e.g., row numbers, product names, quantities, serial numbers, move reason codes, etc.).

| # | Type | Code |
|---|------|------|
| 1 | CALL | `setList(paramBean[0], serviceFormBean);` // Delegates list display configuration (private method, L815) |

### Block 8 — READ: button state controls (L783–L784)

> Reads the two control values that determine which action buttons to enable or disable on the screen.

| # | Type | Code |
|---|------|------|
| 1 | SET | `String stat = sbean.sendMessageString(MV_STAT_CD_02, X31CWebConst.DATABEAN_GET_VALUE);` // Reads Status Code [-> MV_STAT_CD_02 = "状態コード"] |
| 2 | SET | `String stiWay = sbean.sendMessageString(SHITEI_WAY_CD_02, X31CWebConst.DATABEAN_GET_VALUE);` // Reads Designation Method Code [-> SHITEI_WAY_CD_02 = "指定方法コード"] |

### Block 9 — CONDITION: completed status check (confirm create button) (L787–L793)

> If the operation status code equals `"005"` (Completed), disables the Confirm Create button to prevent re-submission of finished transactions. The original Japanese comment says: "状態が完了済の場合" (Status is already completed).

**Block 9.1** — IF `[!JDKCommonUtil.isNull(stat) && "005".equals(stat)]` (L787)

| # | Type | Code |
|---|------|------|
| 1 | SET | `serviceFormBean.sendMessageBoolean(B_CNFRM_CREATE_DSBL_FLG, X31CWebConst.DATABEAN_SET_VALUE, true);` // Disables Confirm Create Button [-> B_CNFRM_CREATE_DSBL_FLG = "登録確認ボタン非活性フラグ"] |

### Block 10 — CONDITION: serial number designation check (quantity details button) (L796–L802)

> If the designation method code equals `"2"` (Serial Number Designation), disables the Quantity Details button. The original comment says: "指定方法が製番指定の場合" (Designation method is serial number designation). When items are tracked by individual serial number rather than quantity, the quantity details button is irrelevant.

**Block 10.1** — IF `[!JDKCommonUtil.isNull(stiWay) && "2".equals(stiWay)]` (L796)

| # | Type | Code |
|---|------|------|
| 1 | SET | `serviceFormBean.sendMessageBoolean(B_CNT_DTL_DSBL_FLG, X31CWebConst.DATABEAN_SET_VALUE, true);` // Disables Quantity Details Button [-> B_CNT_DTL_DSBL_FLG = "数量詳細ボタン非活性フラグ"] |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `KIHON_LIST` | Field | Shelf Move Basic Information List Detail List — the data bean array containing the current shelf move row's display data |
| `MV_MT_SOKO_NM_02` | Field | Origin Warehouse Name — the name of the warehouse at the shelf move source location |
| `MV_MT_KOJI_NM_02` | Field | Origin Worksite Company Name — the name of the worksite/company at the shelf move source |
| `MV_MT_OFFICE_NM_02` | Field | Origin Office Name — the name of the office/desk at the shelf move source |
| `MV_MT_NM_02` | Field | Origin Name — consolidated display field for the source location (first non-empty among warehouse, worksite, office) |
| `MV_SK_SOKO_NM_02` | Field | Destination Warehouse Name — the name of the warehouse at the shelf move destination |
| `MV_SK_KOJI_NM_02` | Field | Destination Worksite Company Name — the name of the worksite/company at the shelf move destination |
| `MV_SK_OFFICE_NM_02` | Field | Destination Office Name — the name of the office/desk at the shelf move destination |
| `MV_SK_NM_02` | Field | Destination Name — consolidated display field for the destination location |
| `MV_STAT_CD_02` | Field | Status Code — the current state of the shelf move operation (e.g., "005" = Completed) |
| `SHITEI_WAY_CD_02` | Field | Designation Method Code — how items are identified during the shelf move (e.g., "2" = Serial Number Designation) |
| `B_CNFRM_CREATE_DSBL_FLG` | Field | Confirm Create Button Disable Flag — when true, the "Confirm and Create" button is hidden/disabled on the screen |
| `B_CNT_DTL_DSBL_FLG` | Field | Quantity Details Button Disable Flag — when true, the "Quantity Details" button is hidden/disabled on the screen |
| `setGamen` | Method | Screen Display Settings — configures all display-related fields and button states for the current screen |
| `setList` | Method | List Display Settings — private helper that populates list-level display data (row numbers, product names, quantities, etc.) |
| 棚移動 (Tana Idou) | Term | Shelf Move — the core business operation of transferring inventory items between storage locations within a warehouse or across facilities |
| 入荷 (Nyuuka) | Term | Goods Receipt / Inbound — the process of recording incoming items; combined with "棚移動" forms "Shelf Move Entry" (recording a shelf move transaction) |
| 移動元 (Idomoto) | Term | Origin / Source — the location from which items are being moved |
| 移動先 (Idosaki) | Term | Destination — the location to which items are being moved |
| 倉庫 (Souko) | Term | Warehouse — a primary storage location within the warehouse facility |
| 工事会社 (Kouji Kaisha) | Term | Worksite Company — a contractor or worksite responsible for a specific installation area |
| 預り先オフィス (Prekari Office) | Term | Office / Desk — the smallest location granularity, representing an individual office or workstation |
| 状態コード (Joutai Code) | Term | Status Code — business status of the operation; "005" indicates Completed |
| 製番指定 (Seiban Shitei) | Term | Serial Number Designation — items tracked by individual serial number rather than by quantity; designated by code "2" |
| X31SDataBeanAccess | Type | OneStop Data Bean Access — the web layer's data carrier used for screen-level input/output data binding |
| X31SDataBeanAccessArray | Type | OneStop Data Bean Array — a collection wrapper for array-style data bean lists (e.g., list grids) |
| JDKCommonUtil.isNull | Method | Null/empty string check utility — returns true if the string is null or empty |
| 登録確認ボタン (Touroku Kakunin Button) | Term | Confirm Create Button — the button used to submit and confirm a shelf move transaction |
| 数量詳細ボタン (Suryuu Shousai Button) | Term | Quantity Details Button — the button to view/modify quantity-level detail for items |
