|
5 | 5 |
|
6 | 6 | namespace OptimaJet.Workflow.Core.Persistence |
7 | 7 | { |
| 8 | + /// <summary> |
| 9 | + /// Interface of a persistence provider, which provide storing of process's instance specific parameters and global parameters |
| 10 | + /// </summary> |
8 | 11 | public interface IPersistenceProvider |
9 | 12 | { |
| 13 | + /// <summary> |
| 14 | + /// Init the provider |
| 15 | + /// </summary> |
| 16 | + /// <param name="runtime">Workflow runtime instance which owned the provider</param> |
10 | 17 | void Init(WorkflowRuntime runtime); |
| 18 | + /// <summary> |
| 19 | + /// Initialize a process instance in persistence store |
| 20 | + /// </summary> |
| 21 | + /// <param name="processInstance">Instance of the process</param> |
11 | 22 | void InitializeProcess (ProcessInstance processInstance); |
| 23 | + /// <summary> |
| 24 | + /// Fills system <see cref="ParameterPurpose.System"/> and persisted <see cref="ParameterPurpose.Persistence"/> parameters of the process |
| 25 | + /// </summary> |
| 26 | + /// <param name="processInstance">Instance of the process</param> |
12 | 27 | void FillProcessParameters(ProcessInstance processInstance); |
| 28 | + /// <summary> |
| 29 | + /// Fills persisted <see cref="ParameterPurpose.Persistence"/> parameters of the process |
| 30 | + /// </summary> |
| 31 | + /// <param name="processInstance">Instance of the process</param> |
13 | 32 | void FillPersistedProcessParameters(ProcessInstance processInstance); |
| 33 | + /// <summary> |
| 34 | + /// Fills system <see cref="ParameterPurpose.System"/> parameters of the process |
| 35 | + /// </summary> |
| 36 | + /// <param name="processInstance">Instance of the process</param> |
14 | 37 | void FillSystemProcessParameters(ProcessInstance processInstance); |
| 38 | + /// <summary> |
| 39 | + /// Saves persisted <see cref="ParameterPurpose.Persistence"/> parameters of the process to store |
| 40 | + /// </summary> |
| 41 | + /// <param name="processInstance">Instance of the process</param> |
15 | 42 | void SavePersistenceParameters(ProcessInstance processInstance); |
| 43 | + /// <summary> |
| 44 | + /// Set process instance status to <see cref="ProcessStatus.Initialized"/> |
| 45 | + /// </summary> |
| 46 | + /// <param name="processInstance">Instance of the process</param> |
16 | 47 | void SetWorkflowIniialized(ProcessInstance processInstance); |
| 48 | + /// <summary> |
| 49 | + /// Set process instance status to <see cref="ProcessStatus.Idled"/> |
| 50 | + /// </summary> |
| 51 | + /// <param name="processInstance">Instance of the process</param> |
17 | 52 | void SetWorkflowIdled(ProcessInstance processInstance); |
| 53 | + /// <summary> |
| 54 | + /// Set process instance status to <see cref="ProcessStatus.Running"/> |
| 55 | + /// </summary> |
| 56 | + /// <param name="processInstance">Instance of the process</param> |
18 | 57 | void SetWorkflowRunning(ProcessInstance processInstance); |
| 58 | + /// <summary> |
| 59 | + /// Set process instance status to <see cref="ProcessStatus.Finalized"/> |
| 60 | + /// </summary> |
| 61 | + /// <param name="processInstance">Instance of the process</param> |
19 | 62 | void SetWorkflowFinalized(ProcessInstance processInstance); |
| 63 | + /// <summary> |
| 64 | + /// Set process instance status to <see cref="ProcessStatus.Terminated"/> |
| 65 | + /// </summary> |
| 66 | + /// <param name="processInstance">Instance of the process</param> |
20 | 67 | void SetWorkflowTerminated(ProcessInstance processInstance, ErrorLevel level, string errorMessage); |
| 68 | + /// <summary> |
| 69 | + /// Resets all process to <see cref="ProcessStatus.Idled"/> status |
| 70 | + /// </summary> |
21 | 71 | void ResetWorkflowRunning(); |
| 72 | + /// <summary> |
| 73 | + /// Updates system parameters of the process in the store |
| 74 | + /// </summary> |
| 75 | + /// <param name="processInstance">Instance of the process</param> |
| 76 | + /// <param name="transition">Last executed transition</param> |
22 | 77 | void UpdatePersistenceState(ProcessInstance processInstance, TransitionDefinition transition); |
| 78 | + /// <summary> |
| 79 | + /// Checks existence of the process |
| 80 | + /// </summary> |
| 81 | + /// <param name="processId">Id of the process</param> |
| 82 | + /// <returns></returns> |
23 | 83 | bool IsProcessExists(Guid processId); |
| 84 | + /// <summary> |
| 85 | + /// Returns status of the process <see cref="ProcessStatus"/> |
| 86 | + /// </summary> |
| 87 | + /// <param name="processId">Id of the process</param> |
| 88 | + /// <returns>Status of the process</returns> |
24 | 89 | ProcessStatus GetInstanceStatus(Guid processId); |
| 90 | + /// <summary> |
| 91 | + /// Saves information about changed scheme to the store |
| 92 | + /// </summary> |
| 93 | + /// <param name="processInstance">Instance of the process whith changed scheme <see cref="ProcessInstance.ProcessScheme"/></param> |
25 | 94 | void BindProcessToNewScheme(ProcessInstance processInstance); |
| 95 | + |
| 96 | + /// <summary> |
| 97 | + /// Saves information about changed scheme to the store |
| 98 | + /// </summary> |
| 99 | + /// <param name="processInstance">Instance of the process whith changed scheme <see cref="ProcessInstance.ProcessScheme"/></param> |
| 100 | + /// <param name="resetIsDeterminingParametersChanged">True if required to reset IsDeterminingParametersChanged flag <see cref="ProcessInstance.IsDeterminingParametersChanged"/></param> |
26 | 101 | void BindProcessToNewScheme(ProcessInstance processInstance, bool resetIsDeterminingParametersChanged); |
| 102 | + /// <summary> |
| 103 | + /// Register a new timer |
| 104 | + /// </summary> |
| 105 | + /// <param name="processId">Id of the process</param> |
| 106 | + /// <param name="name">Timer name <see cref="TimerDefinition.Name"/></param> |
| 107 | + /// <param name="nextExecutionDateTime">Next date and time of timer's execution</param> |
| 108 | + /// <param name="notOverrideIfExists">If true specifies that the existing timer with same name will not be overriden <see cref="TimerDefinition.NotOverrideIfExists"/></param> |
27 | 109 | void RegisterTimer(Guid processId, string name, DateTime nextExecutionDateTime, bool notOverrideIfExists); |
| 110 | + /// <summary> |
| 111 | + /// Removes all timers from the store, exlude listed in ignore list |
| 112 | + /// </summary> |
| 113 | + /// <param name="processId">Id of the process</param> |
| 114 | + /// <param name="timersIgnoreList">Ignore list</param> |
28 | 115 | void ClearTimers(Guid processId, List<string> timersIgnoreList); |
| 116 | + /// <summary> |
| 117 | + /// Clears sign Ignore for all timers |
| 118 | + /// </summary> |
29 | 119 | void ClearTimersIgnore(); |
| 120 | + /// <summary> |
| 121 | + /// Remove specific timer |
| 122 | + /// </summary> |
| 123 | + /// <param name="timerId">Id of the timer</param> |
30 | 124 | void ClearTimer(Guid timerId); |
| 125 | + /// <summary> |
| 126 | + /// Get closest execution date and time for all timers |
| 127 | + /// </summary> |
| 128 | + /// <returns></returns> |
31 | 129 | DateTime? GetCloseExecutionDateTime(); |
| 130 | + /// <summary> |
| 131 | + /// Get all timers which must be executed at this moment of time |
| 132 | + /// </summary> |
| 133 | + /// <returns>List of timers to execute</returns> |
32 | 134 | List<TimerToExecute> GetTimersToExecute(); |
| 135 | + /// <summary> |
| 136 | + /// Remove all information about the process from the store |
| 137 | + /// </summary> |
| 138 | + /// <param name="processId">Id of the process</param> |
33 | 139 | void DeleteProcess(Guid processId); |
| 140 | + /// <summary> |
| 141 | + /// Remove all information about the process from the store |
| 142 | + /// </summary> |
| 143 | + /// <param name="processIds">List of ids of the process</param> |
34 | 144 | void DeleteProcess(Guid[] processIds); |
| 145 | + /// <summary> |
| 146 | + /// Saves a global parameter value |
| 147 | + /// </summary> |
| 148 | + /// <typeparam name="T">System type of the parameter</typeparam> |
| 149 | + /// <param name="type">Logical type of the parameter</param> |
| 150 | + /// <param name="name">Name of the parameter</param> |
| 151 | + /// <param name="value">Value of the parameter</param> |
| 152 | + void SaveGlobalParameter<T>(string type, string name, T value); |
| 153 | + /// <summary> |
| 154 | + /// Returns a global parameter value |
| 155 | + /// </summary> |
| 156 | + /// <typeparam name="T">System type of the parameter</typeparam> |
| 157 | + /// <param name="type">Logical type of the parameter</param> |
| 158 | + /// <param name="name">Name of the parameter</param> |
| 159 | + /// <returns>Value of the parameter</returns> |
| 160 | + T LoadGlobalParameter<T>(string type, string name); |
| 161 | + /// <summary> |
| 162 | + /// Returns a global parameter value |
| 163 | + /// </summary> |
| 164 | + /// <typeparam name="T">System type of the parameter</typeparam> |
| 165 | + /// <param name="type">Logical type of the parameter</param> |
| 166 | + /// <returns>List of the values of the parameters</returns> |
| 167 | + List<T> LoadGlobalParameters<T>(string type); |
| 168 | + /// <summary> |
| 169 | + /// Deletes a global parameter |
| 170 | + /// </summary> |
| 171 | + /// <param name="type">Logical type of the parameter</param> |
| 172 | + /// <param name="name">Name of the parameter</param> |
| 173 | + void DeleteGlobalParameters(string type, string name = null); |
35 | 174 | } |
36 | 175 | } |
0 commit comments