Workflow Engine .NET  2
Public Member Functions | Static Public Member Functions | Public Attributes | Properties | List of all members
OptimaJet.Workflow.Core.Model.ProcessInstance Class Reference

Represent a instance of a specific process More...

Public Member Functions

void AddParameter (ParameterDefinitionWithValue parameter)
 Adds parameter to process parameters collection More...
 
void AddParameters (IEnumerable< ParameterDefinitionWithValue > parameters)
 Adds parameters to process parameters collection More...
 
bool IsParameterExisting (string name)
 Checks that the parameter whether exists or not More...
 
ParameterDefinitionWithValue GetParameter (string name)
 Returns parameter with value ParameterDefinitionWithValue with specific name More...
 
GetParameter< T > (string name)
 Returns parameter's value by specific name More...
 
void SetParameter< T > (string name, T value, ParameterPurpose purposeIfMissing=ParameterPurpose.Temporary)
 Set value of the parameter with specific name. If the definition of the parameter with specific name is absent in the scheme of the process ProcessDefinition.Parameters, there will be creted Temporary parameter ParameterDefinition.Purpose with specified name More...
 
void RemoveParameter (string name)
 Remove parameter from process parameters More...
 
void SetProcessParameters (List< ParameterDefinitionWithValue > parameters)
 Replace process parameters collection by new value More...
 
bool ExecuteConditionFromCodeActions (string name, WorkflowRuntime runtime, string parameter)
 Check condition from global or local code actions with specific name More...
 
void ExecuteCodeAction (string name, WorkflowRuntime runtime, string parameter)
 Execute action from global or local code actions with specific name More...
 
string GetLocalizedStateName (string stateName, CultureInfo culture)
 Returns localized state name in specific culture More...
 
string GetLocalizedCommandName (string commandName, CultureInfo culture)
 Returns localized command name in specific culture More...
 
string GetLocalizedParameterName (string parameterName, CultureInfo culture)
 Returns localized parameter name in specific culture More...
 
string ProcessParametersToString (ParameterPurpose purpose)
 Returns process parameters formatted to string More...
 
void InitPersistenceParametersFromScheme ()
 

Static Public Member Functions

static ProcessInstance Create (Guid schemeId, Guid processId, ProcessDefinition processScheme, bool isSchemeObsolete, bool isDeterminingParametersChanged)
 Create ProcessInstance object More...
 

Public Attributes

ParametersCollection ProcessParameters = new ParametersCollection()
 Returns the list of process parameters ParameterDefinitionWithValue More...
 
ParametersCollection MergedSubprocessParameters = null
 Returns the list of process parameters ParameterDefinitionWithValue from a subprocess which was merged with current process. More...
 

Properties

Guid ProcessId [get, set]
 Returns Id of the process More...
 
Guid ParentProcessId [get, set]
 Returns Id of the parent process if this process is subprocess (parallel branch) More...
 
Guid RootProcessId [get, set]
 Returns Id of the root process in the subprocesses hierarchy if this process is subprocess (parallel branch) More...
 
Guid SchemeId [get, set]
 Returns Id of the scheme of the process More...
 
string PreviousState [get, set]
 Returns the name of the state which was initial for last executed direct transition TransitionDefinition.From More...
 
string ExecutedTimer [get, set]
 Returns the name of the currently executing timer, filled if the transition process was initiated by a timer More...
 
string PreviousStateForDirect [get, set]
 Returns the name of the state which was initial for last executed transition marked as direct TransitionDefinition.From More...
 
string PreviousStateForReverse [get, set]
 Returns the name of the state which was initial for last executed transition marked as reverse TransitionDefinition.From More...
 
string PreviousActivityName [get, set]
 Returns the name of the activity which was initial for last executed transition TransitionDefinition.From More...
 
string PreviousActivityForDirectName [get, set]
 Returns the name of the activity which was initial for last executed transition marked as direct TransitionDefinition.From More...
 
string PreviousActivityForReverseName [get, set]
 Returns the name of the activity which was initial for last executed transition marked as reverse TransitionDefinition.From More...
 
string CurrentCommand [get, set]
 Returns the name of the currently executing command, filled if the transition process was initiated by a command More...
 
string IdentityId [get, set]
 Returns the user id which execute a command or set a state More...
 
string ImpersonatedIdentityId [get, set]
 Returns the user id for whom executes a command or sets a state More...
 
string ExecutedActivityState [get, set]
 Returns the name of the state which is final for currently executing transition TransitionDefinition.To More...
 
ActivityDefinition ExecutedActivity [get, set]
 Returns the activity which is final for currently executing transition TransitionDefinition.To More...
 
TransitionDefinition ExecutedTransition [get, set]
 Returns the currently executing transition TransitionDefinition.To More...
 
string CurrentActivityName [get, set]
 Returns the name of the current activity. Activity which was final for last executed transition TransitionDefinition.From More...
 
List< string > IdentityIds [get, set]
 Returns the list of user ids which have the ability to execute a transition which leads to set executed activity. (which have the ability to execute current transition) It availiable only on pre-execution mode More...
 
List< string > IdentityIdsForCurrentActivity [get, set]
 Returns the list of user ids which have the ability to execute a transition which leads to set executed activity. (which have the ability to execute current transition) The main difference between this property and IdentityIds, is that it takes into account only the last transition that leads into current activity It availiable only on pre-execution mode More...
 
string SchemeCode [get, set]
 Returns the code of the scheme of the process More...
 
string CurrentState [get, set]
 Returns the name of the current state. State which was final for last executed transition TransitionDefinition.From More...
 
string StartTransitionalProcessActivity [get, set]
 Returns the name of the activity from which the transitional process was started. More...
 
ActivityDefinition CurrentActivity [get]
 Returns the name of the current activity. Activity which was final for last executed transition TransitionDefinition.From More...
 
bool IsPreExecution [get, set]
 Returns true within pre-execution mode More...
 
ProcessDefinition ProcessScheme [get, set]
 Returns parsed scheme of the process ProcessDefinition More...
 
bool IsSchemeObsolete [get, set]
 Sign that the scheme of the process is obsolete More...
 
bool IsSubprocess [get]
 Returns true if the pcocess is subprocess More...
 
bool IsDeterminingParametersChanged [get, set]
 Sign that parameters for creating scheme of the process was changed More...
 

Detailed Description

Represent a instance of a specific process

Member Function Documentation

◆ AddParameter()

void OptimaJet.Workflow.Core.Model.ProcessInstance.AddParameter ( ParameterDefinitionWithValue  parameter)

Adds parameter to process parameters collection

Parameters
parameterParameter with value ParameterDefinitionWithValue

◆ AddParameters()

void OptimaJet.Workflow.Core.Model.ProcessInstance.AddParameters ( IEnumerable< ParameterDefinitionWithValue parameters)

Adds parameters to process parameters collection

Parameters
parametersCollection of parameters with value ParameterDefinitionWithValue

◆ Create()

static ProcessInstance OptimaJet.Workflow.Core.Model.ProcessInstance.Create ( Guid  schemeId,
Guid  processId,
ProcessDefinition  processScheme,
bool  isSchemeObsolete,
bool  isDeterminingParametersChanged 
)
static

Create ProcessInstance object

Parameters
schemeIdId of the scheme of the process
processIdId of the process
processSchemeParsed scheme of the process
isSchemeObsoleteSign that the scheme of the process is obsolete
isDeterminingParametersChangedSign that parameters for creating scheme of the process was changed
Returns
ProcessInstance object

◆ ExecuteCodeAction()

void OptimaJet.Workflow.Core.Model.ProcessInstance.ExecuteCodeAction ( string  name,
WorkflowRuntime  runtime,
string  parameter 
)

Execute action from global or local code actions with specific name

Parameters
nameName of the action to execute
runtimeThe instance of WorkflowRuntime
parameterAdditional action parameter

◆ ExecuteConditionFromCodeActions()

bool OptimaJet.Workflow.Core.Model.ProcessInstance.ExecuteConditionFromCodeActions ( string  name,
WorkflowRuntime  runtime,
string  parameter 
)

Check condition from global or local code actions with specific name

Parameters
nameName of the condition to check
runtimeThe instance of WorkflowRuntime
parameterAdditional action parameter
Returns
Condition result

◆ GetLocalizedCommandName()

string OptimaJet.Workflow.Core.Model.ProcessInstance.GetLocalizedCommandName ( string  commandName,
CultureInfo  culture 
)

Returns localized command name in specific culture

Parameters
commandNameSystem command name
cultureCulture
Returns
Localized command name

◆ GetLocalizedParameterName()

string OptimaJet.Workflow.Core.Model.ProcessInstance.GetLocalizedParameterName ( string  parameterName,
CultureInfo  culture 
)

Returns localized parameter name in specific culture

Parameters
parameterNameSystem parameter name
cultureCulture
Returns
Localized parameter name

◆ GetLocalizedStateName()

string OptimaJet.Workflow.Core.Model.ProcessInstance.GetLocalizedStateName ( string  stateName,
CultureInfo  culture 
)

Returns localized state name in specific culture

Parameters
stateNameSystem state name
cultureCulture
Returns
Localized state name

◆ GetParameter()

ParameterDefinitionWithValue OptimaJet.Workflow.Core.Model.ProcessInstance.GetParameter ( string  name)

Returns parameter with value ParameterDefinitionWithValue with specific name

Parameters
nameName of the parameter
Returns
Parameter with value ParameterDefinitionWithValue

◆ GetParameter< T >()

Returns parameter's value by specific name

Template Parameters
TType of the parameter
Parameters
nameName of the parameter
Returns
Value of the parameter

◆ IsParameterExisting()

bool OptimaJet.Workflow.Core.Model.ProcessInstance.IsParameterExisting ( string  name)

Checks that the parameter whether exists or not

Parameters
nameName of the parameter
Returns
true if exists

◆ ProcessParametersToString()

string OptimaJet.Workflow.Core.Model.ProcessInstance.ProcessParametersToString ( ParameterPurpose  purpose)

Returns process parameters formatted to string

Parameters
purposeParameter purpose to filter parameters ParameterPurpose
Returns
Formatted string with parameters values

◆ RemoveParameter()

void OptimaJet.Workflow.Core.Model.ProcessInstance.RemoveParameter ( string  name)

Remove parameter from process parameters

Parameters
nameParameter name

◆ SetParameter< T >()

void OptimaJet.Workflow.Core.Model.ProcessInstance.SetParameter< T > ( string  name,
value,
ParameterPurpose  purposeIfMissing = ParameterPurpose.Temporary 
)

Set value of the parameter with specific name. If the definition of the parameter with specific name is absent in the scheme of the process ProcessDefinition.Parameters, there will be creted Temporary parameter ParameterDefinition.Purpose with specified name

Template Parameters
TType of the parameter
Parameters
nameName of the parameter
valueValue of the parameter

◆ SetProcessParameters()

void OptimaJet.Workflow.Core.Model.ProcessInstance.SetProcessParameters ( List< ParameterDefinitionWithValue parameters)

Replace process parameters collection by new value

Parameters
parameters>Collection of parameters with value ParameterDefinitionWithValue

Member Data Documentation

◆ MergedSubprocessParameters

ParametersCollection OptimaJet.Workflow.Core.Model.ProcessInstance.MergedSubprocessParameters = null

Returns the list of process parameters ParameterDefinitionWithValue from a subprocess which was merged with current process.

◆ ProcessParameters

ParametersCollection OptimaJet.Workflow.Core.Model.ProcessInstance.ProcessParameters = new ParametersCollection()

Returns the list of process parameters ParameterDefinitionWithValue

Property Documentation

◆ CurrentActivity

ActivityDefinition OptimaJet.Workflow.Core.Model.ProcessInstance.CurrentActivity
get

Returns the name of the current activity. Activity which was final for last executed transition TransitionDefinition.From

◆ CurrentActivityName

string OptimaJet.Workflow.Core.Model.ProcessInstance.CurrentActivityName
getset

Returns the name of the current activity. Activity which was final for last executed transition TransitionDefinition.From

◆ CurrentCommand

string OptimaJet.Workflow.Core.Model.ProcessInstance.CurrentCommand
getset

Returns the name of the currently executing command, filled if the transition process was initiated by a command

◆ CurrentState

string OptimaJet.Workflow.Core.Model.ProcessInstance.CurrentState
getset

Returns the name of the current state. State which was final for last executed transition TransitionDefinition.From

◆ ExecutedActivity

ActivityDefinition OptimaJet.Workflow.Core.Model.ProcessInstance.ExecutedActivity
getset

Returns the activity which is final for currently executing transition TransitionDefinition.To

◆ ExecutedActivityState

string OptimaJet.Workflow.Core.Model.ProcessInstance.ExecutedActivityState
getset

Returns the name of the state which is final for currently executing transition TransitionDefinition.To

◆ ExecutedTimer

string OptimaJet.Workflow.Core.Model.ProcessInstance.ExecutedTimer
getset

Returns the name of the currently executing timer, filled if the transition process was initiated by a timer

◆ ExecutedTransition

TransitionDefinition OptimaJet.Workflow.Core.Model.ProcessInstance.ExecutedTransition
getset

Returns the currently executing transition TransitionDefinition.To

◆ IdentityId

string OptimaJet.Workflow.Core.Model.ProcessInstance.IdentityId
getset

Returns the user id which execute a command or set a state

◆ IdentityIds

List<string> OptimaJet.Workflow.Core.Model.ProcessInstance.IdentityIds
getset

Returns the list of user ids which have the ability to execute a transition which leads to set executed activity. (which have the ability to execute current transition) It availiable only on pre-execution mode

◆ IdentityIdsForCurrentActivity

List<string> OptimaJet.Workflow.Core.Model.ProcessInstance.IdentityIdsForCurrentActivity
getset

Returns the list of user ids which have the ability to execute a transition which leads to set executed activity. (which have the ability to execute current transition) The main difference between this property and IdentityIds, is that it takes into account only the last transition that leads into current activity It availiable only on pre-execution mode

◆ ImpersonatedIdentityId

string OptimaJet.Workflow.Core.Model.ProcessInstance.ImpersonatedIdentityId
getset

Returns the user id for whom executes a command or sets a state

◆ IsDeterminingParametersChanged

bool OptimaJet.Workflow.Core.Model.ProcessInstance.IsDeterminingParametersChanged
getset

Sign that parameters for creating scheme of the process was changed

◆ IsPreExecution

bool OptimaJet.Workflow.Core.Model.ProcessInstance.IsPreExecution
getset

Returns true within pre-execution mode

◆ IsSchemeObsolete

bool OptimaJet.Workflow.Core.Model.ProcessInstance.IsSchemeObsolete
getset

Sign that the scheme of the process is obsolete

◆ IsSubprocess

bool OptimaJet.Workflow.Core.Model.ProcessInstance.IsSubprocess
get

Returns true if the pcocess is subprocess

◆ ParentProcessId

Guid OptimaJet.Workflow.Core.Model.ProcessInstance.ParentProcessId
getset

Returns Id of the parent process if this process is subprocess (parallel branch)

◆ PreviousActivityForDirectName

string OptimaJet.Workflow.Core.Model.ProcessInstance.PreviousActivityForDirectName
getset

Returns the name of the activity which was initial for last executed transition marked as direct TransitionDefinition.From

◆ PreviousActivityForReverseName

string OptimaJet.Workflow.Core.Model.ProcessInstance.PreviousActivityForReverseName
getset

Returns the name of the activity which was initial for last executed transition marked as reverse TransitionDefinition.From

◆ PreviousActivityName

string OptimaJet.Workflow.Core.Model.ProcessInstance.PreviousActivityName
getset

Returns the name of the activity which was initial for last executed transition TransitionDefinition.From

◆ PreviousState

string OptimaJet.Workflow.Core.Model.ProcessInstance.PreviousState
getset

Returns the name of the state which was initial for last executed direct transition TransitionDefinition.From

◆ PreviousStateForDirect

string OptimaJet.Workflow.Core.Model.ProcessInstance.PreviousStateForDirect
getset

Returns the name of the state which was initial for last executed transition marked as direct TransitionDefinition.From

◆ PreviousStateForReverse

string OptimaJet.Workflow.Core.Model.ProcessInstance.PreviousStateForReverse
getset

Returns the name of the state which was initial for last executed transition marked as reverse TransitionDefinition.From

◆ ProcessId

Guid OptimaJet.Workflow.Core.Model.ProcessInstance.ProcessId
getset

Returns Id of the process

◆ ProcessScheme

ProcessDefinition OptimaJet.Workflow.Core.Model.ProcessInstance.ProcessScheme
getset

Returns parsed scheme of the process ProcessDefinition

◆ RootProcessId

Guid OptimaJet.Workflow.Core.Model.ProcessInstance.RootProcessId
getset

Returns Id of the root process in the subprocesses hierarchy if this process is subprocess (parallel branch)

◆ SchemeCode

string OptimaJet.Workflow.Core.Model.ProcessInstance.SchemeCode
getset

Returns the code of the scheme of the process

◆ SchemeId

Guid OptimaJet.Workflow.Core.Model.ProcessInstance.SchemeId
getset

Returns Id of the scheme of the process

◆ StartTransitionalProcessActivity

string OptimaJet.Workflow.Core.Model.ProcessInstance.StartTransitionalProcessActivity
getset

Returns the name of the activity from which the transitional process was started.