
# Business Logic — JKKUseStpRlsRunCC.runUseStpRls() [77 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `com.fujitsu.futurity.bp.custom.common.JKKUseStpRlsRunCC` |
| Layer | Common Component (CC) — shared business logic layer |
| Module | `common` (Package: `com.fujitsu.futurity.bp.custom.common`) |

## 1. Role

### JKKUseStpRlsRunCC.runUseStpRls()

This method is the **use-stop-release entry point** for the K-Opticom customer backbone system (eo customer core system). Its business purpose is to execute **use-stop-release** (利用停止解除 — *riyou teishi kaijo*) operations on one or more service contracts. "Use-stop-release" refers to the process of lifting a previously imposed service suspension (use-stop) on a customer's telecommunications service contracts, thereby restoring the service to active status.

The method implements an **iteration/dispatch pattern**: it accepts a batch list of service contracts targeted for release, iterates over each contract, and delegates the actual release processing to `executeUseStpRlsMain()` for each individual contract. During iteration, it tracks any contracts that cannot be released (e.g., due to contractual constraints, suspended status, or related service dependencies) in an "unavailable list" (`fukaUseStpRlsTrgtLst`). The overall processing result flag (`syori_result`) is set to indicate whether all releases succeeded or whether some were unavailable.

The `fixedText` parameter serves as a user-chosen key string that identifies the data namespace within the request/response `IRequestParameterReadWrite` object, enabling this method to read and write its own data map within a shared parameter object. The method operates on all service types — it does not branch by service category.

This method is a **shared utility** called by the wrapper class `JKKUseStpRlsRunWrapperCC.execute()`, which serves as the screen-facing orchestrator. It runs within a database session managed by `SessionHandle` and participates in a larger use-stop-release workflow that spans multiple service components.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["runUseStpRls handle param fixedText"])
    INIT["Initialize statusCode = 0"]
    OPDATE["oPE_DATE = JCCBPCommon.getOpeDate null"]
    GETMAP["Get use_stp_rls_map = param.getData fixedText"]
    GETLST["Get useStpRlsTrgtLst from map USE_STP_RLS_LST"]
    GENFUKA["Create fukaUseStpRlsTrgtLst empty"]
    SETFLG["wk_Fuka_flg = false"]
    LOOPCHK{"useStpRlsTrgtLst size > 0"}
    ILOOP["For each item i in useStpRlsTrgtLst"]
    HPUTSEIKY["paramHash.put SEIKY_KEI_NO useStpHash.get SEIKY_KEI_NO"]
    HPUTSVC["paramHash.put SVC_KEI_NO useStpHash.get SVC_KEI_NO"]
    EXEMAIN["executeUseStpRlsMain handle param paramHash fixedText fukaUseStpRlsTrgtLst"]
    INCR["Increment i"]
    ICHECK{"i less than useStpRlsTrgtLst.size"}
    SETRESULT["Set syori_result based on wk_Fuka_flg"]
    PUTRESULT["use_stp_rls_map.put SYORI_RESULT value"]
    PUTFUKA["use_stp_rls_map.put FUKA_USE_STP_RLS_LST fukaUseStpRlsTrgtLst"]
    SETDATA["param.setData fixedText use_stp_rls_map"]
    SETCONTROL["param.setControlMapData RETURN_CODE formatStatus"]
    END(["Return param"])
    START --> INIT
    INIT --> OPDATE
    OPDATE --> GETMAP
    GETMAP --> GETLST
    GETLST --> GENFUKA
    GENFUKA --> SETFLG
    SETFLG --> LOOPCHK
    LOOPCHK -->|No| SETRESULT
    LOOPCHK -->|Yes| ILOOP
    ILOOP --> HPUTSEIKY
    HPUTSEIKY --> HPUTSVC
    HPUTSVC --> EXEMAIN
    EXEMAIN --> INCR
    INCR --> ICHECK
    ICHECK -->|Yes| HPUTSEIKY
    ICHECK -->|No| SETRESULT
    SETRESULT --> PUTRESULT
    PUTRESULT --> PUTFUKA
    PUTFUKA --> SETDATA
    SETDATA --> SETCONTROL
    SETCONTROL --> END
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `handle` | `SessionHandle` | The database session handle used for all data access within this method's scope. Provides transaction context and connection management for the K-Opticom core system. |
| 2 | `param` | `IRequestParameterReadWrite` | The request/response parameter object that carries data between the screen, common components, service components (SCs), and CBS layers. Contains control maps, data maps keyed by `fixedText`, and return codes. |
| 3 | `fixedText` | `String` | A user-defined namespace key (e.g., a screen-specific identifier) that selects the appropriate data map within `param` where this method reads its input and writes its output. Allows multiple screens to use the same method with isolated data scopes. |

**Instance fields read by this method:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `oPE_DATE` | `String` | Class-level operational date field, set to today's date via `JCCBPCommon.getOpeDate()`. Used by downstream processing to tag records with the processing date. |
| `wk_Fuka_flg` | `boolean` | Class-level flag indicating whether any service contracts could not be released (`true`) or all were released successfully (`false`). Set to `false` at entry and flipped by `executeUseStpRlsMain()`. |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `JCCBPCommon.getOpeDate` | JCCBPCommon | — | Obtains the current operational date (business date) for tagging subsequent records |
| C/R | `executeUseStpRlsMain` | — | — | Delegates per-contract use-stop-release processing; internally calls multiple SCs/CBS for invoice verification, contract info, release execution, SOD issuance, and status updates |

The `executeUseStpRlsMain()` method is the primary workhorse called within the iteration loop. It internally invokes a wide range of SC/CBS operations (listed below) to perform the actual use-stop-release on each individual service contract. The `runUseStpRls` method itself does not directly access any database tables; all data access is delegated to `executeUseStpRlsMain()` and its downstream calls.

### Internal CRU/CRUD operations via `executeUseStpRlsMain()`:

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `getEKK0321B002SC` | EKK0321B002SC | KK_T_SEIKY (Billing) | Invoice pre-list inquiry — verifies billing records for the service contract before release |
| R | `getEKK0081A010SC` | EKK0081A010SC | KK_T_SVKEI (Service Contract) | Service contract inquiry — retrieves contract status and details |
| R | `getEKK0161A010SC` | EKK0161A010SC | KK_T_SVKEI_DETAIL (Service Contract Detail) | Service contract detail inquiry — retrieves detailed service information |
| R | `getEKK0161B004SC` | EKK0161B004SC | KK_T_SVKEI_DETAIL_LIST | Service contract detail list inquiry — retrieves list of service details |
| C/R | `getEKK0351A010SC` | EKK0351A010SC | KK_T_OPTSVKEI (Optional Service Contract) | Optional service contract inquiry — checks optional service attachments |
| C/R | `getEKK0441A010SC` | EKK0441A010SC | KK_T_REQOPTSVKEI (Request Optional Service Contract) | Request optional service contract inquiry — verifies request status |
| C/R | `getEKK0401A010SC` | EKK0401A010SC | KK_T_SUBOPTSVKEI (Sub-Optional Service Contract) | Sub-optional service contract inquiry — checks sub-optional services |
| C | `getEKK0341B022SC` | EKK0341B022SC | KK_T_OPSVKEI (Operation Service) | Optional service registration for SOD issuance |
| C | `executeSodIssuance` | — | KK_T_SOD (Service Order Data) | SOD (Service Order Data) issuance — creates service order data for billing purposes |
| R | `getEKK0161C050SC` | EKK0161C050SC | KK_T_SVKEI_DETAIL | Service contract detail info inquiry — retrieves detail info for SOD |
| R | `getEKK0161C051SC` | EKK0161C051SC | KK_T_SVKEI_DETAIL | Service contract detail info list inquiry |
| R | `getEKK0341C130SC` | EKK0341C130SC | KK_T_OPSVKEI | Operation service info inquiry |
| R | `getEKK0341C131SC` | EKK0341C131SC | KK_T_OPSVKEI | Operation service info list inquiry |
| R | `getEKK0251B001SC` | EKK0251B001SC | KK_T_PRICED (Pricing) | Pricing inquiry |
| R | `getEKK0321A010SC` | EKK0321A010SC | KK_T_SEIKY | Invoice pre-agreement inquiry |
| R | `getEKK0861B002SC` | EKK0861B002SC | — | Customer info inquiry |
| R | `getEKK1091D010SC` | EKK1091D010SC | — | Transfer service inquiry |
| R | `getEKK2811A010SC` | EKK2811A010SC | — | New electricity inquiry |
| R | `getEKK2811B010SC` | EKK2811B010SC | — | New electricity detail inquiry |
| R | `getEKK2811C090SC` | EKK2811C090SC | — | New electricity service info inquiry |
| R | `getEKK2811C100SC` | EKK2811C100SC | — | New electricity service info list inquiry |
| R | `executeOdrHakkoJokenAdd` | — | KK_T_ODR_HAKKO_JOKEN (Order Registration Conditions) | Checks order registration conditions before release |
| R | `executeOdrHakkoJokenAdd` | — | KK_T_ODR_HAKKO (Order Registration) | Registers order for use-stop-release |
| R | `executeChshtDtl` | — | — | Invoice pre-list detail processing |
| R | `JBSbatAKKshkmRsltInfoTukiawsday.setData` | — | — | Sets billing result info with monthly payment |
| R | `JBSbatAKKshkmRsltInfoTukiaws.setData` | — | — | Sets billing result info |
| R | `JBSbatAKKshkmRsltInfoTukiawsRealSkh.setData` | — | — | Sets billing result info with actual schedule |
| R | `JBSbatAKKshkmRsltInfTkCvsNCnsl.setData` | — | — | Sets billing result info with CVS collection and contract |
| R | `JBSbatDKNyukaFinAdd.getData` | JBSbatDKNyukaFinAdd | — | Gets data from download completion registration add |
| R | `JBSbatKKGetCTITelno.setData` | JBSbatKKGetCTITelno | — | Sets data for carrier ID telephone number retrieval |
| R | `JFUeoTelOpTransferCC.getData` | JFUeoTelOpTransferCC | — | Gets data for eo telco transfer processing |
| R | `JFUEoTvCngAddStbCC.getOpeDate` | JFUEoTvCngAddStbCC | — | Gets operational date for eo TV change add STB |
| R | `JFUHikkosiNaviRelAddCC.getOpeDate` | JFUHikkosiNaviRelAddCC | — | Gets operational date for relocation navigation relation add |
| R | `JFUTransferCC.getData` | JFUTransferCC | — | Gets data for transfer processing |
| R | `JFUTransferListToListCC.getData` | JFUTransferListToListCC | — | Gets data for transfer list processing |
| R | `JKKCreditAddCC.getOpeDate` | JKKCreditAddCC | — | Gets operational date for credit add processing |
| R | `JKKModelCommon.getOpeDate` | JKKModelCommon | — | Gets operational date from model common |
| R | `KKW12701SFLogic.getData` | KKW12701SFLogic | — | Gets data for SIF (Screen Interface) logic |

## 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: `getOpeDate` [R], `setData` [-], `setData` [-], `setData` [-], `setData` [-], `executeUseStpRlsMain` [-], `getData` [R], `getData` [R], `getData` [R], `getData` [R], `getData` [R], `getOpeDate` [R], `getOpeDate` [R], `getOpeDate` [R], `getOpeDate` [R]

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | `JKKUseStpRlsRunWrapperCC` (Common Wrapper CBS) | `JKKUseStpRlsRunWrapperCC.execute()` → `JKKUseStpRlsRunCC.runUseStpRls(handle, param, fixedText)` | `getOpeDate [R] —`, `executeUseStpRlsMain [-] → getEKK0321B002SC [R] KK_T_SEIKY`, `executeUseStpRlsMain [-] → executeSodIssuance [C] KK_T_SOD`, `executeUseStpRlsMain [-] → getEKK0161A010SC [R] KK_T_SVKEI_DETAIL`, `executeUseStpRlsMain [-] → getEKK0161B004SC [R] KK_T_SVKEI_DETAIL_LIST`, `executeUseStpRlsMain [-] → executeChshtDtl [-] KK_T_SEIKY` |

## 6. Per-Branch Detail Blocks

**Block 1** — [INITIALIZATION] (L427)

Initialize the method's internal state: set the status code, operational date, and prepare data structures.

| # | Type | Code |
|---|------|------|
| 1 | SET | `statusCode = 0` // Status code initialized to success |
| 2 | CALL | `oPE_DATE = JCCBPCommon.getOpeDate(null)` // [R] Obtain operational date [-> oPE_DATE field set] |
| 3 | EXEC | `use_stp_rls_map = (HashMap) param.getData(fixedText)` // [EXEC] Extract the method's data map from request parameter using fixedText key |
| 4 | EXEC | `useStpRlsTrgtLst = (ArrayList) use_stp_rls_map.get(USE_STP_RLS_LST)` // [EXEC] Get the list of service contracts targeted for release [-> USE_STP_RLS_LST = "use_stp_rls_lst"] |
| 5 | SET | `fukaUseStpRlsTrgtLst = new ArrayList<HashMap>()` // [SET] Create empty list for unavailable contracts |
| 6 | SET | `wk_Fuka_flg = false` // [SET] Reset flag indicating no unavailable contracts yet [-> wk_Fuka_flg instance field] |

**Block 2** — [FOR LOOP] `for (i = 0; i < useStpRlsTrgtLst.size(); i++)` (L439)

Iterate over each service contract entry that is targeted for use-stop-release.

| # | Type | Code |
|---|------|------|
| 1 | SET | `useStpHash = useStpRlsTrgtLst.get(i)` // [SET] Get the i-th contract entry |
| 2 | SET | `paramHash = new HashMap()` // [SET] Create per-contract parameter map |
| 3 | SET | `paramHash.put(SEIKY_KEI_NO, useStpHash.get(SEIKY_KEI_NO))` // [SET] Extract billing contract number [-> SEIKY_KEI_NO = "seiky_kei_no"] |
| 4 | SET | `paramHash.put(SVC_KEI_NO, useStpHash.get(SVC_KEI_NO))` // [SET] Extract service contract number [-> SVC_KEI_NO = "svc_kei_no"] |
| 5 | CALL | `statusCode = executeUseStpRlsMain(handle, param, paramHash, fixedText, fukaUseStpRlsTrgtLst)` // [CALL] Delegate per-contract release processing |

> Note: Error handling code is commented out (lines 455–463). The original logic would format statusCode as a zero-padded string, set it as RETURN_CODE, and throw a CCException with SCCallException if statusCode != 0.

**Block 3** — [CONDITIONAL] `if (wk_Fuka_flg)` (L473)

Set the overall processing result based on whether any contract was unavailable for release.

> `wk_Fuka_flg` is a class-level instance field set to `true` by `executeUseStpRlsMain()` when one or more contracts cannot be released (e.g., due to active contracts, suspended status, or related service dependencies).

**Block 3.1** — [IF BRANCH] `wk_Fuka_flg == true` (L474)

All contracts in the list — at least one — could not be released.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `use_stp_rls_map.put(SYORI_RESULT, SYORI_RESULT_FUKA)` // [EXEC] Set result to "unavailable" [-> SYORI_RESULT = "syori_result", SYORI_RESULT_FUKA = "1"] |

**Block 3.2** — [ELSE BRANCH] `wk_Fuka_flg == false` (L476)

All contracts were successfully released.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `use_stp_rls_map.put(SYORI_RESULT, SYORI_RESULT_OK)` // [EXEC] Set result to "success" [-> SYORI_RESULT_OK = "0"] |

**Block 4** — [SET] Set unavailable list and persist result (L480)

Write the unavailable contracts list and the final data map back to the parameter object, then set the return code.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `use_stp_rls_map.put(FUKA_USE_STP_RLS_LST, fukaUseStpRlsTrgtLst)` // [EXEC] Write unavailable contracts list [-> FUKA_USE_STP_RLS_LST = "fuka_use_stp_rls_lst"] |
| 2 | EXEC | `param.setData(fixedText, use_stp_rls_map)` // [EXEC] Write the complete result map back into the request parameter |
| 3 | SET | `formatStatus = String.format("%1$04d", statusCode)` // [SET] Format statusCode as a 4-digit zero-padded string |
| 4 | EXEC | `param.setControlMapData(SCControlMapKeys.RETURN_CODE, formatStatus)` // [EXEC] Set the HTTP return code in the control map |
| 5 | RETURN | `return param` // [RETURN] Return the populated response parameter object |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| Use-stop-release (利用停止解除) | Business term | The process of lifting a previously imposed service suspension (use-stop) on a customer's telecommunications service contract, thereby restoring active service. In Japanese: *riyou teishi kaijo*. |
| `seiky_kei_no` | Field | Billing contract number — the primary billing account identifier for a customer's contracted services. |
| `svc_kei_no` | Field | Service contract number — the unique identifier for a specific service contract (e.g., internet, TV, phone) under a billing contract. |
| `use_stp_rls_lst` | Field | Use-stop-release target list — the list of service contracts that should be processed for release. |
| `fuka_use_stp_rls_lst` | Field | Unavailable use-stop-release list — the list of contracts that could NOT be released, along with reasons. |
| `syori_result` | Field | Processing result — "0" indicates all releases succeeded, "1" indicates one or more were unavailable. |
| `wk_Fuka_flg` | Field | Work unavailable flag — internal instance field tracking whether any contracts were unavailable during processing. |
| `oPE_DATE` | Field | Operational date — the business processing date, obtained from `JCCBPCommon.getOpeDate()` and used to tag records. |
| `fixedText` | Parameter | User-defined namespace key — allows the same method to operate on isolated data scopes within a shared parameter object, typically set per-screen. |
| SOD (Service Order Data) | Acronym | Service Order Data — order data created for billing and provisioning purposes when services are activated or modified. |
| SVC_KEI_USE_STP_RLS_EXEC_FLG | Field | Service contract use-stop-release execution flag — indicates whether the release processing has been executed for a service contract. |
| `SVC_KEI_STAT_UKE = "010"` | Constant | Service contract status: Received — the contract has been received but not yet processed. |
| `SVC_KEI_STAT_SHOSA = "020"` | Constant | Service contract status: Under review — the contract is being reviewed. |
| `SVC_KEI_STAT_TEIK = "030"` | Constant | Service contract status: Concluded — the contract has been concluded/agreed. |
| `SVC_KEI_STAT_TKC = "100"` | Constant | Service contract status: Providing service — the service is currently active. |
| `SVC_KEI_STAT_KYUS = "210"` | Constant | Service contract status: Suspended/intermittently stopped — the service is temporarily suspended. |
| `SVC_KEI_STAT_STP = "220"` | Constant | Service contract status: Stopped (use-stop) — the service has been suspended (use-stop) and needs release. |
| `SVC_KEI_STAT_DSL = "910"` | Constant | Service contract status: Cancelled — the contract has been fully cancelled. |
| `SVC_KEI_STAT_CNCL = "920"` | Constant | Service contract status: Cancellation completed — the cancellation process has finished. |
| `FUKA_RESON_RTN_IRAI_TORI = "01"` | Constant | Unavailable reason: Request cancellation withdrawn — the customer withdrew their cancellation request. |
| `FUKA_RESON_RTN_KEITK_CHU = "02"` | Constant | Unavailable reason: Contracting in progress — the service contract is still being processed. |
| `FUKA_RESON_RTN_TV_KCN = "03"` | Constant | Unavailable reason: eo TV (KCN) — the service cannot be released due to eo TV (KCN) related constraints. |
| `IDO_DIV_USESTPRLS = "00063"` | Constant | Difference classification (use-stop-release) — classification code for use-stop-release differences. |
| `IDO_RSN_CD_KANUSESTP_RLS = "81"` | Constant | Difference reason code (related use-stop/release) — reason code for differences related to use-stop and release. |
| `PRC_GRP_CD_TV_KCN = "12"` | Constant | Price group: eo TV (KCN) — price group code for eo TV service via KCN. |
| `PRC_GRP_CD_MINEO = "51"` | Constant | Price group: mi NEo — price group code for mi NEo (mobile service). |
| `PRC_GRP_CD_EODENKI = "17"` | Constant | Price group: eo Electricity — price group code for eo Electricity (new electricity service). |
| `PAY_HOSHIKI_CD_ZKI = "003"` | Constant | Payment method: All households unified — payment method code for unified billing across all services. |
| `PAY_HOSHIKI_CD_KYI = "004"` | Constant | Payment method: All residents unified — payment method code for unified billing across all residents. |
| SC (Service Component) | Acronym | Service Component — a layer in the Fujitsu Futurity framework that encapsulates business logic and data access, typically invoked by CBS. |
| CBS (Business Logic Component) | Acronym | Business Logic Component — the business logic layer that coordinates SC calls and implements business rules. |
| `EKK0321B002SC` | SC Code | Invoice pre-list inquiry — inquires billing records for the service contract. |
| `EKK0081A010SC` | SC Code | Service contract inquiry — retrieves service contract information. |
| `EKK0161A010SC` | SC Code | Service contract detail inquiry — retrieves service contract detail records. |
| `EKK0341B022SC` | SC Code | Optional service registration — registers optional service data for SOD issuance. |
| KK_T_SEIKY | Table | Billing table — stores billing contract information. |
| KK_T_SVKEI | Table | Service contract table — stores service contract master records. |
| KK_T_SVKEI_DETAIL | Table | Service contract detail table — stores detailed service contract records. |
| KK_T_SOD | Table | Service Order Data table — stores service order data for billing/provisioning. |
| KK_T_ODR_HAKKO_JOKEN | Table | Order registration conditions table — stores conditions for order registration. |
| KK_T_ODR_HAKKO | Table | Order registration table — stores order registration records. |
| KK_T_OPSVKEI | Table | Operation service table — stores optional/operation service records. |
| KK_T_PRICED | Table | Pricing table — stores pricing information. |
| eo | Brand | "eo" — K-Opticom's broadband telecommunications brand (eo Hikari, eo TV, eo mi NEo, eo Electricity). |
| KCN | Business term | K-Opticom Cable Network — the cable TV network service associated with eo TV. |
| mi NEo | Business term | mi NEo — K-Opticom's mobile phone service brand. |
| Template IDs (EKK0321B002, etc.) | Pattern | Screen interface template identifiers — uniquely identify CBS invocations in the Futurity framework. |
