I'm trying to use custom entrypoints in an Automation script but can't figure out how exactly to use this.
When I add the following C# code in my script, the script can't compile because of syntax errors:
However, when I add an additional Script class (even commented out), the script seems to compile:
The problem is that I can then still not execute my script correctly. The script can only be executed if I add a Script class with a Run method, but then this Run method is used as entrypoint.
Am I doing something wrong or could this feature currently be broken (I have been testing using 10.0.9.0-9365)?
I also noticed that there is not only a "Default" AutomationEntryPointType, but that you can also add an additional "AutomationEntryPointTest" entry point. How does DataMiner determine which one to trigger in case both are defined in your script?
Automation scripts with custom entry points cannot be started using the Cube interface.
In order to start an automation script from a custom entry point you need to send the "ExecuteScriptMessage" (Fill in CustomEntryPoint) to SLNet. This is where you select the entrypoint for the script.
You will need to specify either:
- An empty Script class, containing no methods/properties whatsoever
- Define the different entrypoints in the Script class.
This is because the code will automatically wrap your entire C# block in a Script class if none is present. This is to accomodate small automation scripts that do not specify classes or methods.
The different entry points defined at the moment are tailored for specific use cases and are only called by the server itself (for SRM for example).