# Business Logic — FUW02401SFLogic.checkException() [79 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.FUW02401SF.FUW02401SFLogic` |
| Layer | Service (WebLogic layer — business logic invoked by screen processing) |
| Module | `FUW02401SF` (Package: `eo.web.webview.FUW02401SF`) |

## 1. Role

### FUW02401SFLogic.checkException()

This method performs **exception classification and routing** within the K-Opticom customer backbone system's Home Page URL name acquisition submission process (FUW02401SF). When a `JCCWebServiceException` is thrown during downstream service calls (e.g., option service contract ISP information changes or aging target registration), this method examines the embedded error metadata and determines whether the exception should be re-thrown as-is (for business-priority cases), re-thrown as a more specific `JCCBusinessException` (for system-level errors), or converted to a generic fallback system error.

It implements a **conditional dispatch pattern** based on two dimensions: (1) the error status code (specifically the `RELATION_ERR` = 1100 status, indicating a correlation/relation check failure), and (2) the processing target mode specified by `isTarget` — either "cfm" (confirmation processing / cfm处処理) or "mskm" (completion mail processing / 完了メール処理). Each target mode has its own set of sub-checks: an NG word check (blocked keywords), an aging check (aging target validation), and a timestamp stamp check (update-in-progress detection).

Its **role in the larger system** is to serve as a centralized exception post-processor that sits between service-layer web exceptions and the calling business logic (`cfmMskmSyori()`). Rather than letting raw service exceptions propagate directly, this method translates them into domain-appropriate error codes, enabling the UI layer to display contextually correct error messages to the customer. If none of the known exception patterns match, it falls through to a generic system error (`ERROR_CODE_0002`), ensuring no exception slips through unhandled.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["checkException(se, isTarget)"])
    EXTRACT["Extract error info: msgResult, moreInfo[0], templateId, itemId, status, errFlg"]
    CHECK_STATUS["status == JPCModelConstant.RELATION_ERR (1100)"]
    CHECK_TARGET_CFM["isTarget == CHEK_CFM (cfm)"]
    NG_WORD_CHK_CFM["NG Word Check CFM: templateid==EKK0361C050 AND errFlg==EB AND itemid==url_domain"]
    THROW_SE_BUSINESS["Throw se (Business Exception)"]
    AGING_CHK_CFM_1["Aging Check CFM: templateid==EKK0361C050 AND errFlg==EA AND itemid==url_account"]
    THROW_SE_AGING_1["Throw se (Business Exception)"]
    AGING_CHK_CFM_2["Aging Check CFM: templateid==EZM0111D010 AND errFlg==EA AND itemid==aging_tg_value"]
    THROW_SE_AGING_2["Throw se (Business Exception)"]
    TS_CHK_CFM["Timestamp Stamp Check CFM: templateid==EKK0361C050 AND errFlg==EA AND itemid==upd_dtm_bf"]
    THROW_SYS_0204_CFM["Throw JCCBusinessException (ERROR_CODE_0204 - Cannot Update Error)"]
    CHECK_TARGET_MSKM["isTarget == CHEK_MSKM (mskm)"]
    NG_WORD_CHK_MSKM["NG Word Check MSKM: templateid==EKK0361C050 AND errFlg==EB AND itemid==url_domain"]
    THROW_SYS_0101["Throw JCCBusinessException (ERROR_CODE_0101 - Usage Restriction Error)"]
    AGING_CHK_MSKM_1["Aging Check MSKM: templateid==EKK0361C050 AND errFlg==EA AND itemid==url_account"]
    THROW_SYS_0204_A["Throw JCCBusinessException (ERROR_CODE_0204 - Cannot Update Error)"]
    AGING_CHK_MSKM_2["Aging Check MSKM: templateid==EZM0111D010 AND errFlg==EA AND itemid==aging_tg_value"]
    THROW_SYS_0204_B["Throw JCCBusinessException (ERROR_CODE_0204 - Cannot Update Error)"]
    TS_CHK_MSKM["Timestamp Stamp Check MSKM: templateid==EKK0361C050 AND errFlg==EA AND itemid==upd_dtm_bf"]
    THROW_SYS_0204_TS["Throw JCCBusinessException (ERROR_CODE_0204 - Cannot Update Error)"]
    FALLBACK["Fallback: Throw JCCBusinessException (ERROR_CODE_0002 - System Error)"]
    END(["End (void)"])

    START --> EXTRACT
    EXTRACT --> CHECK_STATUS
    CHECK_STATUS -- "status = 1100 (RELATION_ERR)" --> CHECK_TARGET_CFM
    CHECK_STATUS -- "other" --> FALLBACK
    CHECK_TARGET_CFM -- "isTarget = cfm" --> NG_WORD_CHK_CFM
    CHECK_TARGET_CFM -- "other" --> CHECK_TARGET_MSKM
    NG_WORD_CHK_CFM -- "true" --> THROW_SE_BUSINESS
    NG_WORD_CHK_CFM -- "false" --> AGING_CHK_CFM_1
    AGING_CHK_CFM_1 -- "true" --> THROW_SE_AGING_1
    AGING_CHK_CFM_1 -- "false" --> AGING_CHK_CFM_2
    AGING_CHK_CFM_2 -- "true" --> THROW_SE_AGING_2
    AGING_CHK_CFM_2 -- "false" --> TS_CHK_CFM
    TS_CHK_CFM -- "true" --> THROW_SYS_0204_CFM
    TS_CHK_CFM -- "false" --> CHECK_TARGET_MSKM
    CHECK_TARGET_MSKM -- "isTarget = mskm" --> NG_WORD_CHK_MSKM
    CHECK_TARGET_MSKM -- "other" --> FALLBACK
    NG_WORD_CHK_MSKM -- "true" --> THROW_SYS_0101
    NG_WORD_CHK_MSKM -- "false" --> AGING_CHK_MSKM_1
    AGING_CHK_MSKM_1 -- "true" --> THROW_SYS_0204_A
    AGING_CHK_MSKM_1 -- "false" --> AGING_CHK_MSKM_2
    AGING_CHK_MSKM_2 -- "true" --> THROW_SYS_0204_B
    AGING_CHK_MSKM_2 -- "false" --> TS_CHK_MSKM
    TS_CHK_MSKM -- "true" --> THROW_SYS_0204_TS
    TS_CHK_MSKM -- "false" --> FALLBACK
    THROW_SE_BUSINESS --> END
    THROW_SE_AGING_1 --> END
    THROW_SE_AGING_2 --> END
    THROW_SYS_0204_CFM --> END
    THROW_SYS_0101 --> END
    THROW_SYS_0204_A --> END
    THROW_SYS_0204_B --> END
    THROW_SYS_0204_TS --> END
    FALLBACK --> END
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `se` | `JCCWebServiceException` | A service-layer web exception thrown by downstream option service calls (e.g., ISP information change or aging target registration). Contains embedded error metadata including a message list, template ID identifying the originating service/error type, item ID specifying which data field triggered the error, status code indicating the error category, and an error flag denoting the specific error sub-type. |
| 2 | `isTarget` | `String` | A discriminator string that selects which error-handling branch applies. Can be `"cfm"` (confirmation processing / cfm处処理 — used when handling confirmation-related errors) or `"mskm"` (completion mail processing / 完了メール処理 — used when handling completion mail submission errors). Different values route to different exception types (business exception vs. system exception). |

**Instance fields / external state read:** None — this method is stateless and operates entirely on its parameters and their contained data.

## 4. CRUD Operations / Called Services

This method performs **no CRUD operations** directly. It is a pure exception classifier and router — it reads metadata from the passed `JCCWebServiceException` object and throws exceptions. It does not call any SC (Service Component) methods, CBS (Common Business Service) methods, or database-level operations.

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `se.getMessageList()` | - | - | Reads the embedded message list from the web service exception |
| R | `msgResult.getMessageMoreInfoList()` | - | - | Extracts detailed error metadata (template ID, item ID, status, error flag) from the exception |
| R | `moreInfo[0].getTemplateId()` | - | - | Gets the error template identifier (e.g., `EKK0361C050` for ISP info change, `EZM0111D010` for aging target registration) |
| R | `moreInfo[0].getItemId()` | - | - | Gets the data field identifier that caused the error |
| R | `moreInfo[0].getStatus()` | - | - | Gets the error status code (e.g., `1100` for RELATION_ERR correlation errors) |
| R | `moreInfo[0].getItemCheckErr()` | - | - | Gets the error sub-type flag (e.g., `EA`, `EB`) indicating the specific error condition |

## 5. Dependency Trace

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

No screen/batch entry points found within 8 hops. Direct callers found: 1 method.
Terminal operations from this method: `throw se` [throw], `throw new JCCBusinessException(ERROR_CODE_0204)` [throw], `throw new JCCBusinessException(ERROR_CODE_0101)` [throw], `throw new JCCBusinessException(ERROR_CODE_0002)` [throw]

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Method: `FUW02401SFLogic.cfmMskmSyori()` | `cfmMskmSyori()` -> `checkException(se, isTarget)` | `throw se` [Exception], `throw JCCBusinessException` [System/Business Error] |

**Notes:** The sole caller is `cfmMskmSyori()` (completion mail processing method) within the same class `FUW02401SFLogic`. This method is not invoked directly by any screen or batch entry point within 8 hops. The terminal operations are all exception throws — either the original `JCCWebServiceException` (for business-priority errors that must propagate as-is) or `JCCBusinessException` with specific error codes for system-level error handling.

## 6. Per-Branch Detail Blocks

**Block 1** — [EXTRACT] (L397)

Extract error metadata from the passed `JCCWebServiceException`. As per the comment (関連チェック系は必ずエラーが1つのため0番目から取得する。/ Related check always has exactly one error, so it is obtained from index 0).

| # | Type | Code |
|---|------|------|
| 1 | SET | `msgResult = se.getMessageList()` // Get message list from the exception |
| 2 | SET | `moreInfo = msgResult.getMessageMoreInfoList()` // Get more info array |
| 3 | SET | `info = moreInfo[0]` // Get first (only) error detail [Comment: 関連チェック系は必ずエラーが1つのため0番目から取得する。/ Related check always has exactly one error, so it is obtained from index 0.] |
| 4 | SET | `templateid = info.getTemplateId()` // Error template ID identifying the originating service |
| 5 | SET | `itemid = info.getItemId()` // Data field that triggered the error |
| 6 | SET | `status = info.getStatus()` // Error status code |
| 7 | SET | `errFlg = info.getItemCheckErr()` // Error sub-type flag (EA, EB, etc.) |

**Block 2** — [IF] `status == JPCModelConstant.RELATION_ERR (1100) && isTarget == "cfm"` (L405)

> (Comment: cfm处処理 / Confirmation processing. This block handles correlation check errors for the "cfm" confirmation target mode. It includes an NG word check, two aging checks, and a timestamp stamp check.)

| # | Type | Code |
|---|------|------|
| 1 | SET | `if (String.valueOf(JPCModelConstant.RELATION_ERR).equals(status) && CHEK_CFM.equals(isTarget))` [RELATION_ERR="1100", CHEK_CFM="cfm"] |

**Block 2.1** — [NESTED IF] NG Word Check (CFM) (L409)

> (Comment: 関連チェック / Related check. NGワードチェック / NG Word Check)

| # | Type | Code |
|---|------|------|
| 1 | SET | `if (EKK0361C050.equals(templateid) && JFUStrConst.RELATION_CHECK_ERR_EB.equals(errFlg) && URL_DOMAIN.equals(itemid))` [EKK0361C050="EKK0361C050" (Option Service Contract <ISP> Info Change), RELATION_CHECK_ERR_EB="EB", URL_DOMAIN="url_domain"] |
| 2 | THROW | `throw se` // Throw original JCCWebServiceException as business-priority exception [Comment: 業務用例外をthrow / Throw business exception] |

**Block 2.2** — [ELSE-IF] Aging Check — Option Service (CFM) (L415)

> (Comment: エイジングチェック / Aging Check)

| # | Type | Code |
|---|------|------|
| 1 | SET | `else if (EKK0361C050.equals(templateid) && JFUStrConst.RELATION_CHECK_ERR_EA.equals(errFlg) && URL_ACCOUNT.equals(itemid))` [EKK0361C050="EKK0361C050", RELATION_CHECK_ERR_EA="EA", URL_ACCOUNT="url_account"] |
| 2 | THROW | `throw se` // Throw original JCCWebServiceException as business-priority exception [Comment: 業務用例外をthrow / Throw business exception] |

**Block 2.3** — [ELSE-IF] Aging Check — Aging Target Registration (CFM) (L421)

> (Comment: エイジングチェック / Aging Check)

| # | Type | Code |
|---|------|------|
| 1 | SET | `else if (EZM0111D010.equals(templateid) && JFUStrConst.RELATION_CHECK_ERR_EA.equals(errFlg) && AGING_TG_VALUE.equals(itemid))` [EZM0111D010="EZM0111D010" (Aging Target Registration), RELATION_CHECK_ERR_EA="EA", AGING_TG_VALUE="aging_tg_value"] |
| 2 | THROW | `throw se` // Throw original JCCWebServiceException as business-priority exception [Comment: 業務用例外をthrow / Throw business exception] |

**Block 2.4** — [NESTED IF] Timestamp Stamp Check — Update-in-Progress (CFM) (L428)

> (Comment: 関連チェック (システムエラー) タイムスタンプチェック / Related Check (System Error) — Timestamp Stamp Check. If the update timestamp before change matches, the data is being updated by another process.)

| # | Type | Code |
|---|------|------|
| 1 | SET | `if (EKK0361C050.equals(templateid) && JFUStrConst.RELATION_CHECK_ERR_EA.equals(errFlg) && UPD_DTM_BF.equals(itemid))` [EKK0361C050="EKK0361C050", RELATION_CHECK_ERR_EA="EA", UPD_DTM_BF="upd_dtm_bf"] |
| 2 | THROW | `throw new JCCBusinessException(JFUStrConst.ERROR_CODE_0204)` [ERROR_CODE_0204="0204"] // Throw system exception for cannot-update error [Comment: システムエラーをthrow (更新不可エラー) / Throw system error (cannot update error)] |

**Block 3** — [ELSE-IF] `status == JPCModelConstant.RELATION_ERR (1100) && isTarget == "mskm"` (L436)

> (Comment: cfm处処理 (mskm分支) / Confirmation processing — Completion mail mode. This block handles correlation check errors for the "mskm" completion mail target mode. Same sub-check structure as Block 2 but throws different system exception codes.)

| # | Type | Code |
|---|------|------|
| 1 | SET | `else if (String.valueOf(JPCModelConstant.RELATION_ERR).equals(status) && CHEK_MSKM.equals(isTarget))` [RELATION_ERR="1100", CHEK_MSKM="mskm"] |

**Block 3.1** — [NESTED IF] NG Word Check (MSKM) (L440)

> (Comment: 関連チェック / Related check. NGワードチェック / NG Word Check)

| # | Type | Code |
|---|------|------|
| 1 | SET | `if (EKK0361C050.equals(templateid) && JFUStrConst.RELATION_CHECK_ERR_EB.equals(errFlg) && URL_DOMAIN.equals(itemid))` [EKK0361C050="EKK0361C050", RELATION_CHECK_ERR_EB="EB", URL_DOMAIN="url_domain"] |
| 2 | THROW | `throw new JCCBusinessException(JFUStrConst.ERROR_CODE_0101)` [ERROR_CODE_0101="0101"] // Throw system exception for usage restriction error [Comment: システムエラーをthrow (利用制限エラー) / Throw system error (usage restriction error)] |

**Block 3.2** — [ELSE-IF] Aging Check — Option Service (MSKM) (L446)

> (Comment: エイジングチェック / Aging Check)

| # | Type | Code |
|---|------|------|
| 1 | SET | `else if (EKK0361C050.equals(templateid) && JFUStrConst.RELATION_CHECK_ERR_EA.equals(errFlg) && URL_ACCOUNT.equals(itemid))` [EKK0361C050="EKK0361C050", RELATION_CHECK_ERR_EA="EA", URL_ACCOUNT="url_account"] |
| 2 | THROW | `throw new JCCBusinessException(JFUStrConst.ERROR_CODE_0204)` [ERROR_CODE_0204="0204"] // Throw system exception for cannot-update error [Comment: システムエラーをthrow (利用制限エラー) / Throw system error (usage restriction error)] |

**Block 3.3** — [ELSE-IF] Aging Check — Aging Target Registration (MSKM) (L452)

> (Comment: エイジングチェック / Aging Check)

| # | Type | Code |
|---|------|------|
| 1 | SET | `else if (EZM0111D010.equals(templateid) && JFUStrConst.RELATION_CHECK_ERR_EA.equals(errFlg) && AGING_TG_VALUE.equals(itemid))` [EZM0111D010="EZM0111D010", RELATION_CHECK_ERR_EA="EA", AGING_TG_VALUE="aging_tg_value"] |
| 2 | THROW | `throw new JCCBusinessException(JFUStrConst.ERROR_CODE_0204)` [ERROR_CODE_0204="0204"] // Throw system exception for cannot-update error [Comment: システムエラーをthrow (利用制限エラー) / Throw system error (usage restriction error)] |

**Block 3.4** — [NESTED IF] Timestamp Stamp Check — Update-in-Progress (MSKM) (L459)

> (Comment: 関連チェック (システムエラー) タイムスタンプチェック / Related Check (System Error) — Timestamp Stamp Check)

| # | Type | Code |
|---|------|------|
| 1 | SET | `if (EKK0361C050.equals(templateid) && JFUStrConst.RELATION_CHECK_ERR_EA.equals(errFlg) && UPD_DTM_BF.equals(itemid))` [EKK0361C050="EKK0361C050", RELATION_CHECK_ERR_EA="EA", UPD_DTM_BF="upd_dtm_bf"] |
| 2 | THROW | `throw new JCCBusinessException(JFUStrConst.ERROR_CODE_0204)` [ERROR_CODE_0204="0204"] // Throw system exception for cannot-update error [Comment: システムエラーをthrow (更新不可エラー) / Throw system error (cannot update error)] |

**Block 4** — [FALLBACK] — Unhandled Exception Pattern (L468)

> (Comment: 上記以外の場合システムエラーをスロー / For all other cases, throw system error)

| # | Type | Code |
|---|------|------|
| 1 | THROW | `throw new JCCBusinessException(JFUStrConst.ERROR_CODE_0002)` [ERROR_CODE_0002="0002"] // Generic system error — catches any exception pattern not matched above [Comment: 上記以外の場合システムエラーをスロー / Throw system error for other cases] |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `status` | Field | Error status code — categorizes the error type; `1100` (`RELATION_ERR`) indicates a correlation/relation check failure between data fields |
| `templateid` | Field | Error template ID — identifies the originating service or error scenario; `EKK0361C050` = Option Service Contract <ISP> Information Change, `EZM0111D010` = Aging Target Registration |
| `itemid` | Field | Error item identifier — specifies which data field triggered the error; e.g., `url_domain`, `url_account`, `upd_dtm_bf`, `aging_tg_value` |
| `errFlg` | Field | Error check error flag — sub-type of the error; `EB` = NG word error (blocked keyword detected), `EA` = other relation check error (aging check or timestamp mismatch) |
| `isTarget` | Parameter | Processing target discriminator — determines the error handling mode; `"cfm"` = confirmation processing, `"mskm"` = completion mail processing |
| CHEK_CFM | Constant | `"cfm"` — constant identifying confirmation (cfm) check mode |
| CHEK_MSKM | Constant | `"mskm"` — constant identifying completion mail (mskm) check mode |
| EKK0361C050 | Constant | Option Service Contract <ISP> Information Change — error template for ISP option service changes |
| EZM0111D010 | Constant | Aging Target Registration — error template for aging (time-based) target registration |
| URL_DOMAIN | Constant | `"url_domain"` — error item ID for URL domain (homepage URL name) related errors |
| URL_ACCOUNT | Constant | `"url_account"` — error item ID for URL account related errors |
| UPD_DTM_BF | Constant | `"upd_dtm_bf"` — update datetime before (timestamp stamp) error item ID; used for detecting update-in-progress conflicts |
| AGING_TG_VALUE | Constant | `"aging_tg_value"` — aging target value error item ID; used for aging-related validation errors |
| RELATION_ERR | Constant | `1100` — JPCModelConstant value for correlation/relation check errors |
| RELATION_CHECK_ERR_EA | Constant | `"EA"` — relation check error sub-type A (aging check / timestamp errors) |
| RELATION_CHECK_ERR_EB | Constant | `"EB"` — relation check error sub-type B (NG word / blocked keyword errors) |
| ERROR_CODE_0002 | Constant | `"0002"` — generic system error (common error) |
| ERROR_CODE_0101 | Constant | `"0101"` — usage restriction error (the customer's usage is restricted and cannot proceed) |
| ERROR_CODE_0204 | Constant | `"0204"` — CCMG integration error (used here as cannot-update / optimistic concurrency conflict error) |
| JCCWebServiceException | Class | Service-layer web exception — carries embedded error metadata (message list, more info) thrown by downstream service calls |
| JCCBusinessException | Class | Application-level business exception — thrown with specific error codes for display to the UI layer |
| NG Word Check | Concept | Validation that checks for blocked/invalid keywords in data fields; triggers error code EB |
| Aging Check | Concept | Validation that checks aging (time-based) target conditions; triggers error code EA |
| Timestamp Stamp Check | Concept | Validation that detects if data was modified by another process since it was read (optimistic concurrency control); triggers system error |
| cfm处処理 | Japanese term | Confirmation processing — the business step where the system confirms all data before proceeding |
| 完了メール処理 | Japanese term | Completion mail processing — the business step where the system sends a completion notification email |
| 利用制限エラー | Japanese term | Usage restriction error — the customer's account/service usage is restricted (ERROR_CODE_0101) |
| 更新不可エラー | Japanese term | Cannot update error — data was modified by another process and cannot be safely updated (ERROR_CODE_0204) |
| システムエラー | Japanese term | System error — a generic system-level error (ERROR_CODE_0002) |
| 業務用例外 | Japanese term | Business exception — a business-priority exception that should propagate as-is (the raw JCCWebServiceException) |
| SSO | Acronym | Single Sign-On — customer authentication system |
| ISP | Acronym | Internet Service Provider — option service category |
