# Business Logic — SvcKeiFinderWithDchskmTrgtSvc.isAllEmptyTarget() [6 LOC]

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

## 1. Role

### SvcKeiFinderWithDchskmTrgtSvc.isAllEmptyTarget()

This method serves as a **null/empty-gate predicate** used during service-target matching in a telecom billing service registration system (NTT東日本 / NTT East Japan service order processing). It determines whether all four service-level filter parameters — `svcCd` (service code), `prcGrpCd` (processing group code), `pcrsCd` (product service code), and `pplanCd` (plan code) — are simultaneously empty (either `null` or blank `""`). When all parameters are empty, the system has no specific service-target criteria to match against, which means no service detail lines should be collected as matches; this is a short-circuit optimization that avoids unnecessary evaluation of per-field matching logic. The method is used in a broader service-target comparison flow where each individual parameter is compared via `isCollect()` (which treats empty target values as "always match"), but when all targets are empty, the method returns `false` early so the caller does not waste cycles comparing fields that have no filtering intent. In the larger system, it acts as a **guard clause** that prevents spurious matches when no service codes have been provided as selection criteria, which typically occurs during broad-scope operations such as retrieving all service details for a contract rather than filtering by specific service attributes.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["isAllEmptyTarget(svcCd, prcGrpCd, pcrsCd, pplanCd)"])

    CHECK1{"All four params are null or empty?"}
    RESULT_TRUE["result = true"]
    RESULT_FALSE["result = false"]
    END_RETURN(["Return result"])

    START --> CHECK1
    CHECK1 -->|true| RESULT_TRUE
    RESULT_TRUE --> END_RETURN
    CHECK1 -->|false| RESULT_FALSE
    RESULT_FALSE --> END_RETURN

    subgraph Inner["isEmpty(String item) check per param"]
        I1["null == item OR
item equals \"\""]
    end

    CHECK1 -.-> I1
```

The method delegates each of the four parameters to the `isEmpty(String)` helper method, which checks whether the value is `null` or an empty string (`""`). The results are combined with logical AND — only if **all four** are empty does the method return `true`. This is a flat, linear evaluation with no branching by constant values or service types.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `svcCd` | `String` | Service code — the primary service type identifier (e.g., FTTH, IP phone, cable TV) that determines what kind of telecom service is being queried |
| 2 | `prcGrpCd` | `String` | Processing group code — categorizes the service into a processing group for billing or routing purposes |
| 3 | `pcrsCd` | `String` | Product service code — a more specific code identifying the particular product/service offering within a service type |
| 4 | `pplanCd` | `String` | Plan code — identifies the specific rate plan or tariff plan associated with the service |

All four parameters are optional filter criteria passed from the calling context (`JKKWribSvcKeiOperateCC`). They represent hierarchical levels of service identification, from broad (service type) to narrow (specific plan). When all are empty, the system is operating without service-level filters.

## 4. CRUD Operations / Called Services

This method performs **no database operations, no SC/CBS calls, and no entity reads or writes**. It is a pure in-memory predicate that evaluates string nullability. The only internal method it calls is the private helper `isEmpty(String)`.

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| — | `isEmpty(String)` (private helper) | — | — | In-memory null/blank check; no external I/O |

## 5. Dependency Trace

The method `isAllEmptyTarget` is called inline within `JKKWribSvcKeiOperateCC.java` (the same class) in two locations as a guard predicate during service-target comparison logic. It is also invoked through a `Predicater` evaluation pattern (likely a strategy/predicate-based filtering framework).

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | CC:JKKWribSvcKeiOperateCC (inline) | `JKKWribSvcKeiOperateCC.someComparisonMethod()` → `isAllEmptyTarget()` | None (pure predicate) |
| 2 | CC:JKKWribSvcKeiOperateCC (inline, second caller) | `JKKWribSvcKeiOperateCC.anotherComparisonMethod()` → `isAllEmptyTarget()` | None (pure predicate) |
| 3 | Predicater | `Predicater.evaluate()` → `isAllEmptyTarget()` | None (pure predicate) |

## 6. Per-Branch Detail Blocks

**Block 1** — [METHOD] Method entry with 4 String parameters (L16879)

> Entry point that receives the four service-level filter codes and delegates each to the `isEmpty` helper for null/blank validation.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `isEmpty(svcCd)` // Check if primary service code is null or empty [-> isEmpty helper] |
| 2 | CALL | `isEmpty(prcGrpCd)` // Check if processing group code is null or empty [-> isEmpty helper] |
| 3 | CALL | `isEmpty(pcrsCd)` // Check if product service code is null or empty [-> isEmpty helper] |
| 4 | CALL | `isEmpty(pplanCd)` // Check if plan code is null or empty [-> isEmpty helper] |
| 5 | SET | `result = isEmpty(svcCd) && isEmpty(prcGrpCd) && isEmpty(pcrsCd) && isEmpty(pplanCd)` // Logical AND of all four emptiness checks |

**Block 2** — [RETURN] Return the combined emptiness result (L16883)

> Returns `true` only when all four parameters are null or blank; `false` if any one has a non-empty value.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return result;` // true if all params empty, false otherwise |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `svcCd` | Field | Service code — primary telecom service type identifier (e.g., FTTH, IP telephone, cable TV service) |
| `prcGrpCd` | Field | Processing group code — groups services into categories for billing and order processing workflows |
| `pcrsCd` | Field | Product service code — specific product/service offering code within a broader service type |
| `pplanCd` | Field | Plan code — identifies the specific rate plan, tariff plan, or service tier for a given service |
| `isEmpty` | Helper method | Private utility that checks if a String is null or blank ("") |
| `isAllEmptyTarget` | Method | Guard predicate that returns true only when all target filter codes are empty (no filtering intent) |
| `isCollect` | Helper method | Predicate that determines whether a service target code should be collected/matched; treats empty source as "always matches" |
| WribSvc | Abbreviation | Written/Registered Service — refers to service registration data in the system |
| SvcKei | Abbreviation | Service Detail — a line-item or sub-record within a service contract (書き込みサービス細目) |
| CC | Abbreviation | Common Component — shared utility/component class in the Fujitsu Futurity BP framework |
| NTT East Japan | Business term | Nippon Telegraph and Telephone East Corporation — major Japanese telecommunications provider; this system processes their service orders |
| Short-circuit predicate | Pattern | A boolean check that evaluates early to avoid unnecessary processing when preconditions are not met |
