---
title: "Detailed Design — JBSbatKKCourseChgFileBnkt.setKjFinClStr()"
description: "Detailed design document for the setKjFinClStr method in JBSbatKKCourseChgFileBnkt (Work Completion Cancellation String Builder)"
---

# Business Logic — JBSbatKKCourseChgFileBnkt.setKjFinClStr() [74 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.business.service.JBSbatKKCourseChgFileBnkt` |
| Layer | Batch (Service Component within the batch processing layer) |
| Module | `service` (Package: `eo.business.service`) |

## 1. Role

### JBSbatKKCourseChgFileBnkt.setKjFinClStr()

This method implements the **Work Completion Cancellation String Builder** ("工事完了取消文字列設定処理"). It is responsible for transforming a flat array of 23 work cancellation data fields into a single, comma-delimited record string that is written to a batch output file. The method processes records whose work result status is "3" (Work Completion Cancellation — `KKIFM151_KOJI_RSLT_3`), serving as the data serialization step in the batch's course change file generation pipeline.

The method implements the **Builder pattern** (idiomatic Java `StringBuilder` accumulation): it receives a pre-instantiated `StringBuilder`, appends 23 individual data fields interspersed with comma delimiters (`CONMA`), and returns the populated builder for subsequent file-writing. This is a **shared utility** method — it is called exclusively from `JBSbatKKCourseChgFileBnkt.execute()` within a conditional branch that identifies work cancellation records.

The method has no conditional branches or control flow: it performs a deterministic, linear accumulation of all 23 fields. The field layout evolved over time through two enhancement releases — **ANK-2765** (authentication ID standardization, adding `data[20]` for "Old Price Plan Code") and **ANK-3949** (Netflix introduction Step 1, adding `data[21]` for "New Price Course Code" and `data[22]` for "Old Price Course Code") — which extended the output format without altering the method's core logic.

Note that `data[13]` is **skipped** in this method; instead, a `KARAMOJI` constant (empty string `""`) is appended at that position to represent "Work Project Cancellation Fee — yes/no" (工事案件キャンセル料有無). This gap is intentional: the cancellation fee indicator is not supplied in the input data and defaults to blank.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["setKjFinClStr(kjFinClstrBuilder, data)"])
    S0["Append data[0]: Service Contract Number"]
    C0["Append CONMA ','"]
    S1["Append data[1]: Update Timestamp"]
    C1["Append CONMA ','"]
    S2["Append data[2]: Anomaly Reservation No. 1"]
    C2["Append CONMA ','"]
    S3["Append data[3]: Update Timestamp 1"]
    C3["Append CONMA ','"]
    S4["Append data[4]: Service Code"]
    C4["Append CONMA ','"]
    S5["Append data[5]: Service Contract Detail No. 1"]
    C5["Append CONMA ','"]
    S6["Append data[6]: Registration Date 1"]
    C6["Append CONMA ','"]
    S7["Append data[7]: Service Contract Detail No. 2"]
    C7["Append CONMA ','"]
    S8["Append data[8]: Registration Date 2"]
    C8["Append CONMA ','"]
    S9["Append data[9]: Anomaly Reservation No. 2 (Cancellation Detail)"]
    C9["Append CONMA ','"]
    S10["Append data[10]: Update Timestamp 2 (Cancellation Detail)"]
    C10["Append CONMA ','"]
    S11["Append data[11]: Work Result"]
    C11["Append CONMA ','"]
    S12["Append data[12]: Work Completion Date"]
    C12["Append CONMA ','"]
    SK["Append KARAMOJI '' (empty) — Work Project Cancellation Fee"]
    Ck["Append CONMA ','"]
    S14["Append data[14]: Application Detail No."]
    C14["Append CONMA ','"]
    S15["Append data[15]: Anomaly Separation"]
    C15["Append CONMA ','"]
    S16["Append data[16]: Work Project No."]
    C16["Append CONMA ','"]
    S17["Append data[17]: Price Group Code"]
    C17["Append CONMA ','"]
    S18["Append data[18]: Service Contract Status"]
    C18["Append CONMA ','"]
    S19["Append data[19]: Anomaly Reservation Detail Code"]
    C19["Append CONMA ','"]
    S20["Append data[20]: Old Price Plan Code (ANK-2765)"]
    C20["Append CONMA ',' (ANK-2765)"]
    S21["Append data[21]: New Price Course Code (ANK-3949)"]
    C21["Append CONMA ',' (ANK-3949)"]
    S22["Append data[22]: Old Price Course Code (ANK-3949)"]
    END["Return kjFinClstrBuilder"]

    START --> S0 --> C0 --> S1 --> C1 --> S2 --> C2 --> S3 --> C3 --> S4 --> C4 --> S5 --> C5 --> S6 --> C6 --> S7 --> C7 --> S8 --> C8 --> S9 --> C9 --> S10 --> C10 --> S11 --> C11 --> S12 --> C12 --> SK --> Ck --> S14 --> C14 --> S15 --> C15 --> S16 --> C16 --> S17 --> C17 --> S18 --> C18 --> S19 --> C19 --> S20 --> C20 --> S21 --> C21 --> S22 --> END
```

**Constant Resolution:**

| Constant | Value | Source | Business Meaning |
|----------|-------|--------|------------------|
| `CONMA` | `","` | `JKKBatConst.CONMA` (line 1218) | Comma delimiter — field separator in batch output files |
| `KARAMOJI` | `""` | `JBSbatKKCourseChgFileBnkt.KARAMOJI` (line 82) | Empty string — placeholder for absent "Work Project Cancellation Fee" field (工事案件キャンセル料有無) |

The method contains **no conditional branches** — it is a pure, linear append sequence. All 23 data fields are appended in a fixed order, each followed by a comma delimiter. This linear structure is intentional: the batch consumer (downstream file reader) expects a fixed-column CSV layout.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `kjFinClstrBuilder` | `StringBuilder` | The output accumulator — a pre-instantiated `StringBuilder` that collects the comma-delimited cancellation record. The caller (`execute()`) creates this as `new StringBuilder()` and passes it in. After this method returns, the caller writes its `toString()` to the work completion cancellation output file. |
| 2 | `data` | `String[]` | An array of 23 string elements (indices 0–22, with index 13 intentionally skipped) containing the raw work cancellation record fields extracted from the course change input file. Each index corresponds to a specific business data element (see per-branch detail below). Values may be empty strings for optional fields. |

**Instance Fields Read:** None. This method is fully stateless — it reads only its parameters and static constants.

## 4. CRUD Operations / Called Services

This method performs **no database operations, no SC/CBS calls, and no service invocations**. It is a pure data transformation (string accumulation) method with zero I/O. All 22 `append()` calls are on the `StringBuilder` parameter (a local object), and the only constant used (`CONMA`) is a static string literal from `JKKBatConst`.

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| — | *(N/A — pure transformation)* | — | — | No database or service calls. This method exclusively appends values to a `StringBuilder` parameter. |

## 5. Dependency Trace

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

No screen/batch entry points found within 8 hops. Direct callers found: 1 methods.

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Batch: JBSbatKKCourseChgFileBnkt | `execute()` → `setKjFinClStr(kjFinClstrBuilder, data)` | *(N/A — no terminal CRUD; pure string builder)* |

**Caller context:** The sole caller is `JBSbatKKCourseChgFileBnkt.execute()`, the batch entry point. Within `execute()`, `setKjFinClStr` is invoked in the conditional branch where `kojiRslt` (work result) equals `KKIFM151_KOJI_RSLT_3` ("3" — Work Completion Cancellation). The `execute()` method reads course change records from an input file, classifies each by work result, and routes them to three output files: work completion (`setKjFinStr`), work completion cancellation (`setKjFinClStr`), and work cancellation (`setKjClStr`). This method handles only the cancellation path.

## 6. Per-Branch Detail Blocks

Since this method has no conditional branches, the entire method is a single sequential block.

**Block 1** — [LINEAR SEQUENCE] (L426–L498)

> Sequentially appends 23 fields (index 0–22, skipping 13) with comma delimiters to build the work completion cancellation record string. This is the batch output serialization for "Work Completion Cancellation" records (work result = "3").

| # | Type | Code | Comment |
|---|------|------|---------|
| 1 | EXEC | `kjFinClstrBuilder.append(data[0])` | Append data[0]: Service Contract Number (サービス契約番号) [L426] |
| 2 | EXEC | `kjFinClstrBuilder.append(CONMA)` | Append comma delimiter [L427] |
| 3 | EXEC | `kjFinClstrBuilder.append(data[1])` | Append data[1]: Update Timestamp (更新年月日時刻分秒) [L429] |
| 4 | EXEC | `kjFinClstrBuilder.append(CONMA)` | Append comma delimiter [L430] |
| 5 | EXEC | `kjFinClstrBuilder.append(data[2])` | Append data[2]: Anomaly Reservation No. 1 (異動予約番号1) [L432] |
| 6 | EXEC | `kjFinClstrBuilder.append(CONMA)` | Append comma delimiter [L433] |
| 7 | EXEC | `kjFinClstrBuilder.append(data[3])` | Append data[3]: Update Timestamp 1 (更新年月日時刻分秒1) [L435] |
| 8 | EXEC | `kjFinClstrBuilder.append(CONMA)` | Append comma delimiter [L436] |
| 9 | EXEC | `kjFinClstrBuilder.append(data[4])` | Append data[4]: Service Code (サービスコード) [L438] |
| 10 | EXEC | `kjFinClstrBuilder.append(CONMA)` | Append comma delimiter [L439] |
| 11 | EXEC | `kjFinClstrBuilder.append(data[5])` | Append data[5]: Service Contract Detail No. 1 (サービス契約内容番号1) [L441] |
| 12 | EXEC | `kjFinClstrBuilder.append(CONMA)` | Append comma delimiter [L442] |
| 13 | EXEC | `kjFinClstrBuilder.append(data[6])` | Append data[6]: Registration Date 1 (世代登録年月日1) [L444] |
| 14 | EXEC | `kjFinClstrBuilder.append(CONMA)` | Append comma delimiter [L445] |
| 15 | EXEC | `kjFinClstrBuilder.append(data[7])` | Append data[7]: Service Contract Detail No. 2 (サービス契約内容番号2) [L447] |
| 16 | EXEC | `kjFinClstrBuilder.append(CONMA)` | Append comma delimiter [L448] |
| 17 | EXEC | `kjFinClstrBuilder.append(data[8])` | Append data[8]: Registration Date 2 (世代登録年月日2) [L450] |
| 18 | EXEC | `kjFinClstrBuilder.append(CONMA)` | Append comma delimiter [L451] |
| 19 | EXEC | `kjFinClstrBuilder.append(data[9])` | Append data[9]: Anomaly Reservation No. 2, Cancellation Detail (異動予約番号2（解約内容分）) [L453] |
| 20 | EXEC | `kjFinClstrBuilder.append(CONMA)` | Append comma delimiter [L454] |
| 21 | EXEC | `kjFinClstrBuilder.append(data[10])` | Append data[10]: Update Timestamp 2, Cancellation Detail (更新年月日時刻分秒2（解約内容分）) [L456] |
| 22 | EXEC | `kjFinClstrBuilder.append(CONMA)` | Append comma delimiter [L457] |
| 23 | EXEC | `kjFinClstrBuilder.append(data[11])` | Append data[11]: Work Result (工事結果) [L459] |
| 24 | EXEC | `kjFinClstrBuilder.append(CONMA)` | Append comma delimiter [L460] |
| 25 | EXEC | `kjFinClstrBuilder.append(data[12])` | Append data[12]: Work Completion Date (工事完了日) [L462] |
| 26 | EXEC | `kjFinClstrBuilder.append(CONMA)` | Append comma delimiter [L463] |
| 27 | EXEC | `kjFinClstrBuilder.append(KARAMOJI)` | Append `KARAMOJI` = `""` (empty) — Work Project Cancellation Fee (工事案件キャンセル料有無) [L465] |
| 28 | EXEC | `kjFinClstrBuilder.append(CONMA)` | Append comma delimiter [L466] |
| 29 | EXEC | `kjFinClstrBuilder.append(data[14])` | Append data[14]: Application Detail No. (申請明细番号) — *note: index 13 skipped* [L468] |
| 30 | EXEC | `kjFinClstrBuilder.append(CONMA)` | Append comma delimiter [L469] |
| 31 | EXEC | `kjFinClstrBuilder.append(data[15])` | Append data[15]: Anomaly Separation (異動区分) [L471] |
| 32 | EXEC | `kjFinClstrBuilder.append(CONMA)` | Append comma delimiter [L472] |
| 33 | EXEC | `kjFinClstrBuilder.append(data[16])` | Append data[16]: Work Project No. (工事案件番号) [L474] |
| 34 | EXEC | `kjFinClstrBuilder.append(CONMA)` | Append comma delimiter [L475] |
| 35 | EXEC | `kjFinClstrBuilder.append(data[17])` | Append data[17]: Price Group Code (料金グルーグループコード) [L477] |
| 36 | EXEC | `kjFinClstrBuilder.append(CONMA)` | Append comma delimiter [L478] |
| 37 | EXEC | `kjFinClstrBuilder.append(data[18])` | Append data[18]: Service Contract Status (サービス契約ステータス) [L480] |
| 38 | EXEC | `kjFinClstrBuilder.append(CONMA)` | Append comma delimiter [L481] |
| 39 | EXEC | `kjFinClstrBuilder.append(data[19])` | Append data[19]: Anomaly Reservation Detail Code (異動予約詳細コード) [L483] |
| 40 | EXEC | `kjFinClstrBuilder.append(CONMA)` | ANK-2765 addition: Append comma [L486] |
| 41 | EXEC | `kjFinClstrBuilder.append(data[20])` | ANK-2765 addition: Append data[20]: Old Price Plan Code (旧料金プランコード) [L487] |
| 42 | EXEC | `kjFinClstrBuilder.append(CONMA)` | ANK-3949 addition: Append comma [L490] |
| 43 | EXEC | `kjFinClstrBuilder.append(data[21])` | ANK-3949 addition: Append data[21]: New Price Course Code (新料金コースコード) [L491] |
| 44 | EXEC | `kjFinClstrBuilder.append(CONMA)` | ANK-3949 addition: Append comma [L493] |
| 45 | EXEC | `kjFinClstrBuilder.append(data[22])` | ANK-3949 addition: Append data[22]: Old Price Course Code (旧料金コースコード) [L494] |
| 46 | RETURN | `return kjFinClstrBuilder;` | Return the populated StringBuilder [L497] |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `setKjFinClStr` | Method | Set Kanjou Finish Cancellation String — Japanese name reflects "工事完了取消" (Work Completion Cancellation) |
| `kjFinClstrBuilder` | Field | Abbreviation of "Kanjou Finish Cancellation String Builder" — the StringBuilder accumulating the output record |
| `CONMA` | Constant | "," (comma) — field delimiter used in batch output files; defined in `JKKBatConst.CONMA` |
| `KARAMOJI` | Constant | `""` (empty string) — Japanese "空文字" (empty character); used as a blank placeholder for the "Work Project Cancellation Fee" field |
| サービス契約番号 | Field | Service Contract Number — the unique identifier for a customer's service contract |
| 更新年月日時刻分秒 | Field | Update Year-Month-Day-Hour-Minute-Second — timestamp of the most recent data modification |
| 異動予約番号 | Field | Anomaly Reservation Number — internal tracking ID for a service line item change reservation ("異動" = movement/transfer) |
| サービスコード | Field | Service Code — code identifying the type of telecom service (e.g., FTTH, Mail, Netflix) |
| サービス契約内容番号 | Field | Service Contract Detail Number — sub-identifier within a service contract for specific line items |
| 世代登録年月日 | Field | Generation Registration Date — the date a service record was registered/created in the system |
| 工事結果 | Field | Work Result — the completion status of a field installation/repair job; "3" = Work Completion Cancellation |
| 工事完了日 | Field | Work Completion Date — the date the field work was marked as completed |
| 工事案件キャンセル料有無 | Field | Work Project Cancellation Fee — Yes/No indicator; currently always blank (`KARAMOJI`) |
| 申請明細番号 | Field | Application Detail Number — reference number for a customer change application |
| 異動区分 | Field | Anomaly Separation — classification code distinguishing the type of service change (e.g., transfer, cancellation) |
| 工事案件番号 | Field | Work Project Number — unique identifier for a field work order/project |
| 料金グループコード | Field | Price Group Code — code grouping pricing tiers or bundles |
| サービス契約ステータス | Field | Service Contract Status — current state of the service contract (e.g., active, suspended, terminated) |
| 異動予約詳細コード | Field | Anomaly Reservation Detail Code — detailed classification of the reservation type |
| 旧料金プランコード | Field | Old Price Plan Code — the previous pricing plan before a price change (added in ANK-2765) |
| 新料金コースコード | Field | New Price Course Code — the new pricing course being adopted (added in ANK-3949 for Netflix) |
| 旧料金コースコード | Field | Old Price Course Code — the previous pricing course before a change (added in ANK-3949) |
| 工事完了取消 | Business term | Work Completion Cancellation — the process of reversing/cancelling a previously completed field installation or repair job |
| KKIFM151_KOJI_RSLT_3 | Constant | Work result code "3" — denotes Work Completion Cancellation records; defined in `JBSbatKKConst` |
| ANK-2765 | Change ticket | Authentication ID standardization enhancement — added `data[20]` (Old Price Plan Code) to the output format |
| ANK-3949 | Change ticket | Netflix introduction support (Step 1) — added `data[21]` and `data[22]` (New/Old Price Course Codes) to support Netflix pricing |
| Course Change Batch | Business domain | The broader batch job (`JBSbatKKCourseChgFileBnkt`) that processes customer service course/plan change files, routing records to three output files based on work result type |
