---

# Business Logic — JFUMkmInfoAddFrontiaPreTrnCC.getStbInfo() [91 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `com.fujitsu.futurity.bp.custom.common.JFUMkmInfoAddFrontiaPreTrnCC` |
| Layer | CC/Common Component |
| Module | `common` (Package: `com.fujitsu.futurity.bp.custom.common`) |

## 1. Role

### JFUMkmInfoAddFrontiaPreTrnCC.getStbInfo()

This method performs STB (Set-Top Box) device information retrieval and existence verification during the Frontia (fujitsu's FTTH bundled service) registration pre-processing flow. Its primary business purpose is to look up three complementary reference tables — machine model charges, pricing plan details, and indoor device model agreements — then assemble the resulting data into the work area for downstream processing.

The method follows a **sequential routing/dispatch pattern**: it calls three distinct CBS (Common Business Service) components in a pipeline, each refining the data from the previous step. The first CBS (EKK1621B001) resolves a PCRS code (PCRS is a product/charge code related to the device's monthly fee structure) from the given device model code and the current operating date. The second CBS (EKK0591B003) uses that PCRS code to look up the pricing plan code and the STB model name from the pricing plan table. The third CBS (EZM0411A010) independently resolves the HDD capacity code from the device model code.

This method serves as a **shared utility** within the broader `JFUMkmInfoAddFrontiaPreTrnCC` component. It is designed to populate a specific STB device slot (HD1 through HD5) identified by the `target` parameter, storing four attributes per slot: PCRS code, pricing plan code, HDD capacity code, and model name. If any intermediate CBS call returns no results, the method short-circuits and returns `false`, signaling that the STB device data is incomplete or invalid and preventing downstream processing from proceeding with partial data.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["getStbInfo"])

    START --> INIT["Initialize variables: pcrsCd, pplanCd, stbMdlNm, hddCapaCd to EMPTY<br/>Get opeDate from JCCBPCommon.getOpeDate"]

    INIT --> CALL1["callSC EKK1621B001<br/>Cost table: machine model charges"]

    CALL1 --> CHECK1{EKK1621 output<br/>valid}

    CHECK1 -- true --> EXTRACT1["Extract pcrsCd from response"]

    CHECK1 -- false --> FAIL1(["return false"])

    EXTRACT1 --> CALL2["callSC EKK0591B003<br/>Pricing plan table"]

    CALL2 --> CHECK2{EKK0591 output<br/>valid}

    CHECK2 -- true --> EXTRACT2["Extract pplanCd and stbMdlNm"]

    CHECK2 -- false --> FAIL2(["return false"])

    EXTRACT2 --> CALL3["callSC EZM0411A010<br/>Indoor device model agreement"]

    CALL3 --> CHECK3{EZM output<br/>valid}

    CHECK3 -- true --> EXTRACT3["Extract hddCapaCd"]

    CHECK3 -- false --> FAIL3(["return false"])

    EXTRACT3 --> CHECK_TARGET{Check target value}

    CHECK_TARGET -- stb_hd1_kiki --> SET1["Set stb_hd1 fields<br/>pcrs, pplan, hddCapa, modelNm"]

    CHECK_TARGET -- stb_hd2_kiki --> SET2["Set stb_hd2 fields<br/>pcrs, pplan, hddCapa, modelNm"]

    CHECK_TARGET -- stb_hd3_kiki --> SET3["Set stb_hd3 fields<br/>pcrs, pplan, hddCapa, modelNm"]

    CHECK_TARGET -- stb_hd4_kiki --> SET4["Set stb_hd4 fields<br/>pcrs, pplan, hddCapa, modelNm"]

    CHECK_TARGET -- stb_hd5_kiki --> SET5["Set stb_hd5 fields<br/>pcrs, pplan, hddCapa, modelNm"]

    SET1 --> SUCCESS(["return true"])
    SET2 --> SUCCESS
    SET3 --> SUCCESS
    SET4 --> SUCCESS
    SET5 --> SUCCESS
    FAIL1 --> END_FAIL(["done"])
    FAIL2 --> END_FAIL
    FAIL3 --> END_FAIL
```

**Processing description:**

1. **Initialization** — All four variables (`pcrsCd`, `pplanCd`, `stbMdlNm`, `hddCapaCd`) are initialized to `JFUStrConst.EMPTY` (empty string). The operating date is fetched once via `JCCBPCommon.getOpeDate(null)`.

2. **Step 1 — Machine Model Charge Table (EKK1621B001)** — A mapping input is built with template ID, function code `FUNC_CD_1` (lookup), operating date, and the provided `taknkikiModelCd` (delivery device model code). The `callSC` method dispatches to the CBS. If the result list is empty, the method returns `false` immediately (STB device not found in cost table). Otherwise, the `pcrsCd` is extracted.

3. **Step 2 — Pricing Plan Table (EKK0591B003)** — Using the `pcrsCd` from Step 1, another mapping input is built. The CBS returns pricing plan data. If empty, return `false` (pricing plan not found). Otherwise, both `pplanCd` (pricing plan code) and `stbMdlNm` (STB model name from pricing plan name field) are extracted.

4. **Step 3 — Indoor Device Model Agreement Table (EZM0411A010)** — Using the `taknkikiModelCd` again (independently from Step 1), the CBS returns indoor device model agreement data. If empty, return `false` (device model not registered). Otherwise, `hddCapaCd` (HDD capacity code) is extracted.

5. **Step 4 — Target Device Routing** — The `target` parameter is compared against five constant values (`STB_HD1_KIKI` through `STB_HD5_KIKI`). Each matching branch sets the four collected attributes into the corresponding `workArea` sub-slot via `setStb_hd*_pcrs_cd`, `setStb_hd*_pplan_cd`, `setStb_hd*_hdd_capa_cd`, and `setStb_hd*_model_nm`.

6. **Return** — Returns `true` if all three CBS calls succeeded and the target matched a valid device slot. Returns `false` if any CBS returned no results (incomplete device data).

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `handle` | `SessionHandle` | Database session handle carrying the current transaction context, including authentication credentials, tenant isolation info, and connection pooling metadata required for CBS invocations. |
| 2 | `scCall` | `ServiceComponentRequestInvoker` | Service Component invocation router that dispatches CBS calls to the correct backend service implementation. Carries the invocation chain and metadata needed for the middleware to locate and execute the target CBS. |
| 3 | `param` | `IRequestParameterReadWrite` | Request/response parameter object used to pass template IDs and structured input/output maps between this method and the CBS components. Acts as the communication bus for all SC calls. |
| 4 | `fixedText` | `String` | Fixed text string passed through to CBS calls, typically used for logging, audit trail reference, or display text correlation within the CBS layer. |
| 5 | `taknkikiModelCd` | `String` | 送付機器モデルコード (Delivery Device Model Code) — Identifies the STB (Set-Top Box) device model type. Used as the primary lookup key in both the machine model charge table (EKK1621B001) and the indoor device model agreement table (EZM0411A010). Must correspond to a registered device model in the system. |
| 6 | `target` | `String` | 対象機器 (Target Device) — Identifies which STB device slot (HD1 through HD5) the retrieved information should be stored into. Must match one of five constant values: `stb_hd1_kiki`, `stb_hd2_kiki`, `stb_hd3_kiki`, `stb_hd4_kiki`, or `stb_hd5_kiki`. Controls the destination of the final data assignment. |

**External state read:**

| Field | Source | Usage |
|-------|--------|-------|
| `workArea` | Instance field (`JFUMkmInfoAddFrontiaWorkArea`) | Destination object where the four STB attributes (pcrsCd, pplanCd, hddCapaCd, stbMdlNm) are written into the slot matching `target`. |

## 4. CRUD Operations / Called Services

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

All CBS calls in this method are **Read** operations — they query reference/master tables to retrieve pricing and device model data.

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `JCCBPCommon.getOpeDate` | JCCBPCommon | - (Utility) | Retrieves the current operating date (opeDate) used as a key parameter for the EKK1621B001 CBS call. Acts as a date reference utility. |
| R | `JFUMkmInfoAddFrontiaPreTrnCC.callSC` | EKK1621B001CBS | EKK1621B001 (Cost table for machine model charges) | Dispatches to CBS EKK1621B001 to look up PCRS charge code from the machine model cost table, keyed by operating date and delivery device model code. Returns the product/charge code for billing. |
| R | `JFUMkmInfoAddFrontiaPreTrnCC.callSC` | EKK0591B003CBS | EKK0591B003 (Pricing plan table) | Dispatches to CBS EKK0591B003 to look up pricing plan details (plan code and plan name) from the pricing plan table, keyed by the PCRS code obtained from the previous step. |
| R | `JFUMkmInfoAddFrontiaPreTrnCC.callSC` | EZM0411A010CBS | EZM0411A010 (Indoor device model agreement table) | Dispatches to CBS EZM0411A010 to look up HDD capacity code from the indoor device model agreement table, keyed by the delivery device model code. |

**Note:** The `workArea` setter methods (e.g., `setStb_hd1_pcrs_cd`) are classified as **U** (Update) to the work area session object, though they do not directly touch the database — they populate the in-memory work area that will later be persisted by the calling CBS.

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | CBS: `JFUMkmInfoAddFrontiaPreTrnCC.checkCodeToMaster` | `checkCodeToMaster` -> `getStbInfo(handle, scCall, param, fixedText, taknkikiModelCd, target)` | `EKK1621B001CBS [R] machine model charge table`<br/>`EKK0591B003CBS [R] pricing plan table`<br/>`EZM0411A010CBS [R] indoor device model agreement table`<br/>`workArea.setStb_hd1_* [U] work area session`<br/>`workArea.setStb_hd2_* [U] work area session`<br/>`workArea.setStb_hd3_* [U] work area session`<br/>`workArea.setStb_hd4_* [U] work area session`<br/>`workArea.setStb_hd5_* [U] work area session` |

**Note:** No screen (KKSV*) or batch (KKW*) entry points were found within 8 hops. This method is called exclusively from `checkCodeToMaster` within the same class, which serves as a data validation/checking CBS for the Frontia STB registration master data flow.

## 6. Per-Branch Detail Blocks

**Block 1** — [INITIALIZATION] (L1434)

Initialization of all return variables to empty strings and fetching the operating date.

| # | Type | Code |
|---|------|------|
| 1 | SET | `pcrsCd = JFUStrConst.EMPTY` // Initialize PCRS charge code to empty string |
| 2 | SET | `pplanCd = JFUStrConst.EMPTY` // Initialize pricing plan code to empty string |
| 3 | SET | `stbMdlNm = JFUStrConst.EMPTY` // Initialize STB model name to empty string |
| 4 | SET | `hddCapaCd = JFUStrConst.EMPTY` // Initialize HDD capacity code to empty string |
| 5 | CALL | `opeDate = JCCBPCommon.getOpeDate(null)` // [-> JCCBPCommon] Get current operating date |

> 上りマッピング処理 (機器型式対象料金コスト一覧) — Upstream mapping processing: machine model charges cost table lookup

**Block 2** — [CBS CALL 1: EKK1621B001] (L1443)

Build input mapping and call CBS to retrieve PCRS charge code from the machine model cost table.

| # | Type | Code |
|---|------|------|
| 1 | SET | `ekk1621b001In` = `Object[][] { ... }` // Build 4-row input mapping |
| 1.1 | SET | `[EKK1621B001CBSMsg.TEMPLATEID, TEMPLATE_ID_EKK1621B001]` // Template ID constant |
| 1.2 | SET | `[EKK1621B001CBSMsg.FUNC_CODE, JPCModelConstant.FUNC_CD_1]` // [-> JPCModelConstant.FUNC_CD_1 = "1"] Function code: 1 = lookup/registration |
| 1.3 | SET | `[EKK1621B001CBSMsg.KEY_BASE_YMD, opeDate]` // Operating date key |
| 1.4 | SET | `[EKK1621B001CBSMsg.KEY_TAKNKIKI_MODEL_CD, taknkikiModelCd]` // Delivery device model code key |
| 2 | EXEC | `ekk1621b001Out = callSC(handle, scCall, param, fixedText, ekk1621b001In).getCAANMsgList(EKK1621B001CBSMsg.EKK1621B001CBSMSG1LIST)` // [-> JFUMkmInfoAddFrontiaPreTrnCC.callSC] Dispatch to CBS and extract message list |

**Block 3** — [IF] (EKK1621 output valid) (L1446)

> 料金コード — Charge code

| # | Type | Code |
|---|------|------|
| 1 | IF | `ekk1621b001Out != null && ekk1621b001Out.length > 0` |
| 1.1 | SET | `pcrsCd = ekk1621b001Out[0].getString(EKK1621B001CBSMsg1List.PCRS_CD)` // Extract PCRS charge code from first row |
| 1.2 | ELSE | — |

**Block 3.1** — [ELSE] (EKK1621 output invalid) (L1448)

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return false` // No PCRS code found — STB device not in cost table |

> 上りマッピング処理 (料金プラン一覧照会) — Upstream mapping processing: pricing plan table lookup

**Block 4** — [CBS CALL 2: EKK0591B003] (L1451)

Build input mapping and call CBS to retrieve pricing plan details using the PCRS code from Block 3.

| # | Type | Code |
|---|------|------|
| 1 | SET | `ekk0591b003In` = `Object[][] { ... }` // Build 3-row input mapping |
| 1.1 | SET | `[EKK0591B003CBSMsg.TEMPLATEID, TEMPLATE_ID_EKK0591B003]` // Template ID constant |
| 1.2 | SET | `[EKK0591B003CBSMsg.FUNC_CODE, JPCModelConstant.FUNC_CD_1]` // [-> FUNC_CD_1 = "1"] Function code: 1 = lookup |
| 1.3 | SET | `[EKK0591B003CBSMsg.KEY_PCRS_CD, pcrsCd]` // PCRS code from Block 3 as lookup key |
| 2 | EXEC | `ekk0591b003Out = callSC(handle, scCall, param, fixedText, ekk0591b003In).getCAANMsgList(EKK0591B003CBSMsg.EKK0591B003CBSMSG1LIST)` // [-> callSC] Dispatch to CBS and extract message list |

**Block 5** — [IF] (EKK0591 output valid) (L1456)

> 料金プラン — Pricing plan

| # | Type | Code |
|---|------|------|
| 1 | IF | `ekk0591b003Out != null && ekk0591b003Out.length > 0` |
| 1.1 | SET | `pplanCd = ekk0591b003Out[0].getString(EKK0591B003CBSMsg1List.PPLAN_CD)` // Extract pricing plan code |
| 1.2 | SET | `stbMdlNm = ekk0591b003Out[0].getString(EKK0591B003CBSMsg1List.PPLAN_NM)` // Extract model name from pricing plan name field |
| 1.3 | ELSE | — |

**Block 5.1** — [ELSE] (EKK0591 output invalid) (L1460)

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return false` // No pricing plan found — data chain broken |

> 上りマッピング処理 (屋内機器型式一意照会) — Upstream mapping processing: indoor device model unique lookup

**Block 6** — [CBS CALL 3: EZM0411A010] (L1464)

Build input mapping and call CBS to retrieve HDD capacity code from the indoor device model agreement table.

| # | Type | Code |
|---|------|------|
| 1 | SET | `ezm0411a010In` = `Object[][] { ... }` // Build 3-row input mapping |
| 1.1 | SET | `[EZM0411A010CBSMsg.TEMPLATEID, TEMPLATE_ID_EZM0411A010]` // Template ID constant |
| 1.2 | SET | `[EZM0411A010CBSMsg.FUNC_CODE, JPCModelConstant.FUNC_CD_1]` // [-> FUNC_CD_1 = "1"] Function code: 1 = lookup |
| 1.3 | SET | `[EZM0411A010CBSMsg.KEY_TAKNKIKI_MODEL_CD, taknkikiModelCd]` // Delivery device model code key |
| 2 | EXEC | `ezm0411a010Out = callSC(handle, scCall, param, fixedText, ezm0411a010In).getCAANMsgList(EZM0411A010CBSMsg.EZM0411A010CBSMSG1LIST)` // [-> callSC] Dispatch to CBS and extract message list |

**Block 7** — [IF] (EZM output valid) (L1468)

| # | Type | Code |
|---|------|------|
| 1 | IF | `ezm0411a010Out != null && ezm0411a010Out.length > 0` |
| 1.1 | SET | `hddCapaCd = ezm0411a010Out[0].getString(EZM0411A010CBSMsg1List.HDD_CAPA_CD)` // Extract HDD capacity code |
| 1.2 | ELSE | — |

**Block 7.1** — [ELSE] (EZM output invalid) (L1472)

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return false` // No HDD capacity found — device model not in agreement table |

> 共通領域に設定 — Set to common area

**Block 8** — [IF/ELSE-IF CHAIN: Target Device Routing] (L1474)

Route the collected STB data to the correct work area slot based on the `target` parameter.

| # | Type | Code |
|---|------|------|
| 1 | IF | `JFUMkmInfoAddFrontiaConstCC.STB_HD1_KIKI.equals(target)` `[-> STB_HD1_KIKI = "stb_hd1_kiki"]` |
| 1.1 | SET | `workArea.setStb_hd1_pcrs_cd(pcrsCd)` |
| 1.2 | SET | `workArea.setStb_hd1_pplan_cd(pplanCd)` |
| 1.3 | SET | `workArea.setStb_hd1_hdd_capa_cd(hddCapaCd)` |
| 1.4 | SET | `workArea.setStb_hd1_model_nm(stbMdlNm)` |
| 2 | ELSE-IF | `JFUMkmInfoAddFrontiaConstCC.STB_HD2_KIKI.equals(target)` `[-> STB_HD2_KIKI = "stb_hd2_kiki"]` |
| 2.1 | SET | `workArea.setStb_hd2_pcrs_cd(pcrsCd)` |
| 2.2 | SET | `workArea.setStb_hd2_pplan_cd(pplanCd)` |
| 2.3 | SET | `workArea.setStb_hd2_hdd_capa_cd(hddCapaCd)` |
| 2.4 | SET | `workArea.setStb_hd2_model_nm(stbMdlNm)` |
| 3 | ELSE-IF | `JFUMkmInfoAddFrontiaConstCC.STB_HD3_KIKI.equals(target)` `[-> STB_HD3_KIKI = "stb_hd3_kiki"]` |
| 3.1 | SET | `workArea.setStb_hd3_pcrs_cd(pcrsCd)` |
| 3.2 | SET | `workArea.setStb_hd3_pplan_cd(pplanCd)` |
| 3.3 | SET | `workArea.setStb_hd3_hdd_capa_cd(hddCapaCd)` |
| 3.4 | SET | `workArea.setStb_hd3_model_nm(stbMdlNm)` |
| 4 | ELSE-IF | `JFUMkmInfoAddFrontiaConstCC.STB_HD4_KIKI.equals(target)` `[-> STB_HD4_KIKI = "stb_hd4_kiki"]` |
| 4.1 | SET | `workArea.setStb_hd4_pcrs_cd(pcrsCd)` |
| 4.2 | SET | `workArea.setStb_hd4_pplan_cd(pplanCd)` |
| 4.3 | SET | `workArea.setStb_hd4_hdd_capa_cd(hddCapaCd)` |
| 4.4 | SET | `workArea.setStb_hd4_model_nm(stbMdlNm)` |
| 5 | ELSE-IF | `JFUMkmInfoAddFrontiaConstCC.STB_HD5_KIKI.equals(target)` `[-> STB_HD5_KIKI = "stb_hd5_kiki"]` |
| 5.1 | SET | `workArea.setStb_hd5_pcrs_cd(pcrsCd)` |
| 5.2 | SET | `workArea.setStb_hd5_pplan_cd(pplanCd)` |
| 5.3 | SET | `workArea.setStb_hd5_hdd_capa_cd(hddCapaCd)` |
| 5.4 | SET | `workArea.setStb_hd5_model_nm(stbMdlNm)` |

> Note: There is no final `else` branch — if `target` does not match any of the five constants, all four `workArea` setters are skipped, but the method still returns `true`. This means the CBS lookups succeed but no data is stored, which may indicate a caller-side validation gap.

**Block 9** — [RETURN] (L1520)

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return true` // All CBS lookups succeeded; STB data is complete |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| STB | Business term | Set-Top Box — cable/digital television receiver device deployed at the subscriber premises. In this system, refers to FTTH (Fiber To The Home) bundled service equipment. |
| PCRS | Field/Acronym | 料金コード (Charge/Pricing Code) — A product/charge classification code representing the monthly fee structure associated with an STB device model. Retrieved from the machine model cost table. |
| PCRS_CD | Field | PCRS Charge Code — The specific charge classification code for the STB device's billing tier. |
| PPLAN_CD | Field | Pricing Plan Code — The pricing plan identifier that determines the customer's subscription tier and associated fees. Retrieved from the pricing plan table. |
| PPLAN_NM | Field | Pricing Plan Name — Used in this method as the source for the STB model name (stbMdlNm), extracted from the pricing plan's name field. |
| HDD_CAPA_CD | Field | HDD Capacity Code — Classification code for the STB device's hard disk drive storage capacity (e.g., 500GB, 1TB). Retrieved from the indoor device model agreement table. |
| PPLAN_CD | Field | Pricing Plan Code — Identifier for the customer's pricing plan tier. |
| TAKNKIKI_MODEL_CD | Field | 送付機器モデルコード (Delivery Device Model Code) — The model identifier for the STB device being registered or updated. Used as the primary lookup key for device-related reference tables. |
| FUNC_CD_1 | Constant | Function Code 1 — Represents the "lookup/registration" operation mode in CBS mappings. Indicates read-only reference table lookup in this context. |
| EKK1621B001CBS | CBS | Machine Model Cost Table CBS — Service component that queries the machine model charges reference table. Returns PCRS code based on operating date and device model code. |
| EKK0591B003CBS | CBS | Pricing Plan Table CBS — Service component that queries the pricing plan reference table. Returns pricing plan code and plan name based on PCRS code. |
| EZM0411A010CBS | CBS | Indoor Device Model Agreement Table CBS — Service component that queries the indoor device model agreement reference table. Returns HDD capacity code based on device model code. |
| Frontia | Business term | Fujitsu's bundled broadband service package combining FTTH internet with television and phone services. The "Frontia" naming convention identifies this specific service line in the system. |
| TEMPLATE_ID_* | Constant | CBS template identifier — Each CBS call includes a template ID constant (e.g., `TEMPLATE_ID_EKK1621B001`) that identifies the CBS mapping template for input/output field routing. |
| workArea | Field | 共通領域 (Common Work Area) — In-memory session object (`JFUMkmInfoAddFrontiaWorkArea`) that accumulates STB device data across multiple method calls during a single service registration transaction. Supports up to 5 STB device slots (HD1-HD5). |
| stb_hd1_kiki through stb_hd5_kiki | Constant | 機器 (Device) slot identifiers — Five possible values for the `target` parameter, each corresponding to a physical STB device slot in a subscriber's installation. HD = Home Device. |
| JFUStrConst.EMPTY | Constant | Empty string constant — Used to initialize return variables before CBS lookups, ensuring no null references if a lookup fails before the short-circuit return. |
| 送付機器 (Soufu Kiki) | Japanese term | Delivery Device — The physical equipment (STB set-top box) delivered to the subscriber for FTTH service installation. |
| 料金コード (Ryokin Code) | Japanese term | Charge/Pricing Code — The billing classification for a service or device. |
| 料金プラン (Ryokin Plan) | Japanese term | Pricing Plan — The customer's subscription plan tier that determines pricing and service features. |
| 屋内機器 (Naikuu Kiki) | Japanese term | Indoor Device — Equipment installed inside the subscriber's premises, as opposed to outdoor line equipment. |
| 一意照会 (Ichi Shoukai) | Japanese term | Unique Lookup — A database query that expects exactly one matching record (unambiguous identification). |

---
