# (DD21) Business Logic — JFUSvcOrderAddCC.addMladSvcOrder() [470 LOC]

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

## 1. Role

### JFUSvcOrderAddCC.addMladSvcOrder()

This method is the core entry point for **email address service order registration** in the K-Opticom customer base system. It handles the full lifecycle of email-related service changes — including email address modification (UPDATE), mailbox capacity expansion (EXPAND), and cancellation — by coordinating multiple Service Components (SCs) that manage order settings, service orders, and optional service contract consent. The method implements a **dual-path routing pattern**: it first checks whether any pending "order issuance conditions" (order issuance prerequisites) exist for the target optional service. If pending records are found, it delegates to the legacy Order Issuance CC components (FUSV012207CC or FUSV027504CC) for upstream processing to avoid timing inconsistencies during schema updates. If no pending records exist, it performs direct service order writes using the newer, streamlined approach. The method acts as a shared utility called by multiple screen-operation classes (FUSV0122OPOperation, FUSV0275OPOperation), making it a central coordination hub for email service order fulfillment.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["addMladSvcOrder"])
    START --> INIT["Initialize processing"]

    INIT --> CHECK_FUNC{"FUNC_CODE == FUNC_CD_2"}
    CHECK_FUNC -->|Yes: Update-only check| EARLY_RETURN["Set empty map, return param"]
    EARLY_RETURN --> FINALLY["finally: deleteTempArea"]
    FINALLY --> END_NODE(["Return param"])

    CHECK_FUNC -->|No: Actual processing| EXTRACT_PARAMS["Extract input params from inMap"]
    EXTRACT_PARAMS --> ORDER_CHECK["Query order issuance condition list 2"]

    ORDER_CHECK --> FOR_ORDER["For each order issuance record"]
    FOR_ORDER --> CHECK_SEND_DT{"SEND_REQ_FIN_DTM is null?"}
    CHECK_SEND_DT -->|Yes: Not completed| SET_EXEC_FLG["isExecOrderHakko = true, break"]
    CHECK_SEND_DT -->|No: Completed| NEXT_ORDER{"More records?"}
    NEXT_ORDER -->|Yes| FOR_ORDER
    NEXT_ORDER -->|No| CHECK_EXEC_FLG

    SET_EXEC_FLG --> CHECK_EXEC_FLG{"isExecOrderHakko?"}

    CHECK_EXEC_FLG -->|Yes: Old-style| ACTION_OLD{"inParamActionName"}
    ACTION_OLD -->|ACTION_UPDATE| OLD_UPDATE["Build SOD map for UPDATE, call FUSV012207CC"]
    ACTION_OLD -->|ACTION_EXPAND| OLD_EXPAND["Build SOD map for EXPAND, call FUSV027504CC"]
    OLD_UPDATE --> SET_DATA_OLD_SET["setData, setFuncCode FUNC_CD_1"]
    OLD_EXPAND --> SET_DATA_OLD_SET

    CHECK_EXEC_FLG -->|No: New-style| NEW_STYLE["Direct service order write (new approach)"]

    SET_DATA_OLD_SET --> FINALLY
    ACTION_UPDATE_BRANCH --> FINALLY

    NEW_STYLE --> QUERY_ISP["Query opSvcKei ISP consent (EKK0361A010)"]
    QUERY_ISP --> QUERY_ORD_SET["Query order settings (EKK1041B001)"]

    QUERY_ORD_SET --> CHECK_ORD_ACT{"inParamActionName"}
    CHECK_ORD_ACT -->|UPDATE| SET_DELETE["rcntYokyuSbtCd = CD00317_08"]
    CHECK_ORD_ACT -->|EXPAND| SET_CHANGE["rcntYokyuSbtCd = CD00317_04"]

    SET_DELETE --> ORD_EXISTS{"odrSetList.size > 0?"}
    SET_CHANGE --> ORD_EXISTS

    ORD_EXISTS -->|Yes| UPDATE_ORD["Update order settings (EKK1041C010)"]
    ORD_EXISTS -->|No| CREATE_ORD["Create order settings (EKK1041D010)"]

    UPDATE_ORD --> CHECK_ACT2{"inParamActionName == UPDATE?"}
    CREATE_ORD --> CHECK_ACT2

    CHECK_ACT2 -->|Yes| CREATE_NEW_ORD["Create new order settings (EKK1041D010) chgAfMlad"]
    CREATE_NEW_ORD --> CHECK_EXPAND_NEW{"inParamActionName == EXPAND?"}
    CHECK_EXPAND_NEW -->|Yes| EXEC_SVC_ORDER_CHANGE["Execute svcOrder change (ESC0041D010)"]
    EXEC_SVC_ORDER_CHANGE --> PROCESS_END
    CHECK_EXPAND_NEW -->|No| CHECK_ACT3{"inParamActionName"}

    CHECK_ACT3 -->|UPDATE| EXEC_SVC_ORDER["Execute svcOrder change (ESC0041D010)"]
    EXEC_SVC_ORDER --> PROCESS_END
    CHECK_ACT3 -->|Else| PROCESS_OTHER["Execute svcOrder: cancel, then new"]

    PROCESS_OTHER --> FINALLY
    EXEC_SVC_ORDER_CHANGE --> FINALLY

    ACTION_UPDATE_BRANCH --> FINALLY
    OLD_UPDATE --> FINALLY
    OLD_EXPAND --> FINALLY
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `handle` | `SessionHandle` | Database session handle used for executing service components. Carries the transaction context and database connection state for the current request. |
| 2 | `param` | `IRequestParameterReadWrite` | Request parameter container that holds input data (via `getData`) and output data (via `setData`). Contains the function code, action name, service contract numbers, email addresses, and all processing results propagated between SCs. |
| 3 | `fixedText` | `String` | Service message key used for error message resolution. Acts as a localization key prefix when the framework looks up Japanese error messages for the user. |

**Instance fields / external state read:**

| Field | Source | Business Description |
|-------|--------|---------------------|
| `IN_PARAM_ACTION_NAME` | `JFUSvcOrderAddCC.java:68` | Key constant for extracting action name from input map — identifies the type of email service change operation |
| `IN_PARAM_KEY_SYSID` | `JFUSvcOrderAddCC.java:70` | Key constant for extracting SYSID (service provider identifier) |
| `IN_PARAM_KEY_SVC_KEI_NO` | `JFUSvcOrderAddCC.java:72` | Key constant for extracting service contract number |
| `IN_PARAM_KEY_OP_SVC_KEI_NO` | `JFUSvcOrderAddCC.java:74` | Key constant for extracting optional service contract number |
| `IN_PARAM_KEY_OP_SVC_KEI_GENE_ADD_DTM` | `JFUSvcOrderAddCC.java:76` | Key constant for extracting optional service contract generation registration datetime |
| `IN_PARAM_ML_VRSETTE_HKTGI_FLG` | `JFUSvcOrderAddCC.java:78` | Key constant for extracting mail various-setting inheritance flag |
| `IN_PARAM_MLAD_CHGJ_ML_TNS_FLG` | `JFUSvcOrderAddCC.java:80` | Key constant for extracting mail address change transfer flag |
| `IN_PARAM_CHG_BF_MLAD` | `JFUSvcOrderAddCC.java:82` | Key constant for extracting pre-change email address |
| `IN_PARAM_CHG_AF_MLAD` | `JFUSvcOrderAddCC.java:84` | Key constant for extracting post-change email address |
| `IN_PARAM_POP_ID_PWD` | `JFUSvcOrderAddCC.java:86` | Key constant for extracting POP ID password |
| `IN_PARAM_OLD_MLBOX_CAPA` | `JFUSvcOrderAddCC.java:88` | Key constant for extracting old mail box capacity |
| `IN_PARAM_KEY_SBOP_SVC_KEI_NO` | `JFUSvcOrderAddCC.java:90` | Key constant for extracting sub-optional service contract number |
| `IN_PARAM_KEY_SBOP_SVC_KEI_GENE_ADD_DTM` | `JFUSvcOrderAddCC.java:92` | Key constant for extracting sub-optional service contract generation registration datetime |
| `ACTION_NAME_UPDATE` | `JFUSvcOrderAddCC.java:96` | Action name constant = "UPDATE" — identifies email address change operations |
| `ACTION_NAME_EXPAND` | `JFUSvcOrderAddCC.java:98` | Action name constant = "EXPAND" — identifies mailbox capacity expansion requests |
| `FUNC_CD_2` | `JPCModelConstant.java:32` | Function code = "2" — triggers early-return update-only check mode |

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `executeSC (EKK1081B501)` | EKK1081B501 | KK_T_ODR_HAKJO_JOKEN (Order Issuance Condition List 2) | Queries order issuance condition records to check if any are pending completion for the optional service contract |
| R | `executeSC (EKK0361A010)` | EKK0361A010 | KK_T_OPSVKEI_ISP (Optional Service Contract <ISP> Consent) | Retrieves optional service contract ISP consent details including generation datetime |
| R | `executeSC (EKK1041B001)` | EKK1041B001 | KK_T_ODR_SET (Order Settings) | Searches for existing order settings associated with the service contract and email address |
| U | `executeSC (EKK1041C010)` | EKK1041C010 | KK_T_ODR_SET (Order Settings) | Updates existing order settings record with changed service type code |
| C | `executeSC (EKK1041D010)` | EKK1041D010 | KK_T_ODR_SET (Order Settings) | Creates a new order settings record for the service contract |
| C/R/U/D | `executeSC (ESC0041D010)` | ESC0041D010 | KK_T_SVC_ORDER (Service Order) | Registers service order receipts with various request type codes (new, change, cancellation) |
| R | `executeSC (EKK0411A010)` | EKK0411A010 | KK_T_SBOPSVKEI_ISP (Sub-Optional Service Contract <ISP> Consent) | Retrieves sub-optional service contract ISP consent details when explicit sub-optional contract number is provided in EXPAND mode |
| R | `executeSC (EKK0401B001)` | EKK0401B001 | KK_T_SBOPSVKEI (Sub-Optional Service Contract) | Lists sub-optional service contracts to find the appropriate contract number when not explicitly provided |
| R | `executeSC (EZM0321A010)` | EZM0321A010 | M_WORK_PARAM (Work Parameter Management) | Retrieves business parameter values — specifically the mail address change utilization period (in days) for scheduling |
| - | `JACBatCommon.isNull` | - | - | Null check utility called to validate the `sendReqFinDtm` field |
| - | `JFUBPCommon.isNull` | JFUBPCommon | - | Null check utility (Fujitsu BP extension) for string validation |
| - | `JFUBaseCC.deleteTempArea` | JFUBaseCC | - | Cleans up temporary template areas in the response after processing completes |
| - | `JFUBaseUtil.deleteTempArea` | JFUBase | - | Utility method to delete temporary data areas in the finally block |
| R | `JCCBPCommon.getOpeDate` | JCCBPCommon | - | Retrieves the current operational date for scheduling service order dates |

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Screen:FUSV0122 | `FUSV0122OPOperation.target22` → `CCRequestBroker` → `JFUSvcOrderAddCC.addMladSvcOrder` | `executeSC EKK1081B501 [R] KK_T_ODR_HAKJO_JOKEN`, `executeSC EKK0361A010 [R] KK_T_OPSVKEI_ISP`, `executeSC EKK1041D010 [C] KK_T_ODR_SET`, `executeSC EKK1041C010 [U] KK_T_ODR_SET`, `executeSC ESC0041D010 [C/R/U/D] KK_T_SVC_ORDER`, `executeSC EKK1041B001 [R] KK_T_ODR_SET` |
| 2 | Screen:FUSV0275 | `FUSV0275OPOperation.targetf` → `CCRequestBroker` → `JFUSvcOrderAddCC.addMladSvcOrder` | `executeSC EKK1081B501 [R] KK_T_ODR_HAKJO_JOKEN`, `executeSC EKK0361A010 [R] KK_T_OPSVKEI_ISP`, `executeSC EKK0411A010 [R] KK_T_SBOPSVKEI_ISP`, `executeSC EKK0401B001 [R] KK_T_SBOPSVKEI`, `executeSC ESC0041D010 [C/R/U/D] KK_T_SVC_ORDER`, `executeSC EZM0321A010 [R] M_WORK_PARAM` |

**Instructions:**
- Rows 1-2: Two screen-operation classes call this method as a CCRequestBroker target.
- FUSV0122: Email address change screen — typically processes UPDATE action.
- FUSV0275: Mailbox capacity expansion screen — typically processes EXPAND action.
- Terminal column lists all SCs and their CRUD operations reached from this method.

## 6. Per-Branch Detail Blocks

**Block 1** — [IF] `(JPCModelConstant.FUNC_CD_2.equals(inParamFuncCd))` [FUNC_CD_2="2"] (L313)

> If the function code is "2", this is an update-only check mode. The method returns early without any processing.

| # | Type | Code |
|---|------|------|
| 1 | SET | `param.setData(fixedText, new HashMap())` // Initialize empty map for check mode |
| 2 | EXEC | `setFuncCode(param, fixedText, JPCModelConstant.FUNC_CD_2)` // Set function code for check |
| 3 | RETURN | `return param` // Early return — no actual processing |

**Block 2** — Parameter Extraction (L324-L349)

> Extract all input parameters from the inMap HashMap. These include action name, SYSID, service contract numbers, optional service numbers, email addresses, and mailbox capacity data.

| # | Type | Code |
|---|------|------|
| 1 | SET | `inParamActionName = inMap.get(IN_PARAM_ACTION_NAME)` // Extract action name |
| 2 | SET | `inParamSysid = inMap.get(IN_PARAM_KEY_SYSID)` // Extract service ID |
| 3 | SET | `inParamSvcKeiNo = inMap.get(IN_PARAM_KEY_SVC_KEI_NO)` // Extract main service contract number |
| 4 | SET | `inParamOpSvcKeiNo = inMap.get(IN_PARAM_KEY_OP_SVC_KEI_NO)` // Extract optional service contract number |
| 5 | SET | `inParamOpSvcKeiGeneAddDtm = inMap.get(IN_PARAM_KEY_OP_SVC_KEI_GENE_ADD_DTM)` // Extract optional service generation datetime |
| 6 | SET | `inParamMlHktgiFlg = inMap.get(IN_PARAM_ML_VRSETTE_HKTGI_FLG)` // Extract mail setting inheritance flag |
| 7 | SET | `inParamMlTnsFlg = inMap.get(IN_PARAM_MLAD_CHGJ_ML_TNS_FLG)` // Extract mail transfer flag |
| 8 | SET | `inParamChgBfMlad = inMap.get(IN_PARAM_CHG_BF_MLAD)` // Extract pre-change email address |
| 9 | SET | `inParamChgAfMlad = inMap.get(IN_PARAM_CHG_AF_MLAD)` // Extract post-change email address |
| 10 | SET | `inParamPopIdPwd = inMap.get(IN_PARAM_POP_ID_PWD)` // Extract POP ID password |
| 11 | SET | `inParamOldCapa = inMap.get(IN_PARAM_OLD_MLBOX_CAPA)` // Extract old mailbox capacity |
| 12 | SET | `inParamSbopSvcKeiNo = inMap.get(IN_PARAM_KEY_SBOP_SVC_KEI_NO)` // Extract sub-optional service contract number |
| 13 | SET | `inParamSbopSvcKeiGeneAddDtm = inMap.get(IN_PARAM_KEY_SBOP_SVC_KEI_GENE_ADD_DTM)` // Extract sub-optional service generation datetime |

**Block 3** — [PROC] Order Issuance Condition Check (L354-L360)

> Initialize, set search conditions, and execute the EKK1081B501 SC to query order issuance condition list 2. This determines whether there are pending order issuance prerequisites that need to be processed first.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `initData(param, fixedText, IN_COLUMN_LIST_EKK1081B501)` // Initialize input columns for EKK1081B501 |
| 2 | EXEC | `ignoreSearchError(param, fixedText)` // Set to ignore search errors |
| 3 | EXEC | `setInMapEKK1081B501Search(param, fixedText, inParamOpSvcKeiNo)` // Set search condition with optional service number |
| 4 | CALL | `executeSC(handle, param, fixedText, TEMPLATE_ID_EKK1081B501, ...)` // Execute order issuance condition query |
| 5 | SET | `orderHakkoInfoMapList = getTemplateList(...)` // Retrieve query results as a list |

**Block 4** — [FOR] Iterate Over Order Issuance Records (L365-L383)

> Loop through all order issuance records returned from the query. Check each record for the send request completion datetime (`SEND_REQ_FIN_DTM`). If any record lacks this datetime (is not completed), set `isExecOrderHakko = true` and break. This determines whether the legacy order issuance CC flow is needed.

| # | Type | Code |
|---|------|------|
| 1 | SET | `sendReqFinDtm = orderHakkoInfoMap.get(EKK1081B501CBSMsg1List.SEND_REQ_FIN_DTM)` // Get completion datetime |
| 2 | IF | `JFUBPCommon.isNull(sendReqFinDtm)` // Check if datetime is not set (pending) |
| 3 | SET | `isExecOrderHakko = true` // Flag: old-style processing needed |
| 4 | EXEC | `break` // Exit loop early |

**Block 5** — [IF] `isExecOrderHakko` (L385)

> If any order issuance record was not completed, enter the **old-style processing path**. This avoids timing inconsistencies during schema updates by delegating to upstream Order Issuance CC components.

**Block 5.1** — [IF-ELSE-IF] Action Name Branch (UPDATE vs EXPAND)

**Block 5.1.1** — [IF-IF] `[ACTION_NAME_UPDATE="UPDATE"]` (L394)

> Old-style UPDATE path: Build SOD (Service Order Data) map and delegate to FUSV012207CC.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `initData(param, fixedText, IN_COLUMN_LIST_3)` // Init opSvcKei ISP consent columns |
| 2 | EXEC | `setInMapOpSvcIspSearch(param, fixedText, inParamOpSvcKeiNo)` // Set search condition |
| 3 | CALL | `executeSC(handle, param, fixedText, TEMPLATE_ID_3, ...)` // Execute EKK0361A010 |
| 4 | SET | `chAfOpSvcKeiGeneAddDtm = getTemplateListValue(...)` // Get post-change generation datetime |
| 5 | SET | `sodKihonMap.put(SOD_SYSID, inParamSysid)` // Set SOD SYSID |
| 6 | SET | `sodKihonMap.put(SOD_IDO_DIV, JFUStrConst.CD00576_00031)` // Set migration type = "00031" (Out of scope) [-> CD00576_00031="00031" (JFUStrConst.java:3937)] |
| 7 | SET | `svcKeiMap.put(SOD_SVC_KEI_NO, inParamSvcKeiNo)` // Set main service contract number |
| 8 | SET | `opSvcKeiMap.put(SOD_CHBF_OPSVKEI_NO, inParamOpSvcKeiNo)` // Set pre-change optional service number |
| 9 | SET | `opSvcKeiMap.put(SOD_CHAF_OPSVKEI_NO, inParamOpSvcKeiNo)` // Set post-change optional service number |
| 10 | SET | `opSvcKeiMap.put(SOD_CHAF_OPSVKEI_GENE_ADD_DTM, chAfOpSvcKeiGeneAddDtm)` // Set post-change generation datetime |
| 11 | SET | `sodMap.put(SOD_OPSVKEI_INFO, opSvcKeiMap)` // Add optional service info to SOD map |
| 12 | SET | `trgtList.add(sodMap)` // Add SOD map to target list |
| 13 | SET | `sodCCMap.put(SOD_TRGT_DATA_LIST, trgtList)` // Set target data list |
| 14 | EXEC | `param.setData(CC_TITLE_FUSV012207, sodCCMap)` // Set SOD map for upstream CC [-> CC_TITLE_FUSV012207="FUSV012207CC"] |
| 15 | EXEC | `setFuncCode(param, CC_TITLE_FUSV012207, JPCModelConstant.FUNC_CD_1)` // Set function code = "1" for order issuance |

**Block 5.1.2** — [ELSE-IF] `[ACTION_NAME_EXPAND="EXPAND"]` (L450)

> Old-style EXPAND path: Build SOD map with sub-optional service info and delegate to FUSV027504CC. Handles two sub-branches: when sub-optional service number is explicitly provided, or when it must be looked up.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `initData(param, fixedText, IN_COLUMN_LIST_3)` // Init opSvcKei ISP consent columns |
| 2 | CALL | `executeSC(handle, param, fixedText, TEMPLATE_ID_3, ...)` // Execute EKK0361A010 |
| 3 | SET | `chAfOpSvcKeiGeneAddDtm = getTemplateListValue(...)` // Get post-change generation datetime |
| 4 | IF | `inParamSbopSvcKeiNo != null` // Sub-branch: explicit sub-optional service provided |
| 5 | SET | `opSvcKeiMap.put(SOD_CHBF_SBOPSVKEI_NO, inParamSbopSvcKeiNo)` // Set pre-change sub-optional service number |
| 6 | SET | `opSvcKeiMap.put(SOD_CHBF_SBOPSVKEI_GENE_ADD_DTM, inParamSbopSvcKeiGeneAddDtm)` // Set pre-change generation datetime |
| 7 | SET | `opSvcKeiMap.put(SOD_CHAF_SBOPSVKEI_NO, inParamSbopSvcKeiNo)` // Set post-change sub-optional service number |
| 8 | CALL | `executeSC(..., TEMPLATE_ID_EKK0411A010, ...)` // Execute EKK0411A010 sub-optional ISP consent query |
| 9 | SET | `chAfSbopSvcKeiGeneAddDtm = getTemplateListValue(...)` // Get sub-optional post-change datetime |
| 10 | SET | `opSvcKeiMap.put(SOD_CHAF_SBOPSVKEI_GENE_ADD_DTM, chAfSbopSvcKeiGeneAddDtm)` // Set sub-optional post-change datetime |
| 11 | ELSE | `// No explicit sub-optional number — search list` |
| 12 | EXEC | `initData(param, fixedText, IN_COLUMN_LIST_EKK0401B001)` // Init sub-optional service list columns |
| 13 | CALL | `executeSC(..., TEMPLATE_ID_EKK0401B001, ...)` // Execute EKK0401B001 sub-optional service search |
| 14 | SET | `sbopSvcKeiInfoMapList = getTemplateList(...)` // Retrieve sub-optional service list |
| 15 | FOR | `for each sbopSvcKeiInfoMap` // Iterate over sub-optional contracts |
| 16 | SET | `sbopSvcCd = sbopSvcKeiInfoMap.get(EKK0401B001CBSMsg1List.SBOP_SVC_CD)` // Get sub-optional service code |
| 17 | IF | `CD00137_D02.equals(sbopSvcCd)` // [CD00137_D02="D02" (Mail capacity addition)] (JFUStrConst.java:2000) |
| 18 | SET | `sbopSvcKeiStat = sbopSvcKeiInfoMap.get(EKK0401B001CBSMsg1List.SBOP_SVC_KEI_STAT)` // Get contract status |
| 19 | IF | `!(CD00037_910.equals(sbopSvcKeiStat) || CD00037_920.equals(sbopSvcKeiStat))` // [CD00037_910="910" (Contract cancelled), CD00037_920="920" (Contract cancelled)] (JFUStrConst.java:872,875) |
| 20 | SET | `chAfSbopSvcKeiNo = sbopSvcKeiInfoMap.get(EKK0401B001CBSMsg1List.SBOP_SVC_KEI_NO)` // Get sub-optional service number |
| 21 | SET | `chAfSbopSvcKeiGeneAddDtm = sbopSvcKeiInfoMap.get(EKK0401B001CBSMsg1List.GENE_ADD_DTM)` // Get generation datetime |
| 22 | SET | `opSvcKeiMap.put(SOD_CHAF_SBOPSVKEI_NO, chAfSbopSvcKeiNo)` // Set sub-optional service number |
| 23 | SET | `opSvcKeiMap.put(SOD_CHAF_SBOPSVKEI_GENE_ADD_DTM, chAfSbopSvcKeiGeneAddDtm)` // Set generation datetime |
| 24 | SET | `inMap = param.getData("FUSV027507SC")` // Get progress registration data |
| 25 | SET | `inMap.put(SBOP_SVC_KEI_NO, chAfSbopSvcKeiNo)` // Set sub-optional service number |
| 26 | EXEC | `break` // Exit loop |

**Block 6** — [ELSE] Direct Service Order Write (New Approach) (L574)

> When no pending order issuance records exist, the method performs direct service order writes. This is the new streamlined approach that avoids the legacy Order Issuance CC delegation. The method first queries the optional service contract ISP consent (EKK0361A010), then queries existing order settings (EKK1041B001).

**Block 6.1** — [IF] Action Name: UPDATE (L618)

> When the action is UPDATE, set the request type code to deletion (CD00317_08 = "08") [-> CD00317_08="08" (JFUStrConst.java:2503)].

**Block 6.2** — [IF] Action Name: EXPAND or Other (L622)

> When the action is EXPAND (or other), set the request type code to change (CD00317_04 = "04") [-> CD00317_04="04" (JFUStrConst.java:2497)].

**Block 6.3** — [IF] `odrSetList.size > 0` (L627)

> When existing order settings are found, update the order settings record (EKK1041C010).

| # | Type | Code |
|---|------|------|
| 1 | SET | `odrSetMap = odrSetList.get(0)` // Get first order settings record |
| 2 | EXEC | `initData(param, fixedText, IN_COLUMN_LIST_6)` // Init order settings change columns |
| 3 | EXEC | `setInMapOdrSetChg(param, fixedText, rcntYokyuSbtCd, odrSetMap)` // Set change parameters |
| 4 | CALL | `executeSC(handle, param, fixedText, TEMPLATE_ID_6, ...)` // Execute EKK1041C010 to update |

**Block 6.4** — [ELSE] No existing order settings (L635)

> When no existing order settings are found, create a new order settings record (EKK1041D010).

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `initData(param, fixedText, IN_COLUMN_LIST_1)` // Init order settings creation columns |
| 2 | EXEC | `setInMapOdrSet(param, fixedText, inParamSvcKeiNo, ...)` // Set creation parameters |
| 3 | CALL | `executeSC(handle, param, fixedText, TEMPLATE_ID_1, ...)` // Execute EKK1041D010 to create |

**Block 6.5** — [IF] `ACTION_NAME_UPDATE.equals(inParamActionName)` (L642)

> When the action is UPDATE, create a NEW order settings record using the post-change email address (`chgAfMlad`) and request type code = CD00317_02 ("02", New) [-> CD00317_02="02" (JFUStrConst.java:2491)]. This registers a separate order setting for the new email address.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `initData(param, fixedText, IN_COLUMN_LIST_1)` // Init order settings creation columns |
| 2 | EXEC | `setInMapOdrSet(param, fixedText, inParamSvcKeiNo, inParamOpSvcKeiNo, inParamChgAfMlad, JFUStrConst.CD00317_02)` // Set creation with post-change email |
| 3 | CALL | `executeSC(handle, param, fixedText, TEMPLATE_ID_1, ...)` // Execute EKK1041D010 to create new order settings |

**Block 6.6** — [IF] `ACTION_NAME_EXPAND.equals(inParamActionName)` (L651)

> When the action is EXPAND, execute the service order receipt (ESC0041D010) with request type code = CD00317_04 (Change). Handles two sub-branches: when sub-optional service number is null (search sub-optional service list) or when it is explicitly provided.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `initData(param, fixedText, IN_COLUMN_LIST_2)` // Init service order receipt columns |
| 2 | EXEC | `setInMapSvcOrder(param, fixedText, ..., JCCBPCommon.getOpeDate(null), JFUStrConst.CD00317_04)` // Set service order change parameters with current operational date [-> CD00317_04="04"] (JFUStrConst.java:2497) |
| 3 | CALL | `executeSC(handle, param, fixedText, TEMPLATE_ID_2, ...)` // Execute ESC0041D010 service order change |
| 4 | IF | `inParamSbopSvcKeiNo == null` // Sub-branch: look up sub-optional service |
| 5 | EXEC | `initData(param, fixedText, IN_COLUMN_LIST_EKK0401B001)` // Init sub-optional service list columns |
| 6 | CALL | `executeSC(..., TEMPLATE_ID_EKK0401B001, ...)` // Execute EKK0401B001 sub-optional service search |
| 7 | FOR | `for each sbopSvcKeiInfoMap` // Iterate over sub-optional contracts |
| 8 | SET | `sbopSvcCd = sbopSvcKeiInfoMap.get(EKK0401B001CBSMsg1List.SBOP_SVC_CD)` // Get sub-optional service code |
| 9 | IF | `CD00137_D02.equals(sbopSvcCd)` // [CD00137_D02="D02" (Mail capacity addition)] (JFUStrConst.java:2000) |
| 10 | IF | `!(CD00037_910.equals(sbopSvcKeiStat) || CD00037_920.equals(sbopSvcKeiStat))` // [CD00037_910="910", CD00037_920="920" (Contract cancelled)] (JFUStrConst.java:872,875) |
| 11 | SET | `sbopSvcKeiNo = sbopSvcKeiInfoMap.get(EKK0401B001CBSMsg1List.SBOP_SVC_KEI_NO)` // Get sub-optional service number |
| 12 | SET | `inMap = param.getData("FUSV027507SC")` // Get progress registration data |
| 13 | SET | `inMap.put(SBOP_SVC_KEI_NO, sbopSvcKeiNo)` // Set sub-optional service number |
| 14 | EXEC | `break` // Exit loop |

**Block 6.7** — [ELSE] Not UPDATE action — Process Cancellation + New (L665)

> When not UPDATE (and not EXPAND, or in the non-EXPAND branch of the else): process mail address change by first retrieving the business parameter period (EZM0321A010), calculating the schedule date, then executing three service order receipts: cancellation (CD00317_03 = "03") [-> CD00317_03="03" (JFUStrConst.java:2494)], followed by a new registration (CD00317_02 = "02") [-> CD00317_02="02" (JFUStrConst.java:2491)].

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `initData(param, fixedText, IN_COLUMN_LIST_4)` // Init work parameter management columns |
| 2 | EXEC | `setInMapWorkParamSearch(param, fixedText)` // Set work parameter search |
| 3 | CALL | `executeSC(handle, param, fixedText, TEMPLATE_ID_4, ...)` // Execute EZM0321A010 work parameter query |
| 4 | SET | `period = getTemplateListValue(...)` // Get mail address change utilization period (days) |
| 5 | SET | `scheduleYmd = JFUBPCommon.addSubtractDay(JCCBPCommon.getOpeDate(null), Integer.parseInt(period))` // Calculate schedule date |
| 6 | EXEC | `initData(param, fixedText, IN_COLUMN_LIST_2)` // Init service order receipt columns for cancellation |
| 7 | EXEC | `setInMapSvcOrder(param, fixedText, ..., scheduleYmd, JFUStrConst.CD00317_03)` // Set cancellation parameters [-> CD00317_03="03"] (JFUStrConst.java:2494) |
| 8 | CALL | `executeSC(handle, param, fixedText, TEMPLATE_ID_2, ...)` // Execute ESC0041D010 service order cancellation |
| 9 | EXEC | `initData(param, fixedText, IN_COLUMN_LIST_2)` // Init service order receipt columns for deletion |
| 10 | EXEC | `setInMapSvcOrder(param, fixedText, ..., scheduleYmd, JFUStrConst.CD00317_08)` // Set deletion parameters [-> CD00317_08="08"] (JFUStrConst.java:2503) |
| 11 | CALL | `executeSC(handle, param, fixedText, TEMPLATE_ID_2, ...)` // Execute ESC0041D010 service order deletion |
| 12 | EXEC | `initData(param, fixedText, IN_COLUMN_LIST_2)` // Init service order receipt columns for new |
| 13 | EXEC | `setInMapSvcOrder(param, fixedText, ..., JCCBPCommon.getOpeDate(null), JFUStrConst.CD00317_02)` // Set new registration parameters [-> CD00317_02="02"] (JFUStrConst.java:2491) |
| 14 | CALL | `executeSC(handle, param, fixedText, TEMPLATE_ID_2, ...)` // Execute ESC0041D010 service order new registration |

**Block 7** — [FINALLY] Cleanup (L770)

> Always executes regardless of processing outcome. Cleans up temporary data areas.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `this.deleteTempArea(param, fixedText)` // Clean up temporary template areas |

**Block 8** — [RETURN] (L773)

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return param` // Return the processed request parameter container |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `svc_kei_no` | Field | Service contract number — the unique identifier for a customer's main service contract line |
| `op_svc_kei_no` | Field | Optional service contract number — the identifier for an optional add-on service (e.g., email) attached to a main service contract |
| `sbop_svc_kei_no` | Field | Sub-optional service contract number — a further subdivision of optional services (e.g., a specific mailbox under an email service) |
| `svc_kei_ucwk_no` | Field | Service detail work number — internal tracking ID for service contract detail lines |
| `mlad` / `chg_bf_mlad` / `chg_af_mlad` | Field | Mail address — the customer's email address; `chg_bf_mlad` is the old address, `chg_af_mlad` is the new address |
| `mlbox_capa` | Field | Mail box capacity — the storage quota (in MB) for the customer's email mailbox |
| `send_req_fin_dtm` | Field | Send request completion datetime — timestamp indicating whether an order issuance prerequisite has been fulfilled |
| `gen_add_dtm` | Field | Generationregistration datetime — the timestamp when a service contract record was created or last modified |
| `action_name` | Field | Action name — indicates the type of operation: "UPDATE" (email address change) or "EXPAND" (mailbox capacity increase) |
| `rcnt_yokyu_sbt_cd` | Field | Request type code — classifies the service order request type (CD00317_02 = New, CD00317_03 = Cancellation, CD00317_04 = Change, CD00317_08 = Deletion) |
| SOD | Acronym | Service Order Data — a structured data object containing service contract information for order issuance processing |
| SOD Kihon Info | Field | SOD basic information — contains SYSID and migration type (ido_div) for the service order |
| ISP Consent | Business term | Optional Service Contract <ISP> Consent — the customer's consent record for optional (add-on) services |
| Sub-Optional Service | Business term | Sub-Optional Service — a further subdivision of an optional service, representing a specific contracted item under an optional service umbrella |
| Order Issuance CC | Component | Order Issuance Common Component — upstream component that handles order issuance delegation and timing synchronization |
| EKK1081B501 | SC Code | Order Issuance Condition List 2 SC — queries pending order issuance prerequisite records for an optional service |
| EKK0361A010 | SC Code | Optional Service Contract <ISP> Consent SC — retrieves optional service contract ISP consent details |
| EKK1041B001 | SC Code | Order Settings Search SC — searches for existing order settings associated with a service contract |
| EKK1041C010 | SC Code | Order Settings Change SC — updates existing order settings records |
| EKK1041D010 | SC Code | Order Settings Registration SC — creates new order settings records |
| ESC0041D010 | SC Code | Service Order Receipt SC — registers service order receipts (new, change, cancellation, deletion) with the service order system |
| EKK0411A010 | SC Code | Sub-Optional Service Contract <ISP> Consent SC — retrieves sub-optional service contract ISP consent details |
| EKK0401B001 | SC Code | Sub-Optional Service Contract List SC — lists sub-optional service contracts for lookup |
| EZM0321A010 | SC Code | Business Parameter Management SC — retrieves system business parameters (e.g., mail address change utilization period) |
| FUNC_CD_1 | Constant | Function code = "1" — indicates a full processing mode for service order registration |
| FUNC_CD_2 | Constant | Function code = "2" — indicates an update-only check mode; triggers early return without actual processing |
| CD00317_02 | Constant | Request type code = "02" — New registration request type |
| CD00317_03 | Constant | Request type code = "03" — Cancellation request type |
| CD00317_04 | Constant | Request type code = "04" — Change request type |
| CD00317_08 | Constant | Request type code = "08" — Deletion request type |
| CD00576_00031 | Constant | Migration type = "00031" — indicates "out of scope" migration for SOD basic info |
| CD00137_D02 | Constant | Sub-optional service code = "D02" — Mail capacity addition service type |
| CD00037_910 | Constant | Contract status = "910" — Contract cancelled status |
| CD00037_920 | Constant | Contract status = "920" — Contract cancelled status (alternative code) |
| `FUSV012207CC` | Component | Mail address service SOD order CC component — handles SOD preparation for UPDATE operations in the old-style flow |
| `FUSV027504CC` | Component | Mail address service SOD order CC component — handles SOD preparation for EXPAND operations in the old-style flow |
| K-Opticom | Business term | Japan's telecommunications service provider — the domain context of this system |
| FUSV screens | Business term | Fujitsu Unified Service screens — customer-facing screens for email service management (FUSV0122 = mail address change, FUSV0275 = mailbox capacity expansion) |
