Asynchronous Operations: Assessment Test Questions

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