> ## 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.

# convertRuleStructToString

> **convertRuleStructToString**(`functionString`, `encodedValues`, `ruleS`, `plhArray`, `foreignCalls`, `trackers`, `mappings`): [`RuleJSON`](../../../modules/validation/interfaces/RuleJSON)

Converts a `RuleStruct` object into a JSON-like string representation.

## Parameters

| Parameter        | Type                                                                                | Description                                                                                                   |
| ---------------- | ----------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- |
| `functionString` | `string`                                                                            | The calling function signature as a string.                                                                   |
| `encodedValues`  | `string`                                                                            | A string containing encoded values for the rule.                                                              |
| `ruleS`          | [`RuleStruct`](../../../modules/types/type-aliases/RuleStruct)                      | The `RuleStruct` object containing rule details such as placeholders, positive effects, and negative effects. |
| `plhArray`       | `string`\[]                                                                         | An array to store the names of placeholders extracted from the rule.                                          |
| `foreignCalls`   | [`ForeignCallOnChain`](../../../modules/types/type-aliases/ForeignCallOnChain)\[]   | An array of foreign calls used in the rule.                                                                   |
| `trackers`       | [`TrackerOnChain`](../../../modules/types/type-aliases/TrackerOnChain)\[]           | An array of trackers used in the rule.                                                                        |
| `mappings`       | [`hexToFunctionString`](../../../modules/types/type-aliases/hexToFunctionString)\[] | An array of mappings that associate a `hex` signature with a function.                                        |

## Returns

[`RuleJSON`](../../../modules/validation/interfaces/RuleJSON)

An object of type `ruleJSON` containing the condition, positive effects, negative effects, calling function, and encoded values.

The function processes the `RuleStruct` object to:

* Extract placeholder names and append them to `plhArray`.
* Parse and format positive and negative effects into strings.
* Reverse parse the rule's instruction set to generate a condition string.
* Populate the `ruleJSON` object with the processed data.

## Defined in

[src/parsing/reverse-parsing-logic.ts:353](https://github.com/forte-service-company-ltd/forte-rules-engine-sdk/blob/5aad4d7c3c8cc91280e4449c17ac8ea31219fbed/src/parsing/reverse-parsing-logic.ts#L353)
