---

# Business Logic — JDKCommon48CC.deleteSodWorkMap() [20 LOC]

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

## 1. Role

### JDKCommon48CC.deleteSodWorkMap()

This method is the **cleanup routine** for the Service Order Data (SOD) work area within the Fujitsu Futurity business platform's telecom service contract/order processing system. After completing all multi-functional service deregistration and cancellation processing (e.g., FTTH/BBCall/UQ line cancellation, multi-functional router deregistration), this method purges the SOD working area from the request's work map to ensure no stale session state persists for the current transaction. It implements a **defensive cleanup pattern**: performing null-safe checks and key-presence guards before executing the removal, ensuring idempotent behavior even if called multiple times or if no SOD work data was ever initialized. Its role in the larger system is as a **shared utility method** used by order release/fulfillment processing methods (notably within `JDKCommon48CC`) to tidy up request-scoped work data after service contract processing completes.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["deleteSodWorkMap param"])
    GetWorkArea["Get workMap = param.getMappingWorkArea"]
    CheckNull["Check workMap == null"]
    Return1["Return early"]
    CheckSod["Check workMap.containsKey SOD_WORKAREA_KEY"]
    Return2["Return early if not contains SOD_WORKAREA_KEY"]
    GetSodMap["Get sodWorkMap = this.getSodWorkMap param"]
    RemoveSod["Remove sodWorkMap from workMap"]
    END_NODE(["Return / Next"])

    START --> GetWorkArea
    GetWorkArea --> CheckNull
    CheckNull -->|null| Return1
    Return1 --> END_NODE
    CheckNull -->|not null| CheckSod
    CheckSod -->|false| Return2
    Return2 --> END_NODE
    CheckSod -->|true| GetSodMap
    GetSodMap --> RemoveSod
    RemoveSod --> END_NODE
```

**Block descriptions:**

1. **Retrieve work area**: Extract the work map from the request parameter's mapping work area.
2. **Null guard**: If the work map is null, return immediately — nothing to clean up.
3. **SOD key guard**: If the work map does not contain the SOD work area key (`SOD_WORKAREA_KEY = "SODWORK"`), return immediately — no SOD data was initialized for this transaction.
4. **Fetch SOD work map**: Retrieve the SOD work map object via the helper method `getSodWorkMap()`, which extracts it from the work map using the `SOD_WORKAREA_KEY`.
5. **Remove SOD work map**: Remove the SOD work map from the work map, clearing the SOD working area for this transaction.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `param` | `IRequestParameterReadWrite` | The request parameter object carrying the current transaction's work data. It holds the mapping work area (`Map`) where the SOD (Service Order Data) working area is stored during order release processing. This parameter is the conduit through which the method accesses and removes the SOD work area state. |

**Instance fields / external state:**
| Field | Type | Business Description |
|-------|------|---------------------|
| `SOD_WORKAREA_KEY` | `static final String` | The key name `"SODWORK"` used to store and retrieve the SOD work area HashMap within the request's work map. Defined at `JDKCommon48CC.java:127`. [-> SOD_WORKAREA_KEY="SODWORK" (JDKCommon48CC.java:127)] |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `JDKCommon48CC.getSodWorkMap` | JDKCommon48CC | - (in-memory work map) | Calls `getSodWorkMap(param)` to retrieve the SOD work area HashMap from the request's work map |

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `IRequestParameterReadWrite.getMappingWorkArea` | - | - (in-memory request state) | Reads the work map from the request parameter to access the SOD work area |
| R | `Map.containsKey` | - | - (in-memory work map) | Checks whether the SOD work area key (`"SODWORK"`) exists in the work map |
| D | `Map.remove` | - | - (in-memory work map) | Removes the SOD work area HashMap from the work map, cleaning up session state |

**Classification rationale:**
- `getSodWorkMap` is a **Read** operation: it fetches an existing HashMap from the in-memory work map.
- `Map.remove` is a **Delete** operation: it removes the SOD work area from the in-memory work map.
- No database, CBS, or SC (Service Component) calls are made — this method operates entirely on in-memory request state.

## 5. Dependency Trace

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

Direct callers found: 1 method (within `JDKCommon48CC.java` at line 730).
Terminal operations from this method: `getSodWorkMap` [R]

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Class:JDKCommon48CC (inline caller) | `JDKCommon48CC` order processing method (L730) -> `deleteSodWorkMap` | `getSodWorkMap [R] in-memory work map` |

**Call chain context:**
The method is invoked at line 730 within the same class (`JDKCommon48CC`), near the end of a larger method that processes order release conditions for multi-functional service deregistration. The caller context shows this is called after processing various telecom service types (FTTH/BBCall/UQ/cable) and their associated cancellation/deregistration registrations (via `insertOdrHakkoJoken` and `insertOdrInfSksiWk`). This method serves as the final cleanup step to purge the SOD work area once all service-specific processing is complete.

No external screen/batch entry points (KKSVxxxx) call this method directly — it is an internal helper method invoked exclusively from within `JDKCommon48CC`'s order processing logic.

## 6. Per-Branch Detail Blocks

**Block 1** — [IF] `workMap == null` (L764)

> Retrieve the work area from the request parameter and perform a null check. If the work area is null, return early with no side effects.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `workMap = (Map) param.getMappingWorkArea()` // Get the work map from request parameter |
| 2 | IF | `workMap == null` // L764 [-> workMap null guard] |
| 3 | RETURN | `return;` // Early return — no work area to clean up |

**Block 2** — [IF] `!workMap.containsKey(SOD_WORKAREA_KEY)` (L769)

> Check if the SOD work area key exists in the work map. The key is defined as `SOD_WORKAREA_KEY = "SODWORK"`. If the key does not exist, it means no SOD work data was initialized during this transaction, so return early.

| # | Type | Code |
|---|------|------|
| 1 | IF | `!workMap.containsKey(SOD_WORKAREA_KEY)` // L769 [-> SOD_WORKAREA_KEY="SODWORK" (JDKCommon48CC.java:127)] |
| 2 | RETURN | `return;` // Early return — no SOD work area to remove |

**Block 3** — [Sequential processing] (L773–775)

> Execute the core cleanup: retrieve the SOD work map and remove it from the work map.

| # | Type | Code |
|---|------|------|
| 1 | SET | `sodWorkMap = this.getSodWorkMap(param)` // Retrieve SOD work area HashMap [-> CALL getSodWorkMap(param)] |
| 2 | EXEC | `workMap.remove(sodWorkMap)` // Remove SOD work area from work map [-> D Map.remove] |

> Japanese comment: 「機器毎の処理完了時にSOD作業領域を削除」
> English translation: "Remove the SOD work area when processing for each device is complete."

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| SOD | Acronym | Service Order Data — the in-memory working area used during telecom service order fulfillment to track and process service contracts, lines, and related data |
| SOD_WORKAREA_KEY | Field | The string key `"SODWORK"` used to store and retrieve the SOD work area HashMap within the request's mapping work area |
| workMap | Field | The work map (Map) extracted from the request parameter, serving as a request-scoped workspace for passing data between processing steps during order release |
| `IRequestParameterReadWrite` | Interface | The request parameter interface used in the Fujitsu Futurity platform to carry request data, control maps, and work areas across processing layers |
| `getMappingWorkArea` | Method | Retrieves the work map (Map) from the request parameter, which holds working data for the current transaction |
| `getSodWorkMap` | Method | Local helper method that retrieves the SOD work area HashMap from the work map using the `SOD_WORKAREA_KEY` |
| FTTH | Business term | Fiber To The Home — fiber-optic broadband internet service (service type code "50" for return/cancellation) |
| BBCall | Business term | NTT's fixed wireless broadband service (service type code "F0" for return/cancellation) |
| UQ | Business term | UQ Communications — mobile/wireless service provider (service type code "J0" for return/cancellation) |
| 機器 | Japanese field | Device — refers to the customer premises equipment (CPE) such as routers/modems associated with a service line |
| 多機能ルータ | Japanese field | Multi-functional router — a router with additional features (firewall, VPN, etc.) used in NTT services |
| 解約 | Japanese field | Deregistration/Cancellation — the process of canceling a service contract or service line |
| 消去 | Japanese field | Deletion/Clear — the process of removing cancellation-related records from work data |
| 注文 | Japanese field | Order — refers to the order/release data being processed during the service contract fulfillment flow |
| 作業領域 | Japanese field | Work area — the request-scoped workspace (Map) used for passing intermediate data during transaction processing |
| SC | Acronym | Service Component — a service component class handling business logic for a specific service type |
| CBS | Acronym | Core Business System — a central business system for telecom service management |
| scCall | Variable | The service call object used to execute remote SC/CBS method calls within the processing method |

---
