# Business Logic — JKKBumpMdsCC.executeBumpMds() [664 LOC]

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

## 1. Role

### JKKBumpMdsCC.executeBumpMds()

This method executes a phone number port-back (port-out cancellation / SIP dissociation) operation, commonly known as "bangyo-modoshi" (番ポ戻し) in the Japanese telecom domain. It is the central orchestration method for reversing a port-out — i.e., returning a phone number that was previously ported out back to K-Opticom's network. The method implements a sequential gate-and-proceed pattern: it runs a series of pre-condition checks against the customer's service contract, SOD (Service Order Data) state, phone number token status, and port-out acceptance information, and only proceeds to the actual port-back processing if all checks pass.

The method handles two service paths depending on whether the phone number has a port-out flag (BMP_1 = "1", meaning the number was ported out with a port-out request) — in which case it performs a phone number change (EZM0121C010SC_2) and port-out status change (ETU0151C030SC); or whether the number has no port-out flag (番ポなし), in which case it looks up the telecom carrier (ETU0051B010SC) and then executes a phone number change (EZM0121C010SC). In both paths, it also processes ENUM (E.164 Number Mapping) service order data: if the port-back involves a number without port-out, it sends an ENUM deletion service order; if the number has no port-out flag, it sends an ENUM registration service order. The method delegates SOD issuance to `JKKHakkoSODCC.hakkoSOD()`, which is the shared service order data dispatch engine used across the system. Upon completion, it registers a progress record and returns the enriched parameter object. This method serves as the primary business logic entry point for the "Phone Number Information Change" screen (KKSV0212) and is invoked via the BPM operation framework.

## 2. Processing Pattern (Detailed Business Logic)

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

    START --> INIT["Initialize: opeDate, requestParam, err_code, err_type"]

    INIT --> EXTRACT["Extract Parameters: sysid, svcKeiNo, svcKeiUcwkNo, telNo, prm_ido_div, prm_ido_rsn_cd, enum_krke_douji"]

    EXTRACT --> CHECK1["Check: Service Contract Info callEKK0191A010SC"]

    CHECK1 --> CHECK2["Check: Service Contract Status callEKK0161A010SC"]

    CHECK2 --> STATUS_CHECK{Status = 100?}

    STATUS_CHECK --> |No| ERR002["Set ERR_CD=1100, ERR_TYPE=E002, return param"]

    STATUS_CHECK --> |Yes| CHECK3["Check: Past SOD Execution callEKK1041B001SC"]

    CHECK3 --> SOD_LOOP["Loop: Check RCNT_YOKYU_SBT_CD"]

    SOD_LOOP --> SOD_CHECK{rcnt_yokyu_sbt_cd = 03 or 08?}

    SOD_CHECK --> |Yes| ERR005["Set ERR_CD=1100, ERR_TYPE=E005, return param"]

    SOD_CHECK --> |No| CHECK4["Check: Pending SOD Orders callEKK1081B001SC"]

    CHECK4 --> SOD2_LOOP["Loop: Check YOKYU_SBT_CD for target svcKeiUcwkNo"]

    SOD2_LOOP --> SOD2_CHECK{yokyu_sbt_cd = 03 or 08?}

    SOD2_CHECK --> |Yes| ERR006["Set ERR_CD=1100, ERR_TYPE=E006, return param"]

    SOD2_CHECK --> |No| CHECK5["Check: Phone Number Token Status"]

    CHECK5 --> TOKI_CHECK{Token pending?}

    TOKI_CHECK --> |Yes| ERR004["Set ERR_CD=1100, ERR_TYPE=E004, return param"]

    TOKI_CHECK --> |No| CHECK6["Check: Other Contract Usage callEKK0161B013SC"]

    CHECK6 --> OTHER_CHECK{Other active contract?}

    OTHER_CHECK --> |Yes| ERR008["Set ERR_CD=1100, ERR_TYPE=E008, return param"]

    OTHER_CHECK --> |No| TELNO_STAT["Phone Number Status Judge JKKTelnoStatJudgeCC"]

    TELNO_STAT --> ENUM_CHECK{enum_krke_douji == false?}

    ENUM_CHECK --> |Yes| ERR010["Set ERR_CD=1100, ERR_TYPE=E010, return param"]

    ENUM_CHECK --> |No| STAT06_CHECK{telnoJudgeDiv = 06 or 11?}

    STAT06_CHECK --> |Yes| ERR011["Set ERR_CD=1100, ERR_TYPE=E011, return param"]

    STAT06_CHECK --> |No| MULTISTAT_CHECK{Multiple statuses?}

    MULTISTAT_CHECK --> |Yes| ERR012["Set ERR_CD=1100, ERR_TYPE=E012, return param"]

    MULTISTAT_CHECK --> |No| BUILD_SOD["Build SOD Data Map"]

    BUILD_SOD --> CALL_SOD["Call SOD CC hakkoSOD"]

    CALL_SOD --> CALL_ETU0151["Call Port-Out Acceptance callETU0151A011SC"]

    CALL_ETU0151 --> ENUM_SOD_MAP{Is Jisha self?}

    ENUM_SOD_MAP --> |Yes| CALL_ENUM_SOD["Call ENUM SOD hakkoSOD"]

    ENUM_SOD_MAP --> |No| CALL_EZM["Call Phone Number Agreement callEZM0121A010SC"]

    CALL_ENUM_SOD --> CALL_EZM

    CALL_EZM --> BMP_BRANCH{Has Port-Out?}

    BMP_BRANCH --> |Yes| PHONE_CHANGE["Phone Number Change callEZM0121C010SC_2"]

    PHONE_CHANGE --> PORTOUT_STATUS["Port-Out Status Change callETU0151C030SC"]

    PORTOUT_STATUS --> END_SUCCESS["Set ERR_CD=0000, return param"]

    BMP_BRANCH --> |No| TELCO_LIST["Telecom Carrier List callETU0051B010SC"]

    TELCO_LIST --> EZM_CHANGE["Phone Number Change callEZM0121C010SC"]

    EZM_CHANGE --> PORTOUT_STATUS2["Port-Out Status Change callETU0151C030SC"]

    PORTOUT_STATUS2 --> END_SUCCESS

    END_SUCCESS --> PROGRESS["Register Progress callEKK1091D010SC"]

    PROGRESS --> NORMAL["Set err_code = 0000, return param"]

    ERR002 --> RETURN_E["Return param error"]
    ERR005 --> RETURN_E
    ERR006 --> RETURN_E
    ERR004 --> RETURN_E
    ERR008 --> RETURN_E
    ERR010 --> RETURN_E
    ERR011 --> RETURN_E
    ERR012 --> RETURN_E
    NORMAL --> END_NODE(["End"])
```

**Constant Resolution:**
- `BMP_1 = "1"` (Port-Out flag: "1" means port-out exists / 番ポあり)
- `ERR_LV_BIJINES_ERR = "1100"` (Business error level indicator)
- `ERR_LV_NOMAL = "0000"` (Normal completion code)
- `TELNOJUDGEDIV_04 = "04"` (No port-out — port-out status)
- `TELNOJUDGEDIV_05 = "05"` (No port-out — number retrieval carrier return, pre-switch)
- `TELNOJUDGEDIV_06 = "06"` (No port-out — number retrieval carrier return, post-switch to pre-batch)
- `TELNOJUDGEDIV_09 = "09"` (No port-out — intra-network port-out, port-out status)
- `TELNOJUDGEDIV_10 = "10"` (No port-out — intra-network port-out, number retrieval carrier return, pre-switch)
- `TELNOJUDGEDIV_11 = "11"` (No port-out — intra-network port-out, number retrieval carrier return, post-switch to pre-batch)
- `TLNSTKUTSJGS_JISHATASHADIV_JISHA = "1"` (Phone number retrieval telecom carrier: own company / 自社)
- `IDO_DIV_ENUMDEL = "09001"` (ENUM deletion service code)
- `IDO_DIV_ENUMIADD = "09002"` (ENUM registration service code)
- `FUNC_CODE_KEY` maps to value `"1"` (SOD issuance function code)

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `handle` | `SessionHandle` | Database session handle representing the current user's database connection context for the operation. Used to execute all service component and database calls within the transaction scope. |
| 2 | `param` | `IRequestParameterReadWrite` | Request/response parameter object that carries business data between the calling screen (KKSV0212) and this component. Contains the service contract number, phone number, port-back reason codes, and other input parameters. Also receives error codes and output data set throughout processing. |
| 3 | `fixedText` | `String` | A text identifier used as a key to retrieve data from the `param` object via `param.getData(this.fixedTextGlobal)`. Acts as the data key/namespace for accessing the service-specific parameter map within the broader request parameter context. Set as an instance field `fixedTextGlobal` for use across the class. |

**Instance fields used by this method:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `fixedTextGlobal` | `String` | Copy of the `fixedText` parameter, stored as an instance field for use throughout the method's processing. |
| `opeDate` | `String` | Operation date obtained at method start from `JCCBPCommon.getOpeDate(null)`. Used as the business date for all transactions. |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `callEKK0191A010SC` | EKK0191A010SC | EKK0191A010CBSMsg | Service Contract Info <Phone> confirmation — retrieves service contract details including port-out flag (BMP_UM), token status (DSL_PAUSE_TOKI_SBT_CD, ITENS_OPAF_TOKI_SBT_CD), and genealogy dates |
| R | `callEKK0161A010SC` | EKK0161A010SC | EKK0161A010CBSMsg | Service Contract Info agreement confirmation — retrieves service contract line item status (SVC_KEI_UCWK_STAT) to verify it is 100 (active/available) |
| R | `callEKK1041B001SC` | EKK1041B001SC | EKK1041B001CBSMsg | Order settings list confirmation (Phone order / SIP designation, service contract line) — retrieves past SOD execution results to check if last request type code (RCNT_YOKYU_SBT_CD) is 03 (cancellation) or 08 (deletion) |
| R | `callEKK1081B001SC` | EKK1081B001SC | EKK1081B001CBSMsg | Order issuance condition list confirmation — retrieves pending SOD conditions for the service contract number and line number, checking for unprocessed cancellation (03) or deletion (08) orders targeting the specific line item |
| R | `callEKK0161B013SC` | EKK0161B013SC | EKK0161B013CBSMsg | Service contract line list confirmation (Phone number) — checks for other active contracts using the same phone number, to verify no other contract besides the target is in active status |
| - | `JKKTelnoStatJudgeCC.telnoStatJudge` | - | - | Phone number status judgment component — determines the current status of the phone number (port-out state, number retrieval state, etc.) and whether it belongs to own company or another carrier |
| R | `callETU0151A011SC` | ETU0151A011SC | ETU0151A011CBSMsg | Port-out acceptance agreement confirmation (service contract) — retrieves port-out acceptance information including port-out number and generation date |
| - | `hakkoSOD` (JKKHakkoSODCC) | - | - | SOD (Service Order Data) issuance — the shared service order dispatch engine that creates service order data for the back-end system |
| R | `callEZM0121A010SC` | EZM0121A010SC | EZM0121A010CBSMsg | Phone number agreement confirmation — retrieves the phone number agreement information as a prerequisite before executing the phone number change |
| C | `callETU0051B010SC` | ETU0051B010SC | ETU0051B010CBSMsg | Telecom carrier list confirmation — when no port-out flag exists, this looks up the carrier information for the phone number before executing the phone number change |
| C | `callEZM0121C010SC_2` | EZM0121C010SC | EZM0121C010CBSMsg | Phone number change (port-back with port-out) — updates the phone number with port-out cancellation, changing port-out request control code to "0: not required" |
| C | `callETU0151C030SC` | ETU0151C030SC | ETU0151C030CBSMsg | Port-out acceptance status change — updates the port-out acceptance status (ETU) record |
| C | `callEZM0121C010SC` | EZM0121C010SC | EZM0121C010CBSMsg | Phone number change (port-back without port-out) — updates the phone number by looking up carrier info first |
| C | `callEKK1091D010SC` | EKK1091D010SC | EKK1091D010CBSMsg | Progress registration — registers the processing progress record with program detail number, service contract number, dislocation division, phone number, and dislocation reason code |

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Screen:KKSV0212 | `KKSV0212OPOperation.target1` (CCRequestBroker) -> `JKKBumpMdsCC.executeBumpMds` | SOD issuance, Port-back execution, Progress registration |

**Caller Details:**
- **KKSV0212OPOperation** — The BPM operation class for the "Phone Number Information Change" (電話番号情報変更) screen. It configures a `CCRequestBroker` targeting `JKKBumpMdsCC.executeBumpMds` with parameter key `"trgt_data"`. The broker sets up DB connection and invokes this method as the core business operation. This is the sole caller found.

**Call Chain Terminal Effects:**
- SOD issuance (`hakkoSOD`) -> Service Order Data creation
- ENUM SOD (`hakkoSOD` with `enumSodTrgtData`) -> ENUM service order data creation
- Phone Number Change (`callEZM0121C010SC`, `callEZM0121C010SC_2`) -> EZM0121CBS phone number update
- Port-Out Status Change (`callETU0151C030SC`) -> ETU0151CBS port-out acceptance status update
- Progress Registration (`callEKK1091D010SC`) -> Progress tracking record creation

## 6. Per-Branch Detail Blocks

### Block 1 — INIT `(Initial Setup)` (L214)

> Sets up the operational environment: gets the current operation date, initializes result hash map, creates a service component request invoker, and extracts the request parameter map.

| # | Type | Code |
|---|------|------|
| 1 | SET | `opeDate = JCCBPCommon.getOpeDate(null)` // Operation date acquisition [-> JCCBPCommon.getOpeDate] |
| 2 | SET | `resultHash = new HashMap<String, Object>()` // SIF result storage |
| 3 | SET | `scCall = new ServiceComponentRequestInvoker()` // Service component invoker instantiation |
| 4 | SET | `this.fixedTextGlobal = fixedText` // Store fixedText as instance field |
| 5 | SET | `requestParam = (HashMap)param.getData(this.fixedTextGlobal)` // Extract request parameter map |
| 6 | SET | `statusCode = 0` // Return code for status checking |
| 7 | SET | `err_code = new String()` // Error code (self-implemented) |
| 8 | SET | `err_type = new String()` // Error type (self-implemented) |

### Block 2 — EXTRACT `(Parameter Extraction)` (L236)

> Extracts input parameters from the request parameter map. This is the input preparation block that reads all parameters needed for subsequent processing.

| # | Type | Code |
|---|------|------|
| 1 | SET | `sysid = (String)requestParam.get(SYSID)` // Target SYSID |
| 2 | SET | `svcKeiNo = (String)requestParam.get(SVC_KEI_NO)` // Target service contract number |
| 3 | SET | `svcKeiUcwkNo = (String)requestParam.get(SVC_KEI_UCWK_NO)` // Target service contract line number |
| 4 | SET | `telNo = (String)requestParam.get(TELNO)` // Phone number |
| 5 | SET | `prm_ido_div = (String)requestParam.get(IDO_DIV)` // Dislocation division (reason code) |
| 6 | SET | `prm_ido_rsn_cd = (String)requestParam.get(IDO_RSN_CD)` // Dislocation reason code |
| 7 | SET | `zm0121UpdDtm = (String)requestParam.get(ZM0121_UPD_DTM)` // Phone number update date-time [-> ANK-4494-00-00] |
| 8 | SET | `tu0151UpdDtm = (String)requestParam.get(TU0151_UPD_DTM)` // Port-out update date-time [-> ANK-4494-00-00] |
| 9 | SET | `enum_krke_douji = (Boolean)requestParam.get(ENUM_KRKE_DOUJI)` // ENUM simultaneous switch flag [-> ANK-4494-00-00] |

### Block 3 — CHECK Service Contract Info `(callEKK0191A010SC)` (L285)

> Retrieves service contract information for the target line. This includes the port-out flag (BMP_UM), token status codes, and genealogy dates needed for downstream checks.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `statusCode = callEKK0191A010SC(param, handle, requestParam, resultHash, svcKeiUcwkNo)` // Service Contract Info <Phone> confirmation |
| 2 | IF | `if(statusCode != 0)` -> return param [L290] |
| 3 | SET | `eKK0191A010Hash = (HashMap)resultHash.get(TEMPLATE_ID_EKK0191A010)` // Get service contract info result |
| 4 | SET | `bmpUm = (String)eKK0191A010Hash.get(EKK0191A010CBSMsg1List.BMP_UM)` // Port-out flag [-> BMP_1="1"] |

**Block 3.1 — IF (Error Return)** `(statusCode != 0)` (L290)

> If the service contract info call fails, immediately return the parameter with the error set by the SC.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return param` |

### Block 4 — CHECK Service Contract Status `(callEKK0161A010SC)` (L310)

> Verifies the service contract line item is in status "100" (active/available). If the status is anything other than "100", the port-back cannot proceed.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `statusCode = callEKK0161A010SC(param, handle, requestParam, resultHash, svcKeiUcwkNo)` // Service Contract agreement confirmation |
| 2 | IF | `if(statusCode != 0)` -> return param [L314] |
| 3 | SET | `eKK0161A010Hash = (HashMap)resultHash.get(TEMPLATE_ID_EKK0161A010)` |
| 4 | SET | `svcKeiUcwkStats = (String)eKK0161A010Hash.get(EKK0161A010CBSMsg1List.SVC_KEI_UCWK_STAT)` |

**Block 4.1 — IF (Status != 100)** `(!"100".equals(svcKeiUcwkStats))` (L320)

> Service contract line is not in active status (100). Business error E002.

| # | Type | Code |
|---|------|------|
| 1 | SET | `err_code = ERR_LV_BIJINES_ERR` [-> "1100"] |
| 2 | SET | `err_type = "E002"` |
| 3 | EXEC | `requestParam.put(ERR_CD, err_code)` |
| 4 | EXEC | `requestParam.put(ERR_TYPE, err_type)` |
| 5 | RETURN | `return param` |

### Block 5 — CHECK Past SOD Execution `(callEKK1041B001SC)` (L329)

> Checks if there are any past SOD (Service Order Data) executions for this line. If the latest request type code is "03" (cancellation / 解約) or "08" (deletion / 削除), the port-back is not allowed.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `statusCode = callEKK1041B001SC(param, handle, requestParam, resultHash, svcKeiUcwkNo)` // Order settings list confirmation |
| 2 | IF | `if(statusCode != 0)` -> return param [L333] |
| 3 | SET | `eKK1041B001List = (CAANMsg[])resultHash.get(TEMPLATE_ID_EKK1041B001)` |

**Block 5.1 — FOR Loop** `(i = 0; i < eKK1041B001List.length; i++)` (L336)

> Iterates over past SOD results. Checks each entry's request type code.

| # | Type | Code |
|---|------|------|
| 1 | SET | `eKK1041B001Hash = eKK1041B001List[i].getMsgData()` |
| 2 | SET | `rcnt_yokyu_sbt_cd = (String)eKK1041B001Hash.get(EKK1041B001CBSMsg1List.RCNT_YOKYU_SBT_CD)` // Latest request type code |

**Block 5.1.1 — IF (rcnt_yokyu_sbt_cd = 03 or 08)** `("03".equals(rcnt_yokyu_sbt_cd) || "08".equals(rcnt_yokyu_sbt_cd))` (L343)

> Last request type is cancellation (03 / 解約) or deletion (08 / 削除). Error E005 — port-back not allowed because a cancellation or deletion order already exists.

| # | Type | Code |
|---|------|------|
| 1 | SET | `err_code = ERR_LV_BIJINES_ERR` [-> "1100"] |
| 2 | SET | `err_type = "E005"` |
| 3 | EXEC | `break` |

**Block 5.2 — IF (Error detected in loop)** `(ERR_LV_BIJINES_ERR.equals(err_code))` (L354)

> If an error was set during the SOD loop, skip remaining processing.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `requestParam.put(ERR_CD, err_code)` |
| 2 | EXEC | `requestParam.put(ERR_TYPE, err_type)` |
| 3 | RETURN | `return param` |

### Block 6 — CHECK Pending SOD Orders `(callEKK1081B001SC)` (L363)

> Checks for pending (unprocessed) SOD orders targeting this service contract line. If any pending order has request type code "03" (cancellation) or "08" (deletion) for the target line, error E006 is raised.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `statusCode = callEKK1081B001SC(param, handle, requestParam, resultHash, svcKeiUcwkNo, svcKeiNo)` // Order issuance condition list confirmation |
| 2 | IF | `if(statusCode != 0)` -> return param [L367] |
| 3 | SET | `eKK1081B001List = (CAANMsg[])resultHash.get(TEMPLATE_ID_EKK1081B001)` |

**Block 6.1 — FOR Loop** `(i = 0; i < eKK1081B001List.length; i++)` (L371)

> Iterates over pending SOD order conditions.

| # | Type | Code |
|---|------|------|
| 1 | SET | `eKKeKK1081B001ListHash = eKK1081B001List[i].getMsgData()` |
| 2 | SET | `yokyu_sbt_cd = (String)eKKeKK1081B001ListHash.get(EKK1081B001CBSMsg1List.YOKYU_SBT_CD)` // Request type code |
| 3 | SET | `tgSvcKeiUcwkNo = (String)eKKeKK1081B001ListHash.get(EKK1081B001CBSMsg1List.KK1551_SVC_KEI_UCWK_NO)` // Target service contract line number |

**Block 6.1.1 — IF (yokyu_sbt_cd = 03 or 08 AND matches target line)** `("03".equals(yokyu_sbt_cd) || "08".equals(yokyu_sbt_cd) && !" ".equals(tgSvcKeiUcwkNo) && tgSvcKeiUcwkNo != null && svcKeiUcwkNo.equals(tgSvcKeiUcwkNo))` (L379)

> Pending cancellation/deletion order found for the target line. Error E006 — cannot port-back while a cancellation or deletion order is pending.

| # | Type | Code |
|---|------|------|
| 1 | SET | `err_code = ERR_LV_BIJINES_ERR` [-> "1100"] |
| 2 | SET | `err_type = "E006"` |
| 3 | EXEC | `break` |

**Block 6.2 — IF (Error in pending SOD loop)** `(ERR_LV_BIJINES_ERR.equals(err_code))` (L389)

> If error detected during pending SOD check, skip remaining processing.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `requestParam.put(ERR_CD, err_code)` |
| 2 | EXEC | `requestParam.put(ERR_TYPE, err_type)` |
| 3 | RETURN | `return param` |

### Block 7 — CHECK Token Status (L425)

> Re-fetches service contract info and checks the token status. If there is a pending token (dissociation or transfer) without an end date, the port-back cannot proceed.

| # | Type | Code |
|---|------|------|
| 1 | SET | `eKK0191A010Hash = (HashMap)resultHash.get(TEMPLATE_ID_EKK0191A010)` // Re-fetch |
| 2 | SET | `dsl_pause_toki_sbt_cd = (String)eKK0191A010Hash.get(EKK0191A010CBSMsg1List.DSL_PAUSE_TOKI_SBT_CD)` // Dissociation/stop token type code |
| 3 | SET | `dsl_pause_toki_end_ymd = (String)eKK0191A010Hash.get(EKK0191A010CBSMsg1List.DSL_PAUSE_TOKI_END_YMD)` // Dissociation/stop token end date |
| 4 | SET | `itens_opaf_toki_sbt_cd = (String)eKK0191A010Hash.get(EKK0191A010CBSMsg1List.ITENS_OPAF_TOKI_SBT_CD)` // Transfer-origin token type code |
| 5 | SET | `itens_opaf_toki_end_ymd = (String)eKK0191A010Hash.get(EKK0191A010CBSMsg1List.ITENS_OPAF_TOKI_END_YMD)` // Transfer-origin token end date |

**Block 7.1 — IF (Token pending)** `((dsl_pause_toki_sbt_cd != null && !" ".equals(dsl_pause_toki_sbt_cd) && (dsl_pause_toki_end_ymd == null || " ".equals(dsl_pause_toki_end_ymd))) \|\| (itens_opaf_toki_sbt_cd != null && !" ".equals(itens_opaf_toki_sbt_cd) && (itens_opaf_toki_end_ymd == null || " ".equals(itens_opaf_toki_end_ymd))))` (L435)

> There is a token (dissociation or transfer) that has been started but not completed (no end date set). Error E004 — port-back not allowed while token is pending.

| # | Type | Code |
|---|------|------|
| 1 | SET | `err_code = ERR_LV_BIJINES_ERR` [-> "1100"] |
| 2 | SET | `err_type = "E004"` |
| 3 | EXEC | `requestParam.put(ERR_CD, err_code)` |
| 4 | EXEC | `requestParam.put(ERR_TYPE, err_type)` |
| 5 | RETURN | `return param` |

### Block 8 — CHECK Other Contract Usage `(callEKK0161B013SC)` (L447)

> Checks if there are other service contracts using the same phone number. If any other contract (not the target line) has an active status other than "910" or "920", error E008 is raised.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `statusCode = callEKK0161B013SC(param, handle, requestParam, resultHash, svcKeiUcwkNo, telNo)` // Service contract line list confirmation (Phone) |
| 2 | IF | `if(statusCode != 0)` -> return param [L450] |
| 3 | SET | `eKK0161B013List = (CAANMsg[])resultHash.get(TEMPLATE_ID_EKK0161B013)` |

**Block 8.1 — FOR Loop** `(i = 0; i < eKK0161B013List.length; i++)` (L455)

> Iterates over other contracts using the same phone number.

| # | Type | Code |
|---|------|------|
| 1 | SET | `eKK0161B013ListHash = eKK0161B013List[i].getMsgData()` |
| 2 | SET | `kasSvckeiUcwkNo = (String)eKK0161B013ListHash.get(EKK0161B013CBSMsg1List.SVC_KEI_UCWK_NO)` |
| 3 | SET | `kasSvckeiUcwkStat = (String)eKK0161B013ListHash.get(EKK0161B013CBSMsg1List.SVC_KEI_UCWK_STAT)` |

**Block 8.1.1 — IF (Other active contract found)** `(!kasSvckeiUcwkNo.equals(svcKeiUcwkNo) && !"910".equals(kasSvckeiUcwkStat) && !"920".equals(kasSvckeiUcwkStat))` (L463)

> A different contract line than the target is found, and its status is neither 910 nor 920 (i.e., it's actively in use). Error E008 — other contract usage check failure.

| # | Type | Code |
|---|------|------|
| 1 | SET | `err_code = ERR_LV_BIJINES_ERR` [-> "1100"] |
| 2 | SET | `err_type = "E008"` |
| 3 | EXEC | `break` |

**Block 8.2 — IF (Error in other contract loop)** `(ERR_LV_BIJINES_ERR.equals(err_code))` (L473)

> If error detected, skip remaining processing.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `requestParam.put(ERR_CD, err_code)` |
| 2 | EXEC | `requestParam.put(ERR_TYPE, err_type)` |
| 3 | RETURN | `return param` |

### Block 9 — Phone Number Status Judge (ANK-4494-00-00) (L481)

> Calls the phone number status judgment component to determine the current state of the phone number (port-out status, number retrieval carrier state, etc.). This is a new addition in ANK-4494-00-00 for dual-direction port-back support.

| # | Type | Code |
|---|------|------|
| 1 | SET | `telNoStatJudgeCc = new HashMap<String, Object>()` |
| 2 | EXEC | `telNoStatJudgeCc.put(JKKTelnoStatJudgeConstCC.TELNO, telNo)` |
| 3 | SET | `TelnoStatJudgeCC = new JKKTelnoStatJudgeCC()` |
| 4 | EXEC | `param.setData("telnoStatJudgeCc", telNoStatJudgeCc)` |
| 5 | CALL | `TelnoStatJudgeCC.telnoStatJudge(handle, param, "telnoStatJudgeCc")` |
| 6 | SET | `telnoStatJudgeCcHashMap = (HashMap)param.getData("telnoStatJudgeCc")` |
| 7 | SET | `telNoStatJudgeCcList = (ArrayList)telnoStatJudgeCcHashMap.get(JKKTelnoStatJudgeConstCC.TELNOSTATJUDGECC_LIST)` |
| 8 | SET | `telNoStatJudgeCcListHashMap = (HashMap)telNoStatJudgeCcList.get(0)` |
| 9 | SET | `telnoJudgeDiv = (String)telNoStatJudgeCcListHashMap.get(JKKTelnoStatJudgeConstCC.TELNOJUDGEDIV)` |
| 10 | SET | `tlnStkuTsjgsJishaTashaDiv = (String)telNoStatJudgeCcListHashMap.get(JKKTelnoStatJudgeConstCC.TLNSTKUTSJGS_JISHATASHADIV)` |
| 11 | SET | `monaiBmpUm = (String)telNoStatJudgeCcListHashMap.get(JKKTelnoStatJudgeConstCC.MONAIBMPUM)` |

### Block 10 — IF (ENUM simultaneous switch flag == false) `(enum_krke_douji == false)` (L498)

> If the ENUM simultaneous switch flag is not set, the port-back cannot proceed. This is a business rule enforced after ANK-4494-00-00. Error E010.

| # | Type | Code |
|---|------|------|
| 1 | SET | `err_code = ERR_LV_BIJINES_ERR` [-> "1100"] |
| 2 | SET | `err_type = "E010"` |
| 3 | EXEC | `requestParam.put(ERR_CD, err_code)` |
| 4 | EXEC | `requestParam.put(ERR_TYPE, err_type)` |
| 5 | RETURN | `return param` |

### Block 11 — IF (telnoJudgeDiv = 06 or 11) (L504)

> Phone number status is "06" (No port-out, number retrieval carrier return, post-switch to pre-batch) or "11" (No port-out, intra-network port-out, number retrieval carrier return, post-switch to pre-batch). Error E011 — cannot port-back in this state. Added in ANK-4494-00-00 Step2.

| # | Type | Code |
|---|------|------|
| 1 | SET | `err_code = ERR_LV_BIJINES_ERR` [-> "1100"] |
| 2 | SET | `err_type = "E011"` |
| 3 | EXEC | `requestParam.put(ERR_CD, err_code)` |
| 4 | EXEC | `requestParam.put(ERR_TYPE, err_type)` |
| 5 | RETURN | `return param` |

### Block 12 — IF (Multiple statuses check) (L512)

> Phone number status is in a state where simultaneous ENUM switching is not possible (statuses 04, 05, 06, 09, 10, 11). Error E012. This is a superset of Block 11's check, expanded in ANK-4494-00-00 Step2 to include additional statuses.

| # | Type | Code |
|---|------|------|
| 1 | SET | `err_code = ERR_LV_BIJINES_ERR` [-> "1100"] |
| 2 | SET | `err_type = "E012"` |
| 3 | EXEC | `requestParam.put(ERR_CD, err_code)` |
| 4 | EXEC | `requestParam.put(ERR_TYPE, err_type)` |
| 5 | RETURN | `return param` |

### Block 13 — SOD Data Build (SODCC Error Area) (L523)

> Builds the SOD (Service Order Data) data map for the main port-back service order. This includes basic info (SYSID, dislocation division), service contract info, and service contract line info.

| # | Type | Code |
|---|------|------|
| 1 | SET | `sodMap = new HashMap<String, Object>()` |
| 2 | SET | `sodDataList = new ArrayList<HashMap<String, Object>>()` |
| 3 | SET | `sodTrgtData = new HashMap<String, Object>()` |
| 4 | SET | `sodKihonInfo = new HashMap<String, Object>()` |
| 5 | EXEC | `sodKihonInfo.put(JKKHakkoSODConstCC.INFO_SYSID, sysid)` |
| 6 | EXEC | `sodKihonInfo.put(JKKHakkoSODConstCC.INFO_IDO_DIV, prm_ido_div)` |
| 7 | EXEC | `sodMap.put(JKKHakkoSODConstCC.SOD_KIHON_INFO, sodKihonInfo)` |
| 8 | SET | `svcKeiInfo = new HashMap<String, Object>()` |
| 9 | EXEC | `svcKeiInfo.put(JKKHakkoSODConstCC.INFO_SVC_KEI_NO, svcKeiNo)` |
| 10 | EXEC | `sodMap.put(JKKHakkoSODConstCC.SVC_KEI_INFO, svcKeiInfo)` |
| 11 | SET | `svcKeiUcwkInfo = new HashMap<String, Object>()` |
| 12 | EXEC | `svcKeiUcwkInfo.put(JKKHakkoSODConstCC.INFO_SVC_KEI_UCWK_NO, svcKeiUcwkNo)` |
| 13 | EXEC | `svcKeiUcwkInfo.put(JKKHakkoSODConstCC.INFO_CHAF_SVC_KEI_UCWK_GENE_ADD_DTM, (String)eKK0191A010Hash.get(EKK0191A010CBSMsg1List.GENE_ADD_DTM))` |
| 14 | EXEC | `sodMap.put(JKKHakkoSODConstCC.SVC_KEI_UCWK_INFO, svcKeiUcwkInfo)` |
| 15 | EXEC | `sodDataList.add(sodMap)` |
| 16 | EXEC | `sodTrgtData.put(JKKHakkoSODConstCC.TRGT_DATA_LIST, sodDataList)` |
| 17 | EXEC | `sodTrgtData.put(JCMConstants.FUNC_CODE_KEY, "1")` |

### Block 14 — CALL Main SOD Issuance (L543)

> Invokes the shared SOD issuance component to create the service order data for the port-back operation.

| # | Type | Code |
|---|------|------|
| 1 | SET | `hakkoSODCC = new JKKHakkoSODCC()` |
| 2 | EXEC | `param.setData("sodTrgtData", sodTrgtData)` |
| 3 | CALL | `hakkoSODCC.hakkoSOD(handle, param, "sodTrgtData")` // Service Order Data issuance |

### Block 15 — CALL Port-Out Acceptance (ANK-4494-00-00) (L549)

> Retrieves port-out acceptance agreement information for the phone number. This is required before processing ENUM SOD.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `statusCode = callETU0151A011SC(param, handle, requestParam, resultHash, telNo)` // Port-out acceptance agreement confirmation |
| 2 | IF | `if(statusCode != 0)` -> return param [L553] |
| 3 | SET | `eTU0151A011Hash = (HashMap)resultHash.get(TEMPLATE_ID_ETU0151A011)` |

### Block 16 — ENUM SOD Data Build (ANK-4494-00-00) (L556)

> Builds the ENUM SOD data map. Determines whether to send ENUM deletion (09001 / 番号あり) or ENUM registration (09002 / 番号なし) based on the port-out flag.

| # | Type | Code |
|---|------|------|
| 1 | SET | `enumSodMap = new HashMap<String, Object>()` |
| 2 | SET | `enumSodDataList = new ArrayList<HashMap<String, Object>>()` |
| 3 | SET | `enumSodTrgtData = new HashMap<String, Object>()` |
| 4 | SET | `enumSodKihonInfo = new HashMap<String, Object>()` |
| 5 | EXEC | `enumSodKihonInfo.put(JKKHakkoSODConstCC.PORT_OUT_NO, (String)eTU0151A011Hash.get(ETU0151A011CBSMsg1List.PORT_OUT_NO))` |
| 6 | EXEC | `enumSodKihonInfo.put(JKKHakkoSODConstCC.PORT_OUT_GENE_ADD_DTM, (String)eTU0151A011Hash.get(ETU0151A011CBSMsg1List.GENE_ADD_DTM))` |
| 7 | EXEC | `enumSodKihonInfo.put(JKKHakkoSODConstCC.TELNO, telNo)` |

**Block 16.1 — IF (Has Port-Out: BMP_1 = "1")** `BMP_1.equals(bmpUm)` (L564)

> Port-out exists — ENUM deletion processing. Sets `INFO_IDO_DIV = "09001"` (ENUMDEL).

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `enumSodKihonInfo.put(JKKHakkoSODConstCC.INFO_IDO_DIV, JKKHakkoSODConstCC.IDO_DIV_ENUMDEL)` [-> "09001"] |

**Block 16.2 — ELSE (No Port-Out)** (L566)

> No port-out — ENUM registration processing. Sets `INFO_IDO_DIV = "09002"` (ENUMIADD).

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `enumSodKihonInfo.put(JKKHakkoSODConstCC.INFO_IDO_DIV, JKKHakkoSODConstCC.IDO_DIV_ENUMIADD)` [-> "09002"] |

| # | Type | Code |
|---|------|------|
| 8 | EXEC | `enumSodMap.put(JKKHakkoSODConstCC.SOD_KIHON_INFO, enumSodKihonInfo)` |
| 9 | SET | `enumSodSvcKeiInfo = new HashMap<String, Object>()` |
| 10 | EXEC | `enumSodSvcKeiInfo.put(JKKHakkoSODConstCC.INFO_SVC_KEI_NO, svcKeiNo)` |
| 11 | EXEC | `enumSodMap.put(JKKHakkoSODConstCC.SVC_KEI_INFO, enumSodSvcKeiInfo)` |
| 12 | EXEC | `enumSodDataList.add(enumSodMap)` |
| 13 | EXEC | `enumSodTrgtData.put(JKKHakkoSODConstCC.TRGT_DATA_LIST, enumSodDataList)` |
| 14 | EXEC | `enumSodTrgtData.put(JCMConstants.FUNC_CODE_KEY, "1")` |
| 15 | EXEC | `param.setData("enumSodTrgtData", enumSodTrgtData)` |

### Block 17 — IF (ENUM SOD conditional issuance: #86474) (L570)

> After ANK-4494-00-00 Step2 and #86474, the ENUM SOD is only issued if the phone number retrieval carrier is "own company" (1 / 自社). If it is another company, the ENUM SOD call is skipped.

| # | Type | Code |
|---|------|------|
| 1 | IF | `if(JKKTelnoStatJudgeConstCC.TLNSTKUTSJGS_JISHATASHADIV_JISHA.equals(tlnStkuTsjgsJishaTashaDiv))` -> `hakkoSODCC.hakkoSOD(handle, param, "enumSodTrgtData")` [-> "1" = own company] |

### Block 18 — CALL Phone Number Agreement (ANK-4494-00-00) (L579)

> Retrieves the phone number agreement information before executing the phone number change.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `statusCode = callEZM0121A010SC(param, handle, requestParam, resultHash, telNo)` // Phone number agreement confirmation |
| 2 | IF | `if(statusCode != 0)` -> return param [L583] |
| 3 | SET | `eZM0121A010Hash = (HashMap)resultHash.get(TEMPLATE_ID_EZM0121A010)` |

### Block 19 — BMP Branch: Has Port-Out vs No Port-Out (L588)

**Block 19.1 — IF (Has Port-Out: BMP_1 = "1")** `BMP_1.equals(bmpUm)` (L590)

> The phone number has a port-out flag. Executes phone number change with port-out cancellation and port-out status change.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `statusCode = callEZM0121C010SC_2(param, handle, resultHash, eZM0121A010Hash, telNo, zm0121UpdDtm)` // Phone number change (port-back with port-out) [-> ANK-4494-00-00 Step2 MOD] |
| 2 | IF | `if(statusCode != 0)` -> return param [L596] |
| 3 | CALL | `statusCode = callETU0151C030SC(param, handle, requestParam, resultHash, eTU0151A011Hash, tu0151UpdDtm)` // Port-out status change |
| 4 | IF | `if(statusCode != 0)` -> return param [L601] |

**Block 19.2 — ELSE (No Port-Out)** (L604)

> The phone number does not have a port-out flag. First looks up the telecom carrier, then executes the phone number change.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `statusCode = callETU0051B010SC(param, handle, requestParam, resultHash)` // Telecom carrier list confirmation |
| 2 | IF | `if(statusCode != 0)` -> return param [L609] |
| 3 | SET | `eTU0051B010Hash = (HashMap)resultHash.get(TEMPLATE_ID_ETU0051B010)` |
| 4 | CALL | `statusCode = callEZM0121C010SC(param, handle, requestParam, resultHash, eTU0051B010Hash, eTU0151A011Hash, eZM0121A010Hash, telNo, zm0121UpdDtm)` // Phone number change |
| 5 | IF | `if(statusCode != 0)` -> return param [L614] |
| 6 | CALL | `statusCode = callETU0151C030SC(param, handle, requestParam, resultHash, eTU0151A011Hash, tu0151UpdDtm)` // Port-out status change |
| 7 | IF | `if(statusCode != 0)` -> return param [L619] |

### Block 20 — Progress Registration (L625)

> Registers the processing progress after all port-back operations complete successfully.

| # | Type | Code |
|---|------|------|
| 1 | SET | `eKK1091D010Hash = new HashMap<String, Object>()` |
| 2 | SET | `work = new HashMap<String, Object>()` |
| 3 | EXEC | `work.put("prg_mskm_dtl_no", (String)eKK0161A010Hash.get(EKK0161A010CBSMsg1List.MSKM_DTL_NO))` |
| 4 | EXEC | `work.put("prg_svc_kei_no", svcKeiNo)` |
| 5 | EXEC | `work.put("prg_ido_div", prm_ido_div)` |
| 6 | EXEC | `work.put("prg_tel_no", telNo)` |
| 7 | EXEC | `work.put("prg_ido_rsn_cd", prm_ido_rsn_cd)` |
| 8 | CALL | `callEKK1091D010SC(param, handle, eKK1091D010Hash, work)` // Progress registration |

### Block 21 — Normal Completion (L633)

> Sets the normal completion error code and returns the parameter.

| # | Type | Code |
|---|------|------|
| 1 | SET | `err_code = ERR_LV_NOMAL` [-> "0000"] // Normal completion |
| 2 | SET | `err_type = ""` // Empty = no error occurred |
| 3 | EXEC | `requestParam.put(ERR_CD, err_code)` |
| 4 | EXEC | `requestParam.put(ERR_TYPE, err_type)` |
| 5 | RETURN | `return param` |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `svc_kei_no` | Field | Service contract number — the unique identifier for a service contract (e.g., FTTH internet contract) in the K-Opticom system |
| `svc_kei_ucwk_no` | Field | Service contract line number — the unique identifier for a specific line item within a service contract (e.g., a particular phone line under an internet package) |
| `sysid` | Field | System ID — the target system identifier for the service being processed |
| `telNo` | Field | Phone number — the telephone number subject to the port-back operation |
| `ido_div` | Field | Dislocation division — the dislocation/migration reason code indicating the type of change being performed |
| `ido_rsn_cd` | Field | Dislocation reason code — the specific reason code for the dislocation/migration |
| `enum_krke_douji` | Field | ENUM simultaneous switch flag — a boolean indicating whether ENUM (E.164 Number Mapping) switching is performed simultaneously with the port-back |
| `bmpUm` | Field | Port-out flag (BMP_UM) — indicates whether the phone number has a port-out request flag ("1" = has port-out / あり, "0" = no port-out / なし) |
| `telnoJudgeDiv` | Field | Phone number status judgment division — a classification code indicating the current state of the phone number (e.g., 01 = no port-out/unused, 02 = no port-out/in use, 06 = no port-out/number retrieval carrier return post-switch to pre-batch, 12 = port-out/in use, 13 = port-out post-port-out, etc.) |
| `tlnStkuTsjgsJishaTashaDiv` | Field | Phone number retrieval carrier self/other division — indicates whether the phone number retrieval carrier is "1" (own company / 自社) or "2" (another company / 他社) |
| `rcnt_yokyu_sbt_cd` | Field | Latest request type code — the most recent request type code from past SOD executions; "03" = cancellation (解約), "08" = deletion (削除) |
| `yokyu_sbt_cd` | Field | Request type code — the type code of a pending SOD order; "03" = cancellation (解約), "08" = deletion (削除) |
| `dsl_pause_toki_sbt_cd` | Field | Dissociation/stop token type code — code indicating a token (dissociation/stop) has been issued |
| `dsl_pause_toki_end_ymd` | Field | Dissociation/stop token end date — the completion date for a dissociation/stop token; null or empty means token is still pending |
| `itens_opaf_toki_sbt_cd` | Field | Transfer-origin token type code — code indicating a token issued due to a transfer |
| `itens_opaf_toki_end_ymd` | Field | Transfer-origin token end date — the completion date for a transfer-origin token; null or empty means token is still pending |
| `err_code` | Field | Error code (self-implemented) — "1100" indicates a business-level error occurred, "0000" indicates normal completion |
| `err_type` | Field | Error type — the specific error identifier (E001 through E012) describing the nature of the error |
| ODER_NAIYO_CD | Field | Order content code — classifies the type of order (FTTH registration, Mail change, etc.) |
| SOD | Acronym | Service Order Data — the service order entity used to dispatch processing to the back-end order fulfillment system |
| ENUM | Acronym | E.164 Number Mapping — a DNS-based system that maps telephone numbers to IP addresses for VoIP routing; ENUM registration/deletion is required when porting numbers |
| FTTH | Business term | Fiber To The Home — fiber-optic broadband internet service provided by K-Opticom |
| Port-Out (番ポ) | Business term | Port-Out — the process of porting a phone number from K-Opticom to another carrier. "Bangyo-modoshi" (番ポ戻し) means reversing a port-out (returning the number to K-Opticom) |
| Port-Out Acceptance (ポートアウト受領) | Business term | The process where the receiving carrier (or the porting system) accepts and confirms a port-out request |
| Token (トークン) | Business term | A temporary authorization or marker indicating that a dissociation or transfer process is in progress; must have an end date to be considered complete |
| SIP | Acronym | Session Initiation Protocol — the VoIP protocol used for establishing, modifying, and terminating real-time communications |
| KKSV0212 | Screen | "Phone Number Information Change" (電話番号情報変更) screen — the primary screen that invokes this port-back method via BPM |
| KKSV0212OPOperation | Class | BPM operation class for the KKSV0212 screen; uses CCRequestBroker to delegate to JKKBumpMdsCC.executeBumpMds |
| JKKTelnoStatJudgeCC | Component | Phone number status judgment component — determines the current state and carrier affiliation of a phone number |
| JKKHakkoSODCC | Component | SOD issuance component — the shared service order data dispatch engine used across the system |
| EZM0121 | SC Code | Phone Number Management CBS — handles phone number agreement and change operations |
| ETU0151 | SC Code | Port-Out Acceptance CBS — handles port-out acceptance information and status updates |
| EKK0161 | SC Code | Service Contract Management CBS — handles service contract and line item queries |
| EKK0191 | SC Code | Service Contract Info <Phone> CBS — retrieves phone-specific service contract information |
| EKK1041 | SC Code | Order Settings List CBS — retrieves past SOD execution results |
| EKK1081 | SC Code | Order Issuance Condition List CBS — retrieves pending SOD conditions |
| EKK1091 | SC Code | Progress Registration CBS — registers processing progress records |
| ETU0051 | SC Code | Telecom Carrier List CBS — retrieves telecom carrier information for a phone number |
| IRR | — | Service contract status codes: "100" = active/available, "910" = continuation, "920" = continuation pending |
