# Business Logic — KKW00844SFBean.listKoumokuIds() [54 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.KKW00844SF.KKW00844SFBean` |
| Layer | View Controller (Web Bean — sits in the `eo.web.webview` package, extends `X33VViewBaseBean`) |
| Module | `KKW00844SF` (Package: `eo.web.webview.KKW00844SF`) |

## 1. Role

### KKW00844SFBean.listKoumokuIds()

This method serves as the **item metadata dispatcher** for the KKW00844SF service screen, which is a telecom service contract/listing screen in the K-Opticom order management system. It resolves **which set of column headers (item names)** should be displayed to the end-user in the web-view grid, based on the `key` parameter.

The method implements a **routing/dispatch pattern** across four distinct branches, each handling a different service type or view category:

1. **Default service form view** (when `key` is `null`): Returns a fixed list of 22 standard fields covering service lifecycle attributes — from service start date and contract succession through operation dates, order states, and move reason metadata.

2. **Common info view** (when `key` starts with `/` and has length > 2): Delegates to the parent class `X33VViewBaseBean.listKoumokuIds()` to provide shared/cross-screen field definitions. This handles generic UI items shared across multiple screens in the X33 framework.

3. **Data-type view for Customer Contract Succession** (when `key` equals `"顧客契約引継リスト"`): Delegates to `KKW00844SF01DBean.listKoumokuIds()` to return 10 fields specific to the customer contract succession detail view — including SYID, service contract number, move classification, option service contract number, processing classification, order number, and order detail number.

4. **Data-type view for Move Reason** (when `key` equals `"異動理由リスト"`): Delegates to `KKW00844SF02DBean.listKoumokuIds()` to return 2 fields — move reason code and move reason memo.

5. **Fallback** (none matched): Returns an empty `ArrayList<String>` to prevent errors.

This method is a **shared utility** called by the screen's data-binding infrastructure (the X33 view framework) to populate dropdowns, table columns, or list items. It has no direct callers from other business screens — it is invoked internally by the X33 framework's bean lifecycle (e.g., during view data-type resolution via `typeModelData` or `addListDataInstance`).

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["listKoumokuIds(key)"])
    COND_NULL{"key == null"}
    DEFAULT_LIST["Create ArrayList<String>
Add 22 default service form items
1. 利用開始日 (Service Start Date)
2. 顧客契約引継リスト (Customer Contract Succession List)
3. 異動理由リスト (Move Reason List)
4. サービス契約番号 (Service Contract Number)
5. SYID
6. 異動区分 (Move Classification)
7. 運用日 (Operation Date)
8. 運用日时分秒 (Operation Date Time-Second)
9. サービス契約ステータス (Service Contract Status)
10. 申込明細番号 (Order Detail Number)
11. 更新年月日时分秒 (更新前) (Update Date Time-Second (Before Update))
12. 申込状態識別コード (承認済) (Order State Code (Approved))
13. 申込種類コード (Order Type Code)
14. オプションサービスコード (Option Service Code)
15. オプション料金コースコード (Option Fee Course Code)
16. オプション料金プランコード (Option Fee Plan Code)
17. 親契約識別コード (Parent Contract Code)
18. 事務手数料料自動適用可否 (Admin Fee Auto-Apply)
19. 進捗メモ (Progress Memo)
20. 進捗ステータス (Progress Status)
21. 進捗特記事項1 (Progress Remark 1)
22. ネットタブオプション情報制御コード (Net Tab Option Info Control)
23. 異動年月日时分秒 (Move Date Time-Second)
24. 配送返品状態コード (Delivery Return Status)"]
    COND_SLASH{"key.startsWith('/')
AND key.length() > 2"}
    PARENT_CALL["super.listKoumokuIds(key)
Delegate to X33VViewBaseBean
Common info view (shared fields)"]
    COND_CUST{"key.equals('顧客契約引継リスト')"}
    CUST_LIST["KKW00844SF01DBean.listKoumokuIds()
Return 10 data-type view items:
1. SYID
2. サービス契約番号 (Service Contract No.)
3. 異動区分 (Move Classification)
4. 異動理由コード (Move Reason Code)
5. 異動理由メモ (Move Reason Memo)
6. オプションサービス契約番号 (Option Service Contract No.)
7. 処理区分 (Processing Classification)
8. 申込番号 (Order Number)
9. 申込明細番号 (Order Detail Number)"]
    COND_IDO{"key.equals('異動理由リスト')"}
    IDO_LIST["KKW00844SF02DBean.listKoumokuIds()
Return 2 data-type view items:
1. 異動理由コード (Move Reason Code)
2. 異動理由メモ (Move Reason Memo)"]
    COND_DEFAULT{"None matched"}
    EMPTY_RETURN["Return new ArrayList<String>()
Empty list (fallback)"]
    END_RETURN(["Return ArrayList<String>"])

    START --> COND_NULL
    COND_NULL -->|true| DEFAULT_LIST
    COND_NULL -->|false| COND_SLASH
    DEFAULT_LIST --> END_RETURN
    COND_SLASH -->|true| PARENT_CALL
    COND_SLASH -->|false| COND_CUST
    PARENT_CALL --> END_RETURN
    COND_CUST -->|true| CUST_LIST
    COND_CUST -->|false| COND_IDO
    CUST_LIST --> END_RETURN
    COND_IDO -->|true| IDO_LIST
    COND_IDO -->|false| COND_DEFAULT
    COND_DEFAULT --> EMPTY_RETURN
    EMPTY_RETURN --> END_RETURN
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `key` | `String` | The **item identifier** used to select which field list to return. It represents a view type selector: `null` means the default service form view; a path starting with `/` (e.g., `/common`) requests shared/common screen fields; exact Japanese strings like `"顧客契約引継リスト"` (Customer Contract Succession List) and `"異動理由リスト"` (Move Reason List) request detail-type sub-view metadata. |

**External state read:**
- `super.listKoumokuIds(key)` — delegates to `X33VViewBaseBean.listKoumokuIds()` (Fujitsu X33 framework), which provides common info view field definitions shared across screens.

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `KKW00844SFBean.listKoumokuIds` | KKW00844SFBean | - | Calls `listKoumokuIds` in `KKW00844SFBean` (self-reference for recursive dispatch) |

### Method Call Analysis

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `X33VViewBaseBean.listKoumokuIds` | X33VViewBaseBean | - | Parent class method returning common/shared info view field metadata (X33 framework) |
| R | `KKW00844SF01DBean.listKoumokuIds` | KKW00844SF01DBean | - | Static method returning 10 data-type view items for Customer Contract Succession (SYID, service contract number, move classification, etc.) |
| R | `KKW00844SF02DBean.listKoumokuIds` | KKW00844SF02DBean | - | Static method returning 2 data-type view items for Move Reason (move reason code, move reason memo) |

**Classification rationale:** All three calls are **Read (R)** operations — they return lists of field name strings for UI display purposes. No create, update, or delete operations are performed. No database entities or SC/CBS codes are involved; this is purely a **view metadata resolver** that populates UI column headers.

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Internal: X33 Framework (KKW00844SF screen bean) | `X33VViewBaseBean` lifecycle → `listKoumokuIds` (inferred) | `KKW00844SF01DBean.listKoumokuIds [R]` |
| 2 | Internal: X33 Framework typeModelData flow | `typeModelData` → `listKoumokuIds` (inferred for view resolution) | `KKW00844SF02DBean.listKoumokuIds [R]` |

**Note:** No direct callers were found in the codebase via search (`KKW00844SFBean.listKoumokuIds` returns zero results from `**/*.java`). This method is invoked indirectly by the **Fujitsu X33 View Framework** during screen initialization, when the framework calls `listKoumokuIds` on bean instances to resolve column/item metadata for the view grid. The method itself is a **leaf utility** — it is not called by other business screens or CBS components.

## 6. Per-Branch Detail Blocks

### Block 1 — IF `(key == null)` (L1416)

> When `key` is null, this returns the default service form view item list containing 22 fields covering the full service lifecycle. The original comment reads: "keyがnullの場合、このサービスフォームの項目一覧を返す。" (When key is null, return the item list for this service form.)

| # | Type | Code |
|---|------|------|
| 1 | SET | `ArrayList<String> koumokuList = new ArrayList<String>();` |
| 2 | CALL | `koumokuList.add("利用開始日")` — Service Start Date [-> default view, item 1] |
| 3 | CALL | `koumokuList.add("顧客契約引継リスト")` — Customer Contract Succession List [-> default view, item 2] |
| 4 | CALL | `koumokuList.add("異動理由リスト")` — Move Reason List [-> default view, item 3] |
| 5 | CALL | `koumokuList.add("サービス契約番号")` — Service Contract Number [-> default view, item 4] |
| 6 | CALL | `koumokuList.add("SYID")` — SYID [-> default view, item 5] |
| 7 | CALL | `koumokuList.add("異動区分")` — Move Classification [-> default view, item 6] |
| 8 | CALL | `koumokuList.add("運用日")` — Operation Date [-> default view, item 7] |
| 9 | CALL | `koumokuList.add("運用日时分秒")` — Operation Date Time-Second [-> default view, item 8] |
| 10 | CALL | `koumokuList.add("サービス契約ステータス")` — Service Contract Status [-> default view, item 9] |
| 11 | CALL | `koumokuList.add("申込明細番号")` — Order Detail Number [-> default view, item 10] |
| 12 | CALL | `koumokuList.add("更新年月日时分秒（更新前）")` — Update Date Time-Second (Before Update) [-> default view, item 11] |
| 13 | CALL | `koumokuList.add("申込状態識別コード（承認済）")` — Order State Code (Approved) [-> default view, item 12] |
| 14 | CALL | `koumokuList.add("申込種類コード")` — Order Type Code [-> default view, item 13] |
| 15 | CALL | `koumokuList.add("オプションサービスコード")` — Option Service Code [-> default view, item 14] |
| 16 | CALL | `koumokuList.add("オプション料金コースコード")` — Option Fee Course Code [-> default view, item 15] |
| 17 | CALL | `koumokuList.add("オプション料金プランコード")` — Option Fee Plan Code [-> default view, item 16] |
| 18 | CALL | `koumokuList.add("親契約識別コード")` — Parent Contract Identification Code [-> default view, item 17] |
| 19 | CALL | `koumokuList.add("事務手数料料自動適用可否")` — Admin Fee Auto-Apply Eligibility [-> default view, item 18] |
| 20 | CALL | `koumokuList.add("進捗メモ")` — Progress Memo [-> default view, item 19] |
| 21 | CALL | `koumokuList.add("進捗ステータス")` — Progress Status [-> default view, item 20] |
| 22 | CALL | `koumokuList.add("進捗特記事項1")` — Progress Remark 1 [-> default view, item 21] |
| 23 | CALL | `koumokuList.add("ネットタブオプション情報制御コード")` — Net Tab Option Info Control Code [-> default view, item 22] |
| 24 | CALL | `koumokuList.add("異動年月日时分秒")` — Move Date Time-Second [-> default view, item 23] |
| 25 | CALL | `koumokuList.add("配送返品状態コード")` — Delivery Return Status Code [-> default view, item 24] |
| 26 | RETURN | `return koumokuList;` — Returns the 24-field default list |

### Block 2 — ELSE-IF `(key.startsWith("/") && key.length() > 2)` (L1446)

> 共通情報ビューが指定された場合、基底クラスのメソッドの結果を返す。 (When common info view is specified, return the result of the base class method.)

| # | Type | Code |
|---|------|------|
| 1 | SET | `int separaterPoint = key.indexOf("/");` — Finds position of "/" separator (not stored but used implicitly) |
| 2 | CALL | `return super.listKoumokuIds(key);` — Delegates to `X33VViewBaseBean.listKoumokuIds()` — returns common/shared view fields |

### Block 3 — ELSE-IF `(key.equals("顧客契約引継リスト"))` (L1451)

> データタイプビュー型の項目が存在する場合、各項目ごとにクラスの名項目名リストを返す。データタイプがデータタイプビュー型の項目"顧客契約引継リスト"(項目ID:cust_kei_hktgi_list)、データタイプビューのクラス名が"KKW00844SF01DBean"の例 (When a data-type view item exists, return the class item name list for each item. Example: data-type is data-type view item "Customer Contract Succession List" (item ID: cust_kei_hktgi_list), and the data-type view class name is "KKW00844SF01DBean")

| # | Type | Code |
|---|------|------|
| 1 | CALL | `return KKW00844SF01DBean.listKoumokuIds();` — Static call returning 10 fields: SYID, Service Contract Number, Move Classification, Move Reason Code, Move Reason Memo, Option Service Contract Number, Processing Classification, Order Number, Order Detail Number |

### Block 4 — ELSE-IF `(key.equals("異動理由リスト"))` (L1457)

> データタイプビュー型の項目が存在する場合、各項目ごとにクラスの名項目名リストを返す。データタイプがデータタイプビュー型の項目"異動理由リスト"(項目ID:ido_rsn_list)、データタイプビューのクラス名が"KKW00844SF02DBean"の例 (When a data-type view item exists, return the class item name list for each item. Example: data-type is data-type view item "Move Reason List" (item ID: ido_rsn_list), and the data-type view class name is "KKW00844SF02DBean")

| # | Type | Code |
|---|------|------|
| 1 | CALL | `return KKW00844SF02DBean.listKoumokuIds();` — Static call returning 2 fields: Move Reason Code, Move Reason Memo |

### Block 5 — ELSE `(none matched)` (L1462)

> 上記のいずれでもない場合、空の項目を返す (When none of the above match, return an empty item list.)

| # | Type | Code |
|---|------|------|
| 1 | SET | `new ArrayList<String>()` — Creates a fresh empty list |
| 2 | RETURN | `return new ArrayList<String>();` — Returns empty list as fallback |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `利用開始日` | Field | Service Start Date — the date when the service becomes active |
| `顧客契約引継リスト` | Field | Customer Contract Succession List — a data-type view selector for customer contract succession metadata (item ID: `cust_kei_hktgi_list`) |
| `異動理由リスト` | Field | Move Reason List — a data-type view selector for move/disposition reason metadata (item ID: `ido_rsn_list`) |
| `サービス契約番号` | Field | Service Contract Number — unique identifier for a telecom service contract |
| `SYID` | Field | System ID — internal system tracking identifier (full-width characters `ＳＹＩＤ` in source) |
| `異動区分` | Field | Move Classification — categorizes the type of service change/move |
| `運用日` | Field | Operation Date — the date of the system operation |
| `運用日时分秒` | Field | Operation Date Time-Second — operation timestamp including year, month, day, hour, minute, second |
| `サービス契約ステータス` | Field | Service Contract Status — current status of the service contract |
| `申込明細番号` | Field | Order Detail Number — detailed order line item identifier |
| `更新年月日时分秒（更新前）` | Field | Update Date Time-Second (Before Update) — timestamp of the last update before the current change |
| `申込状態識別コード（承認済）` | Field | Order State Code (Approved) — identifies orders that have been approved |
| `申込種類コード` | Field | Order Type Code — classifies the type of order |
| `オプションサービスコード` | Field | Option Service Code — identifies optional add-on services |
| `オプション料金コースコード` | Field | Option Fee Course Code — pricing course for option services |
| `オプション料金プランコード` | Field | Option Fee Plan Code — pricing plan for option services |
| `親契約識別コード` | Field | Parent Contract Identification Code — identifies the parent contract in a contract hierarchy |
| `事務手数料料自動適用可否` | Field | Admin Fee Auto-Apply Eligibility — flag indicating whether admin fees should be auto-applied |
| `進捗メモ` | Field | Progress Memo — free-text notes on order progress |
| `進捗ステータス` | Field | Progress Status — current progress state of the order |
| `進捗特記事項1` | Field | Progress Remark 1 — first additional remark field for progress tracking |
| `ネットタブオプション情報制御コード` | Field | Net Tab Option Info Control Code — controls visibility/behavior of option information on the net tab |
| `異動年月日时分秒` | Field | Move Date Time-Second — timestamp of the service move/change |
| `配送返品状態コード` | Field | Delivery Return Status Code — status of hardware return/delivery |
| `KKW00844SF` | Module | Order service screen module — a K-Opticom web screen for service contract management |
| `KKW00844SFBean` | Class | View bean for the KKW00844SF screen — extends `X33VViewBaseBean` from Fujitsu's X33 framework |
| `KKW00844SF01DBean` | Class | Data-type detail bean for Customer Contract Succession — provides 10 fields for the contract succession sub-view |
| `KKW00844SF02DBean` | Class | Data-type detail bean for Move Reason — provides 2 fields (code and memo) for the move reason sub-view |
| `X33VViewBaseBean` | Class | Fujitsu X33 framework base class — provides common view bean functionality shared across screens |
| `X33` | Acronym | Fujitsu X33 Web Client Definition Tool — enterprise web application framework |
| `DBean` | Term | Data-type Bean — a specialized bean that provides data-type view metadata for a specific entity/view |
| `view bean` | Term | A bean in the X33 framework that manages UI column headers, data types, and field metadata for a web screen |
| `data-type view` | Term | A sub-view type that provides detailed field metadata for specific business entities (as opposed to the generic default view) |
| `common info view` | Term | A shared view type that provides common field definitions across multiple screens, accessed via path-based key (starting with `/`) |
| `cust_kei_hktgi_list` | Field ID | Item ID for Customer Contract Succession List — maps to `KKW00844SF01DBean` |
| `ido_rsn_list` | Field ID | Item ID for Move Reason List — maps to `KKW00844SF02DBean` |
