# Business Logic — JFUSV016030ReqChk.checkExecution() [15 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `com.fujitsu.futurity.bp.custom.reqchk.JFUSV016030ReqChk` |
| Layer | Service Component (CC/BPM Execution Condition Check) |
| Module | `reqchk` (Package: `com.fujitsu.futurity.bp.custom.reqchk`) |

## 1. Role

### JFUSV016030ReqChk.checkExecution()

This method serves as an execution condition check for the **Discount Service Auto-Application Mobile Registration** feature within the FUSV0160 business process. Specifically, it determines whether the workflow step that registers automatic discount service application to mobile lines should proceed or be skipped entirely. The method implements the **execution condition routing pattern** used by the BPM engine: it returns `true` to signal that the associated process step (JKKWrisvcAutoAplyCC) should execute, or `false` to gate it off and skip processing.

Its role in the larger system is that of a **conditional gatekeeper** within the Fusv0160 operation screen's BPM workflow. The FUSV0160Operation class registers this ReqChk as an `ExeCondition` (execution condition check) for the JKKWrisvcAutoAplyCC2 step, which handles the automatic application of discount services to mobile lines during order registration. The check is wired with `CONST_EQUAL` and `CONST_CONJUNCTION_NON`, meaning the workflow proceeds to JKKWrisvcAutoAplyCC2 only when this method returns `true`.

The method does not perform any business validation itself — it performs a simple presence check. If the caller placed the `JKKWrisvcAutoAplyCCMobileMap` HashMap into the user data before invoking this ReqChk, it signals that there are mobile discount service items to process and the workflow step should run. If the map is absent (null), the workflow skips the registration step, avoiding unnecessary processing for orders that do not involve mobile discount services.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["checkExecution(IRequestParameterReadOnly, IConditionValue)"])
    STEP1["Cast irp to RequestParameter"]
    STEP2["Get userData Map from RequestParameter"]
    STEP3["Retrieve JKKWrisvcAutoAplyCCMobileMap from Map"]
    COND{inMap == null?}
    FALSE_BRANCH["Return false (skip registration)"]
    TRUE_BRANCH["Return true (proceed with registration)"]

    START --> STEP1
    STEP1 --> STEP2
    STEP2 --> STEP3
    STEP3 --> COND
    COND -->|"Yes"| FALSE_BRANCH
    COND -->|"No"| TRUE_BRANCH
```

**Conditional Branch Summary:**

| Branch | Condition | Business Effect |
|--------|-----------|-----------------|
| `inMap == null` | The `JKKWrisvcAutoAplyCCMobileMap` key is absent or its value is `null` | The workflow **skips** the JKKWrisvcAutoAplyCC2 (discount service auto-application to mobile lines) step. No registration occurs. |
| `inMap != null` | The map exists and contains data | The workflow **proceeds** to the JKKWrisvcAutoAplyCC2 step, executing the discount service auto-registration for mobile. |

**Design Pattern:** Presence-check gate — a guard that delegates all business logic to the caller. The decision to execute JKKWrisvcAutoAplyCC2 is determined by whether the upstream processing (likely JKKWrisvcAutoAplyCCMobileCC or a similar controller) populated the map with mobile discount service items. This method merely checks for map existence, making it a lightweight, reusable condition check that can participate in multiple workflow branches without duplicating the map-population logic.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `irp` | `IRequestParameterReadOnly` | The read-only request parameter object carrying the BPM workflow's current state, including the `userData` Map. This is the primary conduit through which caller-side context (such as the `JKKWrisvcAutoAplyCCMobileMap`) flows into the ReqChk. It is cast to `RequestParameter` internally. |
| 2 | `conditionvalue` | `IConditionValue` | The condition value object passed by the BPM engine when evaluating execution conditions. In this method, it is **unused** — the method derives its decision entirely from the request parameter's user data. |

**External state accessed:**

| Field / Source | Access | Business Meaning |
|---------------|--------|------------------|
| `RequestParameter.userData` Map | Read via `rp.getUserData()` | The workflow's shared data container. The key `"JKKWrisvcAutoAplyCCMobileMap"` holds a `HashMap` representing mobile discount service auto-application items collected by earlier processing steps. |

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `RequestParameter.getUserData()` | - | - | Reads the `userData` Map from the request parameter to access workflow context. |
| R | `HashMap.get("JKKWrisvcAutoAplyCCMobileMap")` | - | - | Reads the mobile discount service map from the user data. The map key is the literal string `"JKKWrisvcAutoAplyCCMobileMap"`. |

**Note:** This method performs **no database operations, no service component calls, and no CRUD operations** of its own. It is a pure presence-check guard. The actual database work (create/read/update operations) for the JKKWrisvcAutoAplyCC2 step is delegated to the downstream service component that executes only when this method returns `true`.

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Screen:FUSV0160 | `FUSV0160Operation.getInvokeCBS()` → instantiate `ExeCondition` with class `"com.fujitsu.futurity.bp.custom.reqchk.JFUSV016030ReqChk"` → BPM engine invokes `JFUSV016030ReqChk.checkExecution(irp, conditionvalue)` | No direct terminal — returns boolean to BPM engine. Downstream: `JKKWrisvcAutoAplyCC2` step executes on `true`, which performs discount service auto-registration to mobile lines. |

**Summary:** This method has a single caller — `FUSV0160Operation`, the operation handler for the Fusv0160 screen. The Fusv0160 screen is used for customer order service changes. Within its `getInvokeCBS()` method, this ReqChk is registered as an execution condition for the `JKKWrisvcAutoAplyCC2` workflow step (the comment in FUSV0160Operation reads: `// JKKWrisvcAutoAplyCC2用実行判定`). The BPM engine evaluates all registered `ExeCondition` entries and calls `checkExecution()` to decide whether the downstream step should run.

## 6. Per-Branch Detail Blocks

**Block 1** — [SET] `RequestParameter rp = (RequestParameter)irp;` (L52)

| # | Type | Code |
|---|------|------|
| 1 | SET | `rp = (RequestParameter) irp;` // Cast the read-only interface to concrete RequestParameter |

> **Business Description:** Casts the polymorphic `IRequestParameterReadOnly` interface to its concrete implementation `RequestParameter` to enable access to the `getUserData()` method. This is a standard BPM framework pattern where the execution condition check receives the interface but needs concrete accessors.

**Block 2** — [SET] `Map<?, ?> map = rp.getUserData();` (L53)

| # | Type | Code |
|---|------|------|
| 1 | SET | `map = rp.getUserData();` // Retrieves the shared workflow data Map |

> **Business Description:** Reads the user data Map from the request parameter. This Map is the shared data carrier between BPM workflow steps — it holds all context objects needed across the workflow lifecycle, including the mobile discount service auto-application map.

**Block 3** — [SET] `HashMap inMap = (HashMap)map.get("JKKWrisvcAutoAplyCCMobileMap");` (L54)

| # | Type | Code |
|---|------|------|
| 1 | SET | `inMap = (HashMap) map.get("JKKWrisvcAutoAplyCCMobileMap");` // Retrieve the mobile discount service auto-application map |

> **Business Description:** Extracts the specific HashMap keyed by `"JKKWrisvcAutoAplyCCMobileMap"` from the user data. This map is populated by earlier processing steps (likely the mobile line identification and discount service qualification logic) when the order contains mobile lines eligible for automatic discount service application. The literal key `"JKKWrisvcAutoAplyCCMobileMap"` resolves the business purpose of this ReqChk — it is exclusively tied to the **JKKWrisvcAutoAplyCC** (Discount Service Auto-Application for Mobile) feature.

**Block 4** — [IF] `(inMap == null)` [割引サービス自動適用モバイル登録マップが存在しない場合、処理を実行しない。 / "If the discount service auto-application mobile registration map does not exist, do not execute processing."] (L56-L60)

| # | Type | Code |
|---|------|------|
| 1 | IF | `if (inMap == null)` // Condition: is the map absent? |
| 1.1 | RETURN | `return false;` (L58) // Skip the downstream JKKWrisvcAutoAplyCC2 step |
| 1.2 | ELSE | `return true;` (L60) // Proceed with the downstream step |

> **Business Description:** This is the sole decision point of the method. If the `JKKWrisvcAutoAplyCCMobileMap` is `null` or missing, it means no mobile discount service auto-application items were collected during prior processing — the order does not involve mobile lines requiring automatic discount application. The method returns `false`, causing the BPM engine to skip the JKKWrisvcAutoAplyCC2 workflow step. Conversely, if the map exists (even if empty), it returns `true`, allowing the downstream step to proceed and perform the actual discount service registration.

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `JKKWrisvcAutoAplyCCMobileMap` | Field/Key | Discount Service Auto-Application Mobile Registration Map — a HashMap stored in the workflow's user data that carries mobile line discount service items to the auto-application step. |
| `JKKWrisvcAutoAplyCC` | Acronym | Discount Service Auto-Application for WiRSVC (Wireless/Radio Service) CC — the service component responsible for automatically applying discount services to mobile lines. |
| JKKW | Acronym | Ku-You WiRSVC (customer wireless service) — internal project code for the customer wireless service module within K-Opticom's order fulfillment system. |
| FUSV0160 | Screen Code | Customer order service change screen — used for modifying existing customer service contracts, including adding/removing discount services. |
| ReqChk | Acronym | Requirement Check — execution condition check class used in the BPM engine to decide whether a workflow step should proceed. |
| `checkExecution()` | Method | The standard entry point implemented by `AbstractCustomReqChk` subclasses — returns `true` to allow workflow continuation, `false` to gate/skip the step. |
| `ExeCondition` | Class | Execution condition definition in the BPM engine — holds the ReqChk class name, comparison type (`CONST_EQUAL`), and conjunction mode (`CONST_CONJUNCTION_NON`). |
| BPM | Acronym | Business Process Management — the workflow engine that orchestrates multi-step business operations through condition-gated steps. |
| Discount Service | Business term | Promotional pricing or fee reduction applied to mobile service lines as part of service package bundles. |
| Auto-Application | Business term | The automatic, non-interactive registration of discount services to eligible mobile lines without requiring explicit customer selection per line. |
| WiRSVC | Acronym | Wireless Service — Fujitsu's internal terminology for mobile/cellular service offerings. |
| `RequestParameter` | Class | Concrete implementation of `IRequestParameterReadOnly` — the BPM workflow request object that carries shared data via its `userData` Map across workflow steps. |
| `userData` | Field | The shared data Map within `RequestParameter` that serves as the inter-step communication channel in the BPM workflow. |
