Skip to main content

Event Introduction - C Sharp

Read and write the event store.

Logic TypeAvailable
Generic logic
Aggregator logic

A LOC event is a timestamped log or metadata representing a data flow, which can be read and write in LOC's event store (implemented with Elasticsearch).

The source and target digital identity (DID) are customised nodes defined by users. Multiple events with shared source/target nodes form a data lineage:

Import and Usage

The agent can be used without using additional namespaces:

public static class Logic
{

public static async Task Run(Context ctx)
{
await EventAgent.EmitEvent(new List<EmitEventArgs>
{
new EmitEventArgs(
"some label name",
"some source DID",
"some target DID",
"",
"default"
),
});
}

public static async Task HandleError(Context ctx, Exception error)
{
// ... same
}
}

Events Fields For Query

An event in the event store has the following field names that can be added in query, exclude, filter and sort conditions:

Event Store FieldDescription
label_idlabel ID
label_nameLabel name (labelName in EmitEventArgs)
source_digital_identitySource DID (sourceDigitalIdentity in EmitEventArgs)
target_digital_identityTarget DID (targetDigitalIdentity in EmitEventArgs)
typeType (type in EmitEventArgs)
timestampEvent emitted time (unix timestamp)
sequenceEvent sequence number (the emit order in an array, starting from 0)
execution_idExecution ID
task_idTask ID
data_process_permanent_identityData process permanent ID
data_process_nameData process name
data_process_revisionData process revision number
logic_nameLogic name
logic_permanent_identityLogic permanent ID
logic_revisionLogic revision number
info

The sequence number represents the order of an event emitted in the array. If you emit 10 events at once, they will have sequence number from 1 to 10.

Class Reference

Type

  • Public static class EventAgent

Method: Emit Events

Refer to: Emit Events

Method: Search Events

Refer to: Search Events

Method: Search Event Sequences

Refer to: Search Event Sequences

Examples

See each method pages above for their examples.