Asynchronous Operations: Assessment Test Questions
- (Question pool 7)
What
is the recommended way to execute a long-running operation within a graph or graph
extension?
- Inject the ILongOperationManager interface manually
- Use the graph’s LongOperationManager property
- Instantiate PXLongOperation directly
- Use Task.Run() inside the graph
- (Question pool
8)
Select all correct statements about the IGraphLongOperationManager
interface.
- It must be manually implemented in every graph.
- It is automatically injected into PXGraph via dependency injection.
- It provides overloads that do not require a key parameter.
- It can only execute synchronous operations.
- (Question pool 8)
How
do you access the LongOperationManager property in a graph
extension?
- Graph.LongOperationManager
- PXGraph.LongOperationManager
- Base.LongOperationManager
- ILongOperationManager.Instance
- (Question pool 9)
Which
method should you use to run an asynchronous delegate (Task-based) within a
graph?
- StartOperation(Action method)
- RunAsyncOperation(Task method)
- StartAsyncOperation(Func<CancellationToken, Task> method)
- ExecuteAsync(Func<Task> method)
- (Question pool 9)
What
happens when you use the overloads of ILongOperationManager.StartOperation() or
ILongOperationManager.StartAsyncOperation() that do not require a key
parameter?
- The operation is not tracked by the framework
- The framework automatically associates the operation with the current graph instance
- The operation runs synchronously
- The operation must be manually linked to a graph
- (Question pool 9)
When
should you use the ILongOperationManager interface instead of
IGraphLongOperationManager?
- When working inside a graph
- When working inside a graph extension
- When working with UI actions only
- When executing operations outside of a graph (for example, in a service)
- (Question pool 10) Select all correct statements about the PXLongOperation.StartOperation() method.
- Within the method that you pass to StartOperation(), you call the method that you want to be run asynchronously.
- The StartOperation() method creates a separate thread and executes the specified delegate asynchronously on this thread.
- The method passed into StartOperation() matches the PXToggleAsyncDelegate() delegate type.
- The StartOperation() method can be invoked only in a graph event handler.
- (Question pool 10) Select all correct statements about the PXLongOperation.StartOperation() method.
- This method executes code on a separate thread.
- You should use this method to configure data access class (DAC) attributes.
- This method can be invoked only in an action.
- This method can be invoked only in a graph event handler.
- (Question pool 10)
Suppose
that you are using the PXLongOperation class to execute a long-running operation
asynchronously. Select all of the things that you should do to
initiate an asynchronous operation in an action.
- Call the PXLongOperation.StartOperation() method
- Pass a delegate of the PXToggleAsyncDelegate type
- Stop the asynchronous operation manually
