# Business Logic -- KKW00816SFBean.listKoumokuIds() [71 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.KKW00816SF.KKW00816SFBean` |
| Layer | Service Form Bean (Web/View layer, Fujitsu Futurity X33 framework) |
| Module | `KKW00816SF` (Package: `eo.web.webview.KKW00816SF`) |

## 1. Role

### KKW00816SFBean.listKoumokuIds()

This method serves as the **item metadata dispatcher** for the KKW00816SF service form screen. It resolves what columns (items) a data table should display based on a caller-supplied `key` that identifies the data type context. The key business operation is **returning an `ArrayList<String>` of human-readable item labels** (translated into Japanese) that describe what fields appear in a given view of the service form data.

The method implements a **conditional dispatch/routing pattern**: when `key` is null it returns the full list of 34 top-level service form fields. When `key` starts with a slash (e.g., "/detail"), it delegates to the superclass `X33VViewBaseBean.listKoumokuIds()` which handles generic data-type-based item resolution via the framework. When `key` matches a specific data-type-view label (e.g., `\"顧客契約引継リスト\"` -- Customer Contract Succession List), it dispatches to a static `listKoumokuIds()` on a corresponding detail bean (`KKW00816SF01DBean` or `KKW00816SF02DBean`) that provides a focused subset of columns. For any unmatched key, it returns an empty list as a safe default.

This method is called by the screen's `KKSV0004SF` (and related screens) to dynamically populate dropdown filters and column definitions for service form data. It is **not a data access method** -- it purely provides display metadata to the view layer. The framework's `X33VListedBeanInterface` contract requires this method for listing beans.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["listKoumokuIds String key"])

    START --> COND1{key equals null}

    COND1 -->|Yes| NULL_BRANCH[Build service form item list]
    NULL_BRANCH --> ADD1[Add 34 service form item labels]
    ADD1 --> R1(["Return koumokuList"])

    COND1 -->|No| COND2{key starts with slash and length greater than 2}

    COND2 -->|Yes| DELEGATE[super listKoumokuIds key]
    DELEGATE --> R2(["Return super result"])

    COND2 -->|No| COND3{key equals customer_contract_list}

    COND3 -->|Yes| BEAN1[KKW00816SF01DBean listKoumokuIds]
    BEAN1 --> R3(["Return detail bean list"])

    COND3 -->|No| COND4{key equals option_service_contract_list}

    COND4 -->|Yes| BEAN2[KKW00816SF02DBean listKoumokuIds]
    BEAN2 --> R4(["Return option bean list"])

    COND4 -->|No| EMPTY[Return new ArrayList]
    EMPTY --> R5(["Return empty list"])
```

**Branch Summary:**

| Branch | Condition | Behavior | Business Meaning |
|--------|-----------|----------|------------------|
| Branch 1 | `key == null` | Returns all 34 top-level service form item labels | No filter requested -- show full service form dataset |
| Branch 2 | `key.charAt(0) == '/'` && `key.length() > 2` | Delegates to `super.listKoumokuIds(key)` | Generic data-type view resolution via framework |
| Branch 3 | `key.equals("顧客契約引継リスト")` | Calls `KKW00816SF01DBean.listKoumokuIds()` | Customer contract succession detail view (5 columns) |
| Branch 4 | `key.equals("オプションサービス契約リスト")` | Calls `KKW00816SF02DBean.listKoumokuIds()` | Option service contract detail view (3 columns) |
| Branch 5 | Default (no match) | Returns `new ArrayList<>()` | Unrecognized key -- empty list, safe fallback |

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `key` | `String` | Identifies which data view context to resolve item labels for. Can be: (a) `null` for the full service form, (b) a data-type-view identifier starting with `/` (e.g., `/cust_kei_hktgi_list`) that delegates to the framework, (c) a data-type-view label string such as `顧客契約引継リスト` (Customer Contract Succession List) or `オプションサービス契約リスト` (Option Service Contract List) for detail bean dispatch, or (d) any unrecognized value that results in an empty list. |

| No | Source | Type | Business Description |
|----|--------|------|---------------------|
| 1 | `this` (instance) | `X33VViewBaseBean` (superclass) | Framework base bean providing default `listKoumokuIds()` behavior via `super.listKoumokuIds(key)` |
| 2 | `KKW00816SF01DBean` (static) | `Bean` | Detail bean for customer contract succession data-type view (data-type-view item ID: `cust_kei_hktgi_list`) |
| 3 | `KKW00816SF02DBean` (static) | `Bean` | Detail bean for option service contract data-type view (data-type-view item ID: `op_svc_kei_list`) |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `X33VViewBaseBean.listKoumokuIds` | (Framework) | - | Framework base method resolving items by data-type-view ID (delegated when `key` starts with `/`) |
| R | `KKW00816SF01DBean.listKoumokuIds` | (Static Bean) | - | Returns detail bean column labels: STT, Service Contract Number, Diff. Area, Diff. Reason Code, Diff. Reason Memo (5 items) |
| R | `KKW00816SF02DBean.listKoumokuIds` | (Static Bean) | - | Returns option bean column labels: Option Service Contract No., Option Service Contract Status, Option Service Code (3 items) |

This method performs **zero database operations**. It is purely a metadata/resolution layer method -- no SC (Service Component) or CBS (Business Service) calls, no entity reads, no SQL. All "reads" are constructing `ArrayList<String>` objects with hardcoded Japanese label strings and dispatching to other bean methods that do the same.

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Screen:KKSV0004SF (inferred) | `KKSV0004SF` (service form screen) -> `KKW00816SFBean.listKoumokuIds(String key)` | `listKoumokuIds [R] ArrayList<String>` |

**Notes:** The only direct caller found in the codebase is `KKW00816SFBean.listKoumokuIds()` (an overload that calls this method with `null`). The method is part of the `X33VListedBeanInterface` contract and is invoked by the Futurity X33 framework during screen rendering to populate table column metadata. Callers are not traced further in the code graph -- the pre-computed caller table shows only one entry.

## 6. Per-Branch Detail Blocks

### Block 1 -- IF `(key == null)` (L2276)

> When `key` is null, this branch returns the complete list of 34 service form item labels. This is the "show everything" mode used when the screen first loads or when no data-type-view filter is applied. The labels are hardcoded Japanese display names for each field shown in the service form data table.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | SET | `ArrayList<String> koumokuList = new ArrayList<String>();` | Initialize empty item label list |
| 2 | EXEC | `koumokuList.add("顧客契約引継リスト");` | 1: Customer Contract Succession List [data-type-view ID: `cust_kei_hktgi_list`] |
| 3 | EXEC | `koumokuList.add("オプションサービス契約リスト");` | 2: Option Service Contract List [data-type-view ID: `op_svc_kei_list`] |
| 4 | EXEC | `koumokuList.add("申請種別コード");` | 3: Application Type Code |
| 5 | EXEC | `koumokuList.add("オプションサービスコード");` | 4: Option Service Code |
| 6 | EXEC | `koumokuList.add("親契約識別コード");` | 5: Parent Contract Identification Code |
| 7 | EXEC | `koumokuList.add("業務パラメータID（セッション上限数）");` | 6: Business Parameter ID (Session Maximum Count) |
| 8 | EXEC | `koumokuList.add("業務パラメータ設定値（セッション上限数）");` | 7: Business Parameter Setting Value (Session Maximum Count) |
| 9 | EXEC | `koumokuList.add("業務パラメータID（予約上限日数）");` | 8: Business Parameter ID (Reservation Maximum Days) |
| 10 | EXEC | `koumokuList.add("業務パラメータ設定値（予約上限日数）");` | 9: Business Parameter Setting Value (Reservation Maximum Days) |
| 11 | EXEC | `koumokuList.add("事務手数料自動適用可否");` | 10: Office Fee Auto-Applicability |
| 12 | EXEC | `koumokuList.add("料金コースコード");` | 11: Charge Course Code |
| 13 | EXEC | `koumokuList.add("料金プランコード");` | 12: Charge Plan Code |
| 14 | EXEC | `koumokuList.add("料金プラン固定単価番号");` | 13: Charge Plan Fixed Unit Price Number |
| 15 | EXEC | `koumokuList.add("初期マルチセッショニング認証IDパスワード");` | 14: Initial Multisectioning Authentication ID Password |
| 16 | EXEC | `koumokuList.add("マルチセッショニング認証ID");` | 15: Multisectioning Authentication ID |
| 17 | EXEC | `koumokuList.add("セッション数");` | 16: Session Count |
| 18 | EXEC | `koumokuList.add("利用開始日（年）");` | 17: Service Start Date (Year) |
| 19 | EXEC | `koumokuList.add("利用開始日（月）");` | 18: Service Start Date (Month) |
| 20 | EXEC | `koumokuList.add("利用開始日（日）");` | 19: Service Start Date (Day) |
| 21 | EXEC | `koumokuList.add("利用開始日");` | 20: Service Start Date (Full) |
| 22 | EXEC | `koumokuList.add("サービス課金開始年月日");` | 21: Service Billing Start Year-Month-Day |
| 23 | EXEC | `koumokuList.add("運用年月日");` | 22: Operation Date |
| 24 | EXEC | `koumokuList.add("運用年月日时分秒");` | 23: Operation Date and Time (YYYY-MM-DD HH:MM:SS) |
| 25 | EXEC | `koumokuList.add("実オプションサービス契約ステータス");` | 24: Actual Option Service Contract Status |
| 26 | EXEC | `koumokuList.add("サービス契約ステータス");` | 25: Service Contract Status |
| 27 | EXEC | `koumokuList.add("お客様ステータス");` | 26: Customer Status |
| 28 | EXEC | `koumokuList.add("請求契約番号");` | 27: Billing Contract Number |
| 29 | EXEC | `koumokuList.add("進展ステータス");` | 28: Progress Status |
| 30 | EXEC | `koumokuList.add("進展特記事項1");` | 29: Progress Remarks 1 |
| 31 | EXEC | `koumokuList.add("オーダ種別コード");` | 30: Order Type Code |
| 32 | EXEC | `koumokuList.add("サービスオーダコード");` | 31: Service Order Code |
| 33 | EXEC | `koumokuList.add("要求種別コード");` | 32: Request Type Code |
| 34 | EXEC | `koumokuList.add("オーダ発行条件コード");` | 33: Order Issuance Condition Code |
| 35 | EXEC | `koumokuList.add("オーダ内容コード");` | 34: Order Content Code |
| 36 | EXEC | `koumokuList.add("オプションSOD登録実施");` | 35: Option SOD Registration Implementation |
| 37 | EXEC | `koumokuList.add("世代管理年月日时分秒（サービス契約）");` | 36: Generation Management Date/Time (Service Contract) |
| 38 | EXEC | `koumokuList.add("サービス契約内訳番号");` | 37: Service Contract Breakdown Number |
| 39 | EXEC | `koumokuList.add("世代管理年月日时分秒（サービス契約内訳）");` | 38: Generation Management Date/Time (Service Contract Breakdown) |
| 40 | EXEC | `koumokuList.add("最終更新年月日时分秒");` | 39: Last Update Date/Time |
| 41 | EXEC | `koumokuList.add("異動年月日时分秒");` | 40: Movement Date/Time |
| 42 | EXEC | `koumokuList.add("サービス契約内訳ステータス");` | 41: Service Contract Breakdown Status |
| 43 | RETURN | `return koumokuList;` | Return the complete 34-item list to caller |

### Block 2 -- ELSE-IF `(key.indexOf("/") == 0 && key.length() > 2)` (L2320)

> When `key` starts with a slash and has more than 2 characters, the method delegates to the superclass framework method. This is the generic data-type-view resolution path -- the framework's `X33VViewBaseBean.listKoumokuIds()` resolves items based on the data-type-view ID format (e.g., `/cust_kei_hktgi_list` maps to the `cust_kei_hktgi_list` data-type-view).

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | CALL | `super.listKoumokuIds(key);` | Delegate to framework superclass for generic data-type-view resolution |
| 2 | RETURN | `return super.listKoumokuIds(key);` | Return framework-resolved item list |

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

> When the key matches the data-type-view label for Customer Contract Succession List (data-type-view item ID: `cust_kei_hktgi_list`), this branch delegates to the static `KKW00816SF01DBean.listKoumokuIds()` method. This returns a focused subset of 5 columns relevant to the customer contract succession detail view.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | CALL | `KKW00816SF01DBean.listKoumokuIds();` | Static bean call returning 5 detail columns: STT, Service Contract No., Diff. Area, Diff. Reason Code, Diff. Reason Memo |
| 2 | RETURN | `return KKW00816SF01DBean.listKoumokuIds();` | Return detail bean item list (5 items) |

### Block 4 -- ELSE-IF `(key.equals("オプションサービス契約リスト"))` (L2333)

> When the key matches the data-type-view label for Option Service Contract List (data-type-view item ID: `op_svc_kei_list`), this branch delegates to the static `KKW00816SF02DBean.listKoumokuIds()` method. This returns a focused subset of 3 columns relevant to the option service contract detail view.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | CALL | `KKW00816SF02DBean.listKoumokuIds();` | Static bean call returning 3 detail columns: Option Service Contract No., Option Service Contract Status, Option Service Code |
| 2 | RETURN | `return KKW00816SF02DBean.listKoumokuIds();` | Return option bean item list (3 items) |

### Block 5 -- ELSE (Default / L2338)

> For any key that does not match any of the above conditions (null, slash-prefixed, or the two specific data-type-view labels), this branch returns an empty list as a safe default. No data access, no error thrown -- the caller receives an empty column list and the screen will render with no columns.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | RETURN | `return new ArrayList<String>();` | Return empty list for unrecognized key |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `koumoku` | Field | Item / field -- Japanese term for data table column labels displayed on the service form screen |
| `顧客契約引継リスト` | Field | Customer Contract Succession List -- top-level service form item triggering the `KKW00816SF01DBean` detail view |
| `オプションサービス契約リスト` | Field | Option Service Contract List -- top-level service form item triggering the `KKW00816SF02DBean` detail view |
| `申請種別コード` | Field | Application Type Code -- code classifying the type of application (e.g., new, change, renewal) |
| `オプションサービスコード` | Field | Option Service Code -- identifier for an optional service (e.g., additional features, add-ons) |
| `親契約識別コード` | Field | Parent Contract Identification Code -- code identifying the parent contract in a hierarchical contract structure |
| `業務パラメータID` | Field | Business Parameter ID -- internal identifier for a configurable business parameter |
| `セッション上限数` | Field | Session Maximum Count -- maximum number of concurrent sessions allowed |
| `予約上限日数` | Field | Reservation Maximum Days -- maximum number of days a reservation can be held |
| `事務手数料自動適用可否` | Field | Office Fee Auto-Applicability -- flag indicating whether office/admin fees are automatically applied |
| `料金コースコード` | Field | Charge Course Code -- code for a billing/charging course tier |
| `料金プランコード` | Field | Charge Plan Code -- code for a pricing plan |
| `料金プラン固定単価番号` | Field | Charge Plan Fixed Unit Price Number -- number identifying a fixed unit price within a charge plan |
| `初期マルチセッショニング認証IDパスワード` | Field | Initial Multisectioning Authentication ID Password -- initial credentials for multisectioning (concurrent session) authentication |
| `マルチセッショニング認証ID` | Field | Multisectioning Authentication ID -- ID used for concurrent session authentication |
| `セッション数` | Field | Session Count -- number of active sessions |
| `利用開始日` | Field | Service Start Date -- date when the service becomes active (available as year, month, day, or full date) |
| `サービス課金開始年月日` | Field | Service Billing Start Year-Month-Day -- date when billing for the service begins |
| `運用年月日` | Field | Operation Date -- system operation/administrative date |
| `運用年月日时分秒` | Field | Operation Date and Time -- system operation date with full timestamp (year, month, day, hour, minute, second) |
| `実オプションサービス契約ステータス` | Field | Actual Option Service Contract Status -- actual/live status of an option service contract |
| `サービス契約ステータス` | Field | Service Contract Status -- current status of the service contract |
| `お客様ステータス` | Field | Customer Status -- current status of the customer record |
| `請求契約番号` | Field | Billing Contract Number -- contract number used for billing purposes |
| `進展ステータス` | Field | Progress Status -- current processing/fulfillment status of the order |
| `進展特記事項1` | Field | Progress Remarks 1 -- first free-text field for progress-related notes |
| `オーダ種別コード` | Field | Order Type Code -- code classifying the type of service order |
| `サービスオーダコード` | Field | Service Order Code -- identifier for a service order |
| `要求種別コード` | Field | Request Type Code -- code classifying the type of request |
| `オーダ発行条件コード` | Field | Order Issuance Condition Code -- conditions under which an order is issued |
| `オーダ内容コード` | Field | Order Content Code -- code describing the content of a service order |
| `オプションSOD登録実施` | Field | Option SOD Registration Implementation -- flag indicating whether option SOD (Service Order Data) registration has been performed |
| `世代管理` | Field | Generation Management -- version tracking for data (managing different generations/versions of a record) |
| `サービス契約内訳番号` | Field | Service Contract Breakdown Number -- internal number identifying a line-item breakdown within a service contract |
| `最終更新年月日时分秒` | Field | Last Update Date/Time -- timestamp of the most recent record update |
| `異動年月日时分秒` | Field | Movement Date/Time -- timestamp of the most recent record movement/transfer/operation |
| `サービス契約内訳ステータス` | Field | Service Contract Breakdown Status -- status of a service contract line-item breakdown |
| SOD | Acronym | Service Order Data -- the order fulfillment entity holding service order information |
| X33 | Acronym | Fujitsu Futurity X33 -- enterprise web framework used to build the application |
| `X33VViewBaseBean` | Class | Base bean class in the X33 framework providing default view bean behavior including generic `listKoumokuIds()` |
| `X33VListedBeanInterface` | Interface | X33 framework interface for beans that represent listed/table data; requires `listKoumokuIds()` for column metadata |
| Data-type-view | Concept | A framework concept for displaying a subset of fields from a data-type; identified by an item ID (e.g., `cust_kei_hktgi_list`) or label string |
