# Business Logic — MsgEditer.setRaw() [8 LOC]

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

## 1. Role

### MsgEditer.setRaw()

`setRaw()` is a static utility method that conditionally assigns a value to a `CAANMsg` message object by either setting it with `msg.set(key, value)` or nullifying it with `msg.setNull(key)`, depending on the `isNull` flag. It serves as a low-level, shared data-setting primitive used across the billing and service order processing layer (CC — Common Component layer) of the Futurity BP system. Its sole purpose is to abstract away the null-check boilerplate so that calling code can declaratively express intent: "set this message field, or explicitly clear it." This method is called by `MsgEditer.set()` and `MsgEditer.setDefaultIfNone()` within the same class, forming the foundation of the message-editing utilities used throughout the NTT Docomo billing customization modules (JKKWribSvcKeiOperateCC and related components). It implements a simple conditional-dispatch pattern — not a builder or factory, but a focused utility that eliminates repetitive null-handling logic in business code.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["setRaw(msg, key, value, isNull)"])
    COND([isNull ?])
    SET_NULL(["msg.setNull(key)"])
    SET_VALUE(["msg.set(key, value)"])
    END_NODE(["Return / Next"])

    START --> COND
    COND -->|true| SET_NULL
    COND -->|false| SET_VALUE
    SET_NULL --> END_NODE
    SET_VALUE --> END_NODE
```

**Processing steps:**

1. **Entry**: Receive `msg` (target CAANMsg), `key` (field identifier), `value` (field data), and `isNull` (null-flag).
2. **Conditional branch on `isNull`**: Evaluate whether the value should be treated as null.
   - If `isNull == true`: Call `msg.setNull(key)` to explicitly clear the field in the message, marking it as absent/null in downstream processing.
   - If `isNull == false`: Call `msg.set(key, value)` to store the value under the given key in the message object.
3. **Return**: Method returns void; control passes back to the caller.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `msg` | `CAANMsg` | The message object used to pass data between system components. CAANMsg acts as a key-value container for carrying business data (e.g., service type codes, order content codes, customer info fields) across the billing customization layer. |
| 2 | `key` | `String` | The field identifier/name within the CAANMsg object. Represents a business data field key (e.g., a service type code key, order content key, or customer info key) under which the value or null marker will be stored. |
| 3 | `value` | `Object` | The business data value to store. Its type depends on the field (commonly String for code values like service type codes, or other types). Ignored when `isNull` is true. |
| 4 | `isNull` | `boolean` | The null flag that determines the branching behavior. When `true`, the key is explicitly set to null in the message (clearing any prior value). When `false`, the `value` is stored. This flag is the sole conditional determinant of the method's behavior. |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `JCKMvnoCustInfoAddCC.setNull` | JCKMvnoCustInfoAddCC | - | Calls `setNull` in `JCKMvnoCustInfoAddCC` |
| - | `JKKKapKeiInfoCancelCC.setNull` | JKKKapKeiInfoCancelCC | - | Calls `setNull` in `JKKKapKeiInfoCancelCC` |
| - | `JKKKisnUwHmdkAddCC.setNull` | JKKKisnUwHmdkAddCC | - | Calls `setNull` in `JKKKisnUwHmdkAddCC` |
| - | `JKKKojiChgPlaceNoCC.setNull` | JKKKojiChgPlaceNoCC | - | Calls `setNull` in `JKKKojiChgPlaceNoCC` |
| - | `JKKMvnoSvcKeiStaAddCC.setNull` | JKKMvnoSvcKeiStaAddCC | - | Calls `setNull` in `JKKMvnoSvcKeiStaAddCC` |

**Direct method calls made by `setRaw()`:**

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| U | `CAANMsg.setNull(String key)` | - | In-memory message | Sets the specified key to null in the CAANMsg object. This is an in-memory operation on the message container, not a direct database update. Used to clear or mark fields as absent before passing the message downstream. |
| U | `CAANMsg.set(String key, Object value)` | - | In-memory message | Stores the given value under the specified key in the CAANMsg object. This is an in-memory write to the message's internal key-value store. |

Note: The pre-computed evidence listed in the CRUD section above represents methods that *call* `setRaw()` and pass `setNull` as a terminal operation. `setRaw()` itself does not directly invoke those classes — it delegates to `CAANMsg.setNull()` and `CAANMsg.set()` which operate on the in-memory message object. Downstream components (like `JCKMvnoCustInfoAddCC`, `JKKKapKeiInfoCancelCC`, etc.) receive the edited message and perform their own CRUD operations based on its contents.

## 5. Dependency Trace

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

Direct callers found: 2 methods.

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Class: `MsgEditer.set()` | `MsgEditer.set()` -> `MsgEditer.setRaw()` | `setNull` [-], `set` [-] |
| 2 | Class: `MsgEditer.setDefaultIfNone()` | `MsgEditer.setDefaultIfNone()` -> `MsgEditer.setRaw()` | `setNull` [-], `set` [-] |

No screen/batch entry points (KKSV*) or batch entry points were found within the direct caller graph. The callers `MsgEditer.set()` and `MsgEditer.setDefaultIfNone()` are themselves utility methods within the same `MsgEditer` class, which is called from various CC-level business components throughout the NTT Docomo billing customization layer.

## 6. Per-Branch Detail Blocks

### Block 1 — IF `(isNull)` (L16556)

The method evaluates the `isNull` boolean flag. This is the only conditional branch in the method. It determines whether the value should be stored or the field should be cleared.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `msg.setNull(key);` // Set the specified key to null in the message object // [isNull == true] |
| 2 | RETURN | `return;` // Void method — return to caller |

### Block 2 — ELSE `(isNull == false)` (L16558)

Executed when `isNull` is false. The value parameter is stored in the message under the given key.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `msg.set(key, value);` // Store the value under the key in the message object // [isNull == false] |
| 2 | RETURN | `return;` // Void method — return to caller |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| CAANMsg | Class | Message container — a key-value data structure used to pass business data between components in the NTT Docomo billing customization framework. Fields are stored by string keys. |
| setNull | Method | Clears a field in the CAANMsg by setting its value to null, effectively removing or marking it as absent. |
| set | Method | Stores a value in the CAANMsg under a given key. |
| setRaw | Method | Low-level utility that conditionally sets or nullifies a field in a CAANMsg based on the `isNull` flag. |
| MsgEditer | Class | Static utility class providing message-editing helper methods (set, setRaw, setDefaultIfNone) used across the billing customization CC layer. |
| CC | Layer | Common Component — the service component layer in the NTT Docomo billing system that houses business logic components and utilities. |
| isNull | Parameter | Boolean flag indicating whether a field value should be treated as absent/null. |
| Futurity BP | Product | Fujitsu's Futurity Business Platform — the billing and service management system used by NTT Docomo. |
| JKKWribSvcKeiOperateCC | Class | A billing customization component (CC) handling withdrawal/service type operations — the file where `setRaw()` is referenced from. |
