> For the complete documentation index, see [llms.txt](https://docs.rierino.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rierino.com/devops/api-event-and-process-flows/configuring-saga-steps/condition-step/condition-classes.md).

# Condition Classes

It is possible to define any number and type of new condition classes with specialized configurations. Rierino is shipped with a number of default classes.

## ElementValueCondition

This class(*com.rierino.handler.saga.condition.ElementValueCondition*) returns the value of a specific payload element to be used as a condition value.

| Parameter | Definition                      | Example             |
| --------- | ------------------------------- | ------------------- |
| element   | Json path of the element to use | parameters.language |

## ErrorCodeCondition

This class(*com.rierino.handler.saga.condition.ErrorCodeCondition*) returns the value of event error code (or '-' if null) to be used as a condition value.

## ErrorHttpCondition

This class(*com.rierino.handler.saga.condition.ErrorHttpCondition*) returns the http status code of event error (or '-' if null) to be used as a condition value.

## EventStatusCondition

This class(*com.rierino.handler.saga.condition.EventStatusCondition*) returns the status name of event result (or '-' if null) to be used as a condition value.

## HasElementCondition

This class(*com.rierino.handler.saga.condition.HasElementCondition*) returns "true" or "false" based on whether a specific payload element exists or not.

| Parameter | Definition                      | Example     |
| --------- | ------------------------------- | ----------- |
| element   | Json path of the element to use | customer.id |

## JMESCondition

This class(*com.rierino.handler.saga.condition.JMESCondition*) returns a text value based on evaluation of a JMESPath pattern.

| Parameter      | Definition                                                                            | Example              |
| -------------- | ------------------------------------------------------------------------------------- | -------------------- |
| pattern        | JMESPath pattern to apply                                                             | language=='enUS'     |
| patternElement | Json path to payload element which defines JMESPath pattern to apply                  | parameters.condition |
| store          | Whether JMESPath expression should be cached for future executions (defaults to true) | false                |
| inputElement   | Json path of the payload to run pattern on                                            | parameters           |

{% embed url="<https://jmespath.org>" %}
JMESPath Page
{% endembed %}

## JsonSchemaCondition

This class(*com.rierino.handler.saga.condition.JsonSchemaCondition*) evaluates event payload against a Json schema constraints and returns "success" or "fail".

| Parameter | Definition                           | Example           |
| --------- | ------------------------------------ | ----------------- |
| schema    | String representation of Json schema | {"type":"string"} |

{% embed url="<https://json-schema.org>" %}
Json Schema Page
{% endembed %}

## RegexCondition

This class(*com.rierino.handler.saga.condition.RegexCondition*) evaluates event payload against a regex expression and returns "true" or "false".

| Parameter | Definition                           | Example            |
| --------- | ------------------------------------ | ------------------ |
| element   | Json path of the element to evaluate | customer.data.name |
| regex     | Regex expression to evaluate         | \[a-zA-Z]+         |

## SuccessCondition

This class(*com.rierino.handler.saga.condition.SuccessCondition*) returns "success" or "fail" based on whether the previous saga step had an error or not.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.rierino.com/devops/api-event-and-process-flows/configuring-saga-steps/condition-step/condition-classes.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
