> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bringits.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Transform By JDM

> Transform data into a new object using JDM mapping rules

The Transform By JDM command (Command Type: 1017) transforms the current data into a new object by applying [JDM (JSON Decision Model)](https://github.com/gorules/zen) mapping rules. It supports optional state usage during transformation.

## Overview

The Transform By JDM command provides functionality for:

* Applying complex mapping rules defined in a JDM JSON object
* Transforming input data into a completely different output structure
* Optionally leveraging state from the execution context during transformation

## Command Type

**Command Type ID:** 1017

## Parameters

| Parameter    | Type    | Description                                                                            | Required |
| ------------ | ------- | -------------------------------------------------------------------------------------- | -------- |
| **jdm**      | object  | The JSON object containing the JDM mapping rules for transforming the data             | Yes      |
| **timeout**  | number  | The timeout for the command in milliseconds                                            | Yes      |
| **useState** | boolean | If `true`, uses the current execution state during transformation. Defaults to `false` | No       |

## Usage Examples

### Basic Field Mapping

```json theme={null}
{
  "command": "transform-by-jdm",
  "params": {
    "jdm": {
      "nodes": [],
      "edges": []
    },
    "timeout": 5000
  }
}
```

### Transform with State

```json theme={null}
{
  "command": "transform-by-jdm",
  "params": {
    "jdm": {
      "nodes": [],
      "edges": []
    },
    "timeout": 10000,
    "useState": true
  }
}
```

## JDM Structure

The `jdm` object follows the [gorules/zen](https://github.com/gorules/zen) JSON Decision Model format — a graph of nodes and edges describing transformation logic.

Refer to the [gorules/zen documentation](https://github.com/gorules/zen) for the full JDM specification.

## Common Use Cases

* **Complex Transformations**: Apply non-trivial multi-field transformation logic in one step
* **Rule-Based Mapping**: Use decision model rules to conditionally map data
* **State-Aware Transforms**: Include execution state context in the transformation

## Related Commands

* [JSONata](/stream/commands/parse/jsonata) - Expression-based transformation
* [Zen Parse Expression](/stream/commands/parse/zen-parse) - Evaluate Zen expressions
* [Object Mapper](/stream/commands/parse/object-mapper) - Simpler field-level mapping
