convertRuleStructToString
convertRuleStructToString(
functionString
,encodedValues
,ruleS
,plhArray
):ruleJSON
Converts a RuleStruct
object into a JSON-like string representation.
Parameters
Parameter | Type | Description |
---|---|---|
functionString | string | The function signature as a string. |
encodedValues | string | A string containing encoded values for the rule. |
ruleS | 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. |
Returns
An object of type ruleJSON
containing the condition, positive effects, negative effects, function signature, 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.