Class ProcessEngineImpl
Inheritance
Namespace: Terrasoft.Core.Process
Assembly: Terrasoft.Core.Process.dll
Syntax
public sealed class ProcessEngineImpl : IInternalProcessEngine
Constructors
ProcessEngineImpl(UserConnection)
Initializes an instance of ProcessEngineImpl type with given user connection.
Declaration
public ProcessEngineImpl(UserConnection userConnection)
Parameters
Type | Name | Description |
---|---|---|
UserConnection | userConnection | The user connection. |
Properties
DcmSchemaManager
Gets the schema manager, that works with
Declaration
public DcmSchemaManager DcmSchemaManager { get; }
Property Value
Type | Description |
---|---|
DcmSchemaManager |
EntitySchemaManager
Gets the schema manager, that works with
Declaration
public EntitySchemaManager EntitySchemaManager { get; }
Property Value
Type | Description |
---|---|
EntitySchemaManager |
MaxLoopCount
Gets maximum number of process item repetitions.
Declaration
public int MaxLoopCount { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
ProcessActivityStatus
Gets a list of key/value pairs, where key is the state of activity, and the value is the state Id.
Declaration
public Dictionary<ProcessStatus, Guid> ProcessActivityStatus { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.Dictionary<ProcessStatus, System.Guid> |
ProcessExecutor
Gets the process executor
Declaration
public IProcessExecutor ProcessExecutor { get; }
Property Value
Type | Description |
---|---|
IProcessExecutor | The process executor. |
ProcessListenersColumnName
Declaration
public string ProcessListenersColumnName { get; }
Property Value
Type | Description |
---|---|
System.String |
ProcessParameterStore
Declaration
[Obsolete("7.12.3 | Property is not in use and will be removed in upcoming builds.")]
public IProcessParameterStore ProcessParameterStore { get; }
Property Value
Type | Description |
---|---|
IProcessParameterStore |
ProcessSchemaManager
Gets the schema manager, that works with
Declaration
public ProcessSchemaManager ProcessSchemaManager { get; }
Property Value
Type | Description |
---|---|
ProcessSchemaManager |
SysEntityPrcStartEvents
Gets a list of key/value pairs, where key is the entity schema Id and value is the list of process schema listeners for entity schema.
Declaration
public Dictionary<Guid, List<ProcessSchemaListener>> SysEntityPrcStartEvents { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.Dictionary<System.Guid, System.Collections.Generic.List<ProcessSchemaListener>> |
UserConnection
Gets or sets the user connection.
Declaration
public UserConnection UserConnection { get; set; }
Property Value
Type | Description |
---|---|
UserConnection |
Methods
ActualizeProcessSchemaListeners(Entity, Collection<ProcessSchemaListener>)
Actualizes the list of process signals.
Declaration
public void ActualizeProcessSchemaListeners(Entity entity, Collection<ProcessSchemaListener> listeners)
Parameters
Type | Name | Description |
---|---|---|
Entity | entity | Instance of the |
System.Collections.ObjectModel.Collection<ProcessSchemaListener> | listeners | List of process listeners. |
AddProcessListener(Entity, Guid, String, String, EntityChangeType)
Declaration
public void AddProcessListener(Entity entity, Guid processElementUId, string conditionData = null, string changedColumns = null, EntityChangeType entityChangeType = null)
Parameters
Type | Name | Description |
---|---|---|
Entity | entity | |
System.Guid | processElementUId | |
System.String | conditionData | |
System.String | changedColumns | |
EntityChangeType | entityChangeType |
AddProcessListener(Guid, Guid, Guid, String, String, EntityChangeType)
Declaration
public void AddProcessListener(Guid recordId, Guid entitySchemaUId, Guid processElementUId, string conditionData = null, string changedColumns = null, EntityChangeType entityChangeType = null)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | recordId | |
System.Guid | entitySchemaUId | |
System.Guid | processElementUId | |
System.String | conditionData | |
System.String | changedColumns | |
EntityChangeType | entityChangeType |
CancelNotEnabledDcmProcess(Guid, Guid)
Cancel the DCM process which is disabled, but enabled DCM process for the given entity exists.
Declaration
public void CancelNotEnabledDcmProcess(Guid entitySchemaUId, Guid entityId)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | entitySchemaUId | The entity schema unique identifier. |
System.Guid | entityId | The entity primary column value. |
CompleteExecuting(ProcessActivity, IReadOnlyDictionary<String, Object>, Object[])
Completes executing the process element.
Declaration
[Obsolete("7.12.2 | Method is not in use and will be removed in upcoming releases")]
public ProcessDescriptor CompleteExecuting(ProcessActivity processElement, IReadOnlyDictionary<string, object> parameterValues, params object[] arguments)
Parameters
Type | Name | Description |
---|---|---|
ProcessActivity | processElement | Process element. |
System.Collections.Generic.IReadOnlyDictionary<System.String, System.Object> | parameterValues | Parameter values, where key is name of the parameter and value is parameter value. |
System.Object[] | arguments | Array of the arguments. |
Returns
Type | Description |
---|---|
ProcessDescriptor | Instance of the |
CompleteExecuting(Guid, IReadOnlyDictionary<String, Object>, Object[])
Declaration
public ProcessDescriptor CompleteExecuting(Guid processElementId, IReadOnlyDictionary<string, object> parameterValues, params object[] arguments)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | processElementId | |
System.Collections.Generic.IReadOnlyDictionary<System.String, System.Object> | parameterValues | |
System.Object[] | arguments |
Returns
Type | Description |
---|---|
ProcessDescriptor |
CompleteExecuting(Guid, Object[])
Declaration
public bool CompleteExecuting(Guid processElementUId, params object[] arguments)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | processElementUId | |
System.Object[] | arguments |
Returns
Type | Description |
---|---|
System.Boolean |
ContinueExecuting(UserConnection, Entity, Collection<ProcessListener>)
Continues executing process elements.
Declaration
public Collection<ProcessDescriptor> ContinueExecuting(UserConnection userConnection, Entity entity, Collection<ProcessListener> processListeners)
Parameters
Type | Name | Description |
---|---|---|
UserConnection | userConnection | User connection. |
Entity | entity | Instance of the |
System.Collections.ObjectModel.Collection<ProcessListener> | processListeners | List of process listeners. |
Returns
Type | Description |
---|---|
System.Collections.ObjectModel.Collection<ProcessDescriptor> | List of instances of the |
ExecuteProcessElement(ProcessActivity, Object[])
Declaration
public bool ExecuteProcessElement(ProcessActivity processElement, params object[] parameters)
Parameters
Type | Name | Description |
---|---|---|
ProcessActivity | processElement | |
System.Object[] | parameters |
Returns
Type | Description |
---|---|
System.Boolean |
ExecuteProcessElementByUId(Guid, Object[])
Declaration
public bool ExecuteProcessElementByUId(Guid processElementUId, params object[] parameters)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | processElementUId | |
System.Object[] | parameters |
Returns
Type | Description |
---|---|
System.Boolean |
ExecuteProcessFlowElement(ProcessFlowElement, Object[])
Declaration
public bool ExecuteProcessFlowElement(ProcessFlowElement processElement, params object[] parameters)
Parameters
Type | Name | Description |
---|---|---|
ProcessFlowElement | processElement | |
System.Object[] | parameters |
Returns
Type | Description |
---|---|
System.Boolean |
FindProcessByProcessElementUId(Guid)
Finds the process by UId of the process element.
Declaration
public Process FindProcessByProcessElementUId(Guid processElementUId)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | processElementUId | The UId of the process element. |
Returns
Type | Description |
---|---|
Terrasoft.Core.Process | Found process. |
FindProcessByUId(String)
Declaration
public Process FindProcessByUId(string processUId)
Parameters
Type | Name | Description |
---|---|---|
System.String | processUId |
Returns
Type | Description |
---|---|
Terrasoft.Core.Process |
FindProcessByUId(String, Boolean)
Declaration
public Process FindProcessByUId(string processUId, bool findInDB)
Parameters
Type | Name | Description |
---|---|---|
System.String | processUId | |
System.Boolean | findInDB |
Returns
Type | Description |
---|---|
Terrasoft.Core.Process |
FindProcessElementByUId(Guid)
Declaration
public ProcessActivity FindProcessElementByUId(Guid processElementUId)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | processElementUId |
Returns
Type | Description |
---|---|
ProcessActivity |
FindProcessFlowElementByUId(Guid)
Finds the process flow element by it's unique identifier.
Declaration
public ProcessFlowElement FindProcessFlowElementByUId(Guid processElementUId)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | processElementUId | The process element unique identifier. |
Returns
Type | Description |
---|---|
ProcessFlowElement | Found process flow element. |
FindProcessPropertiesDataByUId(String)
Finds the process properties data by process unique identifier.
Declaration
public Dictionary<string, string> FindProcessPropertiesDataByUId(string processUId)
Parameters
Type | Name | Description |
---|---|---|
System.String | processUId | The process unique identifier. |
Returns
Type | Description |
---|---|
System.Collections.Generic.Dictionary<System.String, System.String> | The list of key/value pairs, where key is the process property name
and value is the process property value. Returns |
GetIsProcessLinkedToEntity(Process, Guid, Guid)
Determines whether the specified process is connected to entity.
Declaration
public bool GetIsProcessLinkedToEntity(Process process, Guid entitySchemaUId, Guid entityId)
Parameters
Type | Name | Description |
---|---|---|
Terrasoft.Core.Process | process | Process instance. |
System.Guid | entitySchemaUId | The entity schema unique identifier. |
System.Guid | entityId | The entity primary column value. |
Returns
Type | Description |
---|---|
System.Boolean |
|
GetProcessByElementUId(Guid)
Gets the process by the process element identifier.
Declaration
public Process GetProcessByElementUId(Guid elementUId)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | elementUId | The identifier of the process element. |
Returns
Type | Description |
---|---|
Terrasoft.Core.Process | Found process. |
GetProcessByUId(String)
Gets the process by unique identifier in memory cache only.
Declaration
public Process GetProcessByUId(string processUId)
Parameters
Type | Name | Description |
---|---|---|
System.String | processUId | The process unique identifier. |
Returns
Type | Description |
---|---|
Terrasoft.Core.Process | The process instance. |
GetProcessByUId(String, Boolean)
Declaration
public Process GetProcessByUId(string processUId, bool findInDB)
Parameters
Type | Name | Description |
---|---|---|
System.String | processUId | |
System.Boolean | findInDB |
Returns
Type | Description |
---|---|
Terrasoft.Core.Process |
GetProcessFromDBByUId(Guid)
Declaration
public SysProcessData GetProcessFromDBByUId(Guid processUId)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | processUId |
Returns
Type | Description |
---|---|
SysProcessData |
GetProcessListeners(UserConnection, Entity, EntityChangeType)
Gets list of process listeners.
Declaration
public Collection<ProcessListener> GetProcessListeners(UserConnection userConnection, Entity entity, EntityChangeType changeType)
Parameters
Type | Name | Description |
---|---|---|
UserConnection | userConnection | User connection. |
Entity | entity | Instance of the |
EntityChangeType | changeType | Type of entity modification. |
Returns
Type | Description |
---|---|
System.Collections.ObjectModel.Collection<ProcessListener> | List of instances of the |
GetProcessListeners(UserConnection, Entity, Guid, EntityChangeType, Boolean)
Gets list of process listeners.
Declaration
public Collection<ProcessListener> GetProcessListeners(UserConnection userConnection, Entity entity, Guid entityId, EntityChangeType changeType, bool checkIsColumnChanged)
Parameters
Type | Name | Description |
---|---|---|
UserConnection | userConnection | User connection. |
Entity | entity | Instance of the |
System.Guid | entityId | Entity identifier. |
EntityChangeType | changeType | Entity change type. |
System.Boolean | checkIsColumnChanged | Flag, that indicates when to check changed columns condition. |
Returns
Type | Description |
---|---|
System.Collections.ObjectModel.Collection<ProcessListener> | A list of process listeners. |
GetProcessSchemaListeners(Entity, EntityChangeType)
Gets list of process signals.
Declaration
public Collection<ProcessSchemaListener> GetProcessSchemaListeners(Entity entity, EntityChangeType changeType)
Parameters
Type | Name | Description |
---|---|---|
Entity | entity | Instance of the |
EntityChangeType | changeType | Type of entity modification. |
Returns
Type | Description |
---|---|
System.Collections.ObjectModel.Collection<ProcessSchemaListener> | List of instances of the |
GetSchemaElement(Guid)
Declaration
public BaseProcessSchemaElement GetSchemaElement(Guid processElementId)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | processElementId |
Returns
Type | Description |
---|---|
BaseProcessSchemaElement |
Initialize(UserConnection)
Declaration
public void Initialize(UserConnection userConnection)
Parameters
Type | Name | Description |
---|---|---|
UserConnection | userConnection |
LinkProcessToEntity(Process, Guid, Guid)
Connects the entity to the specified process.
Declaration
public void LinkProcessToEntity(Process process, Guid entitySchemaUId, Guid entityId)
Parameters
Type | Name | Description |
---|---|---|
Terrasoft.Core.Process | process | The process. |
System.Guid | entitySchemaUId | The UId of the entity schema. |
System.Guid | entityId | The Id of the entity. |
RemoveActivityProcessListener(Guid, Guid, Guid)
Declaration
public bool RemoveActivityProcessListener(Guid activityId, Guid processElUId, Guid activityStatusId)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | activityId | |
System.Guid | processElUId | |
System.Guid | activityStatusId |
Returns
Type | Description |
---|---|
System.Boolean |
RemoveCurrentProcess(String)
Declaration
public bool RemoveCurrentProcess(string processUId)
Parameters
Type | Name | Description |
---|---|---|
System.String | processUId |
Returns
Type | Description |
---|---|
System.Boolean |
RemoveProcessListener(Guid, Guid, Guid, EntityChangeType, Nullable<Guid>)
Declaration
public void RemoveProcessListener(Guid entityId, Guid entitySchemaUId, Guid processElementUId, EntityChangeType entityChangeType = null, Guid? workspaceId = default(Guid? ))
Parameters
Type | Name | Description |
---|---|---|
System.Guid | entityId | |
System.Guid | entitySchemaUId | |
System.Guid | processElementUId | |
EntityChangeType | entityChangeType | |
System.Nullable<System.Guid> | workspaceId |
RemoveProcessPropertiesData(String)
Declaration
public bool RemoveProcessPropertiesData(string processUId)
Parameters
Type | Name | Description |
---|---|---|
System.String | processUId |
Returns
Type | Description |
---|---|
System.Boolean |
RemoveSubProcessPropertiesDataByOwnerProcessUId(String)
Declaration
public void RemoveSubProcessPropertiesDataByOwnerProcessUId(string ownerProcessUId)
Parameters
Type | Name | Description |
---|---|---|
System.String | ownerProcessUId |
RunDcmProcess(Guid, DcmSchema)
Runs the DCM process.
Declaration
public Process RunDcmProcess(Guid entityPrimaryColumnValue, DcmSchema dcmSchema)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | entityPrimaryColumnValue | The entity primary column value. |
DcmSchema | dcmSchema | The DCM schema. |
Returns
Type | Description |
---|---|
Terrasoft.Core.Process | The executed process. |
RunDcmProcesses(Entity, IList<ProcessListener>)
Runs the DCM processes if it was not ran by signal.
Declaration
public Collection<Process> RunDcmProcesses(Entity entity, IList<ProcessListener> listeners)
Parameters
Type | Name | Description |
---|---|---|
Entity | entity | The changed entity. |
System.Collections.Generic.IList<ProcessListener> | listeners | The process listeners of the changed entity. |
Returns
Type | Description |
---|---|
System.Collections.ObjectModel.Collection<Process> | The executed process or |
RunProcessByStartTimerEvent(Guid, Guid)
Runs process by start timer event.
Declaration
public void RunProcessByStartTimerEvent(Guid processSchemaId, Guid processSchemaElementUId)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | processSchemaId | Identifier of the process schema. |
System.Guid | processSchemaElementUId | Unique identifier of the process schema element. |
RunProcesses(UserConnection, Entity, Collection<ProcessSchemaListener>)
Runs processes by signal event.
Declaration
public Collection<ProcessDescriptor> RunProcesses(UserConnection userConnection, Entity entity, Collection<ProcessSchemaListener> listeners)
Parameters
Type | Name | Description |
---|---|---|
UserConnection | userConnection | User connection. |
Entity | entity | Instance of the |
System.Collections.ObjectModel.Collection<ProcessSchemaListener> | listeners | List of process listeners. |
Returns
Type | Description |
---|---|
System.Collections.ObjectModel.Collection<ProcessDescriptor> | List of instances of the |
SetProcess(Process)
Declaration
public void SetProcess(Process process)
Parameters
Type | Name | Description |
---|---|---|
Terrasoft.Core.Process | process |
SetProcessPropertiesData(Process)
Declaration
public void SetProcessPropertiesData(Process process)
Parameters
Type | Name | Description |
---|---|---|
Terrasoft.Core.Process | process |
SynchronizeProcessNotification(IEntity, ProcessExecutingContext)
Synchronizes the process element notification for current activity.
Declaration
public void SynchronizeProcessNotification(IEntity activity, ProcessExecutingContext savingContext)
Parameters
Type | Name | Description |
---|---|---|
IEntity | activity | The activity. |
ProcessExecutingContext | savingContext | The activity update execution context. |
ThrowMessage(String, String)
Throws the message.
Declaration
public void ThrowMessage(string processUId, string message)
Parameters
Type | Name | Description |
---|---|---|
System.String | processUId | Unique identifier of the process. |
System.String | message | The message. |
ThrowSignal(ProcessExecutingContext, String)
Throws the signal.
Declaration
public void ThrowSignal(ProcessExecutingContext context, string signal)
Parameters
Type | Name | Description |
---|---|---|
ProcessExecutingContext | context | The execution context. |
System.String | signal | The signal. |
TryGetSysProcessData(Guid, out SysProcessData)
Declaration
public bool TryGetSysProcessData(Guid sysProcessDataId, out SysProcessData sysProcessData)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | sysProcessDataId | |
SysProcessData | sysProcessData |
Returns
Type | Description |
---|---|
System.Boolean |
TryGetSysProcessId(Guid, out Guid)
Declaration
public bool TryGetSysProcessId(Guid processElementUId, out Guid sysProcessId)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | processElementUId | |
System.Guid | sysProcessId |
Returns
Type | Description |
---|---|
System.Boolean |