-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathExpressionFunction.cs
More file actions
231 lines (186 loc) · 5.25 KB
/
Copy pathExpressionFunction.cs
File metadata and controls
231 lines (186 loc) · 5.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
using System.Text.Json.Serialization;
// ReSharper disable InconsistentNaming
namespace Altinn.App.Core.Models.Expressions;
/// <summary>
/// Enumeration for valid functions in Layout Expressions
///
/// Note that capitalization follows the JavaScript convention of camelCase for function names
/// </summary>
[JsonConverter(typeof(JsonStringEnumConverter))]
public enum ExpressionFunction
{
/// <summary>
/// Expressions that hold a literal value have this as function
/// </summary>
#pragma warning disable CA1707 // Identifiers should not contain underscores
LITERAL_VALUE = -1,
#pragma warning restore CA1707 // Identifiers should not contain underscores
/// <summary>
/// Value for all unknown functions.
/// </summary>
INVALID,
/// <summary>
/// Lookup in datamodel (respect current context for missing indexes for repeating groups)
/// </summary>
dataModel,
/// <summary>
/// Lookup data in simpleBinding for a component with this ID
/// </summary>
component,
/// <summary>
/// Lookup and count the number of data elements for a given data type
/// </summary>
countDataElements,
/// <summary>
/// Lookup a few properties from the instance
/// </summary>
instanceContext,
/// <summary>
/// Parse a date string to a date object, and format it to a string (possibly given a format)
/// </summary>
formatDate,
/// <summary>
/// Conditional
/// </summary>
@if,
/// <summary>
/// Lookup settings from the `frontendSettings` key in appsettings.json (or any environment overrides)
/// </summary>
frontendSettings,
/// <summary>
/// Concat strings
/// </summary>
concat,
/// <summary>
/// Turn characters to upper case
/// </summary>
upperCase,
/// <summary>
/// Turn characters to lower case
/// </summary>
lowerCase,
/// <summary>
/// Capitalize the first letter of a string
/// </summary>
upperCaseFirst,
/// <summary>
/// Lowercase the first letter of a string
/// </summary>
lowerCaseFirst,
/// <summary>
/// Compare two values using an operator (and possibly 'not' before it), return a boolean
/// </summary>
compare,
/// <summary>
/// Check if a string contains another string
/// </summary>
contains,
/// <summary>
/// Check if a string does not contain another string
/// </summary>
notContains,
/// <summary>
/// Check if a comma separated string contains a value
/// </summary>
commaContains,
/// <summary>
/// Check if a string ends with another string
/// </summary>
endsWith,
/// <summary>
/// Check if a string starts with another string
/// </summary>
startsWith,
/// <summary>
/// Check if values are equal
/// </summary>
equals,
/// <summary>
/// <see cref="equals" />
/// </summary>
notEquals,
/// <summary>
/// Compare numerically
/// </summary>
greaterThanEq,
/// <summary>
/// Compare numerically
/// </summary>
lessThan,
/// <summary>
/// Compare numerically
/// </summary>
lessThanEq,
/// <summary>
/// Compare numerically
/// </summary>
greaterThan,
/// <summary>
/// Return the length of a string
/// </summary>
stringLength,
/// <summary>
/// Return the position of a substring in a string
/// </summary>
stringIndexOf,
/// <summary>
/// Replace a substring in a string with another string
/// </summary>
stringReplace,
/// <summary>
/// Return a substring of a string
/// </summary>
stringSlice,
/// <summary>
/// Rounds a number to an integer, or optionally a decimal with a configurable amount of decimal points
/// </summary>
round,
/// <summary>
/// Return true if all the expressions evaluate to true
/// </summary>
and,
/// <summary>
/// Return true if any of the expressions evaluate to true
/// </summary>
or,
/// <summary>
/// Return true if the single argument evaluate to false, otherwise return false
/// </summary>
not,
/// <summary>
/// Returns a positional argument
/// </summary>
argv,
/// <summary>
/// Get the action performed in task prior to bpmn gateway
/// </summary>
gatewayAction,
/// <summary>
/// Gets the currently selected language (or "nb" if not in a context where language is available)
/// </summary>
language,
/// <summary>
/// Lookup the text key in the app's text resources and return the translated value or the key if not found
///
/// If no translations exist for the current language, we will use the resources for "nb"
/// </summary>
text,
/// <summary>
/// Adding numbers. Must be numeric values.
/// </summary>
plus,
/// <summary>
/// Subtracting all preceding values from the first. Must be numeric values.
/// </summary>
minus,
/// <summary>
/// Multiplying numbers. Must be numeric values.
/// </summary>
multiply,
/// <summary>
/// Divide numbers. Must be numeric values.
/// </summary>
divide,
/// <summary>Create a list from the arguments.</summary>
list,
}