# RuleEngineOutput

Records the output of Rule Engine including rule evaluation and actions result.

| JSON representation |
|---|
| ``` { "documentName": string, "ruleEvaluatorOutput": { object (`https://docs.cloud.google.com/document-warehouse/docs/reference/rest/v1/RuleEngineOutput#RuleEvaluatorOutput`) }, "actionExecutorOutput": { object (`https://docs.cloud.google.com/document-warehouse/docs/reference/rest/v1/RuleEngineOutput#ActionExecutorOutput`) } } ``` |

| Fields ||
|---|---|
| `documentName` | `string` name of the document against which the rules and actions were evaluated. |
| `ruleEvaluatorOutput` | ``object (`https://docs.cloud.google.com/document-warehouse/docs/reference/rest/v1/RuleEngineOutput#RuleEvaluatorOutput`)`` Output from Rule Evaluator containing matched, unmatched and invalid rules. |
| `actionExecutorOutput` | ``object (`https://docs.cloud.google.com/document-warehouse/docs/reference/rest/v1/RuleEngineOutput#ActionExecutorOutput`)`` Output from Action Executor containing rule and corresponding actions execution result. |

## RuleEvaluatorOutput

Represents the output of the Rule Evaluator.

| JSON representation |
|---|
| ``` { "triggeredRules": [ { object (`https://docs.cloud.google.com/document-warehouse/docs/reference/rest/v1/projects.locations.ruleSets#Rule`) } ], "matchedRules": [ { object (`https://docs.cloud.google.com/document-warehouse/docs/reference/rest/v1/projects.locations.ruleSets#Rule`) } ], "invalidRules": [ { object (`https://docs.cloud.google.com/document-warehouse/docs/reference/rest/v1/RuleEngineOutput#InvalidRule`) } ] } ``` |

| Fields ||
|---|---|
| `triggeredRules[]` | ``object (`https://docs.cloud.google.com/document-warehouse/docs/reference/rest/v1/projects.locations.ruleSets#Rule`)`` List of rules fetched from database for the given request trigger type. |
| `matchedRules[]` | ``object (`https://docs.cloud.google.com/document-warehouse/docs/reference/rest/v1/projects.locations.ruleSets#Rule`)`` A subset of triggered rules that are evaluated true for a given request. |
| `invalidRules[]` | ``object (`https://docs.cloud.google.com/document-warehouse/docs/reference/rest/v1/RuleEngineOutput#InvalidRule`)`` A subset of triggered rules that failed the validation check(s) after parsing. |

## InvalidRule

A triggered rule that failed the validation check(s) after parsing.

| JSON representation |
|---|
| ``` { "rule": { object (`https://docs.cloud.google.com/document-warehouse/docs/reference/rest/v1/projects.locations.ruleSets#Rule`) }, "error": string } ``` |

| Fields ||
|---|---|
| `rule` | ``object (`https://docs.cloud.google.com/document-warehouse/docs/reference/rest/v1/projects.locations.ruleSets#Rule`)`` Triggered rule. |
| `error` | `string` Validation error on a parsed expression. |

## ActionExecutorOutput

Represents the output of the Action Executor.

| JSON representation |
|---|
| ``` { "ruleActionsPairs": [ { object (`https://docs.cloud.google.com/document-warehouse/docs/reference/rest/v1/RuleEngineOutput#RuleActionsPair`) } ] } ``` |

| Fields ||
|---|---|
| `ruleActionsPairs[]` | ``object (`https://docs.cloud.google.com/document-warehouse/docs/reference/rest/v1/RuleEngineOutput#RuleActionsPair`)`` List of rule and corresponding actions result. |

## RuleActionsPair

Represents a rule and outputs of associated actions.

| JSON representation |
|---|
| ``` { "rule": { object (`https://docs.cloud.google.com/document-warehouse/docs/reference/rest/v1/projects.locations.ruleSets#Rule`) }, "actionOutputs": [ { object (`https://docs.cloud.google.com/document-warehouse/docs/reference/rest/v1/RuleEngineOutput#ActionOutput`) } ] } ``` |

| Fields ||
|---|---|
| `rule` | ``object (`https://docs.cloud.google.com/document-warehouse/docs/reference/rest/v1/projects.locations.ruleSets#Rule`)`` Represents the rule. |
| `actionOutputs[]` | ``object (`https://docs.cloud.google.com/document-warehouse/docs/reference/rest/v1/RuleEngineOutput#ActionOutput`)`` Outputs of executing the actions associated with the above rule. |

## ActionOutput

Represents the result of executing an action.

| JSON representation |
|---|
| ``` { "actionId": string, "actionState": enum (`https://docs.cloud.google.com/document-warehouse/docs/reference/rest/v1/RuleEngineOutput#State`), "outputMessage": string } ``` |

| Fields ||
|---|---|
| `actionId` | `string` id of the action. |
| `actionState` | ``enum (`https://docs.cloud.google.com/document-warehouse/docs/reference/rest/v1/RuleEngineOutput#State`)`` state of an action. |
| `outputMessage` | `string` Action execution output message. |

## State

Represents execution state of the action.

| Enums ||
|---|---|
| `UNKNOWN` | The unknown state. |
| `ACTION_SUCCEEDED` | state indicating action executed successfully. |
| `ACTION_FAILED` | state indicating action failed. |
| `ACTION_TIMED_OUT` | state indicating action timed out. |
| `ACTION_PENDING` | state indicating action is pending. |