# Business Logic — JKKNsidPwdChgOrsjgsCC.addPrg() [28 LOC]

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

## 1. Role

### JKKNsidPwdChgOrsjgsCC.addPrg()

This method performs **progress registration** (Japanese: 進捗登録) — it records a progress status update for a service contract operation within the Fujitsu Futurity business platform. Specifically, it invokes the CBS (Central Business System) component `EKK1091D010` with a structured input payload that captures the current stage of a password change operation (identity verification with shuffle — 身元確認とshuffle).

The method follows a **builder-dispatch** design pattern: it first constructs the CBS input message (an `Object[][]` array) by mapping business parameters — such as the service type number, operation division code, system datetime, and progress status — into a predefined schema, then delegates the actual CBS invocation to the `callSC` helper method. It also prepares a nested error reason detail sub-message (`EKK1091D010CBSMsg1List`) with a default error code of "56" (OTHER), enabling downstream CBS logic to associate an alternate error reason if the standard error handling path is not triggered.

Within the larger system, this method acts as a **shared utility** within the password change workflow (`JKKNsidPwdChgOrsjgsCC`). It is called by `chgNsidPwd()` (the main password change entry point) to register each processing milestone — allowing the platform to track and report the progress of customer-facing operations such as password changes with identity verification.

The method has no conditional branches; it executes a single linear path of message construction followed by a CBS invocation.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["addPrg handle, scCall, param, fixedText, commonKey, prgStat"])
    START --> STEP1["Step 1: Create CAANMsg childTemplate for error reason detail"]
    STEP1 --> STEP2["Step 2: Set ido_rsn_cd to CD00846_OTHER (56) in childTemplate"]
    STEP2 --> STEP3["Step 3: Create ekk1091d010CBSMsg1List array"]
    STEP3 --> STEP4["Step 4: Build input Object[][] for CBS"]
    STEP4 --> STEP4A["Set TEMPLATEID to EKK1091D010"]
    STEP4 --> STEP4B["Set FUNC_CODE to FUNC_CD_1 (1)"]
    STEP4 --> STEP4C["Set SVC_KEI_NO to commonKey"]
    STEP4 --> STEP4D["Set SVC_KEI_UCWK_NO to svcKeiUcwkNo"]
    STEP4 --> STEP4E["Set IDO_DIV to IDO_DIV_IDPWD_SHKKA_SAIFURI (00052)"]
    STEP4 --> STEP4F["Set IDO_DTM to system datetime"]
    STEP4 --> STEP4G["Set PRG_STAT to prgStat parameter"]
    STEP4 --> STEP4H["Set MSKM_DTL_NO to mskmDtlNo"]
    STEP4 --> STEP4I["Set EKK1091D010CBSMSG1LIST to childTemplate array"]
    STEP4I --> STEP5["Step 5: Call CBS via callSC with input and message contents"]
    STEP5 --> STEP6["Step 6: Extract CAANMsgList from result"]
    STEP6 --> END(["Return void"])
```

### Constant Resolution

| Constant | Resolved Value | Business Meaning |
|----------|---------------|------------------|
| `TEMPLATE_ID_EKK1091D010` | `"EKK1091D010"` | CBS template identifier for the EKK1091D010 service operation |
| `JPCModelConstant.FUNC_CD_1` | `"1"` | Function code 1 — typically indicates the primary/standard function mode |
| `JKKSvcConst.IDO_DIV_IDPWD_SHKKA_SAIFURI` | `"00052"` | Installation division code for password change with identity verification (身元確認と shuffle) |
| `JKKStrConst.CD00846_OTHER` | `"56"` | Error reason detail code "OTHER" — a catch-all code for error reasons not covered by predefined categories |

### Processing Flow

**Step 1 — Create error reason detail template:**
A child `CAANMsg` object is instantiated using the class name of `EKK1091D010CBSMsg1List`. This creates a structured message template to hold error reason sub-data that the CBS layer expects.

**Step 2 — Set error reason code:**
The field `ido_rsn_cd` (installation error reason code) is set to `"56"` (OTHER). This provides a default error reason detail that the CBS can use or override.

**Step 3 — Create message array:**
The child template is wrapped into a `CAANMsg[]` array named `ekk1091d010CBSMsg1List`, which serves as the nested sub-message list expected by the CBS.

**Step 4 — Build CBS input mapping:**
An `Object[][]` array is assembled containing 9 key-value pairs, each mapping a CBS message field to its value:

| CBS Field | Value |
|-----------|-------|
| `TEMPLATEID` | `"EKK1091D010"` |
| `FUNC_CODE` | `"1"` (standard function mode) |
| `SVC_KEI_NO` | `commonKey` (shared key parameter) |
| `SVC_KEI_UCWK_NO` | `svcKeiUcwkNo` (instance field: service detail work number) |
| `IDO_DIV` | `"00052"` (password change with identity verification) |
| `IDO_DTM` | Current system datetime (from `JPCBPCommon.getSysDateTimeStamp()`) |
| `PRG_STAT` | `prgStat` (method parameter: progress status) |
| `MSKM_DTL_NO` | `mskmDtlNo` (instance field: masking detail number) |
| `EKK1091D010CBSMSG1LIST` | `ekk1091d010CBSMsg1List` (child error reason template array) |

**Step 5 — Invoke CBS via `callSC`:**
The `callSC` method is invoked with the session handle, service component request invoker, request parameters, the built CBS input, fixed text, and the CBS message contents (from `new EKK1091D010CBSMsg().getContents()`).

**Step 6 — Extract result:**
The CBS response is retrieved by calling `getCAANMsgList(EKK1091D010CBSMsg.EKK1091D010CBSMSG1LIST)` on the returned result, extracting the nested sub-message list.

**Step 7 — Return:**
The method returns `void` (no explicit return statement — the result is extracted inline as the last expression).

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `handle` | `SessionHandle` | The user's session handle — carries the authenticated user context, locale, and tenant information for the CBS invocation |
| 2 | `scCall` | `ServiceComponentRequestInvoker` | The service component request invoker — manages the runtime invocation of CBS/SC components, passing session and parameter context |
| 3 | `param` | `IRequestParameterReadWrite` | Request parameter read-write interface — carries HTTP request parameters or form data for the current operation, allowing CBS to access caller-supplied values |
| 4 | `fixedText` | `String` | User-defined string — a fixed text string provided by the caller, typically used for logging, trace identification, or display purposes within CBS messages |
| 5 | `commonKey` | `String` | Shared key — the primary service contract identifier that links the progress registration to the correct service order/contract line. This maps to `SVC_KEI_NO` (service type number) in the CBS |
| 6 | `prgStat` | `String` | Progress status — indicates the current processing stage of the password change workflow (e.g., "in progress," "completed," "failed"). This value is recorded in `PRG_STAT` field for audit and workflow tracking |

### Instance Fields Read

| Field | Type | Business Description |
|-------|------|---------------------|
| `svcKeiUcwkNo` | `String` | Service detail work number — an internal tracking ID for service contract line items, distinguishing sub-operations within the same service type |
| `mskmDtlNo` | `String` | Masking detail number — an internal identifier for masked/obfuscated data records, used when customer PII is involved in the operation |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| C | `callSC` -> `EKK1091D010CBS` | EKK1091D010CBS | EKK_T_IDO_KANRI (estimated) | Invokes CBS EKK1091D010 to register progress status (IDO = installation/provisioning) with service type number, operation division code (password change), datetime, and error reason detail |

### Detail of the CBS invocation

The method calls `callSC()`, a private helper within `JKKNsidPwdChgOrsjgsCC`, which delegates to the CBS `EKK1091D010`. The CBS receives a structured input containing:
- Template ID (`EKK1091D010`)
- Function code (`1` — standard mode)
- Service key (`SVC_KEI_NO` = `commonKey`)
- Service detail work number (`SVC_KEI_UCWK_NO` = `svcKeiUcwkNo`)
- Installation division code (`IDO_DIV` = `"00052"` — password change with identity verification)
- Installation datetime (`IDO_DTM` = current system time)
- Progress status (`PRG_STAT` = `prgStat`)
- Masking detail number (`MSKM_DTL_NO` = `mskmDtlNo`)
- Error reason detail list (`EKK1091D010CBSMSG1LIST`)

This CBS operation is a **Create** (progress record insertion) — it registers a new progress entry in the installation/provisioning management table, enabling the platform to track and display the current stage of a password change workflow.

## 5. Dependency Trace

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

No screen/batch entry points found within 8 hops. Direct callers found: 1 methods.
Terminal operations from this method: `callSC` [R], `getCAANMsgList` [R], `getContents` [R], `getContents` [R], `getSysDateTimeStamp` [R]

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | CBS: `JKKNsidPwdChgOrsjgsCC.chgNsidPwd` | `chgNsidPwd(handle, scCall, param, ...)` -> `addPrg(handle, scCall, param, fixedText, commonKey, prgStat)` | `EKK1091D010CBS [C] EKK_T_IDO_KANRI` |

**Note:** `chgNsidPwd` is the direct caller of `addPrg` within the same class. This CBS handles the core password change operation with identity verification, calling `addPrg` at key milestones to record workflow progress. The terminal CBS `EKK1091D010` performs a Create operation on the installation/provisioning management table.

## 6. Per-Branch Detail Blocks

> **Note:** This method has no conditional branches (no if/else, switch, loops, or try-catch). It is a single linear block.

**Block 1** — [LINEAR] (L671–L698)

> **Business Description:** Constructs the CBS input payload for progress registration and invokes the CBS. This is a straight-through processing block that builds all CBS fields from method parameters and instance fields, then calls the CBS via the `callSC` helper.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `new CAANMsg(EKK1091D010CBSMsg1List.class.getName())` // Create child template for error reason detail (Japanese: 異動理由明細の作成) |
| 2 | SET | `childTemplate.set("ido_rsn_cd", JKKStrConst.CD00846_OTHER)` // Set error reason code to "56" (OTHER) [-> CD00846_OTHER="56"] |
| 3 | SET | `new CAANMsg[]{childTemplate}` // Wrap child template into array for CBS sub-message list |
| 4 | SET | Build `Object[][] ekk1091d010In` with 9 CBS field mappings: |
| 4.1 | SET | `EKK1091D010CBSMsg.TEMPLATEID, TEMPLATE_ID_EKK1091D010` // Template ID "EKK1091D010" [-> TEMPLATE_ID_EKK1091D010="EKK1091D010"] |
| 4.2 | SET | `EKK1091D010CBSMsg.FUNC_CODE, JPCModelConstant.FUNC_CD_1` // Function code "1" [-> FUNC_CD_1="1"] |
| 4.3 | SET | `EKK1091D010CBSMsg.SVC_KEI_NO, commonKey` // Service type number from caller's shared key |
| 4.4 | SET | `EKK1091D010CBSMsg.SVC_KEI_UCWK_NO, svcKeiUcwkNo` // Service detail work number from instance field |
| 4.5 | SET | `EKK1091D010CBSMsg.IDO_DIV, JKKSvcConst.IDO_DIV_IDPWD_SHKKA_SAIFURI` // Installation division code "00052" [-> IDO_DIV_IDPWD_SHKKA_SAIFURI="00052"] |
| 4.6 | SET | `EKK1091D010CBSMsg.IDO_DTM, JPCBPCommon.getSysDateTimeStamp()` // Current system datetime |
| 4.7 | SET | `EKK1091D010CBSMsg.PRG_STAT, prgStat` // Progress status from method parameter |
| 4.8 | SET | `EKK1091D010CBSMsg.MSKM_DTL_NO, mskmDtlNo` // Masking detail number from instance field |
| 4.9 | SET | `EKK1091D010CBSMsg.EKK1091D010CBSMSG1LIST, ekk1091d010CBSMsg1List` // Child error reason template array |
| 5 | EXEC | `callSC(handle, scCall, param, ekk1091d010In, fixedText, new EKK1091D010CBSMsg().getContents())` // Invoke CBS with built input payload |
| 6 | EXEC | `....getCAANMsgList(EKK1091D010CBSMsg.EKK1091D010CBSMSG1LIST)` // Extract and return nested sub-message list from CBS response |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `ido_rsn_cd` | Field | Installation error reason code — reason code for installation/provisioning anomalies. `"56"` maps to "OTHER" (catch-all category) |
| `ido_div` | Field | Installation division code — classifies the type of installation/provisioning operation. `"00052"` specifically denotes password change with identity verification and shuffle |
| `ido_dtm` | Field | Installation datetime — timestamp of when the installation/provisioning operation was executed, sourced from the system clock |
| `prg_stat` | Field | Progress status — indicates the current stage of a workflow operation (e.g., in progress, completed, failed) |
| `svc_kei_no` | Field | Service type number — the primary identifier for a service contract/line item, used to correlate all operations belonging to the same service |
| `svc_kei_ucwk_no` | Field | Service detail work number — internal tracking ID for sub-operations within a service contract line item |
| `mskm_dtl_no` | Field | Masking detail number — identifier for records involving masked/obfuscated customer PII data |
| `commonKey` | Field | Shared key — business-level service contract identifier passed from the caller, used as `svc_kei_no` in CBS messages |
| `fixedText` | Field | User-defined string — a fixed text string for traceability, often containing caller context or request IDs |
| EKK1091D010 | CBS | Installation progress registration CBS — Central Business System component that records progress/status updates for installation/provisioning operations |
| CAANMsg | Technical | CAAN schema message — Fujitsu's message container for structured CBS/SC communication, supporting nested message lists |
| FUNC_CD_1 | Constant | Function code "1" — standard/primary function mode for CBS operations |
| CD00846_OTHER | Constant | Error reason "OTHER" (code "56") — a default catch-all error reason code for scenarios not covered by predefined categories |
| IDO_DIV_IDPWD_SHKKA_SAIFURI | Constant | Installation division code for password change with identity verification and shuffle (身元確認と shuffle) |
| FUNC_CODE | Field | Function code — identifies the operation mode (standard vs. special) for the CBS |
| TEMPLATEID | Field | CBS template identifier — specifies which CBS schema template to use for message parsing |
| CBS | Acronym | Central Business System — the core backend service layer handling business logic and database operations |
| SC | Acronym | Service Component — the service layer abstraction used for CBS/SC invocation routing |
| IDO | Acronym | Installation/Provisioning (導入) — domain term for telecom service provisioning operations |
| SVC_KEI | Acronym | Service Type (サービス種別) — business domain for service classification and contract management |
| MSKM | Acronym | Masking (マスク) — refers to obfuscated/encrypted customer data handling |
| 進捗登録 | Japanese | Progress registration — business operation to record the current status of a workflow step |
| 身元確認と shuffle | Japanese | Identity verification with shuffle — customer identity verification process combined with a data shuffle operation for the password change workflow |
| 異動理由明細 | Japanese | Installation error reason detail — sub-message containing the reason code for installation/provisioning anomalies |
