Skip to content

Commit 007d422

Browse files
committed
Version 1.4.5
1 parent caa56e6 commit 007d422

File tree

356 files changed

+108302
-12393
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

356 files changed

+108302
-12393
lines changed

.gitattributes

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
###############################################################################
2+
# Set default behavior to automatically normalize line endings.
3+
###############################################################################
4+
* text=auto
5+
6+
###############################################################################
7+
# Set default behavior for command prompt diff.
8+
#
9+
# This is need for earlier builds of msysgit that does not have it on by
10+
# default for csharp files.
11+
# Note: This is only used by command line
12+
###############################################################################
13+
#*.cs diff=csharp
14+
15+
###############################################################################
16+
# Set the merge driver for project and solution files
17+
#
18+
# Merging from the command prompt will add diff markers to the files if there
19+
# are conflicts (Merging from VS is not affected by the settings below, in VS
20+
# the diff markers are never inserted). Diff markers may cause the following
21+
# file extensions to fail to load in VS. An alternative would be to treat
22+
# these files as binary and thus will always conflict and require user
23+
# intervention with every merge. To do so, just uncomment the entries below
24+
###############################################################################
25+
#*.sln merge=binary
26+
#*.csproj merge=binary
27+
#*.vbproj merge=binary
28+
#*.vcxproj merge=binary
29+
#*.vcproj merge=binary
30+
#*.dbproj merge=binary
31+
#*.fsproj merge=binary
32+
#*.lsproj merge=binary
33+
#*.wixproj merge=binary
34+
#*.modelproj merge=binary
35+
#*.sqlproj merge=binary
36+
#*.wwaproj merge=binary
37+
38+
###############################################################################
39+
# behavior for image files
40+
#
41+
# image files are treated as binary by default.
42+
###############################################################################
43+
#*.jpg binary
44+
#*.png binary
45+
#*.gif binary
46+
47+
###############################################################################
48+
# diff behavior for common document formats
49+
#
50+
# Convert binary document formats to text before diffing them. This feature
51+
# is only available from the command line. Turn it on by uncommenting the
52+
# entries below.
53+
###############################################################################
54+
#*.doc diff=astextplain
55+
#*.DOC diff=astextplain
56+
#*.docx diff=astextplain
57+
#*.DOCX diff=astextplain
58+
#*.dot diff=astextplain
59+
#*.DOT diff=astextplain
60+
#*.pdf diff=astextplain
61+
#*.PDF diff=astextplain
62+
#*.rtf diff=astextplain
63+
#*.RTF diff=astextplain

Interfaces/IPersistenceProvider.cs

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,32 +5,171 @@
55

66
namespace OptimaJet.Workflow.Core.Persistence
77
{
8+
/// <summary>
9+
/// Interface of a persistence provider, which provide storing of process's instance specific parameters and global parameters
10+
/// </summary>
811
public interface IPersistenceProvider
912
{
13+
/// <summary>
14+
/// Init the provider
15+
/// </summary>
16+
/// <param name="runtime">Workflow runtime instance which owned the provider</param>
1017
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>
1122
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>
1227
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>
1332
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>
1437
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>
1542
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>
1647
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>
1752
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>
1857
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>
1962
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>
2067
void SetWorkflowTerminated(ProcessInstance processInstance, ErrorLevel level, string errorMessage);
68+
/// <summary>
69+
/// Resets all process to <see cref="ProcessStatus.Idled"/> status
70+
/// </summary>
2171
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>
2277
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>
2383
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>
2489
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>
2594
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>
26101
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>
27109
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>
28115
void ClearTimers(Guid processId, List<string> timersIgnoreList);
116+
/// <summary>
117+
/// Clears sign Ignore for all timers
118+
/// </summary>
29119
void ClearTimersIgnore();
120+
/// <summary>
121+
/// Remove specific timer
122+
/// </summary>
123+
/// <param name="timerId">Id of the timer</param>
30124
void ClearTimer(Guid timerId);
125+
/// <summary>
126+
/// Get closest execution date and time for all timers
127+
/// </summary>
128+
/// <returns></returns>
31129
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>
32134
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>
33139
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>
34144
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);
35174
}
36175
}

Interfaces/IRuntimePersistence.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using System;
2+
using OptimaJet.Workflow.Core.Runtime;
3+
4+
namespace OptimaJet.Workflow.Core.Persistence
5+
{
6+
/// <summary>
7+
/// Provides save and load of workflow runtime parameters. as timers etc
8+
/// </summary>
9+
[System.Obsolete("Interface is not used")]
10+
public interface IRuntimePersistence
11+
{
12+
13+
}
14+
}
Lines changed: 57 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,85 @@
11
using System;
22
using System.Collections.Generic;
3-
using OptimaJet.Workflow.Core.Fault;
43
using OptimaJet.Workflow.Core.Model;
54

65
namespace OptimaJet.Workflow.Core.Persistence
76
{
8-
//Все работы связанные с хранилищем возможно рабиение на отдельные интерфейсы
97

8+
/// <summary>
9+
/// Interface of a persistence provider, which provide storing of schemes
10+
/// </summary>
11+
/// <typeparam name="TSchemeMedium">Type of not parsed scheme</typeparam>
1012
public interface ISchemePersistenceProvider<TSchemeMedium> where TSchemeMedium : class
1113
{
12-
SchemeDefinition<TSchemeMedium> GetProcessSchemeByProcessId(Guid processId);
14+
/// <summary>
15+
/// Gets not parsed scheme of the process by process id
16+
/// </summary>
17+
/// <param name="processId">Id of the process</param>
18+
/// <returns>Not parsed scheme of the process</returns>
19+
SchemeDefinition<TSchemeMedium> GetProcessSchemeByProcessId(Guid processId);
20+
/// <summary>
21+
/// Gets not parsed scheme by id
22+
/// </summary>
23+
/// <param name="schemeId">Id of the scheme</param>
24+
/// <returns>Not parsed scheme of the process</returns>
1325
SchemeDefinition<TSchemeMedium> GetProcessSchemeBySchemeId(Guid schemeId);
26+
27+
/// <summary>
28+
/// Gets not parsed scheme by scheme name and parameters
29+
/// </summary>
30+
/// <param name="schemeCode">Name of the scheme</param>
31+
/// <param name="parameters">Parameters for creating the scheme</param>
32+
/// <param name="ignoreObsolete">True if you need to ignore obsolete schemes</param>
33+
/// <returns>Not parsed scheme of the process</returns>
1434
SchemeDefinition<TSchemeMedium> GetProcessSchemeWithParameters(string schemeCode,
1535
IDictionary<string, object> parameters,
1636
bool ignoreObsolete);
37+
/// <summary>
38+
/// Gets not parsed scheme by scheme name and parameters
39+
/// </summary>
40+
/// <param name="schemeCode">Name of the scheme</param>
41+
/// <param name="parameters">Parameters for creating the scheme</param>
42+
/// <returns>Not parsed scheme of the process</returns>
1743
SchemeDefinition<TSchemeMedium> GetProcessSchemeWithParameters(string schemeCode,
1844
IDictionary<string, object> parameters);
45+
/// <summary>
46+
/// Gets not parsed scheme by scheme name
47+
/// </summary>
48+
/// <param name="code">Name of the scheme</param>
49+
/// <returns>Not parsed scheme of the process</returns>
1950
TSchemeMedium GetScheme(string code);
2051

21-
void SaveScheme(string SchemeCode,
52+
/// <summary>
53+
/// Saves scheme to a store
54+
/// </summary>
55+
/// <param name="schemeCode">Name of the scheme</param>
56+
/// <param name="schemeId">Id of the scheme</param>
57+
/// <param name="scheme">Not parsed scheme</param>
58+
/// <param name="parameters">Parameters for creating the scheme</param>
59+
void SaveScheme(string schemeCode,
2260
Guid schemeId,
2361
TSchemeMedium scheme,
2462
IDictionary<string, object> parameters);
2563

64+
/// <summary>
65+
/// Sets sign IsObsolete to the scheme
66+
/// </summary>
67+
/// <param name="schemeCode">Name of the scheme</param>
68+
/// <param name="parameters">Parameters for creating the scheme</param>
2669
void SetSchemeIsObsolete(string schemeCode, IDictionary<string, object> parameters);
2770

71+
/// <summary>
72+
/// Sets sign IsObsolete to the scheme
73+
/// </summary>
74+
/// <param name="schemeCode">Name of the scheme</param>
2875
void SetSchemeIsObsolete(string schemeCode);
2976

77+
78+
/// <summary>
79+
/// Saves scheme to a store
80+
/// </summary>
81+
/// <param name="schemeCode">Name of the scheme</param>
82+
/// <param name="scheme">Not parsed scheme</param>
3083
void SaveScheme(string schemeCode, string scheme);
3184
}
3285
}

Interfaces/ITimerManager.cs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,45 @@
33

44
namespace OptimaJet.Workflow.Core.Runtime
55
{
6+
/// <summary>
7+
/// Interface of a timer manager, which control timers functioning inside a workflow runtime
8+
/// </summary>
69
public interface ITimerManager
710
{
11+
/// <summary>
12+
/// Register all timers for all outgouing timer transitions for current actvity of the specified process.
13+
/// All timers registered before which are present in transitions will be rewrited except timers marked as NotOverrideIfExists <see cref="TimerDefinition"/>
14+
/// </summary>
15+
/// <param name="processInstance">Process instance whose timers need to be registered</param>
816
void RegisterTimers(ProcessInstance processInstance);
917

18+
/// <summary>
19+
/// Clear timers <see cref="ClearTimers"/> and then register new timers <see cref="RegisterTimers"/>
20+
/// </summary>
21+
/// <param name="processInstance">Process instance whose timers need to be cleared an registered</param>
1022
void ClearAndRegisterTimers(ProcessInstance processInstance);
1123

24+
/// <summary>
25+
/// Clear all registerd timers except present in outgouing timer transitions for current actvity of the specified process and marked as NotOverrideIfExists <see cref="TimerDefinition"/>
26+
/// </summary>
27+
/// <param name="processInstance">Process instance whose timers need to be cleared</param>
1228
void ClearTimers(ProcessInstance processInstance);
1329

1430
void Init(WorkflowRuntime runtime);
1531

32+
/// <summary>
33+
/// Start the timer
34+
/// </summary>
1635
void Start();
1736

37+
/// <summary>
38+
/// Stop the timer
39+
/// </summary>
1840
void Stop();
1941

42+
/// <summary>
43+
/// Refresh interval of the timer
44+
/// </summary>
2045
void Refresh();
2146
}
2247
}

0 commit comments

Comments
 (0)