You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/storage-actions/storage-tasks/storage-task-conditions.md
+4-15Lines changed: 4 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,22 +22,10 @@ This article describes the format of a storage task condition and the properties
22
22
23
23
## Condition format
24
24
25
-
A storage task contains a set of conditions and operations in a JSON document. The following snippet shows how conditions and operations appear in that document.
25
+
A storage task contains a set of conditions and operations in a JSON document. The following image shows how a single condition and operation appear in a the document.
26
26
27
-
```json
28
-
"action": {
29
-
"if": {
30
-
"condition": "<clause>",
31
-
"operations": [
32
-
{
33
-
"name": "<operation name>",
34
-
"onSuccess": "continue",
35
-
"onFailure": "break"
36
-
}
37
-
]
38
-
}
39
-
}
40
-
```
27
+
> [!div class="mx-imgBorder"]
28
+
> 
41
29
42
30
A condition a collection of one or more _clauses_. Each clause contains a _property_, a _value_, and an _operator_. When the storage task runs, it uses the operator to compare a property with a value to determine whether a clause is met by the target object. In a clause, the **operator** always appears first followed by the **property**, and then the **value**. The following image shows how each element is positioned in the expression.
43
31
@@ -127,4 +115,5 @@ The following table shows the operators that you can use in a clause to evaluate
Copy file name to clipboardExpand all lines: articles/storage-actions/storage-tasks/storage-task-operations.md
+49-67Lines changed: 49 additions & 67 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,71 +21,72 @@ An operation is an action that a storage task performs on each object that meets
21
21
22
22
## Operation format
23
23
24
-
A storage task contains a set of conditions and operations in a JSON document. The following snippet shows how conditions and operations appear in that document.
25
-
26
-
```json
27
-
"action": {
28
-
"if": {
29
-
"condition": "<clause>",
30
-
"operations": [
31
-
{
32
-
"name": "<operation name>",
33
-
"parameters": {....},
34
-
"onSuccess": "continue",
35
-
"onFailure": "break"
36
-
}
37
-
]
38
-
}
39
-
}
40
-
```
41
-
42
-
Each clause contains a _property_, a _value_, and an _operator_. When the storage task runs, it uses the operator to compare a property with a value to determine whether a clause is met by the target object. In a clause, the **operator** always appears first followed by the **property**, and then the **value**. The following image shows how each element is positioned in the expression.
24
+
A storage task contains a set of conditions and operations in a JSON document. The following image shows how a single condition and operation appear in a the document.
43
25
44
26
> [!div class="mx-imgBorder"]
45
-
> 
27
+
> 
28
+
29
+
An operation is defined by the following JSON elements:
46
30
47
-
The following clause allows operations only on Microsoft Word documents. This clause targets all documents that end with the file extension `.docx`. Therefore, the operator is `endsWith`, the property is `Name`, the value is `.docx`.
31
+
| Element | Description |
32
+
|---|--|
33
+
|`name`| The name of the operation. For a full list of names, see the [Supported operations](#supported-operations) section of this article. |
34
+
|`parameters`| The names and values of each parameter separated by a comma. To see which parameters are available with each operation, see the [Supported operations](#supported-operations) section of this article. |
35
+
|`onSuccess`| The action to take when the operation is successful for an object. `continue` is the only allowable value during the preview. |
36
+
|`onFailure`| The action to take when the operation fails for a object. `break` is the only allowable value during the preview. |
48
37
49
-
```json
50
-
{
51
-
"condition": "[[[endsWith(Name, '.docx')]]"
52
-
}
53
-
```
54
-
If you define conditions by using the Azure portal, you can see this JSON structure by opening the **Code** tab of the visual designer.
55
-
56
-
> [!div class="mx-imgBorder"]
57
-
> 
58
-
59
-
### Multiple clauses in a condition
60
-
61
-
A condition can contain multiple clauses separated by a comma along with either the string `and` or `or`. The string `and` targets objects that meet the criteria in all clauses in the condition while `or` targets objects that meet the criterion in any of the clauses in the condition. The following image shows the position of the `and` and `or` string along with two clauses.
38
+
The following image shows where each element appears in the definition.
62
39
63
40
> [!div class="mx-imgBorder"]
64
-
> 
65
-
66
-
The following JSON shows a condition that contains two clauses. Because the `and` string is used in this expression, both clauses must evaluate to `true` before an operation is performed on the object.
41
+
> 
42
+
43
+
The following operations applies applies a time-based immutability policy to the object.
Grouped clauses operate as a single unit separate from the rest of the clauses. Grouping clauses is similar to putting parentheses around a mathematical equation or logic expression. The `and` or `or` string for the first clause in the group applies to the whole group.
77
-
78
-
The following image shows two clauses grouped together.
63
+
Separate multiple operations by using a comma. The following image shows the position of two operations in list of operations.
79
64
80
65
> [!div class="mx-imgBorder"]
81
-
> 
66
+
> 
82
67
83
-
The following condition allows operations only on Microsoft Word documents where the `readyForLegalHold` tag of the document is set to a value of `Yes`. Operations are also performed on objects that are greater than 100 bytes even if the other two conditions are not true.
68
+
The following JSON shows two operations separate by a comma.
0 commit comments