---

# (DD35) Business Logic — JDKCommon08CC.editSTBUpdateMsg() [187 LOC]

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

## 1. Role

### JDKCommon08CC.editSTBUpdateMsg()

This method constructs the CAANMsg request payload for the **STB (Set-Top Box) Information Update CBS** service (`EWCA0010003`). It acts as a message-building utility that transforms raw STB device data carried in `msgList` (extracted from `tmpParamMap`) into a properly formatted CBS request message, applying default/hardcoded values for device category, status, and CCAS card state fields per IT-1-2017-0000118 modifications.

The method handles **14 STB-related fields** in total: it reads values from the incoming `msgList` (an `EWCA0010001CBSMsg1List` message) and copies them into the target `EWCA0010003CBSMsg` template — or sets them to null when empty. For three fields (`STB_TK_SBT_CD`, `STB_STAT_CD`, and `CCAS_CARD_STAT_CD`), the method uses hardcoded constant values (`STB="A0"`, `TEKKYOZUMI="019"`, `MISYOKIKA="019"`) rather than reading from the source message, ensuring consistent state transitions regardless of upstream data.

Design-wise, the method follows the **message builder** and **delegation patterns**: it instantiates a `CAANMsg` object, populates it field-by-field with null-safe checks, wraps it into a `CAANMsg[]` array, and stores the array into `paramMap` under the `TEMPLATE_LIST_KEY` — making it ready for the calling method to invoke the actual CBS via `scCall.run()`.

This is a **shared utility method** used by the `updateSTB()` method within `JDKCommon08CC` itself, which in turn is called during STB information update processing flows (notably from the E-WAN unlink/STB management screen chain). The method is called within an iteration loop over `unlinkMap` (a list of STB records requiring update), meaning it is invoked once per STB device that needs its information refreshed in the home management system.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["editSTBUpdateMsg(paramMap, inMap, tmpParamMap)"])
    
    START --> CREATE_MSG["Create CAANMsg template for EWCA0010003 CBS"]
    CREATE_MSG --> SET_TEMPLATE_ID["Set TEMPLATEID = EWCA0010003"]
    SET_TEMPLATE_ID --> CHECK_INMAP{"inMap != null?"}
    
    CHECK_INMAP -->|Yes| SET_COMMON_FIELDS["Set common fields:
FUNC_CODE=1,
operate_date,
operate_datetime,
operator_id"]
    CHECK_INMAP -->|No| SKIP_FIELDS["Skip common fields"]
    
    SET_COMMON_FIELDS --> GET_MSG_LIST["Get msgList from tmpParamMap
(EWCA0010001CBSMSG1LIST)"]
    SKIP_FIELDS --> GET_MSG_LIST
    
    GET_MSG_LIST --> FIELD1_CHECK{"msgList
STB_TK_MDL_CD
== null/empty?"}
    
    FIELD1_CHECK -->|Yes| FIELD1_NULL["template.setNull(STB_TK_MDL_CD)"]
    FIELD1_CHECK -->|No| FIELD1_SET["template.set(STB_TK_MDL_CD,
msgList.STB_TK_MDL_CD)"]
    
    FIELD1_NULL --> FIELD2_CHECK{"msgList
STB_KK_SEIZO_NO
== null/empty?"}
    FIELD1_SET --> FIELD2_CHECK
    
    FIELD2_CHECK -->|Yes| FIELD2_NULL["template.setNull(STB_KK_SEIZO_NO)"]
    FIELD2_CHECK -->|No| FIELD2_SET["template.set(STB_KK_SEIZO_NO,
msgList.STB_KK_SEIZO_NO)"]
    
    FIELD2_NULL --> FIELD3["template.set(STB_TK_SBT_CD,
JDKStrConst.STB=A0)"]
    FIELD2_SET --> FIELD3
    
    FIELD3 --> FIELD4["template.set(STB_STAT_CD,
JWCStrConst.CD_DIV_WATCH_KIKI_KANRI_STAT_TEKKYOZUMI=019)"]
    
    FIELD4 --> FIELD5_CHECK{"msgList
STB_MATSU_YO_GRPID1
== null/empty?"}
    
    FIELD5_CHECK -->|Yes| FIELD5_NULL["template.setNull(STB_MATSU_YO_GRPID1)"]
    FIELD5_CHECK -->|No| FIELD5_SET["template.set(STB_MATSU_YO_GRPID1,
msgList.STB_MATSU_YO_GRPID1)"]
    
    FIELD5_NULL --> FIELD6_CHECK{"msgList
STB_MATSU_YO_GRPID2
== null/empty?"}
    FIELD5_SET --> FIELD6_CHECK
    
    FIELD6_CHECK -->|Yes| FIELD6_NULL["template.setNull(STB_MATSU_YO_GRPID2)"]
    FIELD6_CHECK -->|No| FIELD6_SET["template.set(STB_MATSU_YO_GRPID2,
msgList.STB_MATSU_YO_GRPID2)"]
    
    FIELD6_NULL --> FIELD7_CHECK{"msgList
STB_MATSU_YO_GRPID3
== null/empty?"}
    FIELD6_SET --> FIELD7_CHECK
    
    FIELD7_CHECK -->|Yes| FIELD7_NULL["template.setNull(STB_MATSU_YO_GRPID3)"]
    FIELD7_CHECK -->|No| FIELD7_SET["template.set(STB_MATSU_YO_GRPID3,
msgList.STB_MATSU_YO_GRPID3)"]
    
    FIELD7_NULL --> FIELD8_CHECK{"msgList
STB_MATSU_YO_GRPID4
== null/empty?"}
    FIELD7_SET --> FIELD8_CHECK
    
    FIELD8_CHECK -->|Yes| FIELD8_NULL["template.setNull(STB_MATSU_YO_GRPID4)"]
    FIELD8_CHECK -->|No| FIELD8_SET["template.set(STB_MATSU_YO_GRPID4,
msgList.STB_MATSU_YO_GRPID4)"]
    
    FIELD8_NULL --> FIELD9_CHECK{"msgList
STB_MATSU_YO_GRPID5
== null/empty?"}
    FIELD8_SET --> FIELD9_CHECK
    
    FIELD9_CHECK -->|Yes| FIELD9_NULL["template.setNull(STB_MATSU_YO_GRPID5)"]
    FIELD9_CHECK -->|No| FIELD9_SET["template.set(STB_MATSU_YO_GRPID5,
msgList.STB_MATSU_YO_GRPID5)"]
    
    FIELD9_NULL --> FIELD10_CHECK{"msgList
STB_MATSU_YO_GRPID6
== null/empty?"}
    FIELD9_SET --> FIELD10_CHECK
    
    FIELD10_CHECK -->|Yes| FIELD10_NULL["template.setNull(STB_MATSU_YO_GRPID6)"]
    FIELD10_CHECK -->|No| FIELD10_SET["template.set(STB_MATSU_YO_GRPID6,
msgList.STB_MATSU_YO_GRPID6)"]
    
    FIELD10_NULL --> FIELD11_CHECK{"tmpParamMap
ctrl_area_cd
== null/empty?"}
    FIELD10_SET --> FIELD11_CHECK
    
    FIELD11_CHECK -->|Yes| FIELD11_NULL["template.setNull(CTL_AREA_CD)"]
    FIELD11_CHECK -->|No| FIELD11_SET["template.set(CTL_AREA_CD,
tmpParamMap.ctrl_area_cd)"]
    
    FIELD11_NULL --> FIELD12_CHECK{"msgList
STB_UPD_DTTM
== null/empty?"}
    FIELD11_SET --> FIELD12_CHECK
    
    FIELD12_CHECK -->|Yes| FIELD12_NULL["template.setNull(STB_UPD_DTTM)"]
    FIELD12_CHECK -->|No| FIELD12_SET["template.set(STB_UPD_DTTM,
msgList.STB_UPD_DTTM)"]
    
    FIELD12_NULL --> FIELD13_CHECK{"msgList
CCAS_CAST_UPD_DTTM
== null/empty?"}
    FIELD12_SET --> FIELD13_CHECK
    
    FIELD13_CHECK -->|Yes| FIELD13_NULL["template.setNull(CCAS_UPD_DTTM)"]
    FIELD13_CHECK -->|No| FIELD13_SET["template.set(CCAS_UPD_DTTM,
msgList.CCAS_CAST_UPD_DTTM)"]
    
    FIELD13_NULL --> FIELD14["template.set(CCAS_CARD_STAT_CD,
JWCStrConst.CD_DIV_CCAS_CARD_KANRI_STAT_MISYOKIKA=019)"]
    FIELD13_SET --> FIELD14
    
    FIELD14 --> WRAP_TEMPLATE["Wrap template into
CAANMsg array (size=1)"]
    WRAP_TEMPLATE --> PUT_TEMPLATE["Put CAANMsg array into
paramMap (TEMPLATE_LIST_KEY)"]
    PUT_TEMPLATE --> RETURN_PARAM["Return paramMap"]
    RETURN_PARAM --> END(["End"])
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `paramMap` | `HashMap<String, Object>` | Request parameter map for the CBS call. Used as the output container — the method stores the constructed `CAANMsg[]` template list under the `TEMPLATE_LIST_KEY` (per `JCMConstants`) so the caller can pass it to `scCall.run()`. Also carries common operational data (transaction ID, use-case ID, client hostname, IP address, screen ID) set by the caller before invoking this method. |
| 2 | `inMap` | `HashMap` | Functional context map. Used solely to determine whether common operational fields (`FUNC_CODE`, `operate_date`, `operate_datetime`, `operator_id`) should be set on the template. If `inMap` is non-null, the method sets `FUNC_CODE` to `"1"` (per the code comment "機能コード（デフォルト：1）") and copies the operate date/time and operator ID from `tmpParamMap`. If `inMap` is null, these fields are skipped entirely. |
| 3 | `tmpParamMap` | `HashMap<String, Object>` | Temporary parameter map carrying both the input `EWCA0010001CBSMSG1LIST` message (accessed via key `"EWCA0010001CBSMSG1LIST"`) and auxiliary control data (`ctrl_area_cd`, `operate_date_key`, `operate_datetime_key`, `operator_id`). The `EWCA0010001CBSMSG1LIST` message contains the raw STB device data (model code, serial number, status codes, download group IDs) that this method transforms into the CBS request. |

**External state / instance fields referenced:** None — this method is purely stateless and operates only on its parameters and local variables.

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `template.set(EWCA0010003CBSMsg.TEMPLATEID, "EWCA0010003")` | EWCA0010003CBS | - | Sets template ID on CAANMsg payload |
| - | `template.set(EWCA0010003CBSMsg.FUNC_CODE, "1")` | EWCA0010003CBS | - | Sets function code on CAANMsg payload (only if inMap != null) |
| - | `template.set(EWCA0010003CBSMsg.OPERATEDATE, ...)` | EWCA0010003CBS | - | Sets operation date on CAANMsg payload |
| - | `template.set(EWCA0010003CBSMsg.OPERATEDATETIME, ...)` | EWCA0010003CBS | - | Sets operation datetime on CAANMsg payload |
| - | `template.set(EWCA0010003CBSMsg.OPERATORID, ...)` | EWCA0010003CBS | - | Sets operator ID on CAANMsg payload |
| - | `template.setNull(...)` | EWCA0010003CBS | - | Sets null on CAANMsg fields when source data is empty (applied to 14 fields) |
| - | `template.set(...)` | EWCA0010003CBS | - | Sets non-null values on CAANMsg fields from msgList or hardcoded constants |

**Analysis Notes:**

This method performs **pure message construction** — it does NOT call any external SC (Service Component) or CBS (Common Business Service) directly. All operations are internal `CAANMsg.set()` and `CAANMsg.setNull()` calls that populate an in-memory message object. The actual data access (read/update of STB records in the home management system) is performed by the CBS service `EWCA0010003CBS` which is invoked by the **caller** (`JDKCommon08CC.updateSTB()` method) via `scCall.run(paramMap, handle)` — passing the `paramMap` that was populated by this method.

The CBS message schema `EWCA0010003CBSMsg` (template ID: `"EWCA0010003"`) corresponds to the **STB Information Update CBS** service, which is responsible for updating STB device information in the home management system (家管局系).

## 5. Dependency Trace

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

No screen/batch entry points found within 8 hops. Direct callers found: 1 method.
Terminal operations from this method: `setNull` [-], `set` [-], `set` [-], `set` [-], `set` [-], `set` [-], `set` [-], `set` [-], `set` [-], `set` [-], `set` [-], `set` [-], `set` [-], `set` [-], `set` [-], `set` [-], `set` [-], `set` [-], `set` [-], `set` [-], `set` [-], `set` [-], `set` [-], `set` [-], `set` [-], `set` [-], `set` [-], `set` [-], `set` [-], `set` [-]

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | `JDKCommon08CC.updateSTB()` | `updateSTB()` → `editSTBUpdateMsg(paramMap, inMap, tmpParamMap)` → `paramMap.put(TEMPLATE_LIST_KEY, templates)` | `EWCA0010003CBS` (STB Update CBS) — called by `scCall.run(paramMap, handle)` in `updateSTB()` (L1958) |

**Call Chain Detail:**
The caller `JDKCommon08CC.updateSTB()` is an STB information update processing method that iterates over a list of STB records (`unlinkMap`) requiring update. For each record, it:
1. Builds common SC input data from the request header and control map.
2. Calls `editSTBUpdateMsg()` to construct the STB update CBS request payload.
3. Executes the CBS call via `scCall.run(paramMap, handle)` (line 1958).
4. Processes the result via `editResultRrr(result, param)`.

## 6. Per-Branch Detail Blocks

**Block 1** — [SET] `CAANMsg template = new CAANMsg(EWCA0010003CBSMsg.class.getName())` (L3151)

> Creates a new CAANMsg payload object for the STB Update CBS service (EWCA0010003).

| # | Type | Code |
|---|------|------|
| 1 | SET | `template = new CAANMsg(EWCA0010003CBSMsg.class.getName())` |
| 2 | SET | `template.set(EWCA0010003CBSMsg.TEMPLATEID, "EWCA0010003")` // Template ID = EWCA0010003 |

---

**Block 2** — [IF] `inMap != null` (L3153)

> Conditional block that sets operational/common fields on the template only when `inMap` is non-null. This ensures the CBS request carries operational context (function code, operation date/time, operator ID) when provided.

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.set(EWCA0010003CBSMsg.FUNC_CODE, "1")` // Function code (default: 1) |
| 2 | SET | `template.set(EWCA0010003CBSMsg.OPERATEDATE, tmpParamMap.get("operate_date_key"))` // Operation date |
| 3 | SET | `template.set(EWCA0010003CBSMsg.OPERATEDATETIME, tmpParamMap.get("operate_datetime_key"))` // Operation datetime |
| 4 | SET | `template.set(EWCA0010003CBSMsg.OPERATORID, tmpParamMap.get("operator_id"))` // Operator ID |

**Block 2.1** — [COMMENT - DELETED CODE] STB/CCAS update timestamp fields (L3160–3163)

> Code commented out per ST-2017-0000015 DEL: Previously set `STB_UPD_DTTM` and `CCAS_UPD_DTTM` via `JCCBPCommon.getSysDateTimeStamp()` here; now handled in Block 6.

| # | Type | Code |
|---|------|------|
| 1 | COMMENT | `// STB device update date` (DEL START/END: ST-2017-0000015) |
| 2 | COMMENT | `// CCAS device update timestamp` |

---

**Block 3** — [SET] Retrieve msgList from tmpParamMap (L3167)

> Extracts the input STB device data message from tmpParamMap. This `msgList` (`EWCA0010001CBSMsg1List`) contains the raw STB device information that will be transformed into the CBS request.

| # | Type | Code |
|---|------|------|
| 1 | SET | `msgList = (CAANMsg)tmpParamMap.get("EWCA0010001CBSMSG1LIST")` |

---

**Block 4** — [IF/ELSE] `STB_TK_MDL_CD` — STB device model code (L3171–3179)

> Checks if the STB device model code is null or empty in msgList. If so, sets the field to null on the template; otherwise copies the value from msgList.

| # | Type | Code |
|---|------|------|
| 1 | COND | `msgList.getString(EWCA0010001CBSMsg1List.STB_TK_MDL_CD) == null || "".equals(msgList.getString(...))` |
| 2 | SET | `template.setNull(EWCA0010003CBSMsg.STB_TK_MDL_CD)` // When null/empty |
| 3 | SET | `template.set(EWCA0010003CBSMsg.STB_TK_MDL_CD, msgList.getString(...))` // When present |

---

**Block 5** — [IF/ELSE] `STB_KK_SEIZO_NO` — STB device serial number (L3182–3190)

> Checks if the STB device serial number (製造番号) is null or empty. Null-safe copy from msgList to template.

| # | Type | Code |
|---|------|------|
| 1 | COND | `msgList.getString(EWCA0010001CBSMsg1List.STB_KK_SEIZO_NO) == null || "".equals(msgList.getString(...))` |
| 2 | SET | `template.setNull(EWCA0010003CBSMsg.STB_KK_SEIZO_NO)` // When null/empty |
| 3 | SET | `template.set(EWCA0010003CBSMsg.STB_KK_SEIZO_NO, msgList.getString(...))` // When present |

---

**Block 6** — [SET] `STB_TK_SBT_CD` — STB device category code (L3193–3202)

> STB device category (家中機器種別コード). Modified per ST-2017-0000015: previously read from `tmpParamMap.get("taknkiki_sbt_cd")`; now hardcoded to `JDKStrConst.STB = "A0"`. This ensures all STB update messages consistently use the STB device category code.

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.set(EWCA0010003CBSMsg.STB_TK_SBT_CD, JDKStrConst.STB="A0")` [-> JDKStrConst.STB="A0" (JDKStrConst.java:403)] |
| 2 | COMMENT | `// ST-2017-0000015 MOD: replaced conditional read from tmpParamMap` |

---

**Block 7** — [SET] `STB_STAT_CD` — STB status code (L3205–3213)

> STB status code. Modified per IT1-2017-0000118: previously read directly from `msgList.getString(STB_STAT_CD)`; now hardcoded to `JWCStrConst.CD_DIV_WATCH_KIKI_KANRI_STAT_TEKKYOZUMI = "019"` (ready-to-deliver status). This ensures STB records are always set to "ready for delivery" status during the update, regardless of upstream status.

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.set(EWCA0010003CBSMsg.STB_STAT_CD, JWCStrConst.CD_DIV_WATCH_KIKI_KANRI_STAT_TEKKYOZUMI="019")` [-> JWCStrConst.CD_DIV_WATCH_KIKI_KANRI_STAT_TEKKYOZUMI="019" (JWCStrConst.java:81)] |
| 2 | COMMENT | `// IT1-2017-0000118 MOD: replaced direct copy from msgList with hardcoded value` |

---

**Block 8** — [IF/ELSE] `STB_MATSU_YO_GRPID1` — STB download group ID 1 (L3216–3224)

> Downloads/pre-load group ID 1. Null-safe copy from msgList to template.

| # | Type | Code |
|---|------|------|
| 1 | COND | `msgList.getString(EWCA0010001CBSMsg1List.STB_MATSU_YO_GRPID1) == null || "".equals(msgList.getString(...))` |
| 2 | SET | `template.setNull(EWCA0010003CBSMsg.STB_MATSU_YO_GRPID1)` // When null/empty |
| 3 | SET | `template.set(EWCA0010003CBSMsg.STB_MATSU_YO_GRPID1, msgList.getString(...))` // When present |

---

**Block 9** — [IF/ELSE] `STB_MATSU_YO_GRPID2` — STB download group ID 2 (L3227–3235)

> Downloads/pre-load group ID 2. Null-safe copy from msgList to template.

| # | Type | Code |
|---|------|------|
| 1 | COND | `msgList.getString(EWCA0010001CBSMsg1List.STB_MATSU_YO_GRPID2) == null || "".equals(msgList.getString(...))` |
| 2 | SET | `template.setNull(EWCA0010003CBSMsg.STB_MATSU_YO_GRPID2)` // When null/empty |
| 3 | SET | `template.set(EWCA0010003CBSMsg.STB_MATSU_YO_GRPID2, msgList.getString(...))` // When present |

---

**Block 10** — [IF/ELSE] `STB_MATSU_YO_GRPID3` — STB download group ID 3 (L3238–3246)

> Downloads/pre-load group ID 3. Null-safe copy from msgList to template.

| # | Type | Code |
|---|------|------|
| 1 | COND | `msgList.getString(EWCA0010001CBSMsg1List.STB_MATSU_YO_GRPID3) == null || "".equals(msgList.getString(...))` |
| 2 | SET | `template.setNull(EWCA0010003CBSMsg.STB_MATSU_YO_GRPID3)` // When null/empty |
| 3 | SET | `template.set(EWCA0010003CBSMsg.STB_MATSU_YO_GRPID3, msgList.getString(...))` // When present |

---

**Block 11** — [IF/ELSE] `STB_MATSU_YO_GRPID4` — STB download group ID 4 (L3249–3257)

> Downloads/pre-load group ID 4. Null-safe copy from msgList to template.

| # | Type | Code |
|---|------|------|
| 1 | COND | `msgList.getString(EWCA0010001CBSMsg1List.STB_MATSU_YO_GRPID4) == null || "".equals(msgList.getString(...))` |
| 2 | SET | `template.setNull(EWCA0010003CBSMsg.STB_MATSU_YO_GRPID4)` // When null/empty |
| 3 | SET | `template.set(EWCA0010003CBSMsg.STB_MATSU_YO_GRPID4, msgList.getString(...))` // When present |

---

**Block 12** — [IF/ELSE] `STB_MATSU_YO_GRPID5` — STB download group ID 5 (L3260–3268)

> Downloads/pre-load group ID 5. Null-safe copy from msgList to template.

| # | Type | Code |
|---|------|------|
| 1 | COND | `msgList.getString(EWCA0010001CBSMsg1List.STB_MATSU_YO_GRPID5) == null || "".equals(msgList.getString(...))` |
| 2 | SET | `template.setNull(EWCA0010003CBSMsg.STB_MATSU_YO_GRPID5)` // When null/empty |
| 3 | SET | `template.set(EWCA0010003CBSMsg.STB_MATSU_YO_GRPID5, msgList.getString(...))` // When present |

---

**Block 13** — [IF/ELSE] `STB_MATSU_YO_GRPID6` — STB download group ID 6 (L3271–3279)

> Downloads/pre-load group ID 6. Null-safe copy from msgList to template.

| # | Type | Code |
|---|------|------|
| 1 | COND | `msgList.getString(EWCA0010001CBSMsg1List.STB_MATSU_YO_GRPID6) == null || "".equals(msgList.getString(...))` |
| 2 | SET | `template.setNull(EWCA0010003CBSMsg.STB_MATSU_YO_GRPID6)` // When null/empty |
| 3 | SET | `template.set(EWCA0010003CBSMsg.STB_MATSU_YO_GRPID6, msgList.getString(...))` // When present |

---

**Block 14** — [IF/ELSE] `CTL_AREA_CD` — Control area code from tmpParamMap (L3282–3290)

> Control area code (制御エリアコード). Read from `tmpParamMap` (not msgList), null-safe copy to template.

| # | Type | Code |
|---|------|------|
| 1 | COND | `tmpParamMap.get("ctrl_area_cd") == null || "".equals(tmpParamMap.get("ctrl_area_cd"))` |
| 2 | SET | `template.setNull(EWCA0010003CBSMsg.CTL_AREA_CD)` // When null/empty |
| 3 | SET | `template.set(EWCA0010003CBSMsg.CTL_AREA_CD, tmpParamMap.get("ctrl_area_cd"))` // When present |

---

**Block 15** — [IF/ELSE] `STB_UPD_DTTM` — STB device update datetime (L3294–3302)

> STB device update date/time (STB家用機器更新日時). Added per ST-2017-0000015 ADD: previously set via `JCCBPCommon.getSysDateTimeStamp()` in Block 2.1, now read from msgList to carry the actual update timestamp from the source data.

| # | Type | Code |
|---|------|------|
| 1 | COND | `msgList.getString(EWCA0010001CBSMsg1List.STB_UPD_DTTM) == null || "".equals(msgList.getString(...))` |
| 2 | SET | `template.setNull(EWCA0010003CBSMsg.STB_UPD_DTTM)` // When null/empty |
| 3 | SET | `template.set(EWCA0010003CBSMsg.STB_UPD_DTTM, msgList.getString(...))` // When present |
| 4 | COMMENT | `// ST-2017-0000015 ADD: moved from JCCBPCommon.getSysDateTimeStamp() to msgList copy` |

---

**Block 16** — [IF/ELSE] `CCAS_UPD_DTTM` — CCAS device update datetime (L3305–3313)

> CCAS (Conditional Access System) device update datetime. Added per ST-2017-0000015 ADD: mirrors STB_UPD_DTTM for the CCAS component.

| # | Type | Code |
|---|------|------|
| 1 | COND | `msgList.getString(EWCA0010001CBSMsg1List.CCAS_CAST_UPD_DTTM) == null || "".equals(msgList.getString(...))` |
| 2 | SET | `template.setNull(EWCA0010003CBSMsg.CCAS_UPD_DTTM)` // When null/empty |
| 3 | SET | `template.set(EWCA0010003CBSMsg.CCAS_UPD_DTTM, msgList.getString(...))` // When present |
| 4 | COMMENT | `// ST-2017-0000015 ADD: CCAS cast update datetime` |

---

**Block 17** — [SET] `CCAS_CARD_STAT_CD` — CCAS card management status code (L3316–3324)

> CCAS card management status code (CCASカードステータスコード). Modified per IT1-2017-0000118: previously read from msgList; now hardcoded to `JWCStrConst.CD_DIV_CCAS_CARD_KANRI_STAT_MISYOKIKA = "019"` (not-yet-installed status). Ensures consistent CCAS card state during STB update.

| # | Type | Code |
|---|------|------|
| 1 | SET | `template.set(EWCA0010003CBSMsg.CCAS_CARD_STAT_CD, JWCStrConst.CD_DIV_CCAS_CARD_KANRI_STAT_MISYOKIKA="019")` [-> JWCStrConst.CD_DIV_CCAS_CARD_KANRI_STAT_MISYOKIKA="019" (JWCStrConst.java:121)] |
| 2 | COMMENT | `// IT1-2017-0000118 MOD: replaced direct copy from msgList with hardcoded value` |

---

**Block 18** — [SET] Wrap and store template (L3326–3329)

> Finalizes the message by wrapping the single template into a `CAANMsg[]` array and storing it in `paramMap` under the `TEMPLATE_LIST_KEY`, making it available for the CBS invocation by the caller.

| # | Type | Code |
|---|------|------|
| 1 | SET | `templates = new CAANMsg[1]` |
| 2 | SET | `templates[0] = template` |
| 3 | EXEC | `paramMap.put(JCMConstants.TEMPLATE_LIST_KEY, templates)` |
| 4 | RETURN | `return paramMap` |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| STB | Acronym | Set-Top Box — set-top box device for cable/satellite TV signal reception |
| CCAS | Acronym | Common Card-based Conditional Access System — smart card-based conditional access system for pay-TV |
| EWCA0010003 | CBS ID | STB Information Update CBS — service that updates STB device information in the home management system |
| EWCA0010001CBSMSG1LIST | CBS Message | STB device data input message — carries raw STB device information (model, serial, status, download groups) |
| CAANMsg | Technical | Causal Network ANd Message — an internal message/payload class used to construct CBS request and response objects |
| SC (ServiceComponent) | Technical | Service Component — a service layer component invoked via `ServiceComponentRequestInvoker` |
| CBS (Common Business Service) | Technical | Common Business Service — the integration-layer service that interfaces with the home management system |
| FUNC_CODE | Field | Function code — identifies the type of CBS operation; `"1"` is the default for STB update |
| `operate_date_key` | Field | Operation date — the business date when the operation is performed, sourced from tmpParamMap |
| `operate_datetime_key` | Field | Operation datetime — the full timestamp when the operation is performed, sourced from tmpParamMap |
| `operator_id` | Field | Operator ID — the ID of the operator performing the operation |
| `ctrl_area_cd` | Field | Control area code — the geographic/logical control area identifier for the STB device |
| STB_TK_MDL_CD | Field | STB home device model code — identifies the model of the STB set-top box |
| STB_KK_SEIZO_NO | Field | STB device serial number — the manufacturing serial number of the STB unit |
| STB_TK_SBT_CD | Field | STB home device category code — classifies the device type; hardcoded to `"A0"` (STB) |
| STB_STAT_CD | Field | STB status code — the current management status of the STB; hardcoded to `"019"` (ready-to-deliver: 適応済み) |
| STB_MATSU_YO_GRPID1-6 | Fields | STB download/pre-load group IDs — six group identifiers for content/downloads associated with the STB |
| CCAS_CARD_STAT_CD | Field | CCAS card management status code — the management status of the CCAS card; hardcoded to `"019"` (not yet installed: 未消化) |
| STB_UPD_DTTM | Field | STB device update datetime — the date/time the STB device record was last updated |
| CCAS_UPD_DTTM | Field | CCAS device update datetime — the date/time the CCAS device record was last updated |
| JDKStrConst.STB | Constant | `"A0"` — default STB device category code |
| CD_DIV_WATCH_KIKI_KANRI_STAT_TEKKYOZUMI | Constant | `"019"` — status indicating "ready to deliver" (適応済み) for watch/home device management |
| CD_DIV_CCAS_CARD_KANRI_STAT_MISYOKIKA | Constant | `"019"` — status indicating "not yet installed/absent" (未消化) for CCAS card management |
| TEMPLATE_LIST_KEY | Constant | Key used in paramMap to store the `CAANMsg[]` template array for CBS invocation |
| `EWCA0010003` | Constant | Template ID for the STB Information Update CBS |
| `unlinkMap` | Parameter | List of STB records requiring update — records that were unlinked/disassociated and need their information refreshed |
| home management system | Domain | 家管局系 — the internal home customer management system that tracks STB device inventory and status |
| 適応済み (TEKKYOZUMI) | Domain term | Ready to deliver — the STB status indicating the device has been adapted/prepared and is ready for delivery/installation |
| 未消化 (MISYOKIKA) | Domain term | Not yet installed/consumed — the CCAS card status indicating the card has not yet been installed in a device |

---