Class Process
Represents abstraction for process instances.
Inheritance
Implements
Inherited Members
Namespace: Terrasoft.Core.Process
Assembly: Terrasoft.Core.dll
Syntax
public abstract class Process : ProcessActivity, IProcessDataSerializable, IHandler<ChangeProcessElementPerformerCommand>
Constructors
Process(UserConnection)
Initializes a new instance of the Process class.
Declaration
protected Process(UserConnection userConnection)
Parameters
Type | Name | Description |
---|---|---|
UserConnection | userConnection | The user connection. |
Fields
FlowElementsPropertyName
Declaration
protected const string FlowElementsPropertyName = "HM7"
Field Value
Type | Description |
---|---|
System.String |
Properties
ActivatedEventElements
Gets a collection of the activated events.
Declaration
public virtual Collection<string> ActivatedEventElements { get; }
Property Value
Type | Description |
---|---|
System.Collections.ObjectModel.Collection<System.String> |
FlowElements
Gets a set of the process elements that were executed or are required to execute.
Declaration
public virtual Dictionary<Guid, Collection<ProcessFlowElement>> FlowElements { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.Dictionary<System.Guid, System.Collections.ObjectModel.Collection<ProcessFlowElement>> |
InstanceUId
Gets string value that represents unique identifier of the current process.
Declaration
public virtual string InstanceUId { get; }
Property Value
Type | Description |
---|---|
System.String |
InternalContext
Gets or sets instance of the ProcessExecutingContext type.
Declaration
public virtual ProcessExecutingContext InternalContext { get; set; }
Property Value
Type | Description |
---|---|
ProcessExecutingContext |
IsEmbedded
Gets value that determines whether it is embedded process.
Declaration
public virtual bool IsEmbedded { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsLogging
Declaration
public override bool IsLogging { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Overrides
IsProcess
Gets value that determines it is a process.
Declaration
public override bool IsProcess { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Overrides
IsProcessExecutedByService
Gets or sets value that determines whether the current process is started by service.
Declaration
[Obsolete("7.13.1 | Property is not in use and will be removed in upcoming builds")]
public virtual bool IsProcessExecutedByService { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsProcessExecutedBySignal
Gets or sets value that determines whether the current process is started by signal.
Declaration
public virtual bool IsProcessExecutedBySignal { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsSaved
Gets or sets value that determines whether it is embedded process.
Declaration
public virtual bool IsSaved { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
MaxLoopCount
Gets maximum number of process repetitions.
Declaration
public virtual int MaxLoopCount { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
MetaPathParameterValues
Gets a collection of keys and values, where key is the meta-path and value is delegate.
Declaration
public virtual Dictionary<string, Func<object>> MetaPathParameterValues { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.Dictionary<System.String, System.Func<System.Object>> |
ParameterValueProvider
Gets the family of algorithms that are used to obtain the values of the process parameters.
Declaration
public virtual ProcessParameterValueProvider ParameterValueProvider { get; }
Property Value
Type | Description |
---|---|
ProcessParameterValueProvider |
ProcessModel
Gets instance that implements theIProcessModel interface.
Declaration
protected virtual IProcessModel ProcessModel { get; set; }
Property Value
Type | Description |
---|---|
IProcessModel |
ProcessSchema
Gets the process schema.
Declaration
public virtual ProcessSchema ProcessSchema { get; }
Property Value
Type | Description |
---|---|
ProcessSchema |
ProcessType
Gets or sets the class type of the current process.
Declaration
public virtual Type ProcessType { get; }
Property Value
Type | Description |
---|---|
System.Type |
Result
Gets or sets result of the current process execution.
Declaration
public virtual object Result { get; set; }
Property Value
Type | Description |
---|---|
System.Object |
SchemaManager
Gets instance that implements the ISchemaManager interface.
Declaration
public override ISchemaManager SchemaManager { get; }
Property Value
Type | Description |
---|---|
ISchemaManager |
Overrides
SchemaManagerName
Gets or sets name of schema manager.
Declaration
public override string SchemaManagerName { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Overrides
SchemaManagerNamePropertyName
Gets the meta data index for the "SchemaManagerName" property.
Declaration
public static string SchemaManagerNamePropertyName { get; }
Property Value
Type | Description |
---|---|
System.String |
SchemaUIdPropertyName
Gets the meta data index for the "SchemaUId" property.
Declaration
public static string SchemaUIdPropertyName { get; }
Property Value
Type | Description |
---|---|
System.String |
SerializeToMemory
Gets or sets value that determines whether it is required to serialize the current process in memory.
Declaration
public virtual bool SerializeToMemory { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
ShowExecutionPage
Gets or sets value that determines whether the current process could shows execution pages.
Declaration
public bool ShowExecutionPage { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
ThrowEvents
Gets a set of events that are required to trigger.
Declaration
public virtual Collection<string> ThrowEvents { get; }
Property Value
Type | Description |
---|---|
System.Collections.ObjectModel.Collection<System.String> |
UId
Gets or sets the unique identifier.
Declaration
public override Guid UId { get; set; }
Property Value
Type | Description |
---|---|
System.Guid | The unique identifier. |
Overrides
UseFlowEngineMode
Indicates whether the current process can be executed in interpreted environment.
Declaration
protected override bool UseFlowEngineMode { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Overrides
UseSystemSecurityContext
Gets or sets value that indicates whether is needed system security context.
Declaration
public bool UseSystemSecurityContext { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
WaitingUserTasks
Gets a set of the process elements that are going to show execution page.
Declaration
[Obsolete("7.18.1 | The property is not in use and will be removed in the upcoming releases.")]
public virtual Collection<ProcessFlowElement> WaitingUserTasks { get; }
Property Value
Type | Description |
---|---|
System.Collections.ObjectModel.Collection<ProcessFlowElement> |
Methods
ApplyPropertiesDataValues(DataReader)
Applies state of the current process element.
Declaration
protected override void ApplyPropertiesDataValues(DataReader reader)
Parameters
Type | Name | Description |
---|---|---|
DataReader | reader | Instance that provides sequential reading of data. |
Overrides
Assign(ProcessFlowElement)
Assigns the property values of the current process element to the properties of the specified element.
Declaration
protected override void Assign(ProcessFlowElement processElement)
Parameters
Type | Name | Description |
---|---|---|
ProcessFlowElement | processElement | Instance of the ProcessFlowElement type. |
Overrides
CancelExecuting(Object[])
Cancels the executing.
Declaration
public override void CancelExecuting(params object[] parameters)
Parameters
Type | Name | Description |
---|---|---|
System.Object[] | parameters | Array of the parameter values. |
Overrides
CancelExecution()
Cancels execution of the current process.
Declaration
public virtual void CancelExecution()
CloneShallow()
Creates a shallow copy of the current process.
Declaration
public override object CloneShallow()
Returns
Type | Description |
---|---|
System.Object | Instance that is a copy of the current process. |
Overrides
CompleteApplyingFlowElementsPropertiesData()
Method does nothing.
Declaration
protected virtual void CompleteApplyingFlowElementsPropertiesData()
CompleteProcess()
Completes execution of the current process.
Declaration
protected virtual bool CompleteProcess()
Returns
Type | Description |
---|---|
System.Boolean |
ConvertToProcessDataSourceFilters(ProcessActivity, Guid, String)
Converts a set of filters to a process format.
Declaration
public virtual string ConvertToProcessDataSourceFilters(ProcessActivity processActivity, Guid entitySchemaUId, string dataSourceFilters)
Parameters
Type | Name | Description |
---|---|---|
ProcessActivity | processActivity | Instance of the ProcessActivity class. |
System.Guid | entitySchemaUId | Unique identifier of the entity schema. |
System.String | dataSourceFilters | Set of the filter values. |
Returns
Type | Description |
---|---|
System.String | Converted value of the set of filters. |
Execute(ProcessExecutingContext)
Executes the current process.
Declaration
public override bool Execute(ProcessExecutingContext context)
Parameters
Type | Name | Description |
---|---|---|
ProcessExecutingContext | context | The execution context. |
Returns
Type | Description |
---|---|
System.Boolean |
|
Overrides
Execute(ProcessFlowElement, Object[])
Executes the process element.
Declaration
public virtual bool Execute(ProcessFlowElement processElement, params object[] parameters)
Parameters
Type | Name | Description |
---|---|---|
ProcessFlowElement | processElement | Process element. |
System.Object[] | parameters | The parameters. |
Returns
Type | Description |
---|---|
System.Boolean |
Execute(UserConnection)
Executes the current process.
Declaration
public virtual bool Execute(UserConnection userConnection)
Parameters
Type | Name | Description |
---|---|---|
UserConnection | userConnection | User connection. |
Returns
Type | Description |
---|---|
System.Boolean |
Execute(UserConnection, String)
Executes the current process.
Declaration
public virtual bool Execute(UserConnection userConnection, string startQueueTasksItem)
Parameters
Type | Name | Description |
---|---|---|
UserConnection | userConnection | User connection. |
System.String | startQueueTasksItem | The name of the process element in the queue. |
Returns
Type | Description |
---|---|
System.Boolean |
FillWaitingUserTaskCollection(ProcessFlowElement)
Fills collection with items of the process elements that can interact with user.
Declaration
protected virtual void FillWaitingUserTaskCollection(ProcessFlowElement processElement)
Parameters
Type | Name | Description |
---|---|---|
ProcessFlowElement | processElement | Instance of the ProcessFlowElement type. |
FindFlowElementByName(String)
Finds process element by its name.
Declaration
public virtual ProcessFlowElement FindFlowElementByName(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of the process element. |
Returns
Type | Description |
---|---|
ProcessFlowElement | Found process element. |
FindFlowElementBySchemaElementUId(Guid)
Finds the flow element by schema element UId.
Declaration
public virtual ProcessFlowElement FindFlowElementBySchemaElementUId(Guid schemaElementUId)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | schemaElementUId | The schema element identifier. |
Returns
Type | Description |
---|---|
ProcessFlowElement |
FindFlowElementByUId(Guid)
Finds process element by its unique identifier.
Declaration
public virtual ProcessFlowElement FindFlowElementByUId(Guid elementUId)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | elementUId | Unique identifier of the process element. |
Returns
Type | Description |
---|---|
ProcessFlowElement | Found process element. |
FindParameter(ProcessParameterMapInfo)
Finds parameter by map info.
Declaration
public virtual ProcessSchemaParameter FindParameter(ProcessParameterMapInfo mapInfo)
Parameters
Type | Name | Description |
---|---|---|
ProcessParameterMapInfo | mapInfo | Parameter map info. |
Returns
Type | Description |
---|---|
ProcessSchemaParameter | Parameter. |
GetFlowElementBySchemaElementUId(Guid)
Gets the flow element by schema element UId
Declaration
public virtual ProcessFlowElement GetFlowElementBySchemaElementUId(Guid schemaElementUId)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | schemaElementUId | The schema element identifier. |
Returns
Type | Description |
---|---|
ProcessFlowElement | The process flow element |
Exceptions
Type | Condition |
---|---|
ItemNotFoundException | Thrown when process flow element is not found. |
GetFlowElementsBySchemaElementUId(Guid)
Gets the enumerator of the flow elements founded by their schema element UId.
Declaration
public virtual IEnumerable<ProcessFlowElement> GetFlowElementsBySchemaElementUId(Guid schemaElementUId)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | schemaElementUId | The schema element identifier. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<ProcessFlowElement> | The enumerator of the flow elements. |
GetFlowElementsByShemaElementUId(Guid)
Declaration
[Obsolete("7.13.4 | Use GetFlowElementsBySchemaElementUId(Guid schemaElementUId) instead")]
public virtual IEnumerable<ProcessFlowElement> GetFlowElementsByShemaElementUId(Guid schemaElementUId)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | schemaElementUId |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<ProcessFlowElement> |
GetIsReexecution()
Returns flag that indicates if process has been executed one or more times.
Declaration
public override bool GetIsReexecution()
Returns
Type | Description |
---|---|
System.Boolean |
|
Overrides
GetParameterValue(ProcessSchemaParameter)
Returns parameter value.
Declaration
public override object GetParameterValue(ProcessSchemaParameter parameter)
Parameters
Type | Name | Description |
---|---|---|
ProcessSchemaParameter | parameter | Process schema parameter. |
Returns
Type | Description |
---|---|
System.Object | Parameter value. |
Overrides
GetParameterValue<T>(String)
Gets parameter value by it's name.
Declaration
protected virtual T GetParameterValue<T>(string parameterName)
Parameters
Type | Name | Description |
---|---|---|
System.String | parameterName | The name of parameter. |
Returns
Type | Description |
---|---|
T | Returns the value of the property by name. |
Type Parameters
Name | Description |
---|---|
T | The type of parameter. |
GetParameterValueByMetaPath(String)
Gets the process parameter value by meta path.
Declaration
public virtual object GetParameterValueByMetaPath(string metaPath)
Parameters
Type | Name | Description |
---|---|---|
System.String | metaPath | The process parameter meta path. |
Returns
Type | Description |
---|---|
System.Object | The process parameter value. |
GetParameterValueByUId(String)
Returns value of the parameter.
Declaration
protected virtual object GetParameterValueByUId(string uId)
Parameters
Type | Name | Description |
---|---|---|
System.String | uId | Unique identifier. |
Returns
Type | Description |
---|---|
System.Object | Value of the process parameter. |
GetParameterValues()
Returns element parameters in (Parameter, ParameterValue) format.
Declaration
public override Dictionary<ProcessSchemaParameter, object> GetParameterValues()
Returns
Type | Description |
---|---|
System.Collections.Generic.Dictionary<ProcessSchemaParameter, System.Object> | Dictionary with element parameters. |
Overrides
GetParentProcess()
Returns instance of the main process.
Declaration
public virtual Process GetParentProcess()
Returns
Type | Description |
---|---|
Process | Process. |
GetPropertiesData(Boolean)
Returns serialized state of the current process.
Declaration
public override string GetPropertiesData(bool shouldWriteElements)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | shouldWriteElements | Indicates whether to write other process elements. |
Returns
Type | Description |
---|---|
System.String | String that represents serialized state of the current process element. |
Overrides
HasMapping(String)
Determines whether the specified parameter has mapping value.
Declaration
protected override bool HasMapping(string parameterName)
Parameters
Type | Name | Description |
---|---|---|
System.String | parameterName | Parameter name. |
Returns
Type | Description |
---|---|
System.Boolean |
|
Overrides
InitializeFlowElementProperties(ProcessFlowElement)
Method must be implemented in derived classes.
Declaration
[Obsolete("7.18.1 | Method is not in use and will be removed in upcoming releases.")]
public virtual void InitializeFlowElementProperties(ProcessFlowElement flowElement)
Parameters
Type | Name | Description |
---|---|---|
ProcessFlowElement | flowElement |
InitializeMetaPathParameterValues()
Method does nothing.
Declaration
protected virtual void InitializeMetaPathParameterValues()
InternalExecute(ProcessExecutingContext)
Executes the current process.
Declaration
protected override bool InternalExecute(ProcessExecutingContext context)
Parameters
Type | Name | Description |
---|---|---|
ProcessExecutingContext | context | The execution context. |
Returns
Type | Description |
---|---|
System.Boolean |
Overrides
PrepareStart(ProcessExecutingContext)
Method does nothing.
Declaration
protected virtual void PrepareStart(ProcessExecutingContext context)
Parameters
Type | Name | Description |
---|---|---|
ProcessExecutingContext | context | The execution context. |
ProcessQueue(ProcessExecutingContext)
Processes a queue consisting of process elements.
Declaration
protected virtual bool ProcessQueue(ProcessExecutingContext context)
Parameters
Type | Name | Description |
---|---|---|
ProcessExecutingContext | context | The execution context. |
Returns
Type | Description |
---|---|
System.Boolean |
|
ReadPropertiesData()
Reads state of the current process.
Declaration
public override void ReadPropertiesData()
Overrides
ReadPropertiesData(DataReader)
Reads state of the current process element.
Declaration
public override void ReadPropertiesData(DataReader reader)
Parameters
Type | Name | Description |
---|---|---|
DataReader | reader | Instance that provides sequential reading of data. |
Overrides
ReadPropertiesDataFromDB(UserConnection)
Reads state of the current process from DB.
Declaration
public override void ReadPropertiesDataFromDB(UserConnection userConnection)
Parameters
Type | Name | Description |
---|---|---|
UserConnection | userConnection | User connection. |
Overrides
SetParameterValue<T>(String, T)
Sets protected parameter value by it's name.
Declaration
protected virtual void SetParameterValue<T>(string parameterName, T value)
Parameters
Type | Name | Description |
---|---|---|
System.String | parameterName | The parameter name. |
T | value | The value. |
Type Parameters
Name | Description |
---|---|
T | The type of parameter. |
SetPrivateFieldValue(String, Object, Object)
Sets the value of private field of a process instance.
Declaration
protected override void SetPrivateFieldValue(string fieldName, object source, object value)
Parameters
Type | Name | Description |
---|---|---|
System.String | fieldName | Field name that is declared in the "source" argument. |
System.Object | source | Instance of the Process type. |
System.Object | value | The new field value. |
Overrides
ShouldWriteFlowElementProperties(ProcessFlowElement)
Returns value that determines whether the current process should write state of the specified process element.
Declaration
protected virtual bool ShouldWriteFlowElementProperties(ProcessFlowElement processElement)
Parameters
Type | Name | Description |
---|---|---|
ProcessFlowElement | processElement | Instance of the ProcessFlowElement type. |
Returns
Type | Description |
---|---|
System.Boolean |
|
ThrowEvent(ProcessExecutingContext, String)
Method does noting.
Declaration
public virtual void ThrowEvent(ProcessExecutingContext context, string eventHandler)
Parameters
Type | Name | Description |
---|---|---|
ProcessExecutingContext | context | Execution context. |
System.String | eventHandler | Name of the event handler. |
TryCreateFlowElementInstance(String, Guid, out ProcessFlowElement)
Tries the create flow element instance.
Declaration
protected virtual bool TryCreateFlowElementInstance(string propertyName, Guid schemaElementUId, out ProcessFlowElement processFlowElement)
Parameters
Type | Name | Description |
---|---|---|
System.String | propertyName | Name of the corresponding process class property. |
System.Guid | schemaElementUId | The schema element identifier. |
ProcessFlowElement | processFlowElement | The process flow element. |
Returns
Type | Description |
---|---|
System.Boolean |
|
WriteFlowElementsProperty(DataWriter)
Writes state of the process elements.
Declaration
protected virtual void WriteFlowElementsProperty(DataWriter writer)
Parameters
Type | Name | Description |
---|---|---|
DataWriter | writer | Instance of the DataWriter type. |
WriteProcessParameters()
Writes parameter values of the current process element.
Declaration
protected override void WriteProcessParameters()
Overrides
WritePropertiesData()
Writes state of the current process.
Declaration
public override void WritePropertiesData()
Overrides
WritePropertiesData(DataWriter, Boolean)
Writes state of the current process.
Declaration
public override void WritePropertiesData(DataWriter writer, bool shouldWriteElements)
Parameters
Type | Name | Description |
---|---|---|
DataWriter | writer | Instance of the DataWriter type. |
System.Boolean | shouldWriteElements | Indicates whether to write process elements. |
Overrides
WritePropertiesDataToDB(UserConnection)
Writes state of the current process to DB.
Declaration
public override void WritePropertiesDataToDB(UserConnection userConnection)
Parameters
Type | Name | Description |
---|---|---|
UserConnection | userConnection | User connection. |
Overrides
WritePropertiesDataToMemory()
Writes state of the current process to memory.
Declaration
public override void WritePropertiesDataToMemory()