Assembly: OptimaJet.Workflow.Core

Class WorkflowCommand

OptimaJet.Workflow.Core.Runtime.WorkflowCommand

Represents a workflow command for use in an application.

public sealed class WorkflowCommand

Properties

public Guid ProcessId { get; set; } #
Gets or sets the process identifier for which the command is valid.
public string ValidForActivityName { get; set; } #
Gets or sets the activity name for which the command is valid.
public string ValidForStateName { get; set; } #
Gets or sets the state name for which the command is valid.
public TransitionClassifier Classifier { get; set; } #
Gets or sets the transition classifier for the command. TransitionClassifier
public bool IsForSubprocess { get; set; } #
Gets or sets a value indicating whether the command was received from a subprocess.
public IEnumerable<string> Identities { get; } #
Gets the workflow participant identities that can execute the command.
public string CommandName { get; set; } #
Gets or sets the system name of the command.
public string LocalizedName { get; set; } #
Gets or sets the localized name of the command.

Methods

public object GetParameter(string name) #
Gets the value of the parameter with the specified name.

Parameters

Name
Type
Description
name
String
The parameter name.

Returns

Type
Description
Object
The parameter value, or null if no matching parameter exists.
public void SetParameter(string name, object value, bool persist = false) #
Sets a parameter value. Adds the parameter if it does not already exist.

Parameters

Name
Type
Description
name
String
The parameter name.
value
Object
The parameter value.
persist
Boolean
Whether the parameter is persistent.
public static WorkflowCommand Create(Guid processId, TransitionDefinition transitionDefinition, ProcessDefinition processDefinition, Func<string, Type, object> deserializer = null, CultureInfo culture = null) #
Creates a new WorkflowCommand from a command transition.

Parameters

Name
Type
Description
processId
Guid
The process identifier.
transitionDefinition
TransitionDefinition
The command transition definition.
processDefinition
ProcessDefinition
The parsed process definition used to resolve localized command and parameter names.
deserializer
Func<String, Type, Object>
An optional function used to deserialize parameter default values.
culture
CultureInfo
The culture used to localize command and command parameter names.

Returns

Type
Description
WorkflowCommand
A populated WorkflowCommand instance.

Exceptions

Type
Description
InvalidOperationException
Thrown if the transition is not a command transition or its command is missing.
public void AddIdentity(string identityId) #
Adds a workflow participant identity to the command's WorkflowCommand.Identities collection.

Parameters

Name
Type
Description
identityId
String
The workflow participant identity to add.
public bool Validate(out string errorMessage) #
Validates command data and parameter values.

Parameters

Name
Type
Description
errorMessage
String
When validation fails, contains a summary of validation errors.

Returns

Type
Description
Boolean
true if the command is valid; otherwise, false.
public void SetAllParametersToDefault() #
Sets all parameter values to their default values.
public void SetParameterToDefault(string name) #
Sets the value of the parameter with the specified name to its default value.

Parameters

Name
Type
Description
name
String
The parameter name.

Exceptions

Type
Description
InvalidOperationException
Thrown when no parameter with the specified name exists.

Fields

public List<CommandParameter> Parameters #
Gets or sets the list of parameters for the command.