# Custom Code Handlers

Custom code handlers support dynamic scripts, runtime-loaded Java code, hot-swapped packages, and Python procedures.

Use this page for handler-level details:

* Class names
* Handler parameters
* Runtime dependencies
* Built-in runtime behavior

Use [Custom Code Actions](/devops/api-event-and-process-flows/configuring-saga-steps/event-step/custom-code-actions.md) for action-level saga step fields and parameters.

### Run Scripts

Class: `com.rierino.handler.ScriptLoadedEventHandler`

Executes stored scripts through Javax scripting engines.

#### Handler parameters

| Parameter     | Definition                             | Example              | Default        |
| ------------- | -------------------------------------- | -------------------- | -------------- |
| `code.state`  | State manager storing code definitions | `customJSCodes`      | `handler_code` |
| `code.domain` | Code category allowed for this handler | `custom_calculation` | -              |

Action details: [Run Scripts](/devops/api-event-and-process-flows/configuring-saga-steps/event-step/custom-code-actions/run-scripts.md)

### Run Java Code

Class: `com.rierino.handler.OpenHFTEventHandler`

Loads and executes dynamic Java handler code during runtime.

#### Handler parameters

| Parameter        | Definition                                 | Example             | Default          |
| ---------------- | ------------------------------------------ | ------------------- | ---------------- |
| `code.state`     | State manager storing code definitions     | `customCodes`       | `handler_code`   |
| `code.domain`    | Code category allowed for this handler     | `basket_operations` | -                |
| `code.local.dir` | Local directory used to store dynamic code | `/tmp`              | `java.io.tmpdir` |

Action details: [Run Java Code](/devops/api-event-and-process-flows/configuring-saga-steps/event-step/custom-code-actions/run-java-code.md)

### Run Java Package

Class: `com.rierino.handler.JarLoadedEventHandler`

Loads and executes packaged Java handlers during runtime.

#### Handler parameters

| Parameter       | Definition                            | Example             | Default          |
| --------------- | ------------------------------------- | ------------------- | ---------------- |
| `jar.state`     | State manager storing jar definitions | `customJars`        | `handler_jar`    |
| `jar.domain`    | Jar category allowed for this handler | `basket_operations` | -                |
| `jar.local.dir` | Local directory used to store jars    | `/tmp`              | `java.io.tmpdir` |

Action details: [Run Java Package](/devops/api-event-and-process-flows/configuring-saga-steps/event-step/custom-code-actions/run-java-package.md)

### Run Python Procedure

Class: `com.rierino.handler.py4j.Py4JEventHandler`

Calls Python code through Py4J for runtime event processing.

#### Handler parameters

This handler has no special parameters.

#### Runtime dependency

```gradle
implementation (group:'com.rierino.custom', name: 'py4j', version:"${rierinoVersion}")
```

#### Runtime note

This handler typically requires an extra container alongside the runner, such as `ghcr.io/rierino-open/py-runner`.

Action details: [Run Python Procedure](/devops/api-event-and-process-flows/configuring-saga-steps/event-step/custom-code-actions/run-python-procedure.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.rierino.com/devops/microservices/building-blocks/execution-handlers/custom-code-handlers.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
