Class WorkflowCommand
OptimaJet.Workflow.Core.Runtime.WorkflowCommand
Represents a workflow command for use in an application.
Namespace: OptimaJet.Workflow.Core.Runtime
public sealed class WorkflowCommandProperties
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
nameStringThe parameter name.
Returns
Type
Description
ObjectThe 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
nameStringThe parameter name.
valueObjectThe parameter value.
persistBooleanWhether 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
processIdGuidThe process identifier.
transitionDefinitionTransitionDefinitionThe command transition definition.
processDefinitionProcessDefinitionThe parsed process definition used to resolve localized command and parameter names.
deserializerFunc<String, Type, Object>An optional function used to deserialize parameter default values.
cultureCultureInfoThe culture used to localize command and command parameter names.
Returns
Type
Description
WorkflowCommandA populated WorkflowCommand instance.
Exceptions
Type
Description
InvalidOperationExceptionThrown 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
identityIdStringThe workflow participant identity to add.
public bool Validate(out string errorMessage) #Validates command data and parameter values.
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
nameStringThe parameter name.
Exceptions
Type
Description
InvalidOperationExceptionThrown when no parameter with the specified name exists.
Fields
public List<CommandParameter> Parameters #Gets or sets the list of parameters for the command.