Hi
In my protocol, I have a process (A) that runs for a significant amount of time period and I would like to click a button to execute another QAction (B), which mainly is as simple as setting a new parameter value, while the long process is being run.
I ran a few tests but it seems that QAction B always gets executed after A is finished running, not when the button is clicked. Is it the way that DataMiner is designed? If it is, then is there any way to achieve what I mentioned? Thanks in advance!
Paul
Hi Paul
The DataMiner SLProtocol process is indeed designed so everything gets put on a queue and is executed in sequence. More information can be found about it here: https://docs.dataminer.services/develop/devguide/Connector/InnerWorkingsSLProtocol.html
But it is possible to have a QAction execute without blocking other QActions or actions. To do this, you need to add the following attribute to QAction tag in the protocol.xml:
<QAction id="3" name="example" encoding="csharp" triggers="3" options="queued" >
More information about the queued option can be found here:
https://docs.dataminer.services/develop/schemadoc/Protocol/Protocol.QActions.QAction-options.html#queued
Note
You might need to add locking logic to your code in case the QAction is triggered multiple times and is running concurrently.
Paul,
Multithreading could also be a viable option for the use case above since the tasks executed by the QActions are logically decoupled.