---
title: "Business Logic — JFUShokaishaCheckCC.chkFrontMatch()"
description: "Detailed design for chkFrontMatch method in JFUShokaishaCheckCC"
method: "chkFrontMatch"
class: "JFUShokaishaCheckCC"
fqn: "com.fujitsu.futurity.bp.custom.common.JFUShokaishaCheckCC"
---

# Business Logic — JFUShokaishaCheckCC.chkFrontMatch() [11 LOC]

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

## 1. Role

### JFUShokaishaCheckCC.chkFrontMatch()

This method performs a **prefix (front) matching** check — it determines whether any string element in a given list appears as a prefix of a target value. In the business domain, this is used to classify interruption codes (`intrCd`) against predefined code prefix patterns. Specifically, it answers the question: "Does this interruption code start with any of the recognized code prefix patterns?" The method acts as a shared utility within the `JFUShokaishaCheckCC` class (Shokaisha = Initialization, a common component for initialization-related checks). It implements a simple iteration-and-match design pattern, providing a boolean decision without side effects. As a private static method, it serves as an internal helper used exclusively by `chkIntrCd()` for validating whether an interruption code is an on-site visit code (`Tujyo`) or an entry-style code (`EoEntry`), both of which are identified by specific code prefix patterns maintained in work parameters.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["chkFrontMatch(list, value)"])
    CHECK_EMPTY{"list is empty or null?"}
    LOOP_START["for each key in list"]
    CONDITION{"value.startsWith(key)?"}
    RETURN_TRUE["return true"]
    LOOP_END["end of loop"]
    RETURN_FALSE["return false"]
    END_NODE(["Return"])

    START --> CHECK_EMPTY
    CHECK_EMPTY -->|Yes| RETURN_FALSE
    CHECK_EMPTY -->|No| LOOP_START
    LOOP_START --> CONDITION
    CONDITION -->|true| RETURN_TRUE
    RETURN_TRUE --> END_NODE
    CONDITION -->|false| LOOP_END
    LOOP_END --> LOOP_START
```

The method iterates through each element (`key`) in the provided list and checks whether the target `value` string begins with that key. The moment any prefix match is found, the method returns `true` immediately (short-circuit behavior). If the entire list is exhausted without any match, it returns `false`.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `list` | `List<String>` | A list of code prefix patterns to match against. These prefixes represent recognized interruption code ranges, such as codes designated for on-site visits or entry-style interruptions. The list is obtained from work parameters via `JFUBPCommon.getWorkParamSplit()`, split by comma or a configured delimiter. |
| 2 | `value` | `String` | The interruption code (`intrCd`) to be validated. This is a business code that identifies a specific type of service interruption, and the method checks whether it falls within any of the known prefix ranges. |

No instance fields are read by this method. It is fully stateless.

## 4. CRUD Operations / Called Services

This method performs only in-memory string operations. It calls `String.startsWith()` on each list element and performs iteration over the list. No database, CBS, or SC calls are made.

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| — | `String.startsWith()` | — | — | In-memory string prefix comparison. No persistence operation. |

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | — (CC: JFUShokaishaCheckCC) | `chkIntrCd` -> `chkFrontMatch` | — |

**Direct callers:**
- `JFUShokaishaCheckCC.chkIntrCd()` (line 220): Passes work parameter split by `JFUStrConst.KK_INTRCD_CHK_TG` and the interruption code to check if it is an on-site visit code (`isTujyoIntrCd`).
- `JFUShokaishaCheckCC.chkIntrCd()` (line 223): Passes work parameter split by `JFUStrConst.FU_EO_ENTRY_YK_KIGEN` and the interruption code to check if it is an entry-style code (`isEoEntryCd`).

No screen or batch entry points are traced within the call graph. This method is a private utility called exclusively by `chkIntrCd()` for interruption code classification.

## 6. Per-Branch Detail Blocks

**Block 1** — [FOR] `(for each key in list)` (L484)

> Iterate through each prefix pattern in the list and check if the value starts with it.

| # | Type | Code |
|---|------|------|
| 1 | SET | `key` = `list` element // Each element of the input list is a code prefix to match [-> List<String>] |
| 2 | CALL | `value.startsWith(key)` // Check if the target interruption code starts with the current prefix pattern |
| 3 | RETURN | `true` // A prefix match was found; the value belongs to this code range |

**Block 2** — [ELSE] `(no match found after iterating all keys)` (L489)

> After exhausting all prefix patterns without a match, conclude the value does not belong to any recognized code range.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `false` // No prefix in the list matches the beginning of the value |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `chkFrontMatch` | Method | Prefix (front) matching check — determines if any list element is a prefix of the target value |
| `chkIntrCd` | Method | Interruption code validation — determines the classification of an interruption code |
| `intrCd` | Field | Interruption Code — a business code identifying the type of service interruption or maintenance activity |
| Shokaisha (初期化) | Business term | Initialization — refers to setup or validation steps performed at the beginning of a process |
| Tujyo (突上) | Business term | On-site visit — a type of interruption where a technician must visit the customer's premises |
| EoEntry (EOエントリー) | Business term | EO (External Office) Entry-style interruption — a type of interruption handled via remote system entry rather than on-site dispatch |
| `JFUStrConst.KK_INTRCD_CHK_TG` | Constant | Interruption code check target prefix — work parameter key for on-site visit code prefix patterns |
| `JFUStrConst.FU_EO_ENTRY_YK_KIGEN` | Constant | EO Entry exclusion prefix — work parameter key for entry-style interruption code prefix patterns |
| `getWorkParamSplit` | Method | Splits a work parameter value by delimiter (typically comma) into a list of strings |
| startsWith | API | Java `String.startsWith()` — checks if a string begins with a specified prefix |
