# (DD38) Business Logic — JDKCommon08CC.editOrderSendMsg() [147 LOC]

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

## 1. Role

### JDKCommon08CC.editOrderSendMsg()

This method constructs and populates the message parameters required for the **View Control Order Send Service** (視聴制御オーダ送信サービス — the service that transmits view control orders to the set-top box packager system). It builds a `CAANMsg` template using the `EWC0011C010CBSMsg` schema, populates operational metadata (function code, operating date/time, operator ID), and configures the order metadata (control code, control type, control mode) before mapping terminal equipment details from a message list into the template.

The method specifically handles **order transmission** (送信) — the final step in the unlink workflow where a deactivated STB/C-CAS relationship is reported to the broadcast control system. It always sets the **View Control Order Code** (`WCTRL_ORDER_CD`) to `"02"`, which represents **unregistration/unlink** (非登録（アンリンク）・撤去) — indicating that the terminal equipment is being deregistered or removed from active service.

This method follows a **builder pattern** — it creates a message template, sets each field independently with null-safe guards, then packages the resulting `CAANMsg` array into the parameter map under `JCMConstants.TEMPLATE_LIST_KEY` for downstream SC (Service Component) invocation. The method is a **shared utility** called from the `unlink()` method and likely from other view-control-related flows, acting as a message assembler rather than performing data persistence itself.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["editOrderSendMsg param, inMap, tmpParamMap"])
    CreateTemplate["Create CAANMsg template EWC0011C010CBSMsg"]
    SetTemplateID["template.set TEMPLATEID = EWC0011C010"]
    CheckInMapNull{"inMap != null?"}
    SetFuncCode["template.set FUNC_CODE = 1"]
    SetOperDate["template.set OPERATEDATE from tmpParamMap"]
    SetOperDatetime["template.set OPERATEDATETIME from tmpParamMap"]
    SetOperatorID["template.set OPERATORID from tmpParamMap"]
    SetWctrlOrder["template.set WCTRL_ORDER_CD = 02"]
    SetCtrlType["template.set CTRL_TYPE_CD = 0"]
    SetCtrlMode["template.set CTRL_MODE_CD = 1"]
    SetNullRemux1["template.setNull EWC0011D010CBSMSG1LIST"]
    SetNullTM0["template.setNull EWC0011D010CBSMSG2LIST"]
    SetNullTM1["template.setNull EWC0011D010CBSMSG3LIST"]
    SetNullTM2["template.setNull EWC0011D010CBSMSG4LIST"]
    SetNullTM3["template.setNull EWC0011D010CBSMSG5LIST"]
    SetNullChrgFlg["template.setNull CHRG_FLG"]
    SetNullGrpID["template.setNull EWC0011D010CBSMSG6LIST"]
    SetNullCCAS["template.setNull CCAS_SHKKA_CMD_HAK_FLG"]
    SetNullReSet["template.setNull RE_SETTE_FLG"]
    CheckKyokuNull{"kyoku_cd is null or empty?"}
    SetNullKyoku["template.setNull KYOKU_CD"]
    SetKyoku["template.set KYOKU_CD from tmpParamMap"]
    CheckCtrlAreaNull{"ctrl_area_cd is null or empty?"}
    SetNullCtrlArea["template.setNull CTRL_AREA_CD"]
    SetCtrlArea["template.set CTRL_AREA_CD from tmpParamMap"]
    CheckCtrlYokyuNull{"ctrl_yokyu_key is null or empty?"}
    SetNullCtrlYokyu["template.setNull CTRL_YOKYU_KEY"]
    SetCtrlYokyu["template.set CTRL_YOKYU_KEY from tmpParamMap"]
    GetMsgList["Get EWCA0010001CBSMSG1LIST from tmpParamMap"]
    CheckStbIdNull{"STBID is null or empty?"}
    SetNullStbId["template.setNull STB_ID"]
    SetStbId["template.set STB_ID from msgList"]
    CheckSeizoNoNull{"STB_KK_SEIZO_NO is null or empty?"}
    SetNullSeizoNo["template.setNull STB_KIKI_SEIZO_NO"]
    SetSeizoNo["template.set STB_KIKI_SEIZO_NO from msgList"]
    CheckCtrlModelNull{"STB_MAKER_KOYU_CTL_MDL_CD is null or empty?"}
    SetNullCtrlModel["template.setNull STB_CTRL_MODEL_CD"]
    SetCtrlModel["template.set STB_CTRL_MODEL_CD from msgList"]
    CheckCasNaizoNull{"STB_NAIZOCAS_CD is null or empty?"}
    SetNullCasNaizo["template.setNull STB_CAS_NAIZO_FLG"]
    SetCasNaizo["template.set STB_CAS_NAIZO_FLG from msgList"]
    CheckCcascNoNull{"CCAS_KK_SEIZO_NO is null or empty?"}
    SetNullCcascNo["template.setNull CCAS_CARD_NO"]
    SetCcascNo["template.set CCAS_CARD_NO from msgList"]
    CheckBcasNoNull{"BCAS_KK_SEIZO_NO is null or empty?"}
    SetNullBcasNo["template.setNull BCAS_CARD_NO"]
    SetBcasNo["template.set BCAS_CARD_NO from msgList"]
    CreateTemplateArray["Create CAANMsg array templates new CAANMsg[1]"]
    SetTemplateList["paramMap.put TEMPLATE_LIST_KEY templates"]
    RETURN(["Return paramMap"])

    START --> CreateTemplate
    CreateTemplate --> SetTemplateID
    SetTemplateID --> CheckInMapNull
    CheckInMapNull -- Yes --> SetFuncCode
    SetFuncCode --> SetOperDate
    SetOperDate --> SetOperatorID
    SetOperatorID --> SetWctrlOrder
    SetWctrlOrder --> SetCtrlType
    SetCtrlType --> SetCtrlMode
    SetCtrlMode --> SetNullRemux1
    SetNullRemux1 --> SetNullTM0
    SetNullTM0 --> SetNullTM1
    SetNullTM1 --> SetNullTM2
    SetNullTM2 --> SetNullTM3
    SetNullTM3 --> SetNullChrgFlg
    SetNullChrgFlg --> SetNullGrpID
    SetNullGrpID --> SetNullCCAS
    SetNullCCAS --> SetNullReSet
    SetNullReSet --> CheckKyokuNull
    CheckInMapNull -- No --> CheckKyokuNull
    CheckKyokuNull -- Yes --> SetNullKyoku
    CheckKyokuNull -- No --> SetKyoku
    SetNullKyoku --> CheckCtrlAreaNull
    SetKyoku --> CheckCtrlAreaNull
    CheckCtrlAreaNull -- Yes --> SetNullCtrlArea
    CheckCtrlAreaNull -- No --> SetCtrlArea
    SetNullCtrlArea --> CheckCtrlYokyuNull
    SetCtrlArea --> CheckCtrlYokyuNull
    CheckCtrlYokyuNull -- Yes --> SetNullCtrlYokyu
    CheckCtrlYokyuNull -- No --> SetCtrlYokyu
    SetNullCtrlYokyu --> GetMsgList
    SetCtrlYokyu --> GetMsgList
    GetMsgList --> CheckStbIdNull
    CheckStbIdNull -- Yes --> SetNullStbId
    CheckStbIdNull -- No --> SetStbId
    SetNullStbId --> CheckSeizoNoNull
    SetStbId --> CheckSeizoNoNull
    CheckSeizoNoNull -- Yes --> SetNullSeizoNo
    CheckSeizoNoNull -- No --> SetSeizoNo
    SetNullSeizoNo --> CheckCtrlModelNull
    SetSeizoNo --> CheckCtrlModelNull
    CheckCtrlModelNull -- Yes --> SetNullCtrlModel
    CheckCtrlModelNull -- No --> SetCtrlModel
    SetNullCtrlModel --> CheckCasNaizoNull
    SetCtrlModel --> CheckCasNaizoNull
    CheckCasNaizoNull -- Yes --> SetNullCasNaizo
    CheckCasNaizoNull -- No --> SetCasNaizo
    SetNullCasNaizo --> CheckCcascNoNull
    SetCasNaizo --> CheckCcascNoNull
    CheckCcascNoNull -- Yes --> SetNullCcascNo
    CheckCcascNoNull -- No --> SetCcascNo
    SetNullCcascNo --> CheckBcasNoNull
    SetCcascNo --> CheckBcasNoNull
    CheckBcasNoNull -- Yes --> SetNullBcasNo
    CheckBcasNoNull -- No --> SetBcasNo
    SetNullBcasNo --> CreateTemplateArray
    SetBcasNo --> CreateTemplateArray
    CreateTemplateArray --> SetTemplateList
    SetTemplateList --> RETURN
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `paramMap` | `HashMap<String, Object>` | The return-value parameter map that carries the assembled `CAANMsg` template array. It also carries common SC input data such as transaction ID, use case ID, operator session info, and client host details. After the method returns, the SC framework reads the template array from this map to execute the CBS service call. |
| 2 | `inMap` | `HashMap` | An optional operational context map. When non-null, it signals that the request originates from a screen/user session and requires operational metadata (function code, operating date/time, operator ID) to be written into the message template. A null `inMap` skips these operational fields entirely. |
| 3 | `tmpParamMap` | `HashMap<String, Object>` | The temporary parameter map carrying runtime contextual data. It provides: `kyoku_cd` (office/branch code), `ctrl_area_cd` (control area code), `ctrl_yokyu_key` (control request key), and the `EWCA0010001CBSMSG1LIST` message object containing STB/CCAS/BCAS terminal device details. |

**External state and constants used:**

| Field / Constant | Type | Business Description |
|-----------------|------|---------------------|
| `JWCStrConst.CD_DIV_WCTRL_ORDER_UNSET` | `String` = `"02"` [-> `JWCStrConst.java:441`] | View Control Order Code for unregistration/unlink — hardcoded to always set this value, indicating the terminal equipment is being deregistered. |
| `JCMConstants.TEMPLATE_LIST_KEY` | `String` | The key under which the `CAANMsg[]` template array is stored in `paramMap` for the SC framework to pick up and execute. |
| `EWC0011C010CBSMsg` constants | `String` fields | Template message field identifiers used as keys in `template.set()` / `template.setNull()` calls (TEMPLATEID, FUNC_CODE, OPERATEDATE, OPERATEDATETIME, OPERATORID, WCTRL_ORDER_CD, CTRL_TYPE_CD, CTRL_MODE_CD, KYOKU_CD, CTRL_AREA_CD, CTRL_YOKYU_KEY, STB_ID, STB_KIKI_SEIZO_NO, STB_CTRL_MODEL_CD, STB_CAS_NAIZO_FLG, CCAS_CARD_NO, BCAS_CARD_NO, and all detail list fields). |
| `EWCA0010001CBSMsg1List` constants | `String` fields | Message list field identifiers for reading STB/CCAS/BCAS data (STBID, STB_KK_SEIZO_NO, STB_MAKER_KOYU_CTL_MDL_CD, STB_NAIZOCAS_CD, CCAS_KK_SEIZO_NO, BCAS_KK_SEIZO_NO). |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `JESC0101B010TPMA.getString` | JESC0101B010TPMA | - | Calls `setNull` in `JESC0011C010CBSMsg` detail list fields (Remux TM domains 0-3, billing flag, group ID, CCAS initialization flag, re-setup flag) |
| - | `JESC0101B020TPMA.getString` | JESC0101B020TPMA | - | Calls `setNull` / `set` in `JESC0011C010CBSMsg` template fields (func code, operate date/time, operator, ctrl codes, station, control area, ctrl request, STB/CCAS/BCAS IDs) |
| R | `SCW00701SFLogic.getName` | SCW00701SFLogic | - | Calls `getString` in `SCW00701CBSMsg1List` for STB and CCAS data retrieval (STBID, STB_KK_SEIZO_NO, STB_MAKER_KOYU_CTL_MDL_CD, STB_NAIZOCAS_CD, CCAS_KK_SEIZO_NO, BCAS_KK_SEIZO_NO) |

**Detailed method call analysis:**

This method does **not** directly invoke any SC/CBS service components or perform database CRUD operations. Instead, it is a **message assembly utility** that constructs a `CAANMsg` template with populated fields. The actual service call happens in the caller (`unlink`) which uses `scCall.run(paramMap, handle)` after this method returns.

| # | Called Method | Type | SC Code | Entity / DB | Operation Description |
|---|--------------|------|---------|-------------|----------------------|
| 1 | `new CAANMsg(EWC0011C010CBSMsg.class.getName())` | EXEC | - | - | Creates a new CAANMsg template instance using the EWC0011C010CBSMsg schema |
| 2 | `template.set(EWC0011C010CBSMsg.TEMPLATEID, "EWC0011C010")` | EXEC | - | - | Sets the template ID for the view control order send service |
| 3 | `template.set(EWC0011C010CBSMsg.FUNC_CODE, "1")` | EXEC | - | - | Sets function code (default: "1") when inMap is present |
| 4 | `template.set(EWC0011C010CBSMsg.OPERATEDATE, ...)` | EXEC | - | - | Sets operating date from tmpParamMap |
| 5 | `template.set(EWC0011C010CBSMsg.OPERATEDATETIME, ...)` | EXEC | - | - | Sets operating date/time from tmpParamMap |
| 6 | `template.set(EWC0011C010CBSMsg.OPERATORID, ...)` | EXEC | - | - | Sets operator ID from tmpParamMap |
| 7 | `template.set(EWC0011C010CBSMsg.WCTRL_ORDER_CD, JWCStrConst.CD_DIV_WCTRL_ORDER_UNSET)` | EXEC | - | - | Sets view control order code to "02" (unregister/unlink) [-> CD_DIV_WCTRL_ORDER_UNSET="02" (JWCStrConst.java:441)] |
| 8 | `template.set(EWC0011C010CBSMsg.CTRL_TYPE_CD, "0")` | EXEC | - | - | Sets control type code to "0" (real operation) |
| 9 | `template.set(EWC0011C010CBSMsg.CTRL_MODE_CD, "1")` | EXEC | - | - | Sets control mode code to "1" |
| 10-17 | `template.setNull(...)` for detail lists | EXEC | - | - | Sets null for 8 template detail/flag fields (Remux lists, TM domain lists 0-3, billing flag, group ID, CCAS init flag, re-setup flag) |
| 18-20 | `template.set/setNull` for KYOKU_CD, CTRL_AREA_CD, CTRL_YOKYU_KEY | EXEC | - | - | Conditionally sets or nullifies station code, control area code, and control request key from tmpParamMap |
| 21-27 | `template.set/setNull` for STB/CCAS/BCAS fields | EXEC | - | - | Conditionally sets or nullifies STB ID, manufacturing number, control model code, CAS built-in flag, CCAS card number, and BCAS card number from msgList |
| 28 | `paramMap.put(JCMConstants.TEMPLATE_LIST_KEY, templates)` | EXEC | - | - | Stores the CAANMsg array into paramMap for SC framework consumption |

## 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: `set` [EXEC], `set` [EXEC], `set` [EXEC], `set` [EXEC], `set` [EXEC], `set` [EXEC], `set` [EXEC], `set` [EXEC], `set` [EXEC], `setNull` [EXEC], `setNull` [EXEC], `setNull` [EXEC], `setNull` [EXEC], `setNull` [EXEC], `setNull` [EXEC], `setNull` [EXEC], `setNull` [EXEC], `setNull` [EXEC], `setNull` [EXEC], `setNull` [EXEC], `setNull` [EXEC], `setNull` [EXEC], `set` [EXEC], `set` [EXEC], `set` [EXEC], `set` [EXEC], `set` [EXEC], `set` [EXEC], `set` [EXEC], `set` [EXEC], `set` [EXEC], `set` [EXEC], `set` [EXEC], `set` [EXEC], `set` [EXEC], `set` [EXEC], `set` [EXEC], `set` [EXEC], `set` [EXEC], `set` [EXEC], `set` [EXEC], `set` [EXEC], `set` [EXEC], `set` [EXEC], `set` [EXEC], `set` [EXEC], `set` [EXEC], `set` [EXEC], `put` [EXEC]

Trace who calls this method and what this method ultimately calls.
Uses the pre-computed evidence and caller search results from Step 2 above.

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Method: `JDKCommon08CC.unlink` | `unlink(param, keyTkMdlCd, keyKkSeizoNo, keySvcKeiNo, checkMap, scCall, handle, keyHmpinKikiNo)` -> `editOrderSendMsg(paramMap, inMap, tmpParamMap)` -> `scCall.run(paramMap, handle)` | `EWC0011C010CBS Msg [EXEC - template assembly]` |

**Call chain context:** The `unlink()` method orchestrates the complete STB/C-CAS deregistration workflow:
1. Calls `editOrderUktkMsg()` to receive and register view control order data
2. Then calls `editOrderSendMsg()` to assemble parameters for order transmission to the packager
3. Invokes `scCall.run()` to execute the CBS service call
4. Calls `editResultRrr()` to process the response

## 6. Per-Branch Detail Blocks

**Block 1** — [EXEC] (L2875)
> Creates the CAANMsg template instance for the view control order send service.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `CAANMsg template = new CAANMsg(EWC0011C010CBSMsg.class.getName())` |
| 2 | EXEC | `template.set(EWC0011C010CBSMsg.TEMPLATEID, "EWC0011C010")` // Sets template ID |

**Block 2** — [IF] `(inMap != null)` (L2880)
> When inMap is present (screen-originated request), populates operational metadata into the template. This block sets the function code, operating date/time, operator ID, control codes, and nullifies all detail list/flag fields.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `template.set(EWC0011C010CBSMsg.FUNC_CODE, "1")` // Function code (default: 1) |
| 2 | EXEC | `template.set(EWC0011C010CBSMsg.OPERATEDATE, tmpParamMap.get("operate_date_key"))` // Operating date |
| 3 | EXEC | `template.set(EWC0011C010CBSMsg.OPERATEDATETIME, tmpParamMap.get("operate_datetime_key"))` // Operating date/time |
| 4 | EXEC | `template.set(EWC0011C010CBSMsg.OPERATORID, tmpParamMap.get("operator_id"))` // Operator ID |
| 5 | EXEC | `template.set(EWC0011C010CBSMsg.WCTRL_ORDER_CD, JWCStrConst.CD_DIV_WCTRL_ORDER_UNSET)` // View control order code = 02 (unregister/unlink) [-> CD_DIV_WCTRL_ORDER_UNSET="02" (JWCStrConst.java:441)] |
| 6 | EXEC | `template.set(EWC0011C010CBSMsg.CTRL_TYPE_CD, "0")` // Control type code (0: real) |
| 7 | EXEC | `template.set(EWC0011C010CBSMsg.CTRL_MODE_CD, "1")` // Control mode code (1) |
| 8 | EXEC | `template.setNull(EWC0011C010CBSMsg.EWC0011D010CBSMSG1LIST)` // Digital tier (Remux) details (null) |
| 9 | EXEC | `template.setNull(EWC0011C010CBSMsg.EWC0011D010CBSMSG2LIST)` // Digital tier (TM) domain 0 details (null) |
| 10 | EXEC | `template.setNull(EWC0011C010CBSMsg.EWC0011D010CBSMSG3LIST)` // Digital tier (TM) domain 1 details (null) |
| 11 | EXEC | `template.setNull(EWC0011C010CBSMsg.EWC0011D010CBSMSG4LIST)` // Digital tier (TM) domain 2 details (null) |
| 12 | EXEC | `template.setNull(EWC0011C010CBSMsg.EWC0011D010CBSMSG5LIST)` // Digital tier (TM) domain 3 details (null) |
| 13 | EXEC | `template.setNull(EWC0011C010CBSMsg.CHRG_FLG)` // Billing flag (null) |
| 14 | EXEC | `template.setNull(EWC0011C010CBSMsg.EWC0011D010CBSMSG6LIST)` // Group ID details (null) |
| 15 | EXEC | `template.setNull(EWC0011C010CBSMsg.CCAS_SHKKA_CMD_HAK_FLG)` // C-CAS initial command issuance flag (null) |
| 16 | EXEC | `template.setNull(EWC0011C010CBSMsg.RE_SETTE_FLG)` // Re-setup flag (null) |

**Block 3** — [ELSE-IF chain] `(kyoku_cd null check)` (L2904)
> Conditionally sets the station/office code (局コード). Null if absent from tmpParamMap.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `template.setNull(EWC0011C010CBSMsg.KYOKU_CD)` // Station code (null branch) |
| 2 | EXEC | `template.set(EWC0011C010CBSMsg.KYOKU_CD, tmpParamMap.get("kyoku_cd"))` // Station code (else branch) |

**Block 4** — [ELSE-IF chain] `(ctrl_area_cd null check)` (L2913)
> Conditionally sets the control area code (制御エリアコード). Null if absent from tmpParamMap.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `template.setNull(EWC0011C010CBSMsg.CTRL_AREA_CD)` // Control area code (null branch) |
| 2 | EXEC | `template.set(EWC0011C010CBSMsg.CTRL_AREA_CD, tmpParamMap.get("ctrl_area_cd"))` // Control area code (else branch) |

**Block 5** — [ELSE-IF chain] `(ctrl_yokyu_key null check)` (L2922)
> Conditionally sets the control request key (制御要求キー). Null if absent from tmpParamMap.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `template.setNull(EWC0011C010CBSMsg.CTRL_YOKYU_KEY)` // Control request key (null branch) |
| 2 | EXEC | `template.set(EWC0011C010CBSMsg.CTRL_YOKYU_KEY, tmpParamMap.get("ctrl_yokyu_key"))` // Control request key (else branch) |

**Block 6** — [EXEC] (L2932)
> Retrieves the STB/CCAS message list object from tmpParamMap for extracting terminal device identifiers.

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

**Block 7** — [ELSE-IF chain] `(STBID null check)` (L2936)
> Conditionally sets the STB ID (STBID). Uses msgList.getString() to read from the retrieved message list.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `template.setNull(EWC0011C010CBSMsg.STB_ID)` // STB ID (null branch) |
| 2 | EXEC | `template.set(EWC0011C010CBSMsg.STB_ID, msgList.getString(EWCA0010001CBSMsg1List.STBID))` // STB ID (else branch) |

**Block 8** — [ELSE-IF chain] `(STB_KK_SEIZO_NO null check)` (L2945)
> Conditionally sets the STB manufacturing number (製造番号 — equipment serial number).

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `template.setNull(EWC0011C010CBSMsg.STB_KIKI_SEIZO_NO)` // STB manufacturing number (null branch) |
| 2 | EXEC | `template.set(EWC0011C010CBSMsg.STB_KIKI_SEIZO_NO, msgList.getString(EWCA0010001CBSMsg1List.STB_KK_SEIZO_NO))` // STB manufacturing number (else branch) |

**Block 9** — [ELSE-IF chain] `(STB_MAKER_KOYU_CTL_MDL_CD null check)` (L2954)
> Conditionally sets the STB control model code (制御用機種コード — proprietary manufacturer model code for control purposes).

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `template.setNull(EWC0011C010CBSMsg.STB_CTRL_MODEL_CD)` // STB control model code (null branch) |
| 2 | EXEC | `template.set(EWC0011C010CBSMsg.STB_CTRL_MODEL_CD, msgList.getString(EWCA0010001CBSMsg1List.STB_MAKER_KOYU_CTL_MDL_CD))` // STB control model code (else branch) |

**Block 10** — [ELSE-IF chain] `(STB_NAIZOCAS_CD null check)` (L2963)
> Conditionally sets the CCAS built-in type flag (CCAS内蔵タイプSTB — whether the STB has CCAS built-in).

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `template.setNull(EWC0011C010CBSMsg.STB_CAS_NAIZO_FLG)` // CCAS built-in flag (null branch) |
| 2 | EXEC | `template.set(EWC0011C010CBSMsg.STB_CAS_NAIZO_FLG, msgList.getString(EWCA0010001CBSMsg1List.STB_NAIZOCAS_CD))` // CCAS built-in flag (else branch) |

**Block 11** — [ELSE-IF chain] `(CCAS_KK_SEIZO_NO null check)` (L2972)
> Conditionally sets the CCAS card number (CCASID — CCAS manufacturing serial number).

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `template.setNull(EWC0011C010CBSMsg.CCAS_CARD_NO)` // CCAS card number (null branch) |
| 2 | EXEC | `template.set(EWC0011C010CBSMsg.CCAS_CARD_NO, msgList.getString(EWCA0010001CBSMsg1List.CCAS_KK_SEIZO_NO))` // CCAS card number (else branch) |

**Block 12** — [ELSE-IF chain] `(BCAS_KK_SEIZO_NO null check)` (L2981)
> Conditionally sets the BCAS card number (BCASID — BCAS manufacturing serial number).

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `template.setNull(EWC0011C010CBSMsg.BCAS_CARD_NO)` // BCAS card number (null branch) |
| 2 | EXEC | `template.set(EWC0011C010CBSMsg.BCAS_CARD_NO, msgList.getString(EWCA0010001CBSMsg1List.BCAS_KK_SEIZO_NO))` // BCAS card number (else branch) |

**Block 13** — [EXEC] (L2990)
> Finalizes the template by wrapping it in a `CAANMsg[]` array and storing it into the parameter map under `JCMConstants.TEMPLATE_LIST_KEY`.

| # | Type | Code |
|---|------|------|
| 1 | SET | `CAANMsg[] templates = new CAANMsg[1]` // Create template array |
| 2 | SET | `templates[0] = template` // Populate array with single template |
| 3 | EXEC | `paramMap.put(JCMConstants.TEMPLATE_LIST_KEY, templates)` // Store in paramMap |
| 4 | RETURN | `return paramMap` |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| WCTRL_ORDER_CD | Field | View Control Order Code — classifies the type of view control operation (e.g., "02" = unregister/unlink) |
| CD_DIV_WCTRL_ORDER_UNSET | Constant | Value "02" — represents unregistration/unlink operation for view control orders [-> JWCStrConst.java:441] |
| CTRL_TYPE_CD | Field | Control Type Code — distinguishes between real operations ("0") and other types |
| CTRL_MODE_CD | Field | Control Mode Code — specifies the operational mode of the control command |
| KYOKU_CD | Field | Station/Branch Code — identifies the office or branch responsible for the operation |
| CTRL_AREA_CD | Field | Control Area Code — identifies the regional control area for the view control operation |
| CTRL_YOKYU_KEY | Field | Control Request Key — a key identifying the specific control request |
| STB_ID | Field | Set-Top Box ID — unique identifier of the STB device |
| STB_KIKI_SEIZO_NO | Field | STB Equipment Manufacturing Number — serial number of the STB |
| STB_CTRL_MODEL_CD | Field | STB Control Model Code — manufacturer-specific model code used for STB control |
| STB_CAS_NAIZO_FLG | Field | STB CAS Built-in Flag — indicates whether CCAS is built into the STB |
| CCAS_CARD_NO | Field | CCAS Card Number — manufacturing serial number of the CCAS card (Condes Conditional Access System) |
| BCAS_CARD_NO | Field | BCAS Card Number — manufacturing serial number of the BCAS card (Broadcast Content Protection System) |
| CCAS | Acronym | Condes Conditional Access System — digital cable access control system for authorized channel decryption |
| BCAS | Acronym | Broadcast Content Protection System — Japanese digital broadcasting content protection standard |
| STB | Acronym | Set-Top Box — consumer equipment for receiving and decoding broadcast signals |
| CAANMsg | Acronym | Common Application Abstract Network Message — a message container class used for CBS (Common Business Service) communication |
| FUNC_CODE | Field | Function Code — identifies the operation function type (default "1" for standard operations) |
| OPERATEDATE | Field | Operating Date — the date on which the operation is performed |
| OPERATEDATETIME | Field | Operating Date/Time — the timestamp of the operation |
| OPERATORID | Field | Operator ID — the ID of the user performing the operation |
| CHRG_FLG | Field | Billing Flag — indicates whether billing is applicable for this operation |
| Remux | Business term | Digital tier remuxing — process of remultiplexing digital broadcast channels |
| TM | Business term | Tuner/Module — refers to tuner module or translation module in digital tier classification |
| EWC0011C010 | Template ID | CBS message template ID for the View Control Order Send Service |
| EWCA0010001CBSMSG1LIST | Field | Message list key containing STB/CCAS/BCAS terminal device information retrieved from the prior service step |
| TEMPLATE_LIST_KEY | Constant | Key name under which the `CAANMsg[]` template array is stored in paramMap for SC framework consumption |
| Unregister/Unlink | Business term | The process of deregistering terminal equipment (STB/C-CAS) from active service, setting the order code to "02" |
| SC | Acronym | Service Component — the enterprise service layer that handles CBS calls and data persistence |
| CBS | Acronym | Common Business Service — the service framework for enterprise business operations |
