# Class SubstitutionsProcessor OptimaJet.Workflow.Core.CodeActions.SubstitutionsProcessor Expands process parameter placeholders embedded in action, condition, and rule parameters, annotation values, and other text evaluated for a process instance. Namespace: [OptimaJet.Workflow.Core.CodeActions](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.CodeActions/) ```csharp public static class SubstitutionsProcessor ``` ## Methods `public static Task<(string newValue, bool wasSubstituted)> SubstituteAsync(string value, ProcessInstance processInstance)` Replaces process parameter placeholders in `value` with values resolved through `processInstance`. ### Parameters | Name | Type | Description | | --- | --- | --- | | `value` | `String` | The text to inspect for parameter placeholders. | | `processInstance` | `ProcessInstance` | The [ProcessInstance](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ProcessInstance/) that supplies parameter values for replacements. | ### Returns | Type | Description | | --- | --- | | `Task` | A tuple containing the transformed text and [true](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool) when at least one placeholder was matched; otherwise, the original text and [false](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool). | ### Exceptions | Type | Description | | --- | --- | | `Exception` | Thrown when a parameter resolves to [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) and its placeholder specifies a nonempty format other than `json`. | | `RegexMatchTimeoutException` | Thrown when placeholder matching exceeds the one-second regular-expression timeout. | ### Remarks Placeholders use the `@ParameterName` or `@(ParameterName)` form recognized by [RegexPattern.ParameterAndMaybeQuotes](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.CodeActions/RegexPattern/). Parentheses can delimit a placeholder from adjacent text and allow spaces in parameter names. Dotted names resolve values within structured parameters. A nonempty format after `:` is passed to the value's `ToString(string)` overload. The special `json` format serializes the value with [ParametersSerializer](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime/ParametersSerializer/). Matching single or double quotes immediately around the entire placeholder are consumed as part of the match: ordinary replacements are emitted in double quotes, while a `json` replacement is inserted as a serialized JSON value. ### Example `Order @Order.Id was created on @(CreatedAt:yyyy-MM-dd)` substitutes a nested parameter value and a formatted date. `@(Payload:json)` inserts the serialized parameter value. [Previous SubprocessNameGetterInvoker](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.CodeActions/SubprocessNameGetterInvoker/) [Next DesignerRequest](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Designer/DesignerRequest/)