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

# buildARuleStruct

> **buildARuleStruct**(`ruleSyntax`, `foreignCallNameToID`, `effect`, `trackerNameToID`, `encodedValues`, `additionalForeignCalls`, `additionalEffectForeignCalls`): [`RuleStruct`](../../types/type-aliases/RuleStruct)

Constructs a rule structure based on the provided policy ID, rule syntax, foreign call mappings,
effect data, and tracker mappings. This function processes the rule syntax to generate a structured
representation of the rule, including placeholders, effects, and associated metadata.

## Parameters

| Parameter                      | Type                                                      | Description                                                                   |
| ------------------------------ | --------------------------------------------------------- | ----------------------------------------------------------------------------- |
| `ruleSyntax`                   | [`RuleJSON`](../../validation/interfaces/RuleJSON)        | The JSON representation of the rule syntax, including conditions and effects. |
| `foreignCallNameToID`          | [`FCNameToID`](../../types/type-aliases/FCNameToID)\[]    | An array of mappings between foreign call names and their corresponding IDs.  |
| `effect`                       | [`EffectStructs`](../../types/type-aliases/EffectStructs) | An object containing the positive and negative effects of the rule.           |
| `trackerNameToID`              | [`FCNameToID`](../../types/type-aliases/FCNameToID)\[]    | An array of mappings between tracker names and their corresponding IDs.       |
| `encodedValues`                | `string`                                                  | -                                                                             |
| `additionalForeignCalls`       | `string`\[]                                               | -                                                                             |
| `additionalEffectForeignCalls` | `string`\[]                                               | -                                                                             |

## Returns

[`RuleStruct`](../../types/type-aliases/RuleStruct)

A structured representation of the rule, including its instruction set, placeholders,
effect placeholders, and associated effects.

## Defined in

[src/modules/contract-interaction-utils.ts:142](https://github.com/forte-service-company-ltd/forte-rules-engine-sdk/blob/5aad4d7c3c8cc91280e4449c17ac8ea31219fbed/src/modules/contract-interaction-utils.ts#L142)
