# Business Logic — JKKShkaFinJiKikiStaAddCC.execTelRelationUpd() [226 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `com.fujitsu.futurity.bp.custom.common.JKKShkaFinJiKikiStaAddCC` |
| Layer | CC/Common Component (shared business component within the `com.fujitsu.futurity.bp.custom.common` package) |
| Module | `common` (Package: `com.fujitsu.futurity.bp.custom.common`) |

## 1. Role

### JKKShkaFinJiKikiStaAddCC.execTelRelationUpd()

This method performs **telephone device binding update** — the business operation of synchronizing the mapping between EO optical telephone service contract line items and the terminal (multi-function router or VA device) they are connected to. When a customer's multi-function router is replaced or changed, this method ensures that the service system's records for all associated telephone contracts reflect the new device change number. The method reads the target device change number from the `telRelationUpdKiki_to` message and compares it against each EO optical telephone service contract's VA device change number, collecting those that differ (indicating the contract's device binding needs updating).

The method implements a **dual-path conditional branching pattern** based on the `adchgChuFlg` parameter: in the **normal update path** (`adchgChuFlg = false`), it directly collects service contract line items whose device change numbers differ from the target and updates them via `updateSvcKeiUcwkEoTel`. In the **address-change-in-progress path** (`adchgChuFlg = true`), it performs additional cross-checking against previously confirmed address-change service contracts via `execEKK0161B001`, and if they match a prior address-change work number, it updates them via `updateSvcKeiUcwkEoTelAdchgChu` followed by application date registration via `execEKK0161C030`.

When the delivery division is `"02"` (Repair/修理), the method applies an extra guard: only service contracts whose previous device change number (`prvKikiChgNo`) matches the VA device change number are included, preventing stale device records from being updated during repair workflows.

The method serves as a **shared CBS component** called by `addShkaFinJiKiStaAdd()` (the main order addition/confirmation flow), acting as a post-processing step that ensures device binding consistency after a router change operation completes. It returns the updated timestamp (`updDtm`) for downstream consumers.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["execTelRelationUpd"])
    CHECK_NULL((telRelationUpdKiki_to is null))
    GET_TEMP_DATA["Get ekk0081a010cbsMsg from temporaryData"]
    GET_SVC_KEI_NO["Get telSvcKeiNo from ekk0081a010cbsMsg"]
    CHECK_SVC_NO((telSvcKeiNo is empty))
    CALL_0191["execEKK0191B001 - get EO optical telephone contract details by telSvcKeiNo"]
    CHECK_0191((ekk0191b001cbsMsgList is null or empty))
    GET_KIKI_CHG_NO["Get kikiChgNo from telRelationUpdKiki_to"]
    INIT_LISTS["Initialize telRelUpdSvcUcwkEoTelList and telRelUpdAdchgChuList"]
    
    CHECK_ADCHG((adchgChuFlg))
    ADCHG_FALSE["adchgChuFlg = false: normal update path"]
    LOOP_0191["Loop ekk0191b001cbsMsgList[i]"]
    GET_STAT["Get svcKeiUcwkStat"]
    CHECK_STAT((svcKeiUcwkStat is 910 or 920))
    GET_VA_CHG_NO["Get vaKikichgNo and svcKeiUcwkNo"]
    CHECK_HAISO((haisoDiv = 02))
    HAISO_TRUE["haisoDiv = 02: check prvKikiChgNo match"]
    CHECK_PRV((prvKikiChgNo not empty and does not match))
    CHECK_MATCH((kikiChgNo not equals vaKikichgNo))
    ADD_TO_LIST_1["Add svcKeiUcwkNo to telRelUpdSvcUcwkEoTelList"]
    
    ADCHG_TRUE["adchgChuFlg = true: address change-in-progress path"]
    LOOP_0191_ADCHG["Loop ekk0191b001cbsMsgList[i] (same filtering)"]
    CALL_0161B["execEKK0161B001 - get current service contract details"]
    LOOP_0161B["Loop ekk0161b001cbsMsgList[j]"]
    CHECK_LIST_CONTAIN("svcKeiUcwkNo in svcKeiUcwkNoList AND matches svcKeiUcwkNo_0161")
    CHECK_ADCHG_AFPREV((adchgAfSvcKeiUcwkNoList contains svcKeiUcwkNo_0161))
    ADD_UTWK["Get geneAddDtm/rsvAplyYmd, build utwk array, add to telRelUpdAdchgChuList"]
    
    LIST1_NOT_EMPTY((telRelUpdSvcUcwkEoTelList not empty))
    CALL_UPDATE["updateSvcKeiUcwkEoTel - update phone binding for normal items"]
    
    LIST2_NOT_EMPTY((telRelUpdAdchgChuList not empty))
    CALL_UPDATE_ADCHG["updateSvcKeiUcwkEoTelAdchgChu - update phone binding for address-change items"]
    LOOP_ADCHG_PROCESS["Loop telRelUpdAdchgChuList"]
    CALL_0161A["execEKK0161A010 - get service contract consent confirmation"]
    CALL_0161C["execEKK0161C030 - set contract application date"]
    
    RETURN(["Return updDtm"])
    
    START --> CHECK_NULL
    CHECK_NULL -- false --> GET_TEMP_DATA
    CHECK_NULL -- true --> RETURN
    GET_TEMP_DATA --> GET_SVC_KEI_NO
    GET_SVC_KEI_NO --> CHECK_SVC_NO
    CHECK_SVC_NO -- false --> CALL_0191
    CHECK_SVC_NO -- true --> RETURN
    CALL_0191 --> CHECK_0191
    CHECK_0191 -- false --> GET_KIKI_CHG_NO
    CHECK_0191 -- true --> RETURN
    GET_KIKI_CHG_NO --> INIT_LISTS
    INIT_LISTS --> CHECK_ADCHG
    
    CHECK_ADCHG -- false --> ADCHG_FALSE
    ADCHG_FALSE --> LOOP_0191
    LOOP_0191 --> GET_STAT
    GET_STAT --> CHECK_STAT
    CHECK_STAT -- true --> LOOP_0191
    CHECK_STAT -- false --> GET_VA_CHG_NO
    GET_VA_CHG_NO --> CHECK_HAISO
    CHECK_HAISO -- false --> CHECK_MATCH
    CHECK_HAISO -- true --> HAISO_TRUE
    HAISO_TRUE --> CHECK_PRV
    CHECK_PRV -- true --> LOOP_0191
    CHECK_PRV -- false --> CHECK_MATCH
    CHECK_MATCH -- false --> LOOP_0191
    CHECK_MATCH -- true --> ADD_TO_LIST_1
    ADD_TO_LIST_1 --> LOOP_0191
    
    CHECK_ADCHG -- true --> ADCHG_TRUE
    ADCHG_TRUE --> LOOP_0191_ADCHG
    LOOP_0191_ADCHG --> GET_STAT
    GET_STAT --> CHECK_STAT
    CHECK_STAT -- true --> LOOP_0191_ADCHG
    CHECK_STAT -- false --> GET_VA_CHG_NO
    GET_VA_CHG_NO --> CHECK_HAISO
    CHECK_HAISO -- false --> CHECK_MATCH
    CHECK_HAISO -- true --> HAISO_TRUE
    HAISO_TRUE --> CHECK_PRV
    CHECK_PRV -- true --> LOOP_0191_ADCHG
    CHECK_PRV -- false --> CHECK_MATCH
    CHECK_MATCH -- false --> LOOP_0191_ADCHG
    CHECK_MATCH -- true --> CALL_0161B
    CALL_0161B --> LOOP_0161B
    LOOP_0161B --> CHECK_LIST_CONTAIN
    CHECK_LIST_CONTAIN -- false --> LOOP_0161B
    CHECK_LIST_CONTAIN -- true --> CHECK_ADCHG_AFPREV
    CHECK_ADCHG_AFPREV -- false --> LOOP_0161B
    CHECK_ADCHG_AFPREV -- true --> ADD_UTWK
    ADD_UTWK --> LOOP_0161B
    
    LIST1_NOT_EMPTY -- false --> LIST2_NOT_EMPTY
    LIST1_NOT_EMPTY -- true --> CALL_UPDATE
    CALL_UPDATE --> LIST2_NOT_EMPTY
    LIST2_NOT_EMPTY -- false --> RETURN
    LIST2_NOT_EMPTY -- true --> CALL_UPDATE_ADCHG
    CALL_UPDATE_ADCHG --> LOOP_ADCHG_PROCESS
    LOOP_ADCHG_PROCESS --> CALL_0161A
    CALL_0161A --> CALL_0161C
    CALL_0161C --> LOOP_ADCHG_PROCESS
    LOOP_ADCHG_PROCESS --> RETURN
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `handle` | `SessionHandle` | Database session handle for transaction management and data access |
| 2 | `scCall` | `ServiceComponentRequestInvoker` | Service component call invoker used to dispatch CBS (Common Business Service) calls to downstream components |
| 3 | `param` | `IRequestParameterReadWrite` | Request parameter interface for passing data between components during CBS invocations |
| 4 | `dataMapKey` | `String` | Key used to retrieve temporary working data from the session context map (e.g., `TEMPLATE_ID_EKK0081A010` = `"EKK0081A010"`) |
| 5 | `temporaryData` | `HashMap<String, Object>` | Temporary data store holding CBS message objects across the processing chain; contains the EKK0081A010 message with service contract header data |
| 6 | `telRelationUpdKiki_to` | `CAANMsg` | The target device change message containing the **new** multi-function router device change number (`KIKI_CHG_NO`). Represents the device the phone binding should be updated to. If null, the method returns immediately without processing |
| 7 | `updDtm` | `String` | Update timestamp. Returned as-is if no updates occur; overwritten with the actual update timestamp after `updateSvcKeiUcwkEoTel` or `updateSvcKeiUcwkEoTelAdchgChu` is called. Used for audit trail and versioning |
| 8 | `idoDiv` | `String` | Movement/division code indicating the type of change operation. When not `"00027"` (old: operation settings/operation change), normal device matching applies. Note: the `IDO_DIV_00027` branch was commented out in v19.00.00 |
| 9 | `adchgChuFlg` | `boolean` | **Address change-in-progress flag**. `true`: processing during address change (intermediate state — requires additional address-change-specific handling via `updateSvcKeiUcwkEoTelAdchgChu` and `execEKK0161C030`). `false`: normal update path or address change confirmed (standard device binding update only) |
| 10 | `adchgAfSvcKeiUcwkNoList` | `ArrayList` | List of service contract work numbers that were **already processed after an address change**. Used in the address-change-in-progress path to match current contracts against previously confirmed address-change works |
| 11 | `prvKikiChgNo` | `String` | Previous device change number. When `haisoDiv = "02"` (Repair/修理), only service contracts whose VA device change number matches this previous number are included — preventing incorrect device binding for devices not actually changed during the repair workflow. Empty string means no filter |
| 12 | `haisoDiv` | `String` | **Delivery division code**. When equal to `"02"` (Repair/修理), triggers the `prvKikiChgNo` matching guard. Other values skip the guard and include all non-matching device contracts |

**Constant values resolved:**

| Constant | Value | Business Meaning |
|----------|-------|-----------------|
| `TEMPLATE_ID_EKK0081A010` | `"EKK0081A010"` | Template key for retrieving the service contract header CBS message from temporaryData |
| `SVC_CD_TEL` | `"02"` | Service code for telephone (EO optical telephone) |
| `SVC_KEI_UCWK_STAT_DSL` | `"910"` | Service contract detail status — termination/cancellation. Such contracts are excluded from updates |
| `SVC_KEI_UCWK_STAT_CANCEL` | `"920"` | Service contract detail status — cancellation. Such contracts are excluded from updates |
| `HAISO_DIV_SHURI` | `"02"` | Delivery division — repair. When active, requires `prvKikiChgNo` matching |
| `IDO_DIV_00027` | `"00027"` | Movement division — operation settings (commented out in current code, no longer active) |

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `JKKShkaFinJiKikiStaAddCC.execEKK0191B001` | `EKK0191B001` | EO optical telephone service contract details table | Retrieves list of all EO optical telephone service contract line items for the given telephone service contract number (`telSvcKeiNo`). Used to enumerate which contracts need device binding updates |
| R | `JKKShkaFinJiKikiStaAddCC.execEKK0161B001` | `EKK0161B001` | Current service contract details table | Retrieves the current (live) service contract details for a given service contract number. Used in the address-change-in-progress path to cross-reference existing contracts against the `adchgAfSvcKeiUcwkNoList` |
| R | `JKKShkaFinJiKikiStaAddCC.execEKK0161A010` | `EKK0161A010` | Service contract consent confirmation table | Retrieves the service contract consent confirmation record for a given service contract work number. Used to obtain the contract details needed for date registration |
| U | `JKKShkaFinJiKikiStaAddCC.execEKK0161C030` | `EKK0161C030` | Service contract reservation application table | Sets/registers the contract application date (`rsvAplyYmd`) for processed address-change contracts. This effectively "applies" the address change for previously deferred contracts |
| U | `JKKShkaFinJiKikiStaAddCC.updateSvcKeiUcwkEoTel` | - | EO optical telephone service contract binding table | Updates the device binding (phone-to-device mapping) for standard service contract line items collected in `telRelUpdSvcUcwkEoTelList`. Overwrites the `updDtm` return value |
| U | `JKKShkaFinJiKikiStaAddCC.updateSvcKeiUcwkEoTelAdchgChu` | - | EO optical telephone service contract binding table (address-change path) | Updates the device binding for service contract line items involved in address-change processing. Collects service contract work numbers, generation timestamps, and reservation application dates. Overwrites the `updDtm` return value |

**Classification rationale:**
- **R (Read)**: `execEKK0191B001`, `execEKK0161B001`, `execEKK0161A010` are CBS query methods that retrieve contract detail data. The naming convention `execEKKxxxXxxx` followed by use of result arrays with `getString` calls indicates data retrieval without side effects.
- **U (Update)**: `updateSvcKeiUcwkEoTel`, `updateSvcKeiUcwkEoTelAdchgChu` — explicit update methods modifying device binding records. `execEKK0161C030` — application date registration (insert/update of contract application date field).

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | `JKKShkaFinJiKikiStaAddCC.addShkaFinJiKiStaAdd` | `addShkaFinJiKiStaAdd()` → `execTelRelationUpd(...)` | `execEKK0191B001 [R] EO tel svc contract details`, `execEKK0161B001 [R] current svc contract details`, `execEKK0161A010 [R] svc contract consent confirmation`, `execEKK0161C030 [U] svc contract reservation application`, `updateSvcKeiUcwkEoTel [U] EO tel svc contract binding`, `updateSvcKeiUcwkEoTelAdchgChu [U] EO tel svc contract binding (address-change)` |

## 6. Per-Branch Detail Blocks

**Block 1** — IF `(telRelationUpdKiki_to == null)` (L8989)

Early return guard: if the target device change message is null, there is nothing to update. The `telRelationUpdKiki_from` null check was removed in OM-2015-0001066; only the `to` message is validated.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | RETURN | `return updDtm;` | Returns unchanged timestamp — no update performed because no target device is specified |

**Block 2** — EXEC (L8996)

Retrieve the service contract header from temporary working data.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | CALL | `temporaryData.get(TEMPLATE_ID_EKK0081A010)` | Retrieves the EKK0081A010 CBS message from the temporary data map. `TEMPLATE_ID_EKK0081A010` = `"EKK0081A010"` |
| 2 | SET | `ekk0081a010cbsMsg = (CAANMsg) temporaryData.get(...)` | Cast to CAANMsg for subsequent field extraction |

**Block 3** — EXEC (L9008)

Extract the telephone service contract number.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | CALL | `ekk0081a010cbsMsg.getString(EKK0081A010CBSMsg1List.SVC_KEI_NO)` | Gets the service contract number (`SVC_KEI_NO`) from the header message. In v19.00.00, this was simplified: the previous conditional path based on `SVC_CD_TEL` was removed, and now always reads `SVC_KEI_NO` directly from the EKK0081A010 message |

**Block 4** — IF `("".equals(telSvcKeiNo))` (L9010)

Early return if the service contract number is empty.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | RETURN | `return updDtm;` | No service contract number means there is nothing to look up |

**Block 5** — CALL (L9015)

Query all EO optical telephone service contract line items.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | CALL | `execEKK0191B001(handle, scCall, param, dataMapKey, temporaryData, telSvcKeiNo)` | Retrieves the list of EO optical telephone service contract details for the given telephone service contract number |

**Block 6** — IF `(ekk0191b001cbsMsgList == null || ekk0191b001cbsMsgList.length == 0)` (L9017)

Early return if no EO optical telephone contracts exist for this service.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | RETURN | `return updDtm;` | No contracts to update — nothing to do |

**Block 7** — EXEC (L9022)

Extract the target device change number from the `telRelationUpdKiki_to` message.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | CALL | `telRelationUpdKiki_to.getString(EKK0341A010CBSMsg1List.KIKI_CHG_NO)` | Gets the new multi-function router device change number. In OM-2015-0001066, this was changed from `telRelationUpdKiki_from` (R0) to `telRelationUpdKiki_to` (the target device) |

**Block 8** — EXEC (L9027-L9031)

Initialize the working data structures for both update paths.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | SET | `vaKikichgNo = ""` | Working variable for VA device change number per iteration |
| 2 | SET | `svcKeiUcwkStat = ""` | Working variable for service contract detail status per iteration |
| 3 | SET | `svcKeiUcwkNo = ""` | Working variable for service contract work number per iteration |
| 4 | SET | `telRelUpdSvcUcwkEoTelList = new ArrayList<String>()` | Normal update path: list of service contract work numbers whose device binding needs updating (v7.00.50 addition) |
| 5 | SET | `telRelUpdAdchgChuList = new ArrayList<String[]>()` | Address-change-in-progress path: list of 3-element arrays (svcKeiUcwkNo, geneAddDtm, rsvAplyYmd) for deferred address-change updates (v7.00.50 addition) |

**Block 9** — IF/ELSE `(adchgChuFlg)` (L9033)

Branch on the address-change-in-progress flag. `adchgChuFlg = false` means normal update (not during address change or address change is confirmed). `adchgChuFlg = true` means processing during address change.

---

**Block 9.1** — IF-ELSE-IF body: `adchgChuFlg == false` — Normal update path (L9035)

Iterate through EO optical telephone service contract details, filtering and collecting those that need device binding updates.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | FOR | `i = 0; i < ekk0191b001cbsMsgList.length; i++` | Loop over each EO optical telephone service contract detail |
| 2 | SET | `svcKeiUcwkStat = ekk0191b001cbsMsgList[i].getString(EKK0191B001CBSMsg1List.SVC_KEI_UCWK_STAT)` | Read service contract detail status |

**Block 9.1.1** — IF `(SVC_KEI_UCWK_STAT_DSL.equals(svcKeiUcwkStat) || SVC_KEI_UCWK_STAT_CANCEL.equals(svcKeiUcwkStat))` (L9040)
`SVC_KEI_UCWK_STAT_DSL = "910"` (Termination), `SVC_KEI_UCWK_STAT_CANCEL = "920"` (Cancellation)

Skip contracts that are terminated or cancelled — they should not be updated.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | EXEC | `continue;` | Skip this contract — terminated or cancelled contracts are excluded from device binding updates |

**Block 9.1.2** — EXEC (L9045-L9046)

Read VA device change number and service contract work number.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | SET | `vaKikichgNo = ekk0191b001cbsMsgList[i].getString(EKK0191B001CBSMsg1List.VA_KIKI_CHG_NO)` | Get the VA device change number for this contract |
| 2 | SET | `svcKeiUcwkNo = ekk0191b001cbsMsgList[i].getString(EKK0191B001CBSMsg1List.SVC_KEI_UCWK_NO)` | Get the service contract work number |

**Block 9.1.3** — IF `(HAISO_DIV_SHURI.equals(haisoDiv))` (L9057)
`HAISO_DIV_SHURI = "02"` (Delivery division: Repair/修理)

When the delivery division is "Repair", apply an extra guard: only include the contract if its VA device change number matches the previous device change number (`prvKikiChgNo`). This ensures that only the actually-repaired device's binding is updated, not other devices' bindings on the same line item. Note: the previous `IDO_DIV_00027` (operation settings) branch was removed in v19.00.00 and replaced with the simpler `HAISO_DIV_SHURI` check.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | IF | `(!"".equals(prvKikiChgNo)) && (!prvKikiChgNo.equals(vaKikichgNo))` | Check if previous device change number is non-empty and differs from current VA device |
| 2 | EXEC | `continue;` | Skip — this contract's VA device does not match the repaired device, so it should not be updated |

**Block 9.1.4** — IF `(!kikiChgNo.equals(vaKikichgNo))` (L9064)

Core matching logic: if the VA device change number on the service contract does **not** match the target device change number (multi-function router's change number), this contract needs its device binding updated.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | EXEC | `telRelUpdSvcUcwkEoTelList.add(svcKeiUcwkNo)` | Add to the normal update list — this service contract's device binding is out of date |

**Block 9.2** — IF-ELSE-IF body: `adchgChuFlg == true` — Address-change-in-progress path (L9076)

This is the more complex path, introduced in v7.00.50. When processing during an address change, the method must cross-reference each contract against previously confirmed address-change works (`adchgAfSvcKeiUcwkNoList`) to determine if the contract was already prepared for address change. If so, it records the data needed for deferred date registration.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | FOR | `i = 0; i < ekk0191b001cbsMsgList.length; i++` | Loop over each EO optical telephone service contract detail |
| 2 | SET | `svcKeiUcwkStat = ...getString(...SVC_KEI_UCWK_STAT)` | Read service contract detail status |

**Block 9.2.1** — IF `(SVC_KEI_UCWK_STAT_DSL.equals(svcKeiUcwkStat) \|\| SVC_KEI_UCWK_STAT_CANCEL.equals(svcKeiUcwkStat))` (L9083)

Same exclusion as the normal path: skip terminated or cancelled contracts.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | EXEC | `continue;` | Skip terminated or cancelled contracts |

**Block 9.2.2** — EXEC (L9088-L9089)

Same field extraction as the normal path.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | SET | `vaKikichgNo = ...getString(VA_KIKI_CHG_NO)` | Read VA device change number |
| 2 | SET | `svcKeiUcwkNo = ...getString(SVC_KEI_UCWK_NO)` | Read service contract work number |

**Block 9.2.3** — IF `(HAISO_DIV_SHURI.equals(haisoDiv))` (L9102)
`HAISO_DIV_SHURI = "02"` (Repair)

Same repair guard as the normal path. If the delivery division is repair, only contracts matching the previous device change number are processed.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | IF | `(!"".equals(prvKikiChgNo)) && (!prvKikiChgNo.equals(vaKikichgNo))` | Previous device change number guard |
| 2 | EXEC | `continue;` | Skip non-matching contracts during repair |

**Block 9.2.4** — IF `(!kikiChgNo.equals(vaKikichgNo))` (L9113)

Core condition: VA device change number differs from the target router's change number — this contract needs updating. In the address-change path, additional cross-referencing is performed.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | CALL | `execEKK0161B001(handle, scCall, param, dataMapKey, temporaryData, telSvcKeiNo)` | Query current service contract details for the same service contract number |
| 2 | SET | `svcKeiUcwkNoList = new ArrayList<String>()` | Working list to track which work numbers have already been processed (avoid duplicates in the inner loop) |

**Block 9.2.5** — FOR `j = 0; j < ekk0161b001cbsMsgList.length; j++` (L9117)

Inner loop: iterate through the current service contract details to find matches.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | SET | `svcKeiUcwkNo_0161 = ekk0161b001cbsMsgList[j].getString(EKK0161B001CBSMsg1List.SVC_KEI_UCWK_NO)` | Get the service contract work number from the current (live) contract data |
| 2 | IF | `!svcKeiUcwkNoList.contains(svcKeiUcwkNo_0161) && svcKeiUcwkNo.equals(svcKeiUcwkNo_0161)` | Check: this work number has not been processed yet AND it matches the VA contract's work number |

**Block 9.2.5.1** — IF `(adchgAfSvcKeiUcwkNoList.contains(svcKeiUcwkNo_0161))` (L9123)

This is the key address-change matching logic: the service contract work number must be in the list of previously confirmed address-change work numbers. If it is, this contract was already prepared for address change, and we need to record the update data plus the application date for later registration.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | SET | `geneAddDtm = ekk0161b001cbsMsgList[j].getString(EKK0161B001CBSMsg1List.GENE_ADD_DTM)` | Get the generation/addition timestamp — used as the registered date |
| 2 | SET | `rsvAplyYmd = ekk0161b001cbsMsgList[j].getString(EKK0161B001CBSMsg1List.RSV_APLY_YMD)` | Get the reservation application date — the address change application date (v7.00.50 addition) |
| 3 | SET | `utwk = new String[]{svcKeiUcwkNo, geneAddDtm, rsvAplyYmd}` | Build 3-element work array: (work number, generation date, application date) |
| 4 | EXEC | `telRelUpdAdchgChuList.add(utwk)` | Add to the address-change update list |
| 5 | EXEC | `svcKeiUcwkNoList.add(svcKeiUcwkNo_0161)` | Mark as processed to avoid duplicates in inner loop |

**Block 10** — IF `(!telRelUpdSvcUcwkEoTelList.isEmpty())` (L9136)

Normal update path execution: if there are service contracts whose device binding needs updating (collected in the `adchgChuFlg == false` path).

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | SET | `updDtm = updateSvcKeiUcwkEoTel(handle, scCall, param, dataMapKey, temporaryData, telRelUpdSvcUcwkEoTelList, telRelationUpdKiki_to, idoDiv)` | Update phone binding for standard EO optical telephone service contracts. The old VA device deregistration SOD issuance (`execVaKikiDslSodHakko`) was commented out in OM-2015-0001066 |

**Block 11** — IF `(!telRelUpdAdchgChuList.isEmpty())` (L9143)

Address-change-in-progress update path execution: if there are service contracts that need device binding updates during an address change.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | SET | `updDtm = updateSvcKeiUcwkEoTelAdchgChu(handle, scCall, param, dataMapKey, temporaryData, telRelUpdAdchgChuList, telRelationUpdKiki_to, idoDiv)` | Update phone binding for address-change EO optical telephone service contracts. Overwrites `updDtm` with the update timestamp |

**Block 11.1** — FOR `i = 0; i < telRelUpdAdchgChuList.size(); i++` (L9149)

For each address-change contract that was updated, register the contract application date so the address change is properly applied. This is a deferred processing step: the address change was prepared earlier, and now the date is finalized.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | SET | `utwk = telRelUpdAdchgChuList.get(i)` | Get the 3-element work array for this contract |
| 2 | SET | `svcUcwkNo = utwk[0]` | Service contract work number |
| 3 | SET | `svcUcwkRsvAplyCd = utwk[2]` | Address change application date (the rsvAplyYmd field) |
| 4 | CALL | `ekk0161a010Msg = execEKK0161A010(handle, scCall, param, dataMapKey, temporaryData, svcUcwkNo)` | Get the service contract consent confirmation for this work number |
| 5 | SET | `updDtm = execEKK0161C030(handle, scCall, param, dataMapKey, temporaryData, ekk0161a010Msg, svcUcwkRsvAplyCd)` | Set the contract application date — this finalizes the deferred address change application for this contract. The date is stored as an "operation date" (運用年月日) |

**Block 12** — RETURN (L9167)

Return the final update timestamp.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | RETURN | `return updDtm;` | Return the latest update timestamp. If no updates occurred, returns the original timestamp unchanged |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `svc_kei_no` | Field | Service contract number — the primary identifier for a service contract (e.g., telephone service contract) |
| `svc_kei_ucwk_no` | Field | Service contract work number — internal tracking ID for a service contract line item / detail work |
| `svc_kei_ucwk_stat` | Field | Service contract detail status — indicates the lifecycle state of a service contract detail (e.g., 910 = termination, 920 = cancellation) |
| `kiki_chg_no` | Field | Device change number — a unique identifier assigned when a terminal device (router, VA device) is changed/replaced |
| `va_kiki_chg_no` | Field | VA (Value-Added) device change number — the device change number associated with a VA (Virtual Appliance or Value-Added) terminal on the service contract |
| `tel_relation_upd_kiki_to` | Field | Target device change message — the message containing information about the new device (multi-function router) that the phone binding should point to |
| `ido_div` | Field | Movement/division code — classifies the type of change operation (e.g., 00027 = operation settings, 00009 = course change) |
| `adchg_chu_flg` | Field | Address change-in-progress flag — `true` means processing during address change; `false` means normal update or address change confirmed |
| `adchg_af_svc_kei_ucwk_no_list` | Field | List of service contract work numbers that were already processed after an address change — used for cross-referencing |
| `prv_kiki_chg_no` | Field | Previous device change number — the device change number before the current change; used as a guard during repair operations |
| `haiso_div` | Field | Delivery division code — classifies the type of delivery/change (e.g., "02" = Repair/修理) |
| `gene_add_dtm` | Field | Generation/addition timestamp — the timestamp when a service contract work record was generated |
| `rsv_aply_ymd` | Field | Reservation application year/month/day — the application date for a deferred address change |
| `upd_dtm` | Field | Update timestamp — the timestamp recorded when a device binding update is performed |
| `telRelUpdSvcUcwkEoTelList` | Field | Working list for normal update path — contains service contract work numbers whose device binding needs updating (not during address change) |
| `telRelUpdAdchgChuList` | Field | Working list for address-change-in-progress path — contains arrays of (work number, generation date, application date) for deferred address-change updates |
| EO optical telephone | Business term | EO (Ethernet Optical) optical telephone service — a fiber-optic telephone service using Ethernet over optical network technology |
| VA device | Business term | VA (Value-Added / Virtual Appliance) device — typically a set-top box or similar terminal device provided to the subscriber |
| Multi-function router | Business term | A router device that combines routing, switching, and often Wi-Fi capabilities; the primary network termination point for the customer's premises |
| Device binding | Business term | The mapping/association between a service contract line item (phone service) and the physical terminal device (router/VA) connected to it |
| Device change | Business term | The operation of replacing or modifying a terminal device at the customer's premises, assigned a unique device change number |
| Address change | Business term | A customer request to change the registered address for a service; may involve deferring certain contract updates until the address change is finalized |
| SOD | Acronym | Service Order Data — order-related data entity in the telecom fulfillment system |
| CBS | Acronym | Common Business Service — shared business service components in the Fujitsu Futurity framework |
| SC | Acronym | Service Component — a unit of business logic invoked via the ServiceComponentRequestInvoker |
| CAANMsg | Type | CAAN message object — a message/container class used throughout the Fujitsu Futurity framework for passing structured data between CBS components |
| EKK0081A010 | SC | Service contract header CBS — retrieves the header/main data for a service contract |
| EKK0191B001 | SC | EO optical telephone service contract detail list CBS — retrieves all EO optical telephone service contract line items for a given service contract number |
| EKK0161A010 | SC | Service contract consent confirmation CBS — retrieves the consent confirmation record for a service contract work number |
| EKK0161B001 | SC | Current service contract details CBS — retrieves the current (live) service contract details |
| EKK0161C030 | SC | Service contract reservation application date registration CBS — sets/registers the application date for a service contract reservation |
| EKK0341A010CBSMsg1List | Field list | Constants list for KikiChange (device change) CBS message fields (e.g., SVC_KEI_NO, KIKI_CHG_NO) |
| EKK0081A010CBSMsg1List | Field list | Constants list for EKK0081A010 CBS message fields (e.g., SVC_CD, SVC_KEI_NO) |
| EKK0191B001CBSMsg1List | Field list | Constants list for EKK0191B001 CBS message fields (e.g., SVC_KEI_UCWK_STAT, VA_KIKI_CHG_NO, SVC_KEI_UCWK_NO) |
| EKK0161B001CBSMsg1List | Field list | Constants list for EKK0161B001 CBS message fields (e.g., SVC_KEI_UCWK_NO, GENE_ADD_DTM, RSV_APLY_YMD) |
| OM-2015-0001066 | Change ticket | Change ticket number for OM-2015-0001066 — removed the `telRelationUpdKiki_from` null check, simplified service contract number extraction to always read from EKK0081A010, and changed device change number source from `telRelationUpdKiki_from` to `telRelationUpdKiki_to` |
| v7.00.50 | Version | Version introducing address-change-in-progress support: added `telRelUpdAdchgChuList`, `telRelUpdSvcUcwkEoTelList`, and the `adchgChuFlg` conditional branching path |
| v19.00.00 | Version | Version that removed the `IDO_DIV_00027` (operation settings) guard condition and simplified it to only `HAISO_DIV_SHURI` (Repair) |
| 修理 (shuri) | Japanese term | Repair — the delivery division code "02" indicating the change is related to a repair operation |
