AsyncRequest


AsyncRequest(String name, String executionStrategy)

Base Constructor

Parameters:

  • name - process name (class that implements AsyncProcess)
  • executionStrategy - execution type.

getPrototype()

Clones request.

Return:

A new instance of AsyncRequest with the same properties as the current instance.


delayedExecution(Datetime dt)

Adds record ids to execution.

Return:

Self-reference to chain method invocations.


cancelProcess()

Sets the flag indicating that the current AsyncRequest should be canceled.

Return:

Self-reference to chain method invocations.


withRecords(Set<Id> recordKeys)

Associates a set of record keys with the current AsyncRequest.

Parameters:

  • recordKeys - a set of record keys, represented as a Set of Id values.

Return:

Self-reference to chain method invocations.


withRecords(Set<String> recordKeys)

Associates a set of record keys with the current AsyncRequest.

Parameters:

  • recordKeys - a set of record keys, represented as a Set of String values.

Return:

Self-reference to chain method invocations.


withRecords(String recordKey)

Associates a record key with the current AsyncRequest.

Parameters:

  • recordKey - a record key, represented as an Id value.

Return:

Self-reference to chain method invocations.


withPayload(String payload)

Associates a payload keys with the current AsyncRequest.

Parameters:

  • payload- a string payload to be associated with the request.

Return:

Self-reference to chain method invocations.


withStep(String relatedStepConfigName)

Associates a step with the current AsyncRequest.

Parameters:

  • relatedStepConfigName - name of the step configuration to be associated with the request.

Return:

Self-reference to chain method invocations.


withStepgetStepConfigName()

Gets the step config name.

Return:

The name of the step configuration associated with the request.


setQueueEvent(String queueEvent)

Sets the queue event name.

Parameters:

  • queueEvent - the name of the queue event to associate with the request.

Return:

Self-reference to chain method invocations.


setDelayedQueueObject(String delayedQueueObject)

Sets the delayed queue object.

Parameters:

  • delayedQueueObject - the name of the delayed queue object to associate with the request.

Return:

Self-reference to chain method invocations.


withAsyncStrategy(String strategy).

Sets the execution type.

Parameters:

  • strategy - the name of the asynchronous execution strategy to associate with the request.

Return:

Self-reference to chain method invocations.


addToQueue()

Adds request to the processing queue.

Return:

Self-reference to chain method invocations.


direct()

Sets request to be processed directly without platform events.

Return:

Self-reference to chain method invocations.


addRequestToQueueWIthoutJobExecution()

Adds async requests to queue without job execution. Works only when requests are pushed to the queue.

Return:

Self-reference to chain method invocations.


shouldSkipProcessAfterAddingToQueue()

The Determined process will be executed after adding it to the processing queue.

Return:

True if process will stop after adding to the queue.


isDirect()

Determines if process will be executed without Platform event publication

Return:

True if process will be executed without Platform event publication.


isQueued()

Determines if request need to be stored in the queue before execution..

Return:

True if request should be queued.


isDelayed()

Determines if request is delayed.

Return:

True if the request is delayed.


getDelayedExecutionTime()

Returns the time at which the current AsyncRequest should be executed, if it is delayed.

Return:

Delayed execution date-time.


isCanceled()

Indicates whether the current AsyncRequest has been canceled.

Return:

True if the request describes a cancellation request.


getName()

Gets the name of the process (class need to implement AsyncProcess interface).

Return:

Class name.


setExecutionStrategy()

Gets the process execution strategy (e.g. MultiQueue)

Return:

Execution strategy.


setPayload()

Gets the request payload.

Return:

Serialized payload.


getRecordKeys()

Gets records related to the async process.

Return:

Set of records Ids.


getQueueObject()

Returns the name of the queue object associated with the current AsyncRequest

Return:

The queue object name.


getQueueEvent()

Returns the name of the queue event associated with the current AsyncRequest

Return:

The event queue object name.


getDelayedQueueObject()

Returns the name of the delayed queue object associated with the current AsyncRequest

Return:

The delayed queue object name.