# Business Logic — JKKSvkeiShosaCC.editMapShosaOkHTel() [330 LOC]

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

## 1. Role

### JKKSvkeiShosaCC.editMapShosaOkHTel()

This method performs the **mapping processing for e-Hikari telephone service contracts** after all photo checks (shousa) have passed (OK). Its name translates to "mapping processing for photo check OK telephone" and it is responsible for preparing the final result maps for display and subsequent processing.

The method handles **two distinct business workflows** controlled by the `canCncSvcKei` flag. When cancellation processing is possible (`canCncSvcKei = true`), it executes **both review and closure** (照査および閉結) — mapping service contract data through both the verification-side and closure-side mappers. When cancellation processing is not possible (`canCncSvcKei = false`), it executes **review-only** (照査) processing, which is used when the review has already completed and only the review-side S-IF should be executed.

The method implements a **routing/dispatch design pattern**: it branches by the cancellation flag, then within each branch iterates over six different service contract types (e-Hikari telephone contract, service contract details, option service contract, sub-option service contract, machine option service contract, and service route deployment) and routes each through the appropriate mapper class. For option service contracts, it adds intelligent transfer-type detection that substitutes the operation transfer classification code when the service type is an "option inheritance" (op-hikitugi).

This is a **shared utility method** called by `JKKSvkeiShosaCC.runSvkeiShosa()` as part of the broader service contract verification workflow. It transforms raw result data from search/lookup operations into mapped message structures ready for business processing, acting as the critical bridge between data retrieval and service contract execution.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["editMapShosaOkHTel(params)"])

    INIT["Initialize: create ServiceComponentRequestInvoker, rsltShosaMap, work arrays"]

    INIT0111["Extract workEKK0111A010Array from rsltShokai[MAP_KEY_EKK0111A010]"]
    INIT0191["Extract workEKK0191A010Array from rsltShokai[MAP_KEY_EKK0191A010]"]
    INIT0371["Extract workEKK0371A010Array from rsltShokai[MAP_KEY_EKK0371A010]"]
    INIT0431["Extract workEKK0431A010Array from rsltShokai[MAP_KEY_EKK0431A010]"]
    INIT2811["Extract workEKK2811A010Array from rsltShokai[MAP_KEY_EKK2811A010]"]
    INIT0251["Extract workEKK0251B003Array from rsltShokai[MAP_KEY_EKK0251B003]"]

    CHKCNC{"canCncSvcKei<br/>Cancel-review+Closure?"}

    BRANCH_REVIEW["Execute Review (照査) only branch"]
    BRANCH_REVIEW0111["Process EKK0111A010<br/>Service Contract<eo光電話> Review"]
    BRANCH_REVIEW0191["Process EKK0191A010<br/>Service Contract Details<eo光電話> Review"]
    BRANCH_REVIEW0371["Process EKK0371A010<br/>Option Service Contract<Telephone> Review"]
    BRANCH_REVIEW0431["Process EKK0431A010<br/>Sub Option Service Contract<Telephone> Review"]
    BRANCH_REVIEW2811["Process EKK2811A010<br/>Machine Option Service Contract Review"]
    BRANCH_REVIEW0251["Process EKK0081A010/PPLAN_CD + EKK0251B003<br/>Service Route Deployment Review<br/>Process EKK3131B010 -> EKK3131A010 -> EKK3131C030"]

    BRANCH_BOTH["Execute Review + Closure (照査および閉結) branch"]
    BRANCH_BOTH0111["Process EKK0111A010<br/>Service Contract<eo光電話> Review & Closure"]
    BRANCH_BOTH0191["Process EKK0191A010<br/>Service Contract Details<eo光電話> Review & Closure"]
    BRANCH_BOTH0371["Process EKK0371A010<br/>Option Service Contract<Telephone> Review & Closure"]
    BRANCH_BOTH0431["Process EKK0431A010<br/>Sub Option Service Contract<Telephone> Review & Closure"]
    BRANCH_BOTH2811["Process EKK2811A010<br/>Machine Option Service Contract Review & Closure"]

    RETURN["Return rsltShosaMap"]

    START --> INIT --> INIT0111 --> INIT0191 --> INIT0371 --> INIT0431 --> INIT2811 --> INIT0251 --> CHKCNC
    CHKCNC -- false --> BRANCH_REVIEW
    CHKCNC -- true --> BRANCH_BOTH

    BRANCH_REVIEW --> BRANCH_REVIEW0111 --> BRANCH_REVIEW0191 --> BRANCH_REVIEW0371 --> BRANCH_REVIEW0431 --> BRANCH_REVIEW2811 --> BRANCH_REVIEW0251 --> RETURN
    BRANCH_BOTH --> BRANCH_BOTH0111 --> BRANCH_BOTH0191 --> BRANCH_BOTH0371 --> BRANCH_BOTH0431 --> BRANCH_BOTH2811 --> RETURN
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `handle` | `SessionHandle` | Session manager handle carrying session context and state for the business process lifecycle. Used when calling `getOpSvcKeiIdoDiv()` to detect option transfer types. |
| 2 | `param` | `IRequestParameterReadWrite` | Request parameter object containing model groups and control maps. Carries business data indexed by work area and serves as the I/O conduit for mapper operations. |
| 3 | `userDataIndex` | `int` | Index within the request parameter that identifies which business data work area to process. Used to select the correct data slice for EKK3131A010/EKK3131B010 query mappers. |
| 4 | `rsltShokai` | `HashMap<String, Object>` | Result data from unique search and list search operations. Contains arrays of service contract records keyed by MAP_KEY constants (EKK0111A010, EKK0191A010, etc.). Acts as the input data source for all mapping operations. |
| 5 | `idoDiv` | `String` | Transfer classification code — indicates the type of business change operation (e.g., new registration, address change, transfer). Used as-is for most mappers, but may be overridden for option service contracts when the operation type is "option inheritance" (`IDO_DIV_OP_HIKITUGI = "00003"`). |
| 6 | `canCncSvcKei` | `boolean` | Flag indicating whether cancellation processing is possible. When `false`, only **review (shousa)** mapping is executed (review-only mode, used when the review S-IF is not executed separately). When `true`, **review and closure** (shousa + heiketsu) mapping is executed for all contract types. |

**Instance fields read by this method:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `shosaOkMapper` | Object (mapper) | The review-side mapper (shousa ok mapper) used for mapping data in the review-only branch. Provides `editInMsgEKK*` methods for each contract type. |
| `shokaiMapper` | Object (mapper) | The inquiry/display mapper (shokai mapper) used for EKK3131B010/EKK3131A010 query mapping in the service route deployment section. |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `JBSbatFUCaseFileRnkData.getString` | JBSbatFUCaseFileRnkData | - | Calls `getString` in `JBSbatFUCaseFileRnkData` |
| R | `JBSbatFUMoveNaviData.getString` | JBSbatFUMoveNaviData | - | Calls `getString` in `JBSbatFUMoveNaviData` |
| R | `JBSbatZMAdDataSet.getString` | JBSbatZMAdDataSet | - | Calls `getString` in `JBSbatZMAdDataSet` |
| C | `ACSV0001Flow.run` | ACSV0001Flow | - | Executes ACSV0001 Flow (SSIF call) via ServiceComponentRequestInvoker |
| C | `CNSV0036OPOperation.run` | CNSV0036OPOperation | - | Executes CNSV0036 OP Operation (SSIF call) via ServiceComponentRequestInvoker |
| C | `CNSV0037Flow.run` | CNSV0037Flow | - | Executes CNSV0037 Flow (SSIF call) via ServiceComponentRequestInvoker |
| C | `CNSV0037OPOperation.run` | CNSV0037OPOperation | - | Executes CNSV0037 OP Operation (SSIF call) via ServiceComponentRequestInvoker |
| C | `CNSV0038Flow.run` | CNSV0038Flow | - | Executes CNSV0038 Flow (SSIF call) via ServiceComponentRequestInvoker |
| R | `EKK0111A010CBSMsg.getString` | EKK0111A010CBS | EKK0111A010 | Extracts fields from EKK0111A010CBSMsg templates (service contract record) |
| R | `EKK0191A010CBSMsg.getString` | EKK0191A010CBS | EKK0191A010 | Extracts fields from EKK0191A010CBSMsg templates (service contract details) |
| R | `EKK0361A010CBSMsg1List.getString` | EKK0361A010CBS | EKK0361A010 | Extracts OP_SVC_KEI_NO for option transfer type detection |
| R | `EKK0371A010CBSMsg.getString` | EKK0371A010CBS | EKK0371A010 | Extracts fields from EKK0371A010CBSMsg templates (option service contract) |
| R | `EKK0431A010CBSMsg.getString` | EKK0431A010CBS | EKK0431A010 | Extracts fields from EKK0431A010CBSMsg templates (sub-option service contract) |
| R | `EKK0081A010CBSMsg.getString` | EKK0081A010CBS | EKK0081A010 | Extracts PPLAN_CD for plan code classification |
| R | `EKK0251B003CBSMsg.getString` | EKK0251B003CBS | EKK0251B003 | Extracts SVC_KEI_KAISEN_UCWK_NO (service route deployment work number) |
| R | `EKK2811A010CBSMsg.getString` | EKK2811A010CBS | EKK2811A010 | Extracts KKOP_SVC_CD and KKOP_SVC_KEI_STAT for machine option contract |
| R | `EKK3131B010CBSMsg.getString` | EKK3131B010CBS | EKK3131B010 | Extracts KOJIHI_KAP_KEI_NO and KAP_KEI_STAT from work contract list |
| R | `EKK3131A010CBSMsg.getString` | EKK3131A010CBS | EKK3131A010 | Extracts KOJIHI_KAP_KEI_NO and UPD_DTM from work contract agreement |
| U | `JKKEponSwchKjInfSksi.editInMsgEKK2811C050` | JKKEponSwchKjInfSksi | - | Edits input message for Epon switch key information update |
| U | `JKKKkopSvcUseKeiUpdCCMapper.editInMsgEKK2811C030` | JKKKkopSvcUseKeiUpdCCMapper | - | Maps input message for EKK2811C030 mapper |
| U | `JKKKkopSvcUseKeiUpdCCMapper.editInMsgEKK2811C050` | JKKKkopSvcUseKeiUpdCCMapper | - | Maps input message for EKK2811C050 mapper |
| U | `JKKOpsvckeiKaihkCC.editInMsgEKK0371C030` | JKKOpsvckeiKaihkCC | - | Maps input message for EKK0371C030 operation |
| U | `JKKSvkeiShosaCC.editInMsgCmn` | JKKSvkeiShosaCC | - | Common input message editing — applies common mapping transformations |
| R | `JKKSvkeiShosaCC.getOpSvcKeiIdoDiv` | JKKSvkeiShosaCC | - | Gets operation service contract transfer classification to detect "option inheritance" type |
| R | `JKKSvkeiShosaCC.getWorkData` | JKKSvkeiShosaCC | - | Extracts CAANMsg array from work data map by CBS message type |
| R | `JKKSvkeiShosaCC.getWorkParentData` | JKKSvkeiShosaCC | - | Extracts parent-level CAANMsg array from work data map |
| U | `JKKSvkeiShosaClShokaiMapperCC.editInMsgEKK3131A010` | JKKSvkeiShosaClShokaiMapperCC | - | Maps input message for EKK3131A010 (work contract agreement inquiry) |
| U | `JKKSvkeiShosaClShokaiMapperCC.editInMsgEKK3131B010` | JKKSvkeiShosaClShokaiMapperCC | - | Maps input message for EKK3131B010 (work contract list inquiry) |
| U | `JKKSvkeiShosaCncMapper.editInMsgEKK0111C020` | JKKSvkeiShosaCncMapper | - | Maps input message for EKK0111C020 (service contract closure) |
| U | `JKKSvkeiShosaCncMapper.editInMsgEKK0191C030` | JKKSvkeiShosaCncMapper | - | Maps input message for EKK0191C030 (service contract details closure) |
| U | `JKKSvkeiShosaCncMapper.editInMsgEKK0371C030` | JKKSvkeiShosaCncMapper | - | Maps input message for EKK0371C030 (option service contract closure) |
| U | `JKKSvkeiShosaCncMapper.editInMsgEKK0431C030` | JKKSvkeiShosaCncMapper | - | Maps input message for EKK0431C030 (sub-option service contract closure) |
| U | `JKKSvkeiShosaCncMapper.editInMsgEKK2811C050` | JKKSvkeiShosaCncMapper | - | Maps input message for EKK2811C050 (machine option service contract closure) |
| U | `JKKSvkeiShosaShokaiMapperCC.editInMsgEKK3131A010` | JKKSvkeiShosaShokaiMapperCC | - | Maps input message for EKK3131A010 inquiry mapper |
| U | `JKKSvkeiShosaShokaiMapperCC.editInMsgEKK3131B010` | JKKSvkeiShosaShokaiMapperCC | - | Maps input message for EKK3131B010 inquiry mapper |
| U | `JKKSvkeiShosaShosaClMapperCC.editResultRPEKK3131A010` | JKKSvkeiShosaShosaClMapperCC | - | Edits result R/P for EKK3131A010 (work contract agreement) |
| U | `JKKSvkeiShosaShosaClMapperCC.editResultRPEKK3131B010` | JKKSvkeiShosaShosaClMapperCC | - | Edits result R/P for EKK3131B010 (work contract list) |
| U | `JKKSvkeiShosaShosaNgMapperCC.editInMsgEKK0111C010` | JKKSvkeiShosaShosaNgMapperCC | - | Maps input message for EKK0111C010 (service contract review - ng mapper) |
| U | `JKKSvkeiShosaShosaNgMapperCC.editInMsgEKK0191C010` | JKKSvkeiShosaShosaNgMapperCC | - | Maps input message for EKK0191C010 (service contract details review - ng mapper) |
| U | `JKKSvkeiShosaShosaNgMapperCC.editInMsgEKK0371C010` | JKKSvkeiShosaShosaNgMapperCC | - | Maps input message for EKK0371C010 (option service contract review - ng mapper) |
| U | `JKKSvkeiShosaShosaNgMapperCC.editInMsgEKK0431C010` | JKKSvkeiShosaShosaNgMapperCC | - | Maps input message for EKK0431C010 (sub-option service contract review - ng mapper) |
| U | `JKKSvkeiShosaShosaNgMapperCC.editInMsgEKK3131C030` | JKKSvkeiShosaShosaNgMapperCC | - | Maps input message for EKK3131C030 (work contract closure review) |

## 5. Dependency Trace

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

No screen/batch entry points found within 8 hops. Direct callers found: 1 methods.
Terminal operations from this method: `editInMsgEKK2811C050` [U], `editInMsgEKK2811C050` [U], `editInMsgEKK2811C050` [U], `editInMsgEKK2811C050` [U], `editInMsgEKK2811C050` [U], `getWorkData` [R], `editInMsgEKK0431C030` [U], `getWorkData` [R], `editInMsgEKK0371C030` [U], `editInMsgEKK0371C030` [U], `editInMsgEKK0371C030` [U], `getOpSvcKeiIdoDiv` [R], `getString` [R], `getString` [R], `getString` [R], `getString` [R], `getString` [R], `getWorkData` [R], `editInMsgEKK0191C030` [U], `editInMsgEKK0191C030` [U]

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | CBS: JKKSvkeiShosaCC.runSvkeiShosa | `runSvkeiShosa` -> `editMapShosaOkHTel` | `editInMsgEKK2811C050 [U]`, `editInMsgEKK0431C030 [U]`, `editInMsgEKK0371C030 [U]`, `editInMsgEKK0191C030 [U]`, `editInMsgEKK0111C020 [U]`, `editInMsgEKK3131A010 [U]`, `editInMsgEKK3131B010 [U]`, `editInMsgEKK3131C030 [U]`, `editInMsgEKK0111C010 [U]`, `editInMsgEKK0191C010 [U]`, `editInMsgEKK0371C010 [U]`, `editInMsgEKK0431C010 [U]`, `editInMsgEKK2811C030 [U]`, `editResultRPEKK3131A010 [U]`, `editResultRPEKK3131B010 [U]` |

## 6. Per-Branch Detail Blocks

**Block 1** — [SET] Initialize data structures (L9060)

> Creates the `ServiceComponentRequestInvoker` (for SSIF execution), result map, and all work arrays that hold extracted contract data.

| # | Type | Code |
|---|------|------|
| 1 | SET | `scCall = new ServiceComponentRequestInvoker()` // ANK-3296 SSIF invoker |
| 2 | SET | `rsltShosaMap = new HashMap()` // Result mapping container |
| 3 | SET | `rslt = null` // Intermediate result holder |
| 4 | SET | `workEKK0111A010Array = null` // Service Contract<eo Light Phone> Agreement Verification |
| 5 | SET | `workEKK0191A010Array = null` // Service Contract Details<eo Light Phone> Agreement Verification |
| 6 | SET | `workEKK0371A010Array = null` // Option Service Contract<Telephone> Agreement Verification |
| 7 | SET | `workEKK0431A010Array = null` // Sub Option Service Contract<Telephone> Agreement Verification |
| 8 | SET | `workEKK2811A010Array = null` // Machine Option Service Contract Agreement Verification |
| 9 | SET | `workEKK0251B003Array = null` // Service Contract Circuit Details List Verification |
| 10 | SET | `wkCaanMsgList = null` // Working CAAN message list |
| 11 | SET | `wkMapArray = null` // Working map array |

**Block 2** — [SET] Extract contract arrays from search results (L9084)

> Retrieves each service contract array from the `rsltShokai` map using MAP_KEY constants.

| # | Type | Code |
|---|------|------|
| 1 | SET | `workEKK0111A010Array = (ArrayList)rsltShokai.get(MAP_KEY_EKK0111A010)` // [-> "EKK0111A010"] |
| 2 | SET | `workEKK0191A010Array = (ArrayList)rsltShokai.get(MAP_KEY_EKK0191A010)` // [-> "EKK0191A010"] |
| 3 | SET | `workEKK0371A010Array = (ArrayList)rsltShokai.get(MAP_KEY_EKK0371A010)` // [-> "EKK0371A010"] |
| 4 | SET | `workEKK0431A010Array = (ArrayList)rsltShokai.get(MAP_KEY_EKK0431A010)` // [-> "EKK0431A010"] |
| 5 | SET | `workEKK2811A010Array = (ArrayList)rsltShokai.get(MAP_KEY_EKK2811A010)` // [-> "EKK2811A010"] |
| 6 | SET | `workEKK0251B003Array = (ArrayList)rsltShokai.get(MAP_KEY_EKK0251B003)` // Service Contract Circuit Details List Verification |

**Block 3** — [IF] Service Contract<eo Light Phone> Review (L9089)

> Iterates over the e-Hikari telephone service contract records. For each record, retrieves child templates via `getWorkData()`, then calls `shosaOkMapper.editInMsgEKK0111C010()` (review mapper) followed by `editInMsgCmn()` (common mapper) to produce mapped result entries.

| # | Type | Code |
|---|------|------|
| 1 | SET | `wkMapArray = new ArrayList()` // Reset work array |
| 2 | IF | `workEKK0111A010Array != null` [L9091] |
| 2.1 | FOR | `i = 0; i < workEKK0111A010Array.size(); i++` [L9093] |
| 2.1.1 | SET | `wkTemplates = getWorkData(EKK0111A010CBSMsg.EKK0111A010CBSMSG1LIST, (Map)workEKK0111A010Array.get(i))` |
| 2.1.2 | FOR | `j = 0; j < wkTemplates.length; j++` [L9095] |
| 2.1.2.1 | SET | `childTemplate = wkTemplates[j]` |
| 2.1.2.2 | CALL | `wkCaanMsgList = shosaOkMapper.editInMsgEKK0111C010(param, childTemplate, idoDiv)` // Map service contract review data |
| 2.1.2.3 | SET | `rslt = editInMsgCmn(param, wkCaanMsgList.get(0))` // Apply common mapping |
| 2.1.2.4 | SET | `wkMapArray.add(rslt)` // Accumulate result |
| 3 | SET | `rsltShosaMap.put(MAP_KEY_EKK0111C010, wkMapArray)` // [-> "EKK0111C010"] |

**Block 4** — [IF] `canCncSvcKei` flag — Review-Only Branch (L9102)

> When `canCncSvcKei` is `false`, only review (shousa) mapping is performed. This means the review S-IF is not executed separately, so only review-side mappers are called.

| # | Type | Code |
|---|------|------|
| 1 | IF | `!canCncSvcKei` // [-> true = Review Only] [L9102] |
| 1.1 | [ELSE-IF section: Service Contract Details<eo Light Phone> Review] (L9107) | |

**Block 4.1** — Service Contract Details<eo Light Phone> Review (L9107)

> Processes service contract detail records through the review mapper `editInMsgEKK0191C010`.

| # | Type | Code |
|---|------|------|
| 1 | SET | `wkMapArray = new ArrayList()` |
| 2 | IF | `workEKK0191A010Array != null` [L9109] |
| 2.1 | FOR | `i = 0; i < workEKK0191A010Array.size(); i++` [L9111] |
| 2.1.1 | SET | `wkTemplates = getWorkData(EKK0191A010CBSMsg.EKK0191A010CBSMSG1LIST, (Map)workEKK0191A010Array.get(i))` |
| 2.1.2 | FOR | `j = 0; j < wkTemplates.length; j++` [L9113] |
| 2.1.2.1 | SET | `childTemplate = wkTemplates[j]` |
| 2.1.2.2 | CALL | `wkCaanMsgList = shosaOkMapper.editInMsgEKK0191C010(param, childTemplate, idoDiv)` |
| 2.1.2.3 | SET | `rslt = editInMsgCmn(param, wkCaanMsgList.get(0))` |
| 2.1.2.4 | SET | `wkMapArray.add(rslt)` |
| 3 | SET | `rsltShosaMap.put(MAP_KEY_EKK0191C010, wkMapArray)` // [-> "EKK0191C010"] |

**Block 4.2** — Option Service Contract<Telephone> Review (L9125)

> Processes option service contract records. Includes special handling: if the option service contract transfer type is "option inheritance" (`IDO_DIV_OP_HIKITUGI = "00003"`), the transfer classification is substituted in the mapper call.

| # | Type | Code |
|---|------|------|
| 1 | SET | `wkMapArray = new ArrayList()` |
| 2 | IF | `workEKK0371A010Array != null` [L9127] |
| 2.1 | FOR | `i = 0; i < workEKK0371A010Array.size(); i++` [L9129] |
| 2.1.1 | SET | `wkTemplates = getWorkData(EKK0371A010CBSMsg.EKK0371A010CBSMSG1LIST, (Map)workEKK0371A010Array.get(i))` |
| 2.1.2 | FOR | `j = 0; j < wkTemplates.length; j++` [L9131] |
| 2.1.2.1 | SET | `childTemplate = wkTemplates[j]` |
| 2.1.2.2 | CALL | `currentIdoDiv = getOpSvcKeiIdoDiv(handle, param, childTemplate.getString(EKK0361A010CBSMsg1List.OP_SVC_KEI_NO))` // Detect option transfer type |
| 2.1.2.3 | SET | `op_idoDiv = idoDiv` // Default to caller's transfer classification |
| 2.1.2.4 | IF | `IDO_DIV_OP_HIKITUGI.equals(currentIdoDiv)` // [-> "00003" = Option Inheritance] [L9135] |
| 2.1.2.4.1 | SET | `op_idoDiv = currentIdoDiv` // Substitute with detected transfer type |
| 2.1.2.5 | CALL | `wkCaanMsgList = shosaOkMapper.editInMsgEKK0371C010(param, childTemplate, op_idoDiv)` |
| 2.1.2.6 | SET | `rslt = editInMsgCmn(param, wkCaanMsgList.get(0))` |
| 2.1.2.7 | SET | `wkMapArray.add(rslt)` |
| 3 | SET | `rsltShosaMap.put(MAP_KEY_EKK0371C010, wkMapArray)` // [-> "EKK0371C010"] |

**Block 4.3** — Sub Option Service Contract<Telephone> Review (L9144)

> Processes sub-option service contract records. Null-safe check on templates array (`null != wkTenplates`).

| # | Type | Code |
|---|------|------|
| 1 | SET | `wkMapArray = new ArrayList()` |
| 2 | IF | `workEKK0431A010Array != null` [L9146] |
| 2.1 | FOR | `i = 0; i < workEKK0431A010Array.size(); i++` [L9148] |
| 2.1.1 | SET | `wkTemplates = getWorkData(EKK0431A010CBSMsg.EKK0431A010CBSMSG1LIST, (Map)workEKK0431A010Array.get(i))` |
| 2.1.2 | FOR | `j = 0; null != wkTemplates && j < wkTemplates.length; j++` [L9150] |
| 2.1.2.1 | SET | `childTemplate = wkTemplates[j]` |
| 2.1.2.2 | CALL | `wkCaanMsgList = shosaOkMapper.editInMsgEKK0431C010(param, childTemplate, idoDiv)` |
| 2.1.2.3 | SET | `rslt = editInMsgCmn(param, wkCaanMsgList.get(0))` |
| 2.1.2.4 | SET | `wkMapArray.add(rslt)` |
| 3 | SET | `rsltShosaMap.put(MAP_KEY_EKK0431C010, wkMapArray)` // [-> "EKK0431C010"] |

**Block 4.4** — Machine Option Service Contract Review (L9158)

> Processes machine option service contract records. Filters to only process records where `KKOP_SVC_CD = "G02"` and `KKOP_SVC_KEI_STAT = "010"` (status = completed) — only telephone verification with VA function and completed status is processed.

| # | Type | Code |
|---|------|------|
| 1 | SET | `wkMapArray = new ArrayList()` |
| 2 | IF | `workEKK2811A010Array != null` [L9161] |
| 2.1 | FOR | `i = 0; i < workEKK2811A010Array.size(); i++` [L9162] |
| 2.1.1 | SET | `wkTemplates = getWorkData(EKK2811A010CBSMsg.EKK2811A010CBSMSG1LIST, (Map)workEKK2811A010Array.get(i))` |
| 2.1.2 | FOR | `j = 0; null != wkTemplates && j < wkTemplates.length; j++` [L9165] |
| 2.1.2.1 | SET | `childTemplate = wkTemplates[j]` |
| 2.1.2.2 | SET | `kkop_svc_cd = childTemplate.getString(EKK2811A010CBSMsg1List.KKOP_SVC_CD)` // Machine option service code |
| 2.1.2.3 | SET | `kkop_svc_kei_stat = childTemplate.getString(EKK2811A010CBSMsg1List.KKOP_SVC_KEI_STAT)` // Service contract status |
| 2.1.2.4 | IF | `"G02".equals(kkop_svc_cd) && "010".equals(kkop_svc_kei_stat)` // [G02 = Telephone, 010 = Completed] [L9171] |
| 2.1.2.4.1 | CALL | `wkCaanMsgList = shosaOkMapper.editInMsgEKK2811C030(param, childTemplate, idoDiv)` // Machine option review mapper |
| 2.1.2.4.2 | SET | `rslt = editInMsgCmn(param, wkCaanMsgList.get(0))` |
| 2.1.2.4.3 | SET | `wkMapArray.add(rslt)` |
| 3 | SET | `rsltShosaMap.put(MAP_KEY_EKK2811C030, wkMapArray)` // [-> "EKK2811C030"] |

**Block 4.5** — Service Route Deployment Review + Work Contract Processing (L9180)

> Complex block: First checks the parent plan code (PPLAN_CD) against telephone plan codes. If it matches a telephone plan, extracts service route deployment work numbers. Then queries work contract list (EKK3131B010) and for each work contract with status "010" (completed), queries work contract agreement (EKK3131A010), executes both as SSIF operations, and maps the results.

| # | Type | Code |
|---|------|------|
| 1 | SET | `wkMapArray = new ArrayList()` |
| 2 | SET | `workEKK0081A010 = getWorkParentData(EKK0081A010CBSMsg.EKK0081A010CBSMSG1LIST, rsltShokai, MAP_KEY_EKK0081A010)` // [-> "EKK0081A010"] |
| 3 | SET | `svcKeiKaisenUcwkNo = null` // Service route deployment work number |
| 4 | SET | `pplan_cd = workEKK0081A010[0].getString(EKK0081A010CBSMsg1List.PPLAN_CD)` // Plan code |
| 5 | IF | `pplan_cd` equals telephone plan code [L9186] |
| 5.1 | IF | `pplan_cd.equals(JKKStrConst.CD00565_TEL1_HOME)` // [-> "PA3101"] OR |
| 5.1.1 | IF | `pplan_cd.equals(JKKStrConst.CD00565_TEL1_MEZON)` // [-> "PA3103"] OR |
| 5.1.2 | IF | `pplan_cd.equals(JKKStrConst.CD00565_TEL2_HOME)` // [-> "PA3201"] OR |
| 5.1.3 | IF | `pplan_cd.equals(JKKStrConst.CD00565_TEL2_MEZON)` // [-> "PA3203"] |
| 5.2 | IF | `workEKK0081A010 != null` [L9189] |
| 5.2.1 | FOR | `i = 0; i < workEKK0081A010.length; i++` |
| 5.2.1.1 | SET | `wkTemplates = getWorkData(EKK0251B003CBSMsg.EKK0251B003CBSMSG1LIST, (Map)workEKK0251B003Array.get(i))` |
| 5.2.1.2 | FOR | `j = 0; null != wkTemplates && j < wkTemplates.length; j++` |
| 5.2.1.2.1 | SET | `svcKeiKaisenUcwkNo = childTemplate.getString(EKK0251B003CBSMsg1List.SVC_KEI_KAISEN_UCWK_NO)` // Service route deployment work number |
| 6 | SET | `kojihi_kap_kei_no = null` // Work contract number |
| 7 | SET | `kap_kei_stat = null` // Work contract status |
| 8 | SET | `kojihikapkeino = null` |
| 9 | SET | `upddtmbf = null` |
| 10 | IF | `svcKeiKaisenUcwkNo != null && !"".equals(svcKeiKaisenUcwkNo)` [L9196] |
| 10.1 | CALL | `inMsgEKK3131B010List = shokaiMapper.editInMsgEKK3131B010(param, userDataIndex, svcKeiKaisenUcwkNo, "1")` // Work contract list inquiry |
| 10.2 | SET | `inMsgEKK3131B010Map = editInMsgCmn(param, inMsgEKK3131B010List.get(0))` |
| 10.3 | CALL | `rsltEKK3131B010 = scCall.run(inMsgEKK3131B010Map, handle)` // Execute SSIF |
| 10.4 | EXEC | `shosaOkMapper.editResultRPEKK3131B010(rsltEKK3131B010, param, userDataIndex)` |
| 10.5 | SET | `workEKK3131B010 = getWorkData(EKK3131B010CBSMsg.EKK3131B010CBSMSG1LIST, rsltEKK3131B010)` |
| 10.6 | FOR | `i = 0; workEKK3131B010 != null && i < workEKK3131B010.length; i++` |
| 10.6.1 | SET | `childTemplate = workEKK3131B010[i]` |
| 10.6.2 | SET | `kojihi_kap_kei_no = childTemplate.getString(EKK3131B010CBSMsg1List.KOJIHI_KAP_KEI_NO)` |
| 10.6.3 | SET | `kap_kei_stat = childTemplate.getString(EKK3131B010CBSMsg1List.KAP_KEI_STAT)` |
| 10.6.4 | IF | `kap_kei_stat.equals(JKKModelConst.KAP_KEI_STAT_UK_ZM)` // [-> "010" = Completed] [L9204] |
| 10.6.4.1 | CALL | `inMsgEKK3131A010List = shokaiMapper.editInMsgEKK3131A010(param, userDataIndex, kojihi_kap_kei_no, "2")` // Work contract agreement inquiry |
| 10.6.4.2 | SET | `inMsgEKK3131A010Map = editInMsgCmn(param, inMsgEKK3131A010List.get(0))` |
| 10.6.4.3 | CALL | `rsltEKK3131A010 = scCall.run(inMsgEKK3131A010Map, handle)` // Execute SSIF |
| 10.6.4.4 | EXEC | `shosaOkMapper.editResultRPEKK3131A010(rsltEKK3131A010, param, userDataIndex)` |
| 10.6.4.5 | SET | `workEKK3131A010 = getWorkData(EKK3131A010CBSMsg.EKK3131A010CBSMSG1LIST, rsltEKK3131A010)` |
| 10.6.4.6 | SET | `rslt = editInMsgCmn(param, inMsgEKK3131A010List.get(0))` |
| 10.6.4.7 | SET | `wkMapArray.add(rslt)` |
| 10.6.4.8 | SET | `rsltShokai.put(MAP_KEY_EKK3131A010, wkMapArray)` |
| 10.6.4.9 | SET | `wkMapArray = new ArrayList()` |
| 10.6.4.10 | IF | `workEKK3131A010 != null` |
| 10.6.4.10.1 | SET | `kojihikapkeino = workEKK3131A010[0].getString(EKK3131A010CBSMsg1List.KOJIHI_KAP_KEI_NO)` |
| 10.6.4.10.2 | SET | `upddtmbf = workEKK3131A010[0].getString(EKK3131A010CBSMsg1List.UPD_DTM)` |
| 10.6.4.11 | CALL | `wkCaanMsgList = shosaOkMapper.editInMsgEKK3131C030(param, kojihikapkeino, upddtmbf)` // Work contract closure review |
| 10.6.4.12 | SET | `rslt = editInMsgCmn(param, wkCaanMsgList.get(0))` |
| 10.6.4.13 | SET | `wkMapArray.add(rslt)` |
| 11 | SET | `rsltShosaMap.put(MAP_KEY_EKK3131C030, wkMapArray)` // [-> "EKK3131C030"] |

**Block 5** — [ELSE] Review + Closure Branch (L9335)

> When `canCncSvcKei` is `true`, both review (shousa) and closure (heiketsu) mapping are performed. Uses `JKKSvkeiShosaCncMapper` (cancellation-side mapper) for closure mapping in addition to `shosaOkMapper` for review mapping.

| # | Type | Code |
|---|------|------|
| 1 | [ELSE] // 照査および閉結 (review and closure) [L9335] | |
| 1.1 | [Service Contract Review & Closure] (L9339) | |

**Block 5.1** — Service Contract<eo Light Phone> Review & Closure (L9339)

> Same iteration structure as Block 3 but uses `JKKSvkeiShosaCncMapper.editInMsgEKK0111C020()` for closure mapping instead of the review-side mapper.

| # | Type | Code |
|---|------|------|
| 1 | SET | `wkMapArray = new ArrayList()` |
| 2 | IF | `workEKK0111A010Array != null` [L9341] |
| 2.1 | FOR | `i = 0; i < workEKK0111A010Array.size(); i++` [L9343] |
| 2.1.1 | SET | `wkTemplates = getWorkData(EKK0111A010CBSMsg.EKK0111A010CBSMSG1LIST, (Map)workEKK0111A010Array.get(i))` |
| 2.1.2 | FOR | `j = 0; j < wkTemplates.length; j++` [L9345] |
| 2.1.2.1 | CALL | `rslt = JKKSvkeiShosaCncMapper.editInMsgEKK0111C020(param, wkTemplates[j], idoDiv)` // Closure mapper |
| 2.1.2.2 | SET | `wkMapArray.add(rslt)` |
| 3 | SET | `rsltShosaMap.put(MAP_KEY_EKK0111C020, wkMapArray)` // [-> "EKK0111C020"] |

**Block 5.2** — Service Contract Details<eo Light Phone> Review & Closure (L9353)

| # | Type | Code |
|---|------|------|
| 1 | SET | `wkMapArray = new ArrayList()` |
| 2 | IF | `workEKK0191A010Array != null` [L9355] |
| 2.1 | FOR | `i = 0; i < workEKK0191A010Array.size(); i++` [L9357] |
| 2.1.1 | SET | `wkTemplates = getWorkData(EKK0191A010CBSMsg.EKK0191A010CBSMSG1LIST, (Map)workEKK0191A010Array.get(i))` |
| 2.1.2 | FOR | `j = 0; j < wkTemplates.length; j++` [L9359] |
| 2.1.2.1 | CALL | `rslt = JKKSvkeiShosaCncMapper.editInMsgEKK0191C030(param, wkTemplates[j], idoDiv)` // Closure mapper |
| 2.1.2.2 | SET | `wkMapArray.add(rslt)` |
| 3 | SET | `rsltShosaMap.put(MAP_KEY_EKK0191C030, wkMapArray)` // [-> "EKK0191C030"] |

**Block 5.3** — Option Service Contract<Telephone> Review & Closure (L9367)

> Same transfer-type substitution logic as Block 4.2: when option transfer type is "option inheritance", the detected transfer code is passed instead of the default.

| # | Type | Code |
|---|------|------|
| 1 | SET | `wkMapArray = new ArrayList()` |
| 2 | IF | `workEKK0371A010Array != null` [L9369] |
| 2.1 | FOR | `i = 0; i < workEKK0371A010Array.size(); i++` [L9371] |
| 2.1.1 | SET | `wkTemplates = getWorkData(EKK0371A010CBSMsg.EKK0371A010CBSMSG1LIST, (Map)workEKK0371A010Array.get(i))` |
| 2.1.2 | FOR | `j = 0; j < wkTemplates.length; j++` [L9373] |
| 2.1.2.1 | SET | `childTemplate = wkTemplates[j]` |
| 2.1.2.2 | CALL | `currentIdoDiv = getOpSvcKeiIdoDiv(handle, param, childTemplate.getString(EKK0361A010CBSMsg1List.OP_SVC_KEI_NO))` |
| 2.1.2.3 | SET | `op_idoDiv = idoDiv` |
| 2.1.2.4 | IF | `IDO_DIV_OP_HIKITUGI.equals(currentIdoDiv)` // [-> "00003"] [L9377] |
| 2.1.2.4.1 | SET | `op_idoDiv = currentIdoDiv` |
| 2.1.2.5 | CALL | `rslt = JKKSvkeiShosaCncMapper.editInMsgEKK0371C030(param, childTemplate, op_idoDiv)` // Closure mapper |
| 2.1.2.6 | SET | `wkMapArray.add(rslt)` |
| 3 | SET | `rsltShosaMap.put(MAP_KEY_EKK0371C030, wkMapArray)` // [-> "EKK0371C030"] |

**Block 5.4** — Sub Option Service Contract<Telephone> Review & Closure (L9385)

| # | Type | Code |
|---|------|------|
| 1 | SET | `wkMapArray = new ArrayList()` |
| 2 | IF | `workEKK0431A010Array != null` [L9387] |
| 2.1 | FOR | `i = 0; i < workEKK0431A010Array.size(); i++` |
| 2.1.1 | SET | `wkTemplates = getWorkData(EKK0431A010CBSMsg.EKK0431A010CBSMSG1LIST, (Map)workEKK0431A010Array.get(i))` |
| 2.1.2 | FOR | `j = 0; null != wkTemplates && j < wkTemplates.length; j++` |
| 2.1.2.1 | SET | `childTemplate = wkTemplates[j]` |
| 2.1.2.2 | CALL | `rslt = JKKSvkeiShosaCncMapper.editInMsgEKK0431C030(param, childTemplate, idoDiv)` // Closure mapper |
| 2.1.2.3 | SET | `wkMapArray.add(rslt)` |
| 3 | SET | `rsltShosaMap.put(MAP_KEY_EKK0431C030, wkMapArray)` // [-> "EKK0431C030"] |

**Block 5.5** — Machine Option Service Contract Review & Closure (L9391)

| # | Type | Code |
|---|------|------|
| 1 | SET | `wkMapArray = new ArrayList()` |
| 2 | IF | `workEKK2811A010Array != null` [L9393] |
| 2.1 | FOR | `i = 0; i < workEKK2811A010Array.size(); i++` |
| 2.1.1 | SET | `wkTemplates = getWorkData(EKK2811A010CBSMsg.EKK2811A010CBSMSG1LIST, (Map)workEKK2811A010Array.get(i))` |
| 2.1.2 | FOR | `j = 0; j < wkTemplates.length; j++` |
| 2.1.2.1 | CALL | `rslt = JKKSvkeiShosaCncMapper.editInMsgEKK2811C050(param, wkTemplates[j], idoDiv)` // Closure mapper |
| 2.1.2.2 | SET | `wkMapArray.add(rslt)` |
| 3 | SET | `rsltShosaMap.put(MAP_KEY_EKK2811C050, wkMapArray)` // [-> "EKK2811C050"] |

**Block 6** — [RETURN] (L9400)

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return rsltShosaMap` // Returns all mapped result data |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `shousa` (照査) | Business term | Review/verification — the process of checking service contract data before finalizing |
| `heiketsu` (閉結) | Business term | Closure — the process of finalizing a service contract after review is complete |
| `kan-sei` (完了) | Business term | Completed status; the state when a service contract closure has been finished |
| `eo光電話` (eo Hikari Denwa) | Business term | e-Hikari Telephone — Fujitsu's fiber-optic telephone service brand |
| `ido_div` (異同区分) | Field | Transfer/inconsistency classification code — indicates the type of business change (new registration, address change, transfer, etc.) |
| `IDO_DIV_OP_HIKITUGI` | Constant | Option inheritance transfer classification — code "00003", used when an option service contract is being transferred |
| `IDO_DIV_AD_CHG_ADD` | Constant | Address change/registration transfer classification — code "00019" |
| `canCncSvcKei` | Field | Cancellation service closure possible flag — when true, both review and closure mapping is executed; when false, only review mapping |
| `service_contract` (サービス契約) | Business term | The primary service agreement for e-Hikari telephone service (EKK0111A010) |
| `service_contract_details` (サービス契約内訳) | Business term | Detailed breakdown of service contract items (EKK0191A010) |
| `option_service_contract` (オプションサービス契約) | Business term | Optional add-on service contract for telephone (EKK0371A010) |
| `sub_option_service_contract` (サブオプションサービス契約) | Business term | Secondary optional service contract for telephone (EKK0431A010) |
| `machine_option_service_contract` (機器オプションサービス契約) | Business term | Equipment/machine optional service contract (EKK2811A010) |
| `service_route_deployment` (サービス契約回線内訳) | Business term | Service contract line deployment details (EKK0251B003) |
| `work_contract` (工事費割賦契約) | Business term | Construction fee installment contract — financing agreement for installation costs |
| `work_contract_agreement` (工事費割賦契約一覧照会) | Business term | Work contract list inquiry — EKK3131B010, retrieves installment contract records |
| `work_contract_agreement_detail` (工事費割賦契約一覧照会) | Business term | Work contract agreement inquiry — EKK3131A010, retrieves agreement details |
| `PPLAN_CD` | Field | Plan code — identifies the service plan type (e.g., telephone home plan "PA3101", telephone maison plan "PA3103") |
| `KKOP_SVC_CD` | Field | Machine option service code — identifies the type of machine option service |
| `KKOP_SVC_KEI_STAT` | Field | Machine option service contract status — "010" means completed |
| `OP_SVC_KEI_NO` | Field | Option service contract number — unique identifier for option service contracts |
| `SVC_KEI_KAISEN_UCWK_NO` | Field | Service route deployment work number — internal tracking ID for service route deployment line items |
| `KOJIHI_KAP_KEI_NO` | Field | Work contract number — unique identifier for installation fee installment contracts |
| `KAP_KEI_STAT` | Field | Work contract status — "010" (KAP_KEI_STAT_UK_ZM) means completed |
| `UPD_DTM` | Field | Update timestamp — date/time of last update for work contract records |
| `MAP_KEY_EKK*` | Constant | Map key constants used to identify service contract arrays in the result HashMap |
| `shosaOkMapper` | Component | Review-side mapper object — handles mapping for review-only processing (EKKxxxxC010 methods) |
| `JKKSvkeiShosaCncMapper` | Component | Cancellation-side mapper object — handles mapping for review + closure processing (EKKxxxxC020/C030/C050 methods) |
| `shokaiMapper` | Component | Inquiry/display mapper object — handles data retrieval mapping for EKK3131A010/B010 |
| `editInMsgCmn` | Method | Common input message editor — applies standard mapping transformations across all contract types |
| `getWorkData` | Method | Retrieves CAANMsg arrays from work data maps by CBS message type constant |
| `getWorkParentData` | Method | Retrieves parent-level CAANMsg arrays from the search result map |
| `getOpSvcKeiIdoDiv` | Method | Detects the operation service contract transfer classification to handle option inheritance scenarios |
| `SSIF` | Acronym | Service System Integration Framework — Fujitsu's service execution framework |
| `ServiceComponentRequestInvoker` | Component | SSIF execution invoker — used to run SSIF operations (EKK3131B010, EKK3131A010) programmatically |
| `CAANMsg` | Component | Communication message abstraction — wraps service contract data for mapper processing |
| `IT1-589` | Change ID | 2012-01-27 change that added the `canCncSvcKei` dual-mode processing (review-only vs review+closure) |
| `ST1-2012-0000139` | Change ID | 2012-07-17 change that added option inheritance transfer type substitution for option service contracts |
| `AMK-1578-00-00` | Change ID | Change that added machine option service contract processing (EKK2811A010/EKK2811C030) |
| `ANK-3296-00-00` | Change ID | Change that added service route deployment review processing (EKK0081A010/EKK0251B003/EKK3131A010/B010/C030) and ServiceComponentRequestInvoker |
