Show / Hide Table of Contents

Class ActionContext<TConfig>

Context passed to a custom action's target callback, giving it access to the extractor's configuration and CDF client, information about the specific action invocation it's handling, and the means to report progress and a final result.

Inheritance
object
ActionContext<TConfig>
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Cognite.Extractor.Utils.Unstable.Tasks
Assembly: ExtractorUtils.dll
Syntax
public sealed class ActionContext<TConfig>
Type Parameters
Name Description
TConfig

Extractor configuration type.

Properties

| Edit this page View Source

ApplicationConfig

The extractor's application configuration.

Declaration
public TConfig ApplicationConfig { get; }
Property Value
Type Description
TConfig
| Edit this page View Source

CallMetadata

Caller-supplied metadata provided when this action was triggered, if any.

Declaration
public IReadOnlyDictionary<string, string>? CallMetadata { get; }
Property Value
Type Description
IReadOnlyDictionary<string, string>
| Edit this page View Source

CdfClient

CDF client, if the extractor is configured with one.

Declaration
public CogniteDestination? CdfClient { get; }
Property Value
Type Description
CogniteDestination
| Edit this page View Source

ExternalId

External ID of this specific action invocation. Used when reporting progress or a final result back via ReportProgress(string)/SetResult(string, IReadOnlyDictionary<string, string>?).

Declaration
public string ExternalId { get; }
Property Value
Type Description
string
| Edit this page View Source

IntegrationExternalId

External ID of the integration this action was triggered against.

Declaration
public string IntegrationExternalId { get; }
Property Value
Type Description
string

Methods

| Edit this page View Source

ReportProgress(string)

Report intermediate progress on this action. May be called any number of times, and does not interact with the "call once" guard on SetResult(string, IReadOnlyDictionary<string, string>?).

Unlike SetResult(string, IReadOnlyDictionary<string, string>?), this queues a running-status update immediately -- there is no separate "progress" status on the wire, running is reused for both the initial pickup acknowledgement and every progress update.

Declaration
public void ReportProgress(string message)
Parameters
Type Name Description
string message

Human-readable progress message.

| Edit this page View Source

SetResult(string, IReadOnlyDictionary<string, string>?)

Record the final result of this action, to be reported once the target callback returns. May only be called once per action -- this is a deliberate guard, since an action can only have one final result.

This does not itself send anything -- the terminal update is queued by the dispatcher after the target callback returns without throwing an exception. If the target never calls this, the dispatcher still reports a terminal succeeded update, just with an empty result message.

Declaration
public void SetResult(string message, IReadOnlyDictionary<string, string>? metadata = null)
Parameters
Type Name Description
string message

Human-readable result message.

IReadOnlyDictionary<string, string> metadata

Optional structured result metadata.

Exceptions
Type Condition
ArgumentNullException

If message is null.

InvalidOperationException

If called more than once.

Extension Methods

DataModelUtils.GetOrCreateResourcesAsync<T, T2>(T2, IEnumerable<InstanceIdentifier>, Func<IEnumerable<InstanceIdentifier>, IEnumerable<SourcedNodeWrite<T>>>, Func<IEnumerable<SourcedNodeWrite<T>>, SanitationMode, (IEnumerable<SourcedNodeWrite<T>>, IEnumerable<CogniteError<SourcedNodeWrite<T>>>)>, int, int, RetryMode, SanitationMode, CancellationToken)
  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX