Assembly: OptimaJet.Workflow.Core

Class CommandExecutionResult

OptimaJet.Workflow.Core.Runtime.CommandExecutionResult

Represents the outcome of a workflow command execution.

public class CommandExecutionResult

Constructors

public CommandExecutionResult(string commandName, bool wasExecuted, ProcessInstance processInstance, string message = null) #
Creates a new 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. 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) leaves this property null, including when no eligible transition is found and CommandExecutionResult.WasExecuted is false.

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