Interface ProcessEngine
Namespace: Terrasoft.Core
Assembly: Terrasoft.Core.dll
Syntax
public interface ProcessEngine
Properties
DcmSchemaManager
Gets the schema manager, that works with DcmSchema items.
Declaration
DcmSchemaManager DcmSchemaManager { get; }
Property Value
Type | Description |
---|---|
DcmSchemaManager |
EntitySchemaManager
Gets the schema manager, that works with EntitySchema items.
Declaration
EntitySchemaManager EntitySchemaManager { get; }
Property Value
Type | Description |
---|---|
EntitySchemaManager |
MaxLoopCount
Gets maximum number of process item repetitions.
Declaration
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
Dictionary<ProcessStatus, Guid> ProcessActivityStatus { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.Dictionary<ProcessStatus, System.Guid> |
ProcessExecutor
Gets the process executor IProcessExecutor.
Declaration
IProcessExecutor ProcessExecutor { get; }
Property Value
Type | Description |
---|---|
IProcessExecutor | The process executor. |
ProcessListenersColumnName
Gets the name for the "Active processes" column.
Declaration
string ProcessListenersColumnName { get; }
Property Value
Type | Description |
---|---|
System.String |
ProcessSchemaManager
Gets the schema manager, that works with ProcessSchema items.
Declaration
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
Dictionary<Guid, List<ProcessSchemaListener>> SysEntityPrcStartEvents { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.Dictionary<System.Guid, System.Collections.Generic.List<ProcessSchemaListener>> |
See Also
UserConnection
Gets or sets the user connection.
Declaration
UserConnection UserConnection { get; set; }
Property Value
Type | Description |
---|---|
UserConnection |
Methods
ActualizeProcessSchemaListeners(Entity, Collection<ProcessSchemaListener>)
Actualizes the list of process signals.
Declaration
void ActualizeProcessSchemaListeners(Entity entity, Collection<ProcessSchemaListener> listeners)
Parameters
Type | Name | Description |
---|---|---|
Entity | entity | Instance of the Entity type. |
System.Collections.ObjectModel.Collection<ProcessSchemaListener> | listeners | List of process listeners. |
AddProcessListener(Guid, Guid, Guid, String, String, EntityChangeType)
Declaration
void AddProcessListener(Guid recordId, Guid entitySchemaUId, Guid processElementUId, string conditionData = null, string changedColumns = null, EntityChangeType entityChangeType = EntityChangeType.Updated)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | recordId | |
System.Guid | entitySchemaUId | |
System.Guid | processElementUId | |
System.String | conditionData | |
System.String | changedColumns | |
EntityChangeType | entityChangeType |
AddProcessListener(Entity, Guid, String, String, EntityChangeType)
Declaration
void AddProcessListener(Entity entity, Guid processElementUId, string conditionData = null, string changedColumns = null, EntityChangeType entityChangeType = EntityChangeType.Updated)
Parameters
Type | Name | Description |
---|---|---|
Entity | entity | |
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
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(Guid, IReadOnlyDictionary<String, Object>, Object[])
Completes executing the process element.
Declaration
ProcessDescriptor CompleteExecuting(Guid processElementId, IReadOnlyDictionary<string, object> parameterValues, params object[] arguments)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | processElementId | Identifier of the 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 ProcessDescriptor type. |
CompleteExecuting(Guid, Object[])
Completes executing the process element.
Declaration
bool CompleteExecuting(Guid processElementUId, params object[] parameters)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | processElementUId | Unique identifier of the process element. |
System.Object[] | parameters | Array of the arguments. |
Returns
Type | Description |
---|---|
System.Boolean |
|
ContinueExecuting(UserConnection, Entity, Collection<ProcessListener>)
Continues executing process elements.
Declaration
Collection<ProcessDescriptor> ContinueExecuting(UserConnection userConnection, Entity entity, Collection<ProcessListener> processListeners)
Parameters
Type | Name | Description |
---|---|---|
UserConnection | userConnection | User connection. |
Entity | entity | Instance of the Entity type. |
System.Collections.ObjectModel.Collection<ProcessListener> | processListeners | List of process listeners. |
Returns
Type | Description |
---|---|
System.Collections.ObjectModel.Collection<ProcessDescriptor> | List of instances of the ProcessDescriptor type. |
ExecuteProcessElement(ProcessActivity, Object[])
Declaration
bool ExecuteProcessElement(ProcessActivity processElement, params object[] parameters)
Parameters
Type | Name | Description |
---|---|---|
ProcessActivity | processElement | |
System.Object[] | parameters |
Returns
Type | Description |
---|---|
System.Boolean |
ExecuteProcessElementByUId(Guid, Object[])
Executes the process element.
Declaration
bool ExecuteProcessElementByUId(Guid processElementUId, params object[] parameters)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | processElementUId | Identifier of the process element. |
System.Object[] | parameters | Array of the arguments. |
Returns
Type | Description |
---|---|
System.Boolean |
|
ExecuteProcessFlowElement(ProcessFlowElement, Object[])
Declaration
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
Process FindProcessByProcessElementUId(Guid processElementUId)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | processElementUId | The UId of the process element. |
Returns
Type | Description |
---|---|
Process | Found process. |
FindProcessByUId(String)
Finds the process instance by unique identifier in memory cache only.
Declaration
Process FindProcessByUId(string processUId)
Parameters
Type | Name | Description |
---|---|---|
System.String | processUId | The process unique identifier. |
Returns
Type | Description |
---|---|
Process | The process instance or |
FindProcessByUId(String, Boolean)
Finds the process instance by unique identifier.
Declaration
Process FindProcessByUId(string processUId, bool findInDB)
Parameters
Type | Name | Description |
---|---|---|
System.String | processUId | The process unique identifier. |
System.Boolean | findInDB | if set to |
Returns
Type | Description |
---|---|
Process | The process instance or |
FindProcessElementByUId(Guid)
Declaration
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
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
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
bool GetIsProcessLinkedToEntity(Process process, Guid entitySchemaUId, Guid entityId)
Parameters
Type | Name | Description |
---|---|---|
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
Process GetProcessByElementUId(Guid elementUId)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | elementUId | The identifier of the process element. |
Returns
Type | Description |
---|---|
Process | Found process. |
Exceptions
Type | Condition |
---|---|
ItemNotFoundException |
GetProcessByUId(String)
Gets the process by unique identifier in memory cache only.
Declaration
Process GetProcessByUId(string processUId)
Parameters
Type | Name | Description |
---|---|---|
System.String | processUId | The process unique identifier. |
Returns
Type | Description |
---|---|
Process | The process instance. |
Exceptions
Type | Condition |
---|---|
ItemNotFoundException | If the process instance not found. |
GetProcessByUId(String, Boolean)
Gets the process by unique identifier.
Declaration
Process GetProcessByUId(string processUId, bool findInDB)
Parameters
Type | Name | Description |
---|---|---|
System.String | processUId | The process unique identifier. |
System.Boolean | findInDB | if set to |
Returns
Type | Description |
---|---|
Process | The process instance. |
Exceptions
Type | Condition |
---|---|
ItemNotFoundException | If the process instance not found. |
GetProcessFromDBByUId(Guid)
Returns process data.
Declaration
[Obsolete("7.18.4 | Method is not in use and will be removed in upcoming releases. Use FindProcessByUId method instead")]
SysProcessData GetProcessFromDBByUId(Guid processUId)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | processUId | Unique identifier of the process. |
Returns
Type | Description |
---|---|
SysProcessData | Instance of the SysProcessData type. |
GetProcessListeners(UserConnection, Entity, Guid, EntityChangeType, Boolean)
Gets list of process listeners.
Declaration
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 Entity type. |
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> |
GetProcessListeners(UserConnection, Entity, EntityChangeType)
Gets list of process listeners.
Declaration
Collection<ProcessListener> GetProcessListeners(UserConnection userConnection, Entity entity, EntityChangeType changeType)
Parameters
Type | Name | Description |
---|---|---|
UserConnection | userConnection | User connection. |
Entity | entity | Instance of the Entity type. |
EntityChangeType | changeType | Type of entity modification. |
Returns
Type | Description |
---|---|
System.Collections.ObjectModel.Collection<ProcessListener> | List of instances of the ProcessListener type. |
GetProcessSchemaListeners(Entity, EntityChangeType)
Gets list of process signals.
Declaration
Collection<ProcessSchemaListener> GetProcessSchemaListeners(Entity entity, EntityChangeType changeType)
Parameters
Type | Name | Description |
---|---|---|
Entity | entity | Instance of the Entity type. |
EntityChangeType | changeType | Type of entity modification. |
Returns
Type | Description |
---|---|
System.Collections.ObjectModel.Collection<ProcessSchemaListener> | List of instances of the ProcessListener type. |
GetSchemaElement(Guid)
Returns schema element by the specified identifier.
Declaration
BaseProcessSchemaElement GetSchemaElement(Guid processElementId)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | processElementId | Identifier of the process element. |
Returns
Type | Description |
---|---|
BaseProcessSchemaElement | Found schema element. |
Initialize(UserConnection)
Initializes the current instance.
Declaration
void Initialize(UserConnection userConnection)
Parameters
Type | Name | Description |
---|---|---|
UserConnection | userConnection | User connection. |
LinkProcessToEntity(Process, Guid, Guid)
Connects the entity to the specified process.
Declaration
void LinkProcessToEntity(Process process, Guid entitySchemaUId, Guid entityId)
Parameters
Type | Name | Description |
---|---|---|
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)
Removes the process listener for specified activity.
Declaration
bool RemoveActivityProcessListener(Guid activityId, Guid processElUId, Guid activityStatusId)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | activityId | The activity primary column value. |
System.Guid | processElUId | The process element identifier. |
System.Guid | activityStatusId | The activity status identifier. |
Returns
Type | Description |
---|---|
System.Boolean |
RemoveCurrentProcess(String)
Removes process from data store.
Declaration
bool RemoveCurrentProcess(string processUId)
Parameters
Type | Name | Description |
---|---|---|
System.String | processUId | Unique identifier of the process. |
Returns
Type | Description |
---|---|
System.Boolean |
RemoveProcessListener(Guid, Guid, Guid, EntityChangeType, Nullable<Guid>)
Removes the process listener for specified entity.
Declaration
void RemoveProcessListener(Guid entityId, Guid entitySchemaUId, Guid processElementUId, EntityChangeType entityChangeType = EntityChangeType.Updated, Guid? workspaceId = default(Guid? ))
Parameters
Type | Name | Description |
---|---|---|
System.Guid | entityId | The entity identifier. |
System.Guid | entitySchemaUId | The entity schema identifier. |
System.Guid | processElementUId | The process element identifier. |
EntityChangeType | entityChangeType | Type of the entity change. |
System.Nullable<System.Guid> | workspaceId | The workspace identifier. |
RemoveProcessPropertiesData(String)
Declaration
bool RemoveProcessPropertiesData(string processUId)
Parameters
Type | Name | Description |
---|---|---|
System.String | processUId |
Returns
Type | Description |
---|---|
System.Boolean |
RemoveSubProcessPropertiesDataByOwnerProcessUId(String)
Declaration
void RemoveSubProcessPropertiesDataByOwnerProcessUId(string ownerProcessUId)
Parameters
Type | Name | Description |
---|---|---|
System.String | ownerProcessUId |
RunDcmProcess(Guid, DcmSchema)
Runs the DCM process.
Declaration
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 |
---|---|
Process | The executed process. |
RunDcmProcesses(Entity, IList<ProcessListener>)
Runs the DCM processes if it was not ran by signal.
Declaration
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
void RunProcessByStartTimerEvent(Guid processSchemaId, Guid processSchemaElementUId)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | processSchemaId | Process schema Id. |
System.Guid | processSchemaElementUId | Signal event element UId. |
RunProcesses(UserConnection, Entity, Collection<ProcessSchemaListener>)
Runs processes by signal event.
Declaration
Collection<ProcessDescriptor> RunProcesses(UserConnection userConnection, Entity entity, Collection<ProcessSchemaListener> listeners)
Parameters
Type | Name | Description |
---|---|---|
UserConnection | userConnection | User connection. |
Entity | entity | Instance of the Entity type. |
System.Collections.ObjectModel.Collection<ProcessSchemaListener> | listeners | List of process listeners. |
Returns
Type | Description |
---|---|
System.Collections.ObjectModel.Collection<ProcessDescriptor> | List of instances of the ProcessDescriptor type. |
SetProcess(Process)
Sets process in data store.
Declaration
void SetProcess(Process process)
Parameters
Type | Name | Description |
---|---|---|
Process | process | Process instance. |
SetProcessPropertiesData(Process)
Puts a process in
Declaration
void SetProcessPropertiesData(Process process)
Parameters
Type | Name | Description |
---|---|---|
Process | process |
SynchronizeProcessNotification(IEntity, ProcessExecutingContext)
Synchronizes the process element notification for current activity.
Declaration
void SynchronizeProcessNotification(IEntity activity, ProcessExecutingContext savingContext)
Parameters
Type | Name | Description |
---|---|---|
IEntity | activity | The activity. |
ProcessExecutingContext | savingContext | The activity update execution context. |
ThrowMessage(String, String)
Declaration
void ThrowMessage(string processUId, string message)
Parameters
Type | Name | Description |
---|---|---|
System.String | processUId | |
System.String | message |
ThrowSignal(ProcessExecutingContext, String)
Declaration
void ThrowSignal(ProcessExecutingContext context, string signal)
Parameters
Type | Name | Description |
---|---|---|
ProcessExecutingContext | context | |
System.String | signal |
TryGetSysProcessData(Guid, out SysProcessData)
Declaration
[Obsolete("7.18.4 | Method is not in use and will be removed in upcoming releases. Use FindProcessByUId method instead")]
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
bool TryGetSysProcessId(Guid processElementUId, out Guid sysProcessId)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | processElementUId | |
System.Guid | sysProcessId |
Returns
Type | Description |
---|---|
System.Boolean |