Table of Contents

Class WorkZone

Namespace
DCR.Workflow.Effect.Kmd
Assembly
DCR.Workflow.dll
public class WorkZone : HttpEffectBase, IEffect
Inheritance
WorkZone
Implements
Inherited Members
Extension Methods

Constructors

WorkZone(ILogger<WorkZone>, HttpClient, IConfiguration)

public WorkZone(ILogger<WorkZone> logger, HttpClient httpClient, IConfiguration config)

Parameters

logger ILogger<WorkZone>
httpClient HttpClient
config IConfiguration

Fields

CURRENT_ID

public static readonly string CURRENT_ID

Field Value

string

ConfigurationKey2

public const string ConfigurationKey2 = "DCR:Workflow:Effect:Kmd:WorkZone:BaseURL"

Field Value

string

THIS

public static readonly string THIS

Field Value

string

VALIDATION_KEYS

public static readonly string VALIDATION_KEYS

Field Value

string

Properties

BaseURL

public string BaseURL { get; set; }

Property Value

string

Description

public override string Description { get; }

Property Value

string

Id

Id of the effect

public override string Id { get; }

Property Value

string

Remarks

This is the id used to identify the effect. Modellers use this id to indicate that an activity should have the effect

LocalParameters

Parameters that will be set by the effect when running. These will be provided by the effect implementation when the effect runs.

public override string[] LocalParameters { get; }

Property Value

string[]

Remarks

These are useful for effects with multi-step implementation, e.g., first a GET gets a list of ids, then for each such id, a POST is executed. In the parameter for the URL of those posts, a "local parameter" $(ID) can be used to contain the id the current POST is executing for.

RequiredParameters

Parameters required to be set

public override string[] RequiredParameters { get; }

Property Value

string[]

Remarks

The context parameter to Runtime.Execute must define at least the keys listed here.

ShouldRunActivityDidExecute

public override bool ShouldRunActivityDidExecute { get; }

Property Value

bool

ShouldRunActivityWillExecute

public override bool ShouldRunActivityWillExecute { get; }

Property Value

bool

Methods

ActivityDidExecute(Model, Activity, Dictionary<string, string>)

public override Task<Result> ActivityDidExecute(Model m, Activity a, Dictionary<string, string> ps)

Parameters

m Model
a Activity
ps Dictionary<string, string>

Returns

Task<Result>

ActivityWillExecute(Model, Activity, Dictionary<string, string>)

Callback to run effect before activity execution

public override Task<Result> ActivityWillExecute(Model m, Activity a, Dictionary<string, string> parameters)

Parameters

m Model
a Activity
parameters Dictionary<string, string>

The parameters for the effect. In value, references to model values, e.g., $(Activity) are replaced with their values. [LINK: model value references docs] The dictionary is guaranteed to have defined value for all keys in RequiredParameters.

Returns

Task<Result>

A pair of a Result structure and an optional state object to be passed in to a subsequent call to ActivityDidExecute.

Remarks

Execute the effect, possibly returning an updated value. The effect executes before the underlying activity is executed, and if the effect fails (throws), execution of the activity is aborted.

getValidationDictionary(Dictionary<string, string>)

public Dictionary<string, string> getValidationDictionary(Dictionary<string, string> parameters)

Parameters

parameters Dictionary<string, string>

Returns

Dictionary<string, string>

validateResults(Dictionary<string, string>, string)

public bool validateResults(Dictionary<string, string> parameters, string json)

Parameters

parameters Dictionary<string, string>
json string

Returns

bool