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
# Implementing the OnRequestScriptInfo entry point
6
6
7
-
From DataMiner 10.5.7/10.6.0 <!-- RN 42969 --> onwards, the [OnRequestScriptInfo](xref:Skyline.DataMiner.Automation.AutomationEntryPointType.Types.OnRequestScriptInfo) entry point can be implemented in an Automation script. This will allow other Automation scripts (or any other code) to request information about the script in question. The [example](#orchestration-script-example) below uses the entry point to detect which profile parameter values a script needs to orchestrate a device.
7
+
From DataMiner 10.5.7/10.6.0 <!-- RN 42969 --> onwards, the [OnRequestScriptInfo](xref:Skyline.DataMiner.Automation.AutomationEntryPointType.Types.OnRequestScriptInfo) entry point can be implemented in an Automation script. This will allow other Automation scripts (or any other code) to request information about the script in question.
8
+
9
+
The [example](#orchestration-script-example) below uses the entry point to find out which profile parameter values a script needs in order to orchestrate a device.
8
10
9
11
## Using the entry point
10
12
@@ -15,27 +17,27 @@ To use the entry point, add a method with the following signature to the script:
Both [RequestScriptInfoInput](xref:Skyline.DataMiner.Net.Automation.RequestScriptInfoInput) and [RequestScriptInfoOutput](xref:Skyline.DataMiner.Net.Automation.RequestScriptInfoOutput) have a `Data` property of type `Dictionary<string, string>`, which can be used to exchange information between the script and other code. It is strongly recommended to keep the passed data below 20 MB. If larger chunks need to be passed, it's suggested to instead pass a reference to that information.
20
+
Both [RequestScriptInfoInput](xref:Skyline.DataMiner.Net.Automation.RequestScriptInfoInput) and [RequestScriptInfoOutput](xref:Skyline.DataMiner.Net.Automation.RequestScriptInfoOutput) have a `Data` property of type `Dictionary<string, string>`, which can be used to exchange information between the script and other code. It is strongly recommended to keep the passed data below 20 MB. If larger chunks need to be passed, a reference to that information should be passed instead.
19
21
20
22
## Arguments
21
23
22
24
If the script has any script parameters, dummies or memory files, then these are not required when executing the `OnRequestScriptInfo` entry point. However, they are required when executing the `Run` method of that same script.
23
25
24
-
If the entry point would make use of them, it's recommended to provide all defined arguments in the code that's executing the entry point. In case that isn't possible the following should be taken into account when an argument is used in the entry point code:
26
+
If the entry point would make use of them, it is recommended to provide all defined arguments in the code that is executing the entry point. In case that is not possible, the following should be taken into account when an argument is used in the entry point code:
25
27
26
28
- When an omitted script parameter is used in the entry point logic, retrieving the script parameter is possible, but its value will be an empty string.
27
29
- When an omitted dummy is used in the entry point logic, retrieving the dummy is possible, but it will refer to DMA ID -1 and element ID -1. Any actions that use the dummy will fail with an exception.
28
30
- When an omitted memory file is used in the entry point logic, retrieving the memory file is possible, but it will refer to a linked file that is empty. Retrieving a value using the memory file will fail with an exception.
29
31
30
32
## Starting the entry point
31
33
32
-
To start the `OnRequestScriptInfo` entry point the below methods can be used. Within an Automation script the entry point should be executed as a [subscript](#subscript).
34
+
To start the `OnRequestScriptInfo` entry point, you can use the below-mentioned methods. Within an Automation script, the entry point should be executed as a [subscript](#subscript).
33
35
34
36
### Subscript
35
37
36
38
To execute the `OnRequestScriptInfo` entry point within Automation, you have to use the [PrepareSubScript](xref:Skyline.DataMiner.Automation.Engine.PrepareSubScript(System.String,Skyline.DataMiner.Net.Automation.RequestScriptInfoInput)) method.
37
39
38
-
In the following snippet, the entry point of the script "Script with entry point" will be started. As input data, the "Action" key with value "RequestValues" is used. After the script's entry point has been executed synchronously (i.e. the default behavior), the returned output is checked for the value of the key "ActionResult".
40
+
In the following snippet, the entry point of the script "Script with entry point" will be started. The "Action" key with value "RequestValues" is used as input data. After the script's entry point has been executed synchronously (i.e. the default behavior), the returned output is checked for the value of the "ActionResult" key.
39
41
40
42
```csharp
41
43
varinput=newRequestScriptInfoInput
@@ -62,7 +64,7 @@ The `input` passed when preparing the subscript can be used to sent the data to
62
64
63
65
The `ExecuteScriptMessage` can be used to trigger the entry point using an SLNet connection. This message should **not** be used to request the information in an Automation script.
64
66
65
-
In the following snippet, the entry point of the script "Script with entry point" will be started. As input data, the "Action" key with value "RequestValues" is used. After the script's entry point has been executed synchronously, the returned output is checked for the value of the key "ActionResult".
67
+
In the following snippet, the entry point of the script "Script with entry point" will be started. The "Action" key with value "RequestValues" is used as input data. After the script's entry point has been executed synchronously, the returned output is checked for the value of the "ActionResult" key.
66
68
67
69
```csharp
68
70
varinput=newRequestScriptInfoInput
@@ -98,8 +100,8 @@ When an `ExecuteScriptMessage` is sent, an `ExecuteScriptResponseMessage` will b
98
100
99
101
## Orchestration script example
100
102
101
-
In this example a library was created, to easily implement Automation scripts that orchestrate a function of a device, resource or element. The `OnRequestScriptInfo` entry point is used to detect which values, defined as profile parameters, such a script needs to perform the orchestration.
103
+
In this example, a library was created to implement Automation scripts that orchestrate a function of a device, resource or element. The `OnRequestScriptInfo` entry point is used to find out which values (defined as profile parameters) such a script needs in order to perform the orchestration.
102
104
103
105
The [OrchestrationHelperExample repository](https://github.com/SkylineCommunications/SLC-S-OrchestrationHelperExample) is available on GitHub.
104
106
105
-
A more detailed explanation, together with the flow of the scripts, is available in [the project's README](https://github.com/SkylineCommunications/SLC-S-OrchestrationHelperExample?tab=readme-ov-file#technical-documentation-for-the-orchestrationhelper-example).
107
+
A more detailed explanation, as well as the script flow, is available in [the project's README file](https://github.com/SkylineCommunications/SLC-S-OrchestrationHelperExample?tab=readme-ov-file#technical-documentation-for-the-orchestrationhelper-example).
Copy file name to clipboardExpand all lines: user-guide/Advanced_Modules/Automation_module/Using_CSharp/Adding_CSharp_code_to_an_Automation_script.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -229,7 +229,7 @@ Restrictions:
229
229
> Be careful how you handle async code in an Automation script. See [Handling async code](xref:Handling_Async_Code).
230
230
231
231
> [!NOTE]
232
-
> From DataMiner 10.5.7/10.6.0 <!-- RN 42969 --> onwards, the [OnRequestScriptInfo](xref:Skyline.DataMiner.Automation.AutomationEntryPointType.Types.OnRequestScriptInfo) entry point allows other Automation scripts (or any other code) to request information about the script in question. Information about implementing that entry point and executing it is available [in this how-to](xref:Implementing_OnRequestScriptInfo_Entry_Point).
232
+
> From DataMiner 10.5.7/10.6.0 <!-- RN 42969 --> onwards, the [OnRequestScriptInfo](xref:Skyline.DataMiner.Automation.AutomationEntryPointType.Types.OnRequestScriptInfo) entry point allows other Automation scripts (or any other code) to request information about the script in question. Information about implementing that entry point and executing it is available in [this how-to](xref:Implementing_OnRequestScriptInfo_Entry_Point).
0 commit comments