# Class CommandExecutionResult OptimaJet.Workflow.Core.Runtime.CommandExecutionResult Represents the outcome of a workflow command execution. Namespace: [OptimaJet.Workflow.Core.Runtime](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime/) ```csharp public class CommandExecutionResult ``` ## Constructors `public CommandExecutionResult(string commandName, bool wasExecuted, ProcessInstance processInstance, string message = null)` Creates a new [CommandExecutionResult](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime/CommandExecutionResult/) with execution details. ### Parameters | Name | Type | Description | | --- | --- | --- | | `commandName` | `String` | The name of the executed command. | | `wasExecuted` | `Boolean` | Indicates whether the command was executed. | | `processInstance` | `ProcessInstance` | The process instance after executing the command. | | `message` | `String` | An optional diagnostic message copied verbatim to [CommandExecutionResult.Message](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime/CommandExecutionResult/). See that property for the cases in which the runtime supplies a value. | ## Properties `public string CommandName { get; set; }` Gets or sets the name of the command that was executed. `public bool WasExecuted { get; set; }` Gets or sets a value indicating whether the command has been executed. `public ProcessInstance ProcessInstance { get; set; }` Gets or sets the process instance at the result stage. `public string Message { get; set; }` Gets or sets an optional diagnostic message supplied by the code that produced this result. ### Remarks This is not a value returned by a workflow action or activity. Regular command execution through [WorkflowRuntime.ExecuteCommandAsync(WorkflowCommand, string, string, CancellationToken, bool)](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime/WorkflowRuntime/) leaves this property [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null), including when no eligible transition is found and [CommandExecutionResult.WasExecuted](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime/CommandExecutionResult/) is [false](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool). The [OfflineApi](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime/OfflineApi/) batch command API populates this property for commands that it cannot execute: - For the first command that fails, it contains the caught exception's message. This also includes the internally generated `Command didn't found.` message when no matching available command is found. - If the process identifier is empty, it contains `Process doesn't exists.`. - For commands skipped after an earlier command in the same process command chain fails, it contains `The command chain is interrupted.`. Callers that create or modify a result directly may supply other text. [Previous CodeActionsCompiledEventArgs](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime/CodeActionsCompiledEventArgs/) [Next CommandParameter](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime/CommandParameter/)